From fc34ce3c456b7930ed269157708ce843be946b39 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Thu, 11 Jul 2024 18:19:17 -0400 Subject: [PATCH 01/36] feat(typespec): Add initial typespec definitions Signed-off-by: Diwank Tomer --- typespec/.gitignore | 1 + typespec/agents/endpoints.tsp | 25 + typespec/agents/main.tsp | 8 + typespec/agents/models.tsp | 56 ++ typespec/chat/endpoints.tsp | 36 ++ typespec/chat/main.tsp | 8 + typespec/chat/models.tsp | 270 +++++++++ typespec/common/interfaces.tsp | 225 +++++++ typespec/common/main.tsp | 10 + typespec/common/mixins.tsp | 49 ++ typespec/common/scalars.tsp | 44 ++ typespec/common/types.tsp | 28 + typespec/docs/endpoints.tsp | 30 + typespec/docs/main.tsp | 8 + typespec/docs/models.tsp | 44 ++ typespec/entries/endpoints.tsp | 27 + typespec/entries/main.tsp | 8 + typespec/entries/models.tsp | 120 ++++ typespec/jobs/endpoints.tsp | 15 + typespec/jobs/main.tsp | 8 + typespec/jobs/models.tsp | 43 ++ typespec/main.tsp | 89 +++ typespec/package-lock.json | 1011 +++++++++++++++++++++++++++++++ typespec/package.json | 15 + typespec/sessions/endpoints.tsp | 24 + typespec/sessions/main.tsp | 8 + typespec/sessions/models.tsp | 55 ++ typespec/tools/endpoints.tsp | 27 + typespec/tools/main.tsp | 8 + typespec/tools/models.tsp | 137 +++++ typespec/tspconfig.yaml | 9 + typespec/users/endpoints.tsp | 25 + typespec/users/main.tsp | 8 + typespec/users/models.tsp | 45 ++ typespec/versions.tsp | 5 + 35 files changed, 2529 insertions(+) create mode 100644 typespec/.gitignore create mode 100644 typespec/agents/endpoints.tsp create mode 100644 typespec/agents/main.tsp create mode 100644 typespec/agents/models.tsp create mode 100644 typespec/chat/endpoints.tsp create mode 100644 typespec/chat/main.tsp create mode 100644 typespec/chat/models.tsp create mode 100644 typespec/common/interfaces.tsp create mode 100644 typespec/common/main.tsp create mode 100644 typespec/common/mixins.tsp create mode 100644 typespec/common/scalars.tsp create mode 100644 typespec/common/types.tsp create mode 100644 typespec/docs/endpoints.tsp create mode 100644 typespec/docs/main.tsp create mode 100644 typespec/docs/models.tsp create mode 100644 typespec/entries/endpoints.tsp create mode 100644 typespec/entries/main.tsp create mode 100644 typespec/entries/models.tsp create mode 100644 typespec/jobs/endpoints.tsp create mode 100644 typespec/jobs/main.tsp create mode 100644 typespec/jobs/models.tsp create mode 100644 typespec/main.tsp create mode 100644 typespec/package-lock.json create mode 100644 typespec/package.json create mode 100644 typespec/sessions/endpoints.tsp create mode 100644 typespec/sessions/main.tsp create mode 100644 typespec/sessions/models.tsp create mode 100644 typespec/tools/endpoints.tsp create mode 100644 typespec/tools/main.tsp create mode 100644 typespec/tools/models.tsp create mode 100644 typespec/tspconfig.yaml create mode 100644 typespec/users/endpoints.tsp create mode 100644 typespec/users/main.tsp create mode 100644 typespec/users/models.tsp create mode 100644 typespec/versions.tsp diff --git a/typespec/.gitignore b/typespec/.gitignore new file mode 100644 index 000000000..98d4239d8 --- /dev/null +++ b/typespec/.gitignore @@ -0,0 +1 @@ +/tsp-output/ diff --git a/typespec/agents/endpoints.tsp b/typespec/agents/endpoints.tsp new file mode 100644 index 000000000..f20a3b138 --- /dev/null +++ b/typespec/agents/endpoints.tsp @@ -0,0 +1,25 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "../common"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +using Common; + +namespace Agents; + +// +// AGENT ENDPOINTS +// + +interface Endpoints + extends LimitOffsetPagination, + CreateEndpoint, + CreateOrUpdateEndpoint, + UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint, + GetEndpoint {} \ No newline at end of file diff --git a/typespec/agents/main.tsp b/typespec/agents/main.tsp new file mode 100644 index 000000000..c77e6f239 --- /dev/null +++ b/typespec/agents/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Agents; + +// +// AGENTS +// \ No newline at end of file diff --git a/typespec/agents/models.tsp b/typespec/agents/models.tsp new file mode 100644 index 000000000..7a925fa1f --- /dev/null +++ b/typespec/agents/models.tsp @@ -0,0 +1,56 @@ +import "../common"; +import "../chat"; + +using Common; +using Chat; + +namespace Agents; + +// +// AGENT MODELS +// + +model Agent { + ...HasId; + ...HasMetadata; + ...HasTimestamps; + + /** Name of the agent */ + @maxLength(120) + name: identifierSafeUnicode = ""; + + /** About the agent */ + about: string = ""; + + /** Model name to use (gpt-4-turbo, gemini-nano etc) */ + "model": string = ""; + + /** Instructions for the agent */ + instructions: string | string[] = ""; + + /** Default settings for all sessions created by this agent */ + default_settings?: DefaultChatSettings; +} + +/** Payload for updating a agent */ +@withVisibility("create", "update") +model UpdateAgentRequest { + ...Agent; +} + +/** Payload for patching a agent */ +model PatchAgentRequest is UpdateAgentRequest {} + +/** Payload for creating a agent (and associated documents) */ +model CreateAgentRequest { + ...UpdateAgentRequest; + + /** Documents to index for this agent. (Max: 100 items) */ + @maxItems(100) + docs: unknown[] = #[]; +} + +model CreateOrUpdateAgentRequest { + id: uuid; + ...UpdateAgentRequest; +} \ No newline at end of file diff --git a/typespec/chat/endpoints.tsp b/typespec/chat/endpoints.tsp new file mode 100644 index 000000000..f7530e2fc --- /dev/null +++ b/typespec/chat/endpoints.tsp @@ -0,0 +1,36 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "../common"; +import "../sessions"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +using Common; +using Sessions; + +namespace Chat; + +// +// CHAT ENDPOINTS +// + +interface Endpoints { + @post + @doc("Generate a response from the model") + generate( + @header contentType: yaml | json; + + @body + @doc("Request to generate a response from the model") + body: ChatInput; + ): { + @statusCode _: "200"; + + @body + @doc("Response from the model") + body: ChatResponse; + }; +} diff --git a/typespec/chat/main.tsp b/typespec/chat/main.tsp new file mode 100644 index 000000000..ce0fad1ab --- /dev/null +++ b/typespec/chat/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Chat; + +// +// CHAT +// \ No newline at end of file diff --git a/typespec/chat/models.tsp b/typespec/chat/models.tsp new file mode 100644 index 000000000..69c173164 --- /dev/null +++ b/typespec/chat/models.tsp @@ -0,0 +1,270 @@ +import "@typespec/http"; + +import "../common"; +import "../docs"; +import "../entries"; +import "../tools"; + +using TypeSpec.Http; + +using Common; +using Docs; +using Entries; +using Tools; + +namespace Chat; + +// +// CHAT MODELS +// + +/** Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) */ +enum GenerationPreset { + problem_solving, + conversational, + fun, + prose, + creative, + business, + deterministic, + code, + multilingual, +} + +/** + * The reason the model stopped generating tokens. This will be `stop` + * if the model hit a natural stop point or a provided stop sequence, + * `length` if the maximum number of tokens specified in the request + * was reached, `content_filter` if content was omitted due to a flag + * from our content filters, `tool_calls` if the model called a tool. + */ +enum FinishReason { + stop, + length, + content_filter, + tool_calls, +} + +/** Determines how the session accesses history and memories */ +model MemoryAccessOptions { + /** Whether previous memories should be recalled or not (will be enabled in a future release) */ + @visibility("read") // DISABLED + recall: boolean = false; + + /** Whether this interaction should form new memories or not (will be enabled in a future release) */ + @visibility("read") // DISABLED + remember: boolean = false; + + /** Whether this interaction should be stored in the session history or not */ + save: boolean = true; +} + +model CompletionResponseFormat { + /** The format of the response */ + type: "text" | "json_object" = "text"; +} + +model CommonChatSettings { + /** Identifier of the model to be used */ + `model`?: identifierSafeUnicode; + + /** Indicates if the server should stream the response as it's generated */ + stream: boolean = false; + + /** Up to 4 sequences where the API will stop generating further tokens. */ + @minItems(1) + @maxItems(4) + stop?: string[]; + + /** If specified, the system will make a best effort to sample deterministically for that particular seed value */ + @minValue(-1) + @maxValue(1000) + seed?: int16; + + /** The maximum number of tokens to generate in the chat completion */ + @minValue(1) + max_tokens?: uint32; + + /** Modify the likelihood of specified tokens appearing in the completion */ + logit_bias?: Record; + + /** Response format (set to `json_object` to restrict output to JSON) */ + response_format?: CompletionResponseFormat; +} + +model GenerationPresetSettings { + /** Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) */ + preset?: GenerationPreset; +} + +model OpenAISettings { + /** 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. */ + @minValue(-2) + @maxValue(2) + frequency_penalty?: float32; + + /** 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. */ + @minValue(-2) + @maxValue(2) + presence_penalty?: float32; + + /** 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. */ + @minValue(0) + @maxValue(5) + temperature?: float32; + + /** 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. */ + @minValue(0) + @maxValue(1) + top_p?: float32; +} + +model vLLMSettings { + /** 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. */ + @minValue(0) + @maxValue(2) + repetition_penalty?: float32; + + /** Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. */ + @minValue(0) + @maxValue(2) + length_penalty?: float32; + + /** 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. */ + @minValue(0) + @maxValue(5) + temperature?: float32; + + /** 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. */ + @minValue(0) + @maxValue(1) + top_p?: float32; + + /** Minimum probability compared to leading token to be considered */ + @minValue(0) + @maxValue(1) + min_p?: float32; +} + +/** Default settings for the chat session (also used by the agent) */ +alias DefaultChatSettings = GenerationPresetSettings | OpenAISettings | vLLMSettings; + +alias ChatSettings = ( + CommonChatSettings & GenerationPresetSettings +) | ( + CommonChatSettings & OpenAISettings +) | ( + CommonChatSettings & vLLMSettings +); + +/** Usage statistics for the completion request */ +model CompetionUsage { + /** Number of tokens in the generated completion */ + @visibility("read") + completion_tokens: uint32; + + /** Number of tokens in the prompt */ + @visibility("read") + prompt_tokens: uint32; + + /** Total number of tokens used in the request (prompt + completion) */ + @visibility("read") + total_tokens: uint32; +} + +model ChatInputData { + /** A list of new input messages comprising the conversation so far. */ + @minItems(1) + messages: InputChatMLMessage[]; + + /** (Advanced) List of tools that are provided in addition to agent's default set of tools. */ + @minItems(1) + tools?: FunctionTool[]; + + /** Can be one of existing tools given to the agent earlier or the ones provided in this request. */ + tool_choice?: ToolChoiceOption; +} + +alias ChatInput = ( + ChatInputData & MemoryAccessOptions & CommonChatSettings & GenerationPresetSettings +) | ( + ChatInputData & MemoryAccessOptions & CommonChatSettings & OpenAISettings +) | ( + ChatInputData & MemoryAccessOptions & CommonChatSettings & vLLMSettings +); + +model BaseTokenLogProb { + token: string; + + /** The log probability of the token */ + logprob: float32; + + bytes: uint16[] | null; +} + +model TokenLogProb extends BaseTokenLogProb { + top_logprobs: BaseTokenLogProb[]; +} + +model LogProbResponse { + /** The log probabilities of the tokens */ + content: TokenLogProb[] | null; +} + +model BaseChatOutput { + index: uint32; + + /** The reason the model stopped generating tokens */ + finish_reason: FinishReason; + + /** The log probabilities of tokens */ + logprobs: LogProbResponse | null; +} + +/** The output returned by the model. Note that, depending on the model provider, they might return more than one message. */ +model SingleChatOutput extends BaseChatOutput { + message: ChatMLMessage; +} + +/** The output returned by the model. Note that, depending on the model provider, they might return more than one message. */ +model MultipleChatOutput extends BaseChatOutput { + messages: ChatMLMessage[]; +} + +alias ChatOutput = SingleChatOutput | MultipleChatOutput; + +/** Streaming chat completion output */ +model ChatOutputChunk extends BaseChatOutput { + /** The message generated by the model */ + delta: ChatMLMessage; +} + +model BaseChatResponse { + /** Usage statistics for the completion request */ + usage: CompetionUsage | null; + + /** Background job IDs that may have been spawned from this interaction. */ + jobs: uuid[]; + + /** Documents referenced for this request (for citation purposes). */ + docs: DocReference[]; + + ...HasCreatedAt; + ...HasId; +} + +model ChunkChatResponse extends BaseChatResponse { + @header contentType: eventStream; + + /** The deltas generated by the model */ + choices: ChatOutputChunk[]; +} + +model MessageChatResponse extends BaseChatResponse { + @header contentType: json; + + /** The deltas generated by the model */ + choices: ChatOutputChunk[]; +} + +alias ChatResponse = ChunkChatResponse | MessageChatResponse; \ No newline at end of file diff --git a/typespec/common/interfaces.tsp b/typespec/common/interfaces.tsp new file mode 100644 index 000000000..8892514b0 --- /dev/null +++ b/typespec/common/interfaces.tsp @@ -0,0 +1,225 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "./scalars.tsp"; +import "./types.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +namespace Common; + +// +// COMMON INTERFACES +// + +interface LimitOffsetPagination { + @get + @doc("List {TName} items", {TName: TName}) + list( + @query + @doc("Limit the number of {TName} items returned", {TName: TName}) + limit: limit = 100, + + @query + @doc("Offset the {TName} items returned", {TName: TName}) + offset: offset = 0, + + /** Sort by a field */ + @query sort_by: sortBy = "created_at", + + /** Sort direction */ + @query direction: sortDirection = "asc", + + /** JSON string of object that should be used to filter objects by metadata */ + @query metadata_filter: string = "{}", + + @query before?: unixTimestamp32, + @query after?: unixTimestamp32, + ): T[]; +} + +interface CreateEndpoint { + @post + @doc("Create new {TName}", {TName: TName}) + create( + @header contentType: yaml | json; + + ...CreateT + ): { + @statusCode _: "201"; + + @body + @doc("Details of {TName} resource created along with ID", {TName: TName}) + body: ResourceCreatedResponse; + }; +} + +interface CreateOrUpdateEndpoint { + @put + @doc("Create or update {TName} (ID is required in payload; existing resource will be overwritten)", {TName: TName}) + createOrUpdate( + @header contentType: yaml | json; + + ...CreateOrUpdateT + ): { + @statusCode _: "200"; + + @body + @doc("Details of {TName} resource updated along with ID", {TName: TName}) + body: ResourceUpdatedResponse; + }; +} + +interface UpdateEndpoint { + @put + @route("{id}") + @doc("Update {TName} by id (overwrite)", {TName: TName}) + update( + @header contentType: yaml | json; + + @path + @doc("ID of the {TName}", {TName: TName}) + id: uuid, + + ...UpdateT, + ): { + @statusCode _: "200"; + + @body + @doc("Details of {TName} resource updated along with ID", {TName: TName}) + body: ResourceUpdatedResponse; + }; +} + +interface PatchEndpoint { + @patch + @route("{id}") + @doc("Patch {TName} by id (merge changes)", {TName: TName}) + patch( + @header contentType: yaml | json; + + @path + @doc("ID of the {TName}", {TName: TName}) + id: uuid, + + ...PatchT, + ): { + @statusCode _: "200"; + + @body + @doc("Details of {TName} resource patched along with ID", {TName: TName}) + body: ResourceUpdatedResponse; + }; +} + +interface GetEndpoint { + @get + @route("{id}") + @doc("Get {TName} by id", {TName: TName}) + get( + @path + @doc("ID of the {TName}", {TName: TName}) + id: uuid, + ): T; +} + +interface DeleteEndpoint { + @delete + @route("{id}") + @doc("Delete {TName} by id", {TName: TName}) + delete( + @path + @doc("ID of the {TName}", {TName: TName}) + id: uuid, + ): { + @statusCode _: "202"; + + @body + @doc("Details of {TName} resource deleted along with ID", {TName: TName}) + body: ResourceDeletedResponse; + }; +} + +interface ChildLimitOffsetPagination< + T, + TName extends string, + P, + PName extends string +> { + @get + @doc("List {TName} items of parent {PName}", {TName: TName, PName: PName}) + list( + @path + @doc("ID of parent {PName}", {PName: PName}) + id: uuid, + + @query + @doc("Limit the number of {TName} items returned", {TName: TName}) + limit: limit = 100, + + @query + @doc("Offset the {TName} items returned", {TName: TName}) + offset: offset = 0, + + /** Sort by a field */ + @query sort_by: sortBy = "created_at", + + /** Sort direction */ + @query direction: sortDirection = "asc", + + /** JSON string of object that should be used to filter objects by metadata */ + @query metadata_filter: string = "{}", + ): T[]; +} + +interface ChildCreateEndpoint< + T, + TName extends string, + P, + PName extends string, + CreateT = T +> { + @post + @doc("Create new {TName}", {TName: TName}) + create( + @header contentType: yaml | json; + + @path + @doc("ID of parent {PName}", {PName: PName}) + id: uuid, + + ...CreateT, + ): { + @statusCode _: "201"; + + @body + @doc("Details of {TName} resource created along with ID", {TName: TName}) + body: ResourceCreatedResponse; + }; +} + +interface ChildDeleteEndpoint< + T, + TName extends string, + P, + PName extends string +> { + @post + @doc("Delete {TName} of a {PName} by id", {TName: TName, PName: PName}) + delete( + @path + @doc("ID of parent {PName}", {PName: PName}) + parent_id: uuid, + + @path + @doc("ID of the {TName}", {TName: TName}) + id: uuid, + ): { + @statusCode _: "202"; + + @body + @doc("Details of {TName} resource deleted along with ID", {TName: TName}) + body: ResourceDeletedResponse; + }; +} diff --git a/typespec/common/main.tsp b/typespec/common/main.tsp new file mode 100644 index 000000000..a7473f475 --- /dev/null +++ b/typespec/common/main.tsp @@ -0,0 +1,10 @@ +import "./interfaces.tsp"; +import "./mixins.tsp"; +import "./scalars.tsp"; +import "./types.tsp"; + +namespace Common; + +// +// COMMON +// diff --git a/typespec/common/mixins.tsp b/typespec/common/mixins.tsp new file mode 100644 index 000000000..09dab76ba --- /dev/null +++ b/typespec/common/mixins.tsp @@ -0,0 +1,49 @@ +import "./scalars.tsp"; +import "./types.tsp"; + +namespace Common; + +// +// COMMON MIXINS +// + +model HasCreatedAt { + /** When this resource was created as UTC date-time */ + @visibility("read") + created_at: utcDateTime; +} + +model HasUpdatedAt { + /** When this resource was updated as UTC date-time */ + @visibility("read") + updated_at: utcDateTime; +} + +model HasDeletedAt { + /** When this resource was deleted as UTC date-time */ + @visibility("read") + deleted_at: utcDateTime; +} + +model HasTimestamps { + ...HasCreatedAt; + ...HasUpdatedAt; +} + +model HasId { + @visibility("read") + @key + id: uuid; +} + +/** (Optional) Metadata for a resource */ +model HasMetadata { + metadata?: Metadata; +} + +const emptyMetadata: Metadata = #{ a: 1 }; + +model HasJobs { + /** IDs (if any) of jobs created as part of this request */ + jobs: uuid[]; +} \ No newline at end of file diff --git a/typespec/common/scalars.tsp b/typespec/common/scalars.tsp new file mode 100644 index 000000000..2311e97e8 --- /dev/null +++ b/typespec/common/scalars.tsp @@ -0,0 +1,44 @@ +namespace Common; + +// +// COMMON SCALARS +// + +@format("uuid") +scalar uuid extends string; + +/** + * For Unicode character safety + * See: https://unicode.org/reports/tr31/ + * See: https://www.unicode.org/reports/tr39/#Identifier_Characters + */ +@pattern("^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$") +scalar identifierSafeUnicode extends string; + +/** Limit the number of results */ +@minValue(1) +@maxValueExclusive(1000) +scalar limit extends uint16; + +/** Offset to apply to the results */ +@minValue(0) +scalar offset extends uint32; + +/** Sort by a field */ +alias sortBy = "created_at" | "updated_at" | "deleted_at"; + +/** Sort direction */ +alias sortDirection = "asc" | "desc"; + +@minValue(-100.0) +@maxValue(100.0) +scalar logit_bias extends float32; + +/** YAML Mime Type; see: https://stackoverflow.com/questions/332129/yaml-media-type */ +alias yaml = "application/yaml" | "text/x-yaml" | "text/yaml"; +alias json = "application/json"; +alias eventStream = "text/event-stream"; + + +/** Different possible sources that can produce new entries */ +alias entrySource = "api_request" | "api_response" | "tool_response" | "internal" | "summarizer" | "meta"; \ No newline at end of file diff --git a/typespec/common/types.tsp b/typespec/common/types.tsp new file mode 100644 index 000000000..63d92ed95 --- /dev/null +++ b/typespec/common/types.tsp @@ -0,0 +1,28 @@ +namespace Common; + +// +// COMMON TYPES +// + +alias Metadata = Record; + +model ResourceCreatedResponse { + @doc("ID of created {TName}", {TName: TName}) + id: uuid; + ...HasCreatedAt; + ...HasJobs; +} + +model ResourceUpdatedResponse { + @doc("ID of updated {TName}", {TName: TName}) + id: uuid; + ...HasUpdatedAt; + ...HasJobs; +} + +model ResourceDeletedResponse { + @doc("ID of deleted {TName}", {TName: TName}) + id: uuid; + ...HasDeletedAt; + ...HasJobs; +} \ No newline at end of file diff --git a/typespec/docs/endpoints.tsp b/typespec/docs/endpoints.tsp new file mode 100644 index 000000000..705d0a497 --- /dev/null +++ b/typespec/docs/endpoints.tsp @@ -0,0 +1,30 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "../agents"; +import "../common"; +import "../users"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +using Agents; +using Common; +using Users; + +namespace Docs; + +// +// DOCS ENDPOINTS +// + +interface UserEndpoints + extends ChildLimitOffsetPagination {} + +interface AgentEndpoints + extends ChildLimitOffsetPagination {} + +interface IndividualDocEndpoints + extends GetEndpoint, + DeleteEndpoint {} diff --git a/typespec/docs/main.tsp b/typespec/docs/main.tsp new file mode 100644 index 000000000..deb0ca34d --- /dev/null +++ b/typespec/docs/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Docs; + +// +// DOCS +// \ No newline at end of file diff --git a/typespec/docs/models.tsp b/typespec/docs/models.tsp new file mode 100644 index 000000000..0c2c73b70 --- /dev/null +++ b/typespec/docs/models.tsp @@ -0,0 +1,44 @@ +import "../common"; + +using Common; + +namespace Docs; + +// +// DOCS MODELS +// + +model Doc { + ...HasId; + ...HasMetadata; + ...HasCreatedAt; + + /** Title describing what this document contains */ + @maxLength(800) + title: identifierSafeUnicode; + + /** Contents of the document */ + content: string | string[]; +} + +/** Payload for creating a doc */ +@withVisibility("create") +model CreateDocRequest { + ...Doc; +} + +model DocOwner { + id: uuid; + role: "user" | "agent"; +} + +model DocReference { + /** The owner of this document. */ + owner: DocOwner; + + /** ID of the document */ + id: uuid; + + /** Snippets referred to of the document */ + snippet_index: uint16[]; +} \ No newline at end of file diff --git a/typespec/entries/endpoints.tsp b/typespec/entries/endpoints.tsp new file mode 100644 index 000000000..ad328f474 --- /dev/null +++ b/typespec/entries/endpoints.tsp @@ -0,0 +1,27 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "../common"; +import "../sessions"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +using Common; +using Sessions; + +namespace Entries; + +// +// ENTRY ENDPOINTS +// + +interface Endpoints + extends ChildLimitOffsetPagination< + History, + "History", + Session, + "Session" + >, + DeleteEndpoint {} diff --git a/typespec/entries/main.tsp b/typespec/entries/main.tsp new file mode 100644 index 000000000..870e41a3e --- /dev/null +++ b/typespec/entries/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Entries; + +// +// ENTRIES +// \ No newline at end of file diff --git a/typespec/entries/models.tsp b/typespec/entries/models.tsp new file mode 100644 index 000000000..40390bb87 --- /dev/null +++ b/typespec/entries/models.tsp @@ -0,0 +1,120 @@ +import "../common"; +import "../tools"; + +using Common; +using Tools; + +namespace Entries; + +// +// ENTRY MODELS +// + +/** Image detail level */ +enum ImageDetail { + low, + high, + auto, +} + +/** ChatML role (system|assistant|user|function_call|function|function_response|auto) */ +enum ChatMLRole { + user, + agent, + system, + function, + function_response, + function_call, + auto, +} + +model ImageURL { + /** Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) */ + @format("uri") + url: string; + + /** The detail level of the image */ + detail: ImageDetail = ImageDetail.auto; +} + +@discriminator("type") +model BaseChatMLContentPart { + /** The type of content part */ + type: string; + text?: string; + image_url?: ImageURL; +} + +model ChatMLTextContentPart extends BaseChatMLContentPart { + text: string; + + /** The type (fixed to 'text') */ + type: "text" = "text"; +} + +model ChatMLImageContentPart extends BaseChatMLContentPart { + /** The image URL */ + image_url: ImageURL; + + /** The type (fixed to 'image_url') */ + type: "image_url" = "image_url"; +} + +alias ChatMLContentPart = ChatMLTextContentPart | ChatMLImageContentPart; + +model ChatMLMessage { + /** The role of the message */ + role: ChatMLRole; + + /** The content parts of the message */ + content: string | string[] | ChatMLContentPart[]; + + /** Name */ + name?: string; + + /** Whether to continue this message or return a new one */ + @visibility("create") + continue?: boolean; + + /** Tool calls generated by the model. */ + @visibility("read") + tool_calls: ChosenToolCall[] = #[]; + + ...HasCreatedAt; + ...HasId; +} + +@withVisibility("create") +model InputChatMLMessage { + ...ChatMLMessage; +} + +alias EntryContent = ChatMLContentPart[] | Tool | ChosenToolCall | string | ToolResponse; + +model Entry { + @key entry_id: uuid; + role: ChatMLRole; + name: string | null = null; + content: EntryContent | EntryContent[]; + source: entrySource; + + /** This is the time that this event refers to. */ + timestamp: unixTimestamp32; + + /** This is the time it was added to the database */ + ...HasCreatedAt; +} + +model Relation { + head: uuid; + relation: string; + tail: uuid; +} + +model History { + entries: Entry[]; + relations: Relation[]; + session_id: uuid; + + ...HasCreatedAt; +} \ No newline at end of file diff --git a/typespec/jobs/endpoints.tsp b/typespec/jobs/endpoints.tsp new file mode 100644 index 000000000..431061aba --- /dev/null +++ b/typespec/jobs/endpoints.tsp @@ -0,0 +1,15 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "../common"; +import "./models.tsp"; + +using Common; + +namespace Jobs; + +// +// JOB ENDPOINTS +// + +interface Endpoints extends GetEndpoint {} \ No newline at end of file diff --git a/typespec/jobs/main.tsp b/typespec/jobs/main.tsp new file mode 100644 index 000000000..9d62fa530 --- /dev/null +++ b/typespec/jobs/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Jobs; + +// +// JOBS +// \ No newline at end of file diff --git a/typespec/jobs/models.tsp b/typespec/jobs/models.tsp new file mode 100644 index 000000000..07663d005 --- /dev/null +++ b/typespec/jobs/models.tsp @@ -0,0 +1,43 @@ +import "../common"; + +using Common; + +namespace Jobs; + +// +// JOB MODELS +// + +/** Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) */ +enum JobState { + pending, + in_progress, + retrying, + succeeded, + aborted, + failed, + "unknown", +} + +model JobStatus { + ...HasId; + ...HasTimestamps; + + /** Name of the job */ + @maxLength(120) + name: identifierSafeUnicode = ""; + + /** Reason for the current state of the job */ + reason: string = ""; + + /** Whether this Job supports progress updates */ + has_progress: boolean = false; + + /** Progress percentage */ + @minValue(0) + @maxValue(100) + progress: float32 = 0.0; + + /** Current state of the job */ + state: JobState = JobState.pending; +} \ No newline at end of file diff --git a/typespec/main.tsp b/typespec/main.tsp new file mode 100644 index 000000000..21199c55f --- /dev/null +++ b/typespec/main.tsp @@ -0,0 +1,89 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "@typespec/versioning"; + +import "./agents"; +import "./chat"; +import "./docs"; +import "./entries"; +import "./jobs"; +import "./sessions"; +import "./tools"; +import "./users"; +import "./versions.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; +using TypeSpec.Versioning; + +using Versions; + +// +// MAIN +// + +/** Julep is a backend for creating stateful AI apps with background tasks and long-term memory easily. */ +@service({ + name: "julep-api", + title: "Julep API", +}) +@versioned(ApiVersions) +@summary("A backend for creating stateful AI apps") +@info({ + termsOfService: "https://julep.ai/terms", + contact: { + name: "Julep AI", + url: "https://julep.ai", + email: "developers@julep.ai", + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html", + }, +}) +@externalDocs("https://docs.julep.ai", "Julep API documentation") +@server( + "https://{serverEnv}.julep.ai/api", + "The julep cloud service endpoint", + { + @doc("The environment to use") + serverEnv?: "api" | "api-alpha" = "api-alpha", + } +) +@useAuth( + ApiKeyAuth + | ApiKeyAuth +) +namespace Api { + // model Agent_ is Agents.Agent {} + + @route("/agents") + interface Agent extends Agents.Endpoints {} + + @route("/agents/{id}/docs") + interface AgentDocs extends Docs.AgentEndpoints {} + + @route("/agents/{id}/tools") + interface AgentTools extends Tools.AgentEndpoints {} + + @route("/users") + interface User extends Users.Endpoints {} + + @route("/users/{id}/docs") + interface UserDocs extends Docs.UserEndpoints {} + + @route("/sessions") + interface Session extends Sessions.Endpoints {} + + @route("/sessions/{id}/history") + interface History extends Entries.Endpoints {} + + @route("/docs/{id}") + interface AgentIndividualDoc extends Docs.IndividualDocEndpoints {} + + @route("/tools") + interface Tool extends Tools.Endpoints {} + + @route("/jobs") + interface Job extends Jobs.Endpoints {} +} diff --git a/typespec/package-lock.json b/typespec/package-lock.json new file mode 100644 index 000000000..69b87555d --- /dev/null +++ b/typespec/package-lock.json @@ -0,0 +1,1011 @@ +{ + "name": "julep-typespec", + "version": "0.3.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "julep-typespec", + "version": "0.3.0", + "dependencies": { + "@azure-tools/typespec-autorest": "^0.43.0", + "@typespec/compiler": "latest", + "@typespec/http": "latest", + "@typespec/openapi": "^0.57.0", + "@typespec/openapi3": "latest", + "@typespec/rest": "latest", + "@typespec/versioning": "^0.57.0", + "autorest": "^3.7.1" + } + }, + "node_modules/@azure-tools/typespec-autorest": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.43.0.tgz", + "integrity": "sha512-tZ9uXXOdxu2y01W9n3mzXf+IEY2MQkP/JaQaKlcOx2+dbklHNQWSDU0Vm6Gmm6l//XiF9QiI8653BiuO97czyw==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.43.0", + "@azure-tools/typespec-azure-resource-manager": "~0.43.0", + "@azure-tools/typespec-client-generator-core": "~0.43.0", + "@typespec/compiler": "~0.57.0", + "@typespec/http": "~0.57.0", + "@typespec/openapi": "~0.57.0", + "@typespec/rest": "~0.57.0", + "@typespec/versioning": "~0.57.0" + } + }, + "node_modules/@azure-tools/typespec-azure-core": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.43.0.tgz", + "integrity": "sha512-B1r0i3segJ7RuNXxcAMBy8H2t+jTkaf74dkyUWD0HIFPkhETN0uR59nuor+s+LoLU8yI4JypOFSNZt6e1rod8w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.57.0", + "@typespec/http": "~0.57.0", + "@typespec/rest": "~0.57.0" + } + }, + "node_modules/@azure-tools/typespec-azure-resource-manager": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.43.0.tgz", + "integrity": "sha512-0GQL+/o1u+PAB63FpYz3sy3ZgZvCtk5T4sDAnICnV23v2YWIONDMUfxxd0x40xJbY6PkcwwHDpBLNMqajf2H6A==", + "license": "MIT", + "peer": true, + "dependencies": { + "change-case": "~5.4.4", + "pluralize": "^8.0.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.43.0", + "@typespec/compiler": "~0.57.0", + "@typespec/http": "~0.57.0", + "@typespec/openapi": "~0.57.0", + "@typespec/rest": "~0.57.0", + "@typespec/versioning": "~0.57.0" + } + }, + "node_modules/@azure-tools/typespec-client-generator-core": { + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.43.1.tgz", + "integrity": "sha512-NwNN/fIOcjOU/8o6ViCuEAAQl6zmu2X1QKPuXxeSy8ssDwrTiX9Ho2X/7IZM4XmOArKTtgmTkNcSnnmuj5dsGg==", + "license": "MIT", + "peer": true, + "dependencies": { + "change-case": "~5.4.4", + "pluralize": "^8.0.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.43.0", + "@typespec/compiler": "~0.57.0", + "@typespec/http": "~0.57.0", + "@typespec/rest": "~0.57.0", + "@typespec/versioning": "~0.57.0", + "@typespec/xml": "~0.57.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@typespec/compiler": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.57.0.tgz", + "integrity": "sha512-Z5L7J90Ol21IbzU+rBD2wzKy2vJ2Yg2FIzi+yB5rtb7/c4oBea/CgEByMVHBtT7uw45ZXJpHOiepuGSPVXw2EA==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "~7.24.2", + "ajv": "~8.13.0", + "change-case": "~5.4.4", + "globby": "~14.0.1", + "mustache": "~4.2.0", + "picocolors": "~1.0.1", + "prettier": "~3.2.5", + "prompts": "~2.4.2", + "semver": "^7.6.2", + "vscode-languageserver": "~9.0.1", + "vscode-languageserver-textdocument": "~1.0.11", + "yaml": "~2.4.2", + "yargs": "~17.7.2" + }, + "bin": { + "tsp": "cmd/tsp.js", + "tsp-server": "cmd/tsp-server.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@typespec/http": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.57.0.tgz", + "integrity": "sha512-k3bWOTPNqlRB3/TmrXVBtObmxj2J20l2FnhGXvs+tjdtbXLxCQWmvQz6xlne9nkLAtWVB/pQRUn+oMJfhWta3w==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.57.0" + } + }, + "node_modules/@typespec/openapi": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.57.0.tgz", + "integrity": "sha512-35wK/BqjOXSlhWuGMwoYN3FSgIYFOKtw8ot4ErcgmxAGuKaS2GkUhZvtQJXUn2ByU0Fl4jqslPmTz8SEcz7rbw==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.57.0", + "@typespec/http": "~0.57.0" + } + }, + "node_modules/@typespec/openapi3": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-0.57.0.tgz", + "integrity": "sha512-spNLzwCTduPISJBTWhqsMLTjuGC3Tdh/FVI1rTGnRunB7ZXjhRyz031o1bCe2BZeW1w1sacZGfe+ba8sXqgMxA==", + "license": "MIT", + "dependencies": { + "yaml": "~2.4.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.57.0", + "@typespec/http": "~0.57.0", + "@typespec/openapi": "~0.57.0", + "@typespec/versioning": "~0.57.0" + } + }, + "node_modules/@typespec/rest": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.57.0.tgz", + "integrity": "sha512-mZj76Kf+cmH38pYA6LT8Zz7QjuR3fdQo5bc8pXhKMwLq9vRqNLz6Z9InbOeo8zY+xP0GfUwEU9kXczmCc8gyRA==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.57.0", + "@typespec/http": "~0.57.0" + } + }, + "node_modules/@typespec/versioning": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.57.0.tgz", + "integrity": "sha512-kk6zCNSwcqqYB9isNNagTy+Zv6wEIRA4NkcZ/X1riTj2zhJwKsIFNXQWm1yxpZn+BY4+1QtuaQHuBLo8HbgR/w==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.57.0" + } + }, + "node_modules/@typespec/xml": { + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.57.0.tgz", + "integrity": "sha512-itsFsahgBRNREoF4FXUgELmNGtOMmzNnhxT+NeAl4f7EXmz/mu1y/k9hWmDXWr+DB0Oq1r0Fc+D0TSl51szzlQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.57.0" + } + }, + "node_modules/ajv": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/autorest": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/autorest/-/autorest-3.7.1.tgz", + "integrity": "sha512-6q17NtosQZPqBkIOUnaOPedf3PDIBF7Ha1iEGRhTqZF6TG2Q/1E3ID/D+ePIIzZDKvW01p/2pENq/oiBWH9IGQ==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "autorest": "entrypoints/app.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", + "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "license": "MIT", + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "license": "MIT", + "bin": { + "mustache": "bin/mustache" + } + }, + "node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT" + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "license": "MIT", + "dependencies": { + "vscode-languageserver-protocol": "3.17.5" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "license": "MIT", + "dependencies": { + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==", + "license": "MIT" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "license": "MIT" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/typespec/package.json b/typespec/package.json new file mode 100644 index 000000000..bdbf4601f --- /dev/null +++ b/typespec/package.json @@ -0,0 +1,15 @@ +{ + "name": "julep-typespec", + "version": "0.3.0", + "type": "module", + "dependencies": { + "@typespec/compiler": "latest", + "@typespec/http": "latest", + "@typespec/openapi": "^0.57.0", + "@typespec/openapi3": "latest", + "@typespec/rest": "latest", + "@typespec/versioning": "^0.57.0", + "autorest": "^3.7.1" + }, + "private": true +} diff --git a/typespec/sessions/endpoints.tsp b/typespec/sessions/endpoints.tsp new file mode 100644 index 000000000..8af4711ff --- /dev/null +++ b/typespec/sessions/endpoints.tsp @@ -0,0 +1,24 @@ +import "@typespec/http"; +import "@typespec/openapi"; +import "../common"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +using Common; + +namespace Sessions; + +// +// SESSION ENDPOINTS +// + +interface Endpoints + extends LimitOffsetPagination, + CreateEndpoint, + CreateOrUpdateEndpoint, + UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint, + GetEndpoint {} \ No newline at end of file diff --git a/typespec/sessions/main.tsp b/typespec/sessions/main.tsp new file mode 100644 index 000000000..9ceccb955 --- /dev/null +++ b/typespec/sessions/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Sessions; + +// +// SESSIONS +// \ No newline at end of file diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp new file mode 100644 index 000000000..4026b3614 --- /dev/null +++ b/typespec/sessions/models.tsp @@ -0,0 +1,55 @@ +import "../common"; + +using Common; + +namespace Sessions; + +// +// SESSION MODELS +// + +model Session { + ...HasId; + ...HasMetadata; + ...HasTimestamps; + + /** User ID of user associated with this session */ + @visibility("create") + user_id: uuid; + + /** Agent ID of agent associated with this session */ + @visibility("create") + agent_id: uuid; + + /** A specific situation that sets the background for this session */ + situation: string = ""; + + /** Summary (null at the beginning) - generated automatically after every interaction */ + @visibility("read") + summary: string | null = null; + + /** Render system and assistant message content as jinja templates */ + render_templates: boolean = false; +} + +/** Payload for updating a session */ +@withVisibility("update") +model UpdateSessionRequest { + ...Session; +} + +/** Payload for patching a session */ +model PatchSessionRequest is UpdateSessionRequest {} + +/** Payload for creating a session */ +@withVisibility("create") +model CreateSessionRequest { + ...Session; +} + +@withVisibility("create", "update") +model CreateOrUpdateSessionRequest { + id: uuid; + + ...CreateSessionRequest; +} \ No newline at end of file diff --git a/typespec/tools/endpoints.tsp b/typespec/tools/endpoints.tsp new file mode 100644 index 000000000..466283fff --- /dev/null +++ b/typespec/tools/endpoints.tsp @@ -0,0 +1,27 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "../common"; +import "../agents"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +using Common; +using Agents; + +namespace Tools; + +// +// TOOL ENDPOINTS +// + +interface Endpoints + extends UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint {} + +interface AgentEndpoints + extends ChildLimitOffsetPagination, + ChildCreateEndpoint {} diff --git a/typespec/tools/main.tsp b/typespec/tools/main.tsp new file mode 100644 index 000000000..56b098047 --- /dev/null +++ b/typespec/tools/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Tools; + +// +// TOOLS +// \ No newline at end of file diff --git a/typespec/tools/models.tsp b/typespec/tools/models.tsp new file mode 100644 index 000000000..04b5dd995 --- /dev/null +++ b/typespec/tools/models.tsp @@ -0,0 +1,137 @@ +import "../common"; + +using Common; + +namespace Tools; + +// +// TOOL MODELS +// + +enum ToolType { + /** A tool that emulates a function call */ + function, + + /** A tool that uses one of the Julep integrations */ + integration, + + /** A tool that uses a system resource */ + system, + + /** A tool that makes an API call */ + api_call, +} + +/** The parameters the functions accepts, described as a JSON Schema object. */ +alias FunctionParameters = Record; + +alias ToolOutput = Record; + +alias ToolChoiceOption = "auto" | "none" | NamedToolChoice; + +/** Function definition */ +model FunctionDef { + /** The name of the function */ + name: string; + + /** The parameters the function accepts */ + parameters: FunctionParameters; + + /** Description of the function */ + description?: identifierSafeUnicode; +} + +@discriminator("type") +model Tool { + /** Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) */ + type: ToolType; + + /** The tool should be run in the background (not supported at the moment) */ + background: boolean = false; + + /** Whether the tool that can be run interactively (response should contain "stop" boolean field) */ + interactive: boolean = false; + + function?: FunctionDef; + integration?: unknown; + system?: unknown; + api_call?: unknown; + + ...HasTimestamps; + ...HasId; +} + +model FunctionTool extends Tool { + type: ToolType.function; + background: false = false; + interactive: false = false; + + /** The function to call */ + function: FunctionDef; +} + +model FunctionCallOption { + /** The name of the function */ + name: string; +} + +@discriminator("type") +model NamedToolChoice { + /** Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) */ + type: ToolType; + + function?: FunctionCallOption; + integration?: unknown; + system?: unknown; + api_call?: unknown; +} + +model NamedFunctionChoice extends NamedToolChoice { + type: ToolType.function; + + /** The function to call */ + function: FunctionCallOption; +} + +model ToolResponse { + @key id: uuid; + + /** The output of the tool */ + output: ToolOutput; +} + +/** Payload for creating a tool */ +@withVisibility("create") +model CreateToolRequest { + ...Tool; +} + +/** Payload for updating a tool */ +@withVisibility("update") +model UpdateToolRequest { + ...Tool; +} + +/** Payload for patching a tool */ +model PatchToolRequest is UpdateToolRequest {} + +/** The response tool value generated by the model */ +@discriminator("type") +model ChosenToolCall { + /** Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) */ + type: ToolType; + + function?: FunctionCallOption; + integration?: unknown; + system?: unknown; + api_call?: unknown; + + ...HasId; +} + +model ChosenFunctionCall extends ChosenToolCall { + type: ToolType.function; + + /** The function to call */ + function: FunctionCallOption; +} \ No newline at end of file diff --git a/typespec/tspconfig.yaml b/typespec/tspconfig.yaml new file mode 100644 index 000000000..c574698ad --- /dev/null +++ b/typespec/tspconfig.yaml @@ -0,0 +1,9 @@ +emit: + - "@typespec/openapi3" + +options: + "@typespec/openapi3": + file-type: yaml + output-file: "openapi-{version}.yaml" + new-line: lf + omit-unreachable-types: true \ No newline at end of file diff --git a/typespec/users/endpoints.tsp b/typespec/users/endpoints.tsp new file mode 100644 index 000000000..236243bca --- /dev/null +++ b/typespec/users/endpoints.tsp @@ -0,0 +1,25 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +import "../common"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + +using Common; + +namespace Users; + +// +// USER ENDPOINTS +// + +interface Endpoints + extends LimitOffsetPagination, + CreateEndpoint, + CreateOrUpdateEndpoint, + UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint, + GetEndpoint {} \ No newline at end of file diff --git a/typespec/users/main.tsp b/typespec/users/main.tsp new file mode 100644 index 000000000..9470ac5af --- /dev/null +++ b/typespec/users/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Users; + +// +// USERS +// \ No newline at end of file diff --git a/typespec/users/models.tsp b/typespec/users/models.tsp new file mode 100644 index 000000000..1d53311d4 --- /dev/null +++ b/typespec/users/models.tsp @@ -0,0 +1,45 @@ +import "../common"; + +using Common; + +namespace Users; + +// +// USER MODELS +// + +model User { + ...HasId; + ...HasMetadata; + ...HasTimestamps; + + /** Name of the user */ + @maxLength(120) + name: identifierSafeUnicode = ""; + + /** About the user */ + about: string = ""; +} + +/** Payload for updating a user */ +@withVisibility("create", "update") +model UpdateUserRequest { + ...User; +} + +/** Payload for patching a user */ +model PatchUserRequest is UpdateUserRequest {} + +/** Payload for creating a user (and associated documents) */ +model CreateUserRequest { + ...UpdateUserRequest; + + /** Documents to index for this user. (Max: 100 items) */ + @maxItems(100) + docs: unknown[] = #[]; +} + +model CreateOrUpdateUserRequest { + id: uuid; + ...UpdateUserRequest; +} \ No newline at end of file diff --git a/typespec/versions.tsp b/typespec/versions.tsp new file mode 100644 index 000000000..54b7b267c --- /dev/null +++ b/typespec/versions.tsp @@ -0,0 +1,5 @@ +namespace Versions; + +enum ApiVersions { + v0_3: "0.3.0", +} From 2d6f6b81b6fc0ad9b475db1dad59165ef5f18ee0 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Fri, 12 Jul 2024 17:59:34 -0400 Subject: [PATCH 02/36] feat(typespec): Add Tasks typespec Signed-off-by: Diwank Tomer --- typespec/agents/endpoints.tsp | 6 -- typespec/chat/endpoints.tsp | 2 - typespec/common/scalars.tsp | 5 +- typespec/docs/endpoints.tsp | 6 -- typespec/entries/endpoints.tsp | 6 -- typespec/entries/models.tsp | 6 +- typespec/jobs/endpoints.tsp | 3 - typespec/main.tsp | 40 +++++--- typespec/sessions/endpoints.tsp | 5 - typespec/sessions/models.tsp | 8 +- typespec/tasks/endpoints.tsp | 18 ++++ typespec/tasks/main.tsp | 8 ++ typespec/tasks/models.tsp | 162 ++++++++++++++++++++++++++++++++ typespec/tools/endpoints.tsp | 6 -- typespec/users/endpoints.tsp | 6 -- 15 files changed, 229 insertions(+), 58 deletions(-) create mode 100644 typespec/tasks/endpoints.tsp create mode 100644 typespec/tasks/main.tsp create mode 100644 typespec/tasks/models.tsp diff --git a/typespec/agents/endpoints.tsp b/typespec/agents/endpoints.tsp index f20a3b138..a3c6353a9 100644 --- a/typespec/agents/endpoints.tsp +++ b/typespec/agents/endpoints.tsp @@ -1,12 +1,6 @@ -import "@typespec/http"; -import "@typespec/openapi"; - import "../common"; import "./models.tsp"; -using TypeSpec.Http; -using TypeSpec.OpenAPI; - using Common; namespace Agents; diff --git a/typespec/chat/endpoints.tsp b/typespec/chat/endpoints.tsp index f7530e2fc..5418633c1 100644 --- a/typespec/chat/endpoints.tsp +++ b/typespec/chat/endpoints.tsp @@ -1,12 +1,10 @@ import "@typespec/http"; -import "@typespec/openapi"; import "../common"; import "../sessions"; import "./models.tsp"; using TypeSpec.Http; -using TypeSpec.OpenAPI; using Common; using Sessions; diff --git a/typespec/common/scalars.tsp b/typespec/common/scalars.tsp index 2311e97e8..1c57f7c55 100644 --- a/typespec/common/scalars.tsp +++ b/typespec/common/scalars.tsp @@ -41,4 +41,7 @@ alias eventStream = "text/event-stream"; /** Different possible sources that can produce new entries */ -alias entrySource = "api_request" | "api_response" | "tool_response" | "internal" | "summarizer" | "meta"; \ No newline at end of file +alias entrySource = "api_request" | "api_response" | "tool_response" | "internal" | "summarizer" | "meta"; + +@pattern("^(function|integration|system|api_call)/(\\w+)$") +scalar toolType extends string; diff --git a/typespec/docs/endpoints.tsp b/typespec/docs/endpoints.tsp index 705d0a497..722298329 100644 --- a/typespec/docs/endpoints.tsp +++ b/typespec/docs/endpoints.tsp @@ -1,14 +1,8 @@ -import "@typespec/http"; -import "@typespec/openapi"; - import "../agents"; import "../common"; import "../users"; import "./models.tsp"; -using TypeSpec.Http; -using TypeSpec.OpenAPI; - using Agents; using Common; using Users; diff --git a/typespec/entries/endpoints.tsp b/typespec/entries/endpoints.tsp index ad328f474..306a1c429 100644 --- a/typespec/entries/endpoints.tsp +++ b/typespec/entries/endpoints.tsp @@ -1,13 +1,7 @@ -import "@typespec/http"; -import "@typespec/openapi"; - import "../common"; import "../sessions"; import "./models.tsp"; -using TypeSpec.Http; -using TypeSpec.OpenAPI; - using Common; using Sessions; diff --git a/typespec/entries/models.tsp b/typespec/entries/models.tsp index 40390bb87..b6a09b53b 100644 --- a/typespec/entries/models.tsp +++ b/typespec/entries/models.tsp @@ -1,7 +1,9 @@ import "../common"; +import "../sessions"; import "../tools"; using Common; +using Sessions; using Tools; namespace Entries; @@ -92,7 +94,6 @@ model InputChatMLMessage { alias EntryContent = ChatMLContentPart[] | Tool | ChosenToolCall | string | ToolResponse; model Entry { - @key entry_id: uuid; role: ChatMLRole; name: string | null = null; content: EntryContent | EntryContent[]; @@ -103,6 +104,7 @@ model Entry { /** This is the time it was added to the database */ ...HasCreatedAt; + ...HasId; } model Relation { @@ -114,7 +116,7 @@ model Relation { model History { entries: Entry[]; relations: Relation[]; - session_id: uuid; + session_id: Session.id; ...HasCreatedAt; } \ No newline at end of file diff --git a/typespec/jobs/endpoints.tsp b/typespec/jobs/endpoints.tsp index 431061aba..fbc8a210b 100644 --- a/typespec/jobs/endpoints.tsp +++ b/typespec/jobs/endpoints.tsp @@ -1,6 +1,3 @@ -import "@typespec/http"; -import "@typespec/openapi"; - import "../common"; import "./models.tsp"; diff --git a/typespec/main.tsp b/typespec/main.tsp index 21199c55f..ca7e63140 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -8,6 +8,7 @@ import "./docs"; import "./entries"; import "./jobs"; import "./sessions"; +import "./tasks"; import "./tools"; import "./users"; import "./versions.tsp"; @@ -51,39 +52,52 @@ using Versions; } ) @useAuth( - ApiKeyAuth - | ApiKeyAuth + ApiKeyAuth | ApiKeyAuth< + ApiKeyLocation.header, + "X-Auth-Key" + > ) namespace Api { - // model Agent_ is Agents.Agent {} + model Agent is Agents.Agent; + model Doc is Docs.Doc; + model Tool is Tools.Tool; + model User is Users.User; + model Session is Sessions.Session; + model History is Entries.History; + model Entry is Entries.Entry; + model Task is Tasks.Task; + model JobStatus is Jobs.JobStatus; @route("/agents") - interface Agent extends Agents.Endpoints {} + interface AgentRoute extends Agents.Endpoints {} @route("/agents/{id}/docs") - interface AgentDocs extends Docs.AgentEndpoints {} + interface AgentDocsRoute extends Docs.AgentEndpoints {} @route("/agents/{id}/tools") - interface AgentTools extends Tools.AgentEndpoints {} + interface AgentToolsRoute extends Tools.AgentEndpoints {} @route("/users") - interface User extends Users.Endpoints {} + interface UserRoute extends Users.Endpoints {} @route("/users/{id}/docs") - interface UserDocs extends Docs.UserEndpoints {} + interface UserDocsRoute extends Docs.UserEndpoints {} @route("/sessions") - interface Session extends Sessions.Endpoints {} + interface SessionRoute extends Sessions.Endpoints {} @route("/sessions/{id}/history") - interface History extends Entries.Endpoints {} + interface HistoryRoute extends Entries.Endpoints {} @route("/docs/{id}") - interface AgentIndividualDoc extends Docs.IndividualDocEndpoints {} + interface AgentIndividualDocRoute extends Docs.IndividualDocEndpoints {} + + @route("/tasks") + interface TaskRoute extends Tasks.Endpoints {} @route("/tools") - interface Tool extends Tools.Endpoints {} + interface ToolRoute extends Tools.Endpoints {} @route("/jobs") - interface Job extends Jobs.Endpoints {} + interface JobRoute extends Jobs.Endpoints {} } diff --git a/typespec/sessions/endpoints.tsp b/typespec/sessions/endpoints.tsp index 8af4711ff..650c6604a 100644 --- a/typespec/sessions/endpoints.tsp +++ b/typespec/sessions/endpoints.tsp @@ -1,11 +1,6 @@ -import "@typespec/http"; -import "@typespec/openapi"; import "../common"; import "./models.tsp"; -using TypeSpec.Http; -using TypeSpec.OpenAPI; - using Common; namespace Sessions; diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index 4026b3614..b32531415 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -1,6 +1,10 @@ +import "../agents"; import "../common"; +import "../users"; +using Agents; using Common; +using Users; namespace Sessions; @@ -15,11 +19,11 @@ model Session { /** User ID of user associated with this session */ @visibility("create") - user_id: uuid; + user_id: User.id; /** Agent ID of agent associated with this session */ @visibility("create") - agent_id: uuid; + agent_id: Agent.id; /** A specific situation that sets the background for this session */ situation: string = ""; diff --git a/typespec/tasks/endpoints.tsp b/typespec/tasks/endpoints.tsp new file mode 100644 index 000000000..3c5771288 --- /dev/null +++ b/typespec/tasks/endpoints.tsp @@ -0,0 +1,18 @@ +import "../common"; +import "./models.tsp"; + +using Common; + +namespace Tasks; + +// +// Task ENDPOINTS +// + +interface Endpoints + extends UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint, + LimitOffsetPagination, + CreateOrUpdateEndpoint, + CreateEndpoint {} diff --git a/typespec/tasks/main.tsp b/typespec/tasks/main.tsp new file mode 100644 index 000000000..cf07c122f --- /dev/null +++ b/typespec/tasks/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Tasks; + +// +// TASKS +// \ No newline at end of file diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp new file mode 100644 index 000000000..32594cf89 --- /dev/null +++ b/typespec/tasks/models.tsp @@ -0,0 +1,162 @@ +import "../agents"; +import "../common"; +import "../chat"; +import "../entries"; + +using Agents; +using Chat; +using Common; +using Entries; + +namespace Tasks; + +// +// TASK MODELS +// + +// -- cannot use an enum here coz typespec doesnt allow it in discriminated models +alias WorkflowStepKind = ( + /** A step that runs a tool */ + | "tool_call" + + /** A step that runs a subworkflow */ + | "yield" + + /** A step that runs a prompt */ + | "prompt" + + /** A step that evaluates an expression */ + | "evaluate" + + /** A step that runs a conditional */ + | "if_else" + + /** A step that runs a loop */ + | "loop" + + /** Throw an error */ + | "error" +); + +@discriminator("__kind") +model WorkflowStep { + @visibility("read") + __kind?: WorkflowStepKind; +} + +model ToolCallStep extends WorkflowStep { + @visibility("read") + __kind: "tool_call" = "tool_call"; + + /** The tool to run */ + tool: toolType; + + /** The input parameters for the tool */ + arguments: Record; +} + +/** An object where values are strings in the Common Expression Language that get evaluated before being passed downstream */ +scalar CEL extends string; +alias CELObject = Record; + +model YieldStep extends WorkflowStep { + @visibility("read") + __kind: "yield" = "yield"; + + /** The subworkflow to run */ + workflow: string; + + /** The input parameters for the subworkflow */ + arguments: CELObject; +} + +model PromptStep extends WorkflowStep { + @visibility("read") + __kind: "prompt" = "prompt"; + + /** The prompt to run */ + prompt: string | InputChatMLMessage[]; + + /** Settings for the prompt */ + settings: ChatSettings; +} + +model EvaluateStep extends WorkflowStep { + @visibility("read") + __kind: "evaluate" = "evaluate"; + + /** The expression to evaluate */ + evaluate: CELObject; +} + +model IfElseWorkflowStep extends WorkflowStep { + @visibility("read") + __kind: "if_else" = "if_else"; + + /** The condition to evaluate */ + `if`: CEL; + + /** The steps to run if the condition is true */ + then: YieldStep; + + /** The steps to run if the condition is false */ + `else`: YieldStep; +} + +model ErrorWorkflowStep extends WorkflowStep { + @visibility("read") + __kind: "error" = "error"; + + /** The error message */ + error: string; +} + +@withVisibility("create") +model CreateWorkflowStep { + ...WorkflowStep; +} + +model Workflow { + @key name: identifierSafeUnicode; + + /** The steps in the workflow */ + steps: WorkflowStep[]; +} + +/** Object describing a Task */ +model Task { + @visibility("read", "create") + name: string; + + description: string = ""; + main: WorkflowStep[]; + input_schema: Record | null = null; + tools: toolType[]; + + @visibility("read") + agent_id: Agent.id; + + ...HasId; + ...HasTimestamps; + ...Record; +} + +/** Payload for updating a task */ +@withVisibility("update") +model UpdateTaskRequest { + ...Task; +} + +/** Payload for patching a task */ +model PatchTaskRequest is UpdateTaskRequest {} + +/** Payload for creating a task */ +@withVisibility("create") +model CreateTaskRequest { + ...Task; +} + +model CreateOrUpdateTaskRequest { + id: uuid; + ...CreateTaskRequest; +} \ No newline at end of file diff --git a/typespec/tools/endpoints.tsp b/typespec/tools/endpoints.tsp index 466283fff..186093740 100644 --- a/typespec/tools/endpoints.tsp +++ b/typespec/tools/endpoints.tsp @@ -1,13 +1,7 @@ -import "@typespec/http"; -import "@typespec/openapi"; - import "../common"; import "../agents"; import "./models.tsp"; -using TypeSpec.Http; -using TypeSpec.OpenAPI; - using Common; using Agents; diff --git a/typespec/users/endpoints.tsp b/typespec/users/endpoints.tsp index 236243bca..7796c484c 100644 --- a/typespec/users/endpoints.tsp +++ b/typespec/users/endpoints.tsp @@ -1,12 +1,6 @@ -import "@typespec/http"; -import "@typespec/openapi"; - import "../common"; import "./models.tsp"; -using TypeSpec.Http; -using TypeSpec.OpenAPI; - using Common; namespace Users; From 038158613f786f3c750e2d6a6a4105629be28da8 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Fri, 12 Jul 2024 18:57:32 -0400 Subject: [PATCH 03/36] feat(typespec): Add Executions typespec Signed-off-by: Diwank Tomer --- typespec/executions/endpoints.tsp | 24 ++++++ typespec/executions/main.tsp | 8 ++ typespec/executions/models.tsp | 124 ++++++++++++++++++++++++++++++ typespec/main.tsp | 20 +++-- typespec/tasks/endpoints.tsp | 32 +++++++- 5 files changed, 202 insertions(+), 6 deletions(-) create mode 100644 typespec/executions/endpoints.tsp create mode 100644 typespec/executions/main.tsp create mode 100644 typespec/executions/models.tsp diff --git a/typespec/executions/endpoints.tsp b/typespec/executions/endpoints.tsp new file mode 100644 index 000000000..c2ff867b9 --- /dev/null +++ b/typespec/executions/endpoints.tsp @@ -0,0 +1,24 @@ +import "../common"; +import "./models.tsp"; + +using Common; + +namespace Executions; + +// +// EXECUTION ENDPOINTS +// + +interface Endpoints + extends UpdateEndpoint, + GetEndpoint {} + +interface TransitionEndpoints + extends ChildLimitOffsetPagination< + { + transitions: Transition[], + }, + "Transitions", + Execution, + "Execution" + > {} diff --git a/typespec/executions/main.tsp b/typespec/executions/main.tsp new file mode 100644 index 000000000..2b3552741 --- /dev/null +++ b/typespec/executions/main.tsp @@ -0,0 +1,8 @@ +import "./endpoints.tsp"; +import "./models.tsp"; + +namespace Executions; + +// +// EXECUTIONS +// \ No newline at end of file diff --git a/typespec/executions/models.tsp b/typespec/executions/models.tsp new file mode 100644 index 000000000..0b9dd6080 --- /dev/null +++ b/typespec/executions/models.tsp @@ -0,0 +1,124 @@ +import "../common"; +import "../tasks"; + +using Common; +using Tasks; + +namespace Executions; + +// +// EXECUTION MODELS +// + +/** The status of an execution */ +alias ExecutionStatus = ( + /** The execution is queued and waiting to start */ + | "queued" + + /** The execution is starting */ + | "starting" + + /** The execution is running */ + | "running" + + /** The execution is awaiting input */ + | "awaiting_input" + + /** The execution has succeeded */ + | "succeeded" + + /** The execution has failed */ + | "failed" + + /** The execution has been cancelled by the user */ + | "cancelled" +); + +model Execution { + /** The ID of the task that the execution is running */ + @visibility("read") + task_id: Task.id; + + /** The status of the execution */ + @visibility("read") + status: ExecutionStatus; + + /** The input to the execution */ + input: Record; + + ...HasTimestamps; + ...HasId; +} + +/** Payload for creating an execution */ +@withVisibility("create") +model CreateExecutionRequest { + ...Execution; +} + +@discriminator("status") +model UpdateExecutionRequest { + status: ExecutionStatus; +} + +model StopExecutionRequest extends UpdateExecutionRequest { + status: "cancelled" = "cancelled"; + + /** The reason for stopping the execution */ + reason: string | null = null; +} + +model ResumeExecutionRequest extends UpdateExecutionRequest { + status: "running" = "running"; + + /** The input to resume the execution with */ + input?: Record; +} + +model TaskTokenResumeExecutionRequest { + status: "running" = "running"; + + /** A Task Token is a unique identifier for a specific Task Execution. */ + task_token: string; + + /** The input to resume the execution with */ + input?: Record; +} + +/* +- finish +- wait +- error +- step +- cancelled +*/ + +alias TransitionType = ( + | "finish" + | "wait" + | "error" + | "step" + | "cancelled" +); + +alias TransitionTarget = [identifierSafeUnicode, uint16]; + +model Transition { + @visibility("read") + type: TransitionType; + + @visibility("read") + execution_id: Execution.id; + + @visibility("read") + outputs: Record; + + @visibility("read") + current: TransitionTarget; + + @visibility("read") + next: TransitionTarget | null; + + ...HasId; + ...HasTimestamps; +} \ No newline at end of file diff --git a/typespec/main.tsp b/typespec/main.tsp index ca7e63140..367c3ab04 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -6,6 +6,7 @@ import "./agents"; import "./chat"; import "./docs"; import "./entries"; +import "./executions"; import "./jobs"; import "./sessions"; import "./tasks"; @@ -69,7 +70,7 @@ namespace Api { model JobStatus is Jobs.JobStatus; @route("/agents") - interface AgentRoute extends Agents.Endpoints {} + interface AgentsRoute extends Agents.Endpoints {} @route("/agents/{id}/docs") interface AgentDocsRoute extends Docs.AgentEndpoints {} @@ -78,22 +79,31 @@ namespace Api { interface AgentToolsRoute extends Tools.AgentEndpoints {} @route("/users") - interface UserRoute extends Users.Endpoints {} + interface UsersRoute extends Users.Endpoints {} @route("/users/{id}/docs") interface UserDocsRoute extends Docs.UserEndpoints {} @route("/sessions") - interface SessionRoute extends Sessions.Endpoints {} + interface SessionsRoute extends Sessions.Endpoints {} @route("/sessions/{id}/history") interface HistoryRoute extends Entries.Endpoints {} @route("/docs/{id}") - interface AgentIndividualDocRoute extends Docs.IndividualDocEndpoints {} + interface AgentIndividualDocsRoute extends Docs.IndividualDocEndpoints {} @route("/tasks") - interface TaskRoute extends Tasks.Endpoints {} + interface TasksRoute extends Tasks.Endpoints {} + + @route("/tasks/{id}/executions") + interface TaskExecutionsRoute extends Tasks.ExecutionEndpoints {} + + @route("/executions") + interface ExecutionsRoute extends Executions.Endpoints {} + + @route("/executions/{id}/transitions") + interface ExecutionTransitionsRoute extends Executions.TransitionEndpoints {} @route("/tools") interface ToolRoute extends Tools.Endpoints {} diff --git a/typespec/tasks/endpoints.tsp b/typespec/tasks/endpoints.tsp index 3c5771288..9246421fe 100644 --- a/typespec/tasks/endpoints.tsp +++ b/typespec/tasks/endpoints.tsp @@ -1,12 +1,18 @@ +import "@typespec/http"; + import "../common"; +import "../executions"; import "./models.tsp"; +using TypeSpec.Http; + using Common; +using Executions; namespace Tasks; // -// Task ENDPOINTS +// TASK ENDPOINTS // interface Endpoints @@ -16,3 +22,27 @@ interface Endpoints LimitOffsetPagination, CreateOrUpdateEndpoint, CreateEndpoint {} + +interface ExecutionEndpoints + extends ChildCreateEndpoint, + ChildLimitOffsetPagination { + @put + @doc("Resume an execution with a task token") + resumeWithTaskToken( + @header contentType: yaml | json; + + @path + @doc("ID of parent Task") + id: uuid, + + @body + @doc("Request to resume an execution with a task token") + body: TaskTokenResumeExecutionRequest; + ): { + @statusCode _: "200"; + + @body + @doc("Response of resuming the execution with the ID found") + body: ResourceUpdatedResponse; + }; + } \ No newline at end of file From 787d654371727155c5e2faa5cd1c5ef0f685908f Mon Sep 17 00:00:00 2001 From: Dmitry Paramonov Date: Sat, 13 Jul 2024 14:34:11 +0300 Subject: [PATCH 04/36] feat: Add session token budget and context overflow --- typespec/sessions/models.tsp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index b32531415..506cd07ca 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -34,6 +34,12 @@ model Session { /** Render system and assistant message content as jinja templates */ render_templates: boolean = false; + + /** Threshold value for the adaptive context functionality */ + token_budget: int | null = null + + /** Action to start on context window overflow */ + context_overflow: string | null = null } /** Payload for updating a session */ From a56bbbedf11ee08ac2b9ecb8ffc8ea00d6f1d63a Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sat, 13 Jul 2024 20:06:28 -0400 Subject: [PATCH 05/36] fix(typespec): Minor spec fixes Signed-off-by: Diwank Tomer --- typespec/common/scalars.tsp | 6 +++--- typespec/sessions/models.tsp | 2 +- typespec/tasks/models.tsp | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/typespec/common/scalars.tsp b/typespec/common/scalars.tsp index 1c57f7c55..437844943 100644 --- a/typespec/common/scalars.tsp +++ b/typespec/common/scalars.tsp @@ -39,9 +39,9 @@ alias yaml = "application/yaml" | "text/x-yaml" | "text/yaml"; alias json = "application/json"; alias eventStream = "text/event-stream"; - /** Different possible sources that can produce new entries */ alias entrySource = "api_request" | "api_response" | "tool_response" | "internal" | "summarizer" | "meta"; -@pattern("^(function|integration|system|api_call)/(\\w+)$") -scalar toolType extends string; +/** Naming convention for tool references. Tools are resolved in order: `step-settings` -> `task` -> `agent` */ +@pattern("^(function|integration|system|api_call)\\.(\\w+)$") +scalar toolRef extends string; diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index 506cd07ca..344461068 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -36,7 +36,7 @@ model Session { render_templates: boolean = false; /** Threshold value for the adaptive context functionality */ - token_budget: int | null = null + token_budget: uint16 | null = null; /** Action to start on context window overflow */ context_overflow: string | null = null diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 32594cf89..97eadbc0d 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -2,11 +2,13 @@ import "../agents"; import "../common"; import "../chat"; import "../entries"; +import "../tools"; using Agents; using Chat; using Common; using Entries; +using Tools; namespace Tasks; @@ -49,7 +51,7 @@ model ToolCallStep extends WorkflowStep { __kind: "tool_call" = "tool_call"; /** The tool to run */ - tool: toolType; + tool: toolRef; /** The input parameters for the tool */ arguments: Record; @@ -129,9 +131,18 @@ model Task { name: string; description: string = ""; + + /** The entrypoint of the task. */ main: WorkflowStep[]; + + /** The schema for the input to the task. `null` means all inputs are valid. */ input_schema: Record | null = null; - tools: toolType[]; + + /** Tools defined specifically for this task not included in the Agent itself. */ + tools: CreateToolRequest[] = #[]; + + /** Whether to inherit tools from the parent agent or not. Defaults to true. */ + inherit_tools: boolean = true; @visibility("read") agent_id: Agent.id; From a88ab44c9a6ba6c2abc461daa8acaed6fddfe7f7 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sat, 13 Jul 2024 20:16:17 -0400 Subject: [PATCH 06/36] feat(typespec): Add name field to Tool Signed-off-by: Diwank Tomer --- typespec/common/scalars.tsp | 4 ++++ typespec/tools/models.tsp | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/typespec/common/scalars.tsp b/typespec/common/scalars.tsp index 437844943..aeef009c9 100644 --- a/typespec/common/scalars.tsp +++ b/typespec/common/scalars.tsp @@ -15,6 +15,10 @@ scalar uuid extends string; @pattern("^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$") scalar identifierSafeUnicode extends string; +/** Valid python identifier names */ +@pattern("^[^\\W0-9]\\w*$") +scalar validPythonIdentifier extends string; + /** Limit the number of results */ @minValue(1) @maxValueExclusive(1000) diff --git a/typespec/tools/models.tsp b/typespec/tools/models.tsp index 04b5dd995..ed83a6d72 100644 --- a/typespec/tools/models.tsp +++ b/typespec/tools/models.tsp @@ -31,8 +31,8 @@ alias ToolChoiceOption = "auto" | "none" | NamedToolChoice; /** Function definition */ model FunctionDef { - /** The name of the function */ - name: string; + /** DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. */ + name?: validPythonIdentifier = "overriden"; /** The parameters the function accepts */ parameters: FunctionParameters; @@ -80,6 +80,9 @@ model NamedToolChoice { /** Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) */ type: ToolType; + /** The name of the tool/function */ + name: validPythonIdentifier; + function?: FunctionCallOption; integration?: unknown; system?: unknown; From c5414e02cee1657bc24c7a9c56b953387c6cf529 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 14 Jul 2024 18:44:41 -0400 Subject: [PATCH 07/36] refactor(typespec): Minor refactors to common/ utils Signed-off-by: Diwank Tomer --- typespec/common/interfaces.tsp | 45 ++++------------------------------ typespec/common/types.tsp | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/typespec/common/interfaces.tsp b/typespec/common/interfaces.tsp index 8892514b0..e769c1510 100644 --- a/typespec/common/interfaces.tsp +++ b/typespec/common/interfaces.tsp @@ -1,11 +1,9 @@ import "@typespec/http"; -import "@typespec/openapi"; import "./scalars.tsp"; import "./types.tsp"; using TypeSpec.Http; -using TypeSpec.OpenAPI; namespace Common; @@ -17,26 +15,8 @@ interface LimitOffsetPagination { @get @doc("List {TName} items", {TName: TName}) list( - @query - @doc("Limit the number of {TName} items returned", {TName: TName}) - limit: limit = 100, - - @query - @doc("Offset the {TName} items returned", {TName: TName}) - offset: offset = 0, - - /** Sort by a field */ - @query sort_by: sortBy = "created_at", - - /** Sort direction */ - @query direction: sortDirection = "asc", - - /** JSON string of object that should be used to filter objects by metadata */ - @query metadata_filter: string = "{}", - - @query before?: unixTimestamp32, - @query after?: unixTimestamp32, - ): T[]; + ...PaginationOptions + ): {results: T[]}; } interface CreateEndpoint { @@ -153,24 +133,9 @@ interface ChildLimitOffsetPagination< @path @doc("ID of parent {PName}", {PName: PName}) id: uuid, - - @query - @doc("Limit the number of {TName} items returned", {TName: TName}) - limit: limit = 100, - - @query - @doc("Offset the {TName} items returned", {TName: TName}) - offset: offset = 0, - - /** Sort by a field */ - @query sort_by: sortBy = "created_at", - - /** Sort direction */ - @query direction: sortDirection = "asc", - - /** JSON string of object that should be used to filter objects by metadata */ - @query metadata_filter: string = "{}", - ): T[]; + + ...PaginationOptions + ): {results: T[]}; } interface ChildCreateEndpoint< diff --git a/typespec/common/types.tsp b/typespec/common/types.tsp index 63d92ed95..4be017203 100644 --- a/typespec/common/types.tsp +++ b/typespec/common/types.tsp @@ -1,3 +1,9 @@ +import "@typespec/http"; +import "@typespec/openapi"; + +using TypeSpec.Http; +using TypeSpec.OpenAPI; + namespace Common; // @@ -25,4 +31,23 @@ model ResourceDeletedResponse { id: uuid; ...HasDeletedAt; ...HasJobs; +} + +model PaginationOptions { + @query + @doc("Limit the number of {TName} items returned", {TName: TName}) + limit: limit = 100, + + @query + @doc("Offset the {TName} items returned", {TName: TName}) + offset: offset = 0, + + /** Sort by a field */ + @query sort_by: sortBy = "created_at", + + /** Sort direction */ + @query direction: sortDirection = "asc", + + /** JSON string of object that should be used to filter objects by metadata */ + @query metadata_filter: string = "{}", } \ No newline at end of file From 955f8b9f11c773549920c77e0915baa09e14bdd3 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 14 Jul 2024 18:50:01 -0400 Subject: [PATCH 08/36] feat(typespec): Add search endpoints Signed-off-by: Diwank Tomer --- typespec/docs/endpoints.tsp | 19 ++++++++++++ typespec/docs/models.tsp | 59 +++++++++++++++++++++++++++++++++++-- typespec/main.tsp | 6 ++++ 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/typespec/docs/endpoints.tsp b/typespec/docs/endpoints.tsp index 722298329..cc15aef27 100644 --- a/typespec/docs/endpoints.tsp +++ b/typespec/docs/endpoints.tsp @@ -1,8 +1,12 @@ +import "@typespec/http"; + import "../agents"; import "../common"; import "../users"; import "./models.tsp"; +using TypeSpec.Http; + using Agents; using Common; using Users; @@ -22,3 +26,18 @@ interface AgentEndpoints interface IndividualDocEndpoints extends GetEndpoint, DeleteEndpoint {} + +interface SearchEndpoints { + @doc("Search for documents owned by {TName}", {TName: TName}) + @post + search( + @path + @doc("ID of the {TName}", {TName: TName}) + id: User.id | Agent.id, + + ...PaginationOptions<"Doc">, + body: DocSearchRequest, + ): { + results: DocReference[]; + }; +} diff --git a/typespec/docs/models.tsp b/typespec/docs/models.tsp index 0c2c73b70..e74eafd46 100644 --- a/typespec/docs/models.tsp +++ b/typespec/docs/models.tsp @@ -1,6 +1,10 @@ +import "../agents"; import "../common"; +import "../users"; +using Agents; using Common; +using Users; namespace Docs; @@ -28,7 +32,7 @@ model CreateDocRequest { } model DocOwner { - id: uuid; + id: User.id | Agent.id; role: "user" | "agent"; } @@ -37,8 +41,59 @@ model DocReference { owner: DocOwner; /** ID of the document */ - id: uuid; + id: Doc.id; /** Snippets referred to of the document */ snippet_index: uint16[]; + snippet?: string; +} + +@discriminator("mode") +model DocSearchRequest { + text?: string | string[]; + vector?: float[] | float[][]; + + /** The search mode */ + mode: "vector" | "text" | "hybrid"; + + /** The confidence cutoff level */ + @minValue(0) + @maxValue(1) + confidence: float = 0.5; + + /** The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; */ + @minValue(0) + @maxValue(1) + alpha: float = 0.75; + + /** Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. */ + mmr: boolean = false; + + /** The language to be used for text-only search. Support for other languages coming soon. */ + lang: "en-US" = "en-US"; +} + +model VectorDocSearchRequest extends DocSearchRequest { + /** Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ + vector: float[] | float[][]; + + text?: never; + mode: "vector" = "vector"; +} + +model TextOnlyDocSearchRequest extends DocSearchRequest { + /** Text or texts to use in the search. In `text` search mode, only BM25 is used. */ + text: string | string[]; + + vector?: never; + mode: "text" = "text"; +} + +model HybridDocSearchRequest extends DocSearchRequest { + /** Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. */ + text?: string | string[]; + + /** Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ + vector?: float[] | float[][]; + mode: "hybrid" = "hybrid"; } \ No newline at end of file diff --git a/typespec/main.tsp b/typespec/main.tsp index 367c3ab04..632b7943d 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -75,6 +75,9 @@ namespace Api { @route("/agents/{id}/docs") interface AgentDocsRoute extends Docs.AgentEndpoints {} + @route("/agents/{id}/search") + interface AgentsDocsSearchRoute extends Docs.SearchEndpoints<"Agent"> {} + @route("/agents/{id}/tools") interface AgentToolsRoute extends Tools.AgentEndpoints {} @@ -84,6 +87,9 @@ namespace Api { @route("/users/{id}/docs") interface UserDocsRoute extends Docs.UserEndpoints {} + @route("/users/{id}/search") + interface UserDocsSearchRoute extends Docs.SearchEndpoints<"User"> {} + @route("/sessions") interface SessionsRoute extends Sessions.Endpoints {} From 6373794bfe36bd0230c4e4821795fa6e4d4ce01d Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 15 Jul 2024 15:54:13 -0400 Subject: [PATCH 09/36] feat(typespec): Add multi-agent multi-user sessions, add template for situation Signed-off-by: Diwank Tomer --- typespec/common/constants.tsp | 64 +++++++++++++++++++++ typespec/common/main.tsp | 1 + typespec/docs/models.tsp | 2 + typespec/executions/models.tsp | 2 +- typespec/sessions/models.tsp | 102 +++++++++++++++++++++++++++++---- typespec/tasks/models.tsp | 20 +++---- typespec/versions.tsp | 2 +- 7 files changed, 170 insertions(+), 23 deletions(-) create mode 100644 typespec/common/constants.tsp diff --git a/typespec/common/constants.tsp b/typespec/common/constants.tsp new file mode 100644 index 000000000..e60329752 --- /dev/null +++ b/typespec/common/constants.tsp @@ -0,0 +1,64 @@ +namespace Common; + +// +// COMMON CONSTANTS +// + +const defaultSessionSystemMessage: string = """ +{%- if agent.name -%} +You are {{agent.name}}.{{" "}} +{%- endif -%} + +{%- if agent.about -%} +About you: {{agent.name}}.{{" "}} +{%- endif -%} + +{%- if user -%} +You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} +{%- endif -%} + +{{"\n\n"}} + +{%- if agent.instructions -%} +Instructions:{{"\n"}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{"\n"}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{"\n"}} + {%- endfor -%} + {%- endif -%} + {{"\n"}} +{%- endif -%} + +{%- if tools -%} +Tools:{{"\n"}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} +{{"\n\n"}} +{%- endif -%} + +{%- if docs -%} +Relevant documents:{{"\n"}} + {%- for doc in docs -%} + {{doc.title}}{{"\n"}} + {%- if doc.content is string -%} + {{doc.content}}{{"\n"}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{"\n"}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} +{%- endif -%} +"""; \ No newline at end of file diff --git a/typespec/common/main.tsp b/typespec/common/main.tsp index a7473f475..a6279bcb5 100644 --- a/typespec/common/main.tsp +++ b/typespec/common/main.tsp @@ -1,3 +1,4 @@ +import "./constants.tsp"; import "./interfaces.tsp"; import "./mixins.tsp"; import "./scalars.tsp"; diff --git a/typespec/docs/models.tsp b/typespec/docs/models.tsp index e74eafd46..8d75f5776 100644 --- a/typespec/docs/models.tsp +++ b/typespec/docs/models.tsp @@ -45,6 +45,8 @@ model DocReference { /** Snippets referred to of the document */ snippet_index: uint16[]; + + title?: string; snippet?: string; } diff --git a/typespec/executions/models.tsp b/typespec/executions/models.tsp index 0b9dd6080..df759b13a 100644 --- a/typespec/executions/models.tsp +++ b/typespec/executions/models.tsp @@ -101,7 +101,7 @@ alias TransitionType = ( | "cancelled" ); -alias TransitionTarget = [identifierSafeUnicode, uint16]; +alias TransitionTarget = [validPythonIdentifier, uint16]; model Transition { @visibility("read") diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index 344461068..cfee449a6 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -1,10 +1,6 @@ -import "../agents"; import "../common"; -import "../users"; -using Agents; using Common; -using Users; namespace Sessions; @@ -12,21 +8,34 @@ namespace Sessions; // SESSION MODELS // +@discriminator("__kind") model Session { - ...HasId; - ...HasMetadata; - ...HasTimestamps; + @visibility("none") + __kind: ( + | "single_agent_no_user" + | "single_agent_single_user" + | "single_agent_multi_user" + | "multi_agent_no_user" + | "multi_agent_single_user" + | "multi_agent_multi_user" + ); /** User ID of user associated with this session */ @visibility("create") - user_id: User.id; + user?: uuid; + + @visibility("create") + users?: uuid[]; /** Agent ID of agent associated with this session */ @visibility("create") - agent_id: Agent.id; + agent?: uuid; + + @visibility("create") + agents?: uuid[]; /** A specific situation that sets the background for this session */ - situation: string = ""; + situation: string = defaultSessionSystemMessage; /** Summary (null at the beginning) - generated automatically after every interaction */ @visibility("read") @@ -39,9 +48,80 @@ model Session { token_budget: uint16 | null = null; /** Action to start on context window overflow */ - context_overflow: string | null = null + context_overflow: string | null = null; + + ...HasId; + ...HasMetadata; + ...HasTimestamps; +} + +model SingleAgentNoUserSession extends Session { + @visibility("none") + __kind: "single_agent_no_user" = "single_agent_no_user"; + + user?: never; + users?: never; + agents?: never; + + agent: uuid; +} + +model SingleAgentSingleUserSession extends Session { + @visibility("none") + __kind: "single_agent_single_user" = "single_agent_single_user"; + + users?: never; + agents?: never; + + agent: uuid; + user: uuid; +} + +model SingleAgentMultiUserSession extends Session { + @visibility("none") + __kind: "single_agent_multi_user" = "single_agent_multi_user"; + + user?: never; + agents?: never; + + agent: uuid; + users: uuid[]; +} + +model MultiAgentNoUserSession extends Session { + @visibility("none") + __kind: "multi_agent_no_user" = "multi_agent_no_user"; + + user?: never; + users?: never; + agent?: never; + + agents: uuid[]; } +model MultiAgentSingleUserSession extends Session { + @visibility("none") + __kind: "multi_agent_single_user" = "multi_agent_single_user"; + + users?: never; + agent?: never; + + agents: uuid[]; + user: uuid; +} + +model MultiAgentMultiUserSession extends Session { + @visibility("none") + __kind: "multi_agent_multi_user" = "multi_agent_multi_user"; + + user?: never; + agent?: never; + + agents: uuid[]; + users: uuid[]; +} + + /** Payload for updating a session */ @withVisibility("update") model UpdateSessionRequest { diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 97eadbc0d..097dc311f 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -42,12 +42,12 @@ alias WorkflowStepKind = ( @discriminator("__kind") model WorkflowStep { - @visibility("read") + @visibility("none") __kind?: WorkflowStepKind; } model ToolCallStep extends WorkflowStep { - @visibility("read") + @visibility("none") __kind: "tool_call" = "tool_call"; /** The tool to run */ @@ -62,7 +62,7 @@ scalar CEL extends string; alias CELObject = Record; model YieldStep extends WorkflowStep { - @visibility("read") + @visibility("none") __kind: "yield" = "yield"; /** The subworkflow to run */ @@ -73,7 +73,7 @@ model YieldStep extends WorkflowStep { } model PromptStep extends WorkflowStep { - @visibility("read") + @visibility("none") __kind: "prompt" = "prompt"; /** The prompt to run */ @@ -84,7 +84,7 @@ model PromptStep extends WorkflowStep { } model EvaluateStep extends WorkflowStep { - @visibility("read") + @visibility("none") __kind: "evaluate" = "evaluate"; /** The expression to evaluate */ @@ -92,21 +92,21 @@ model EvaluateStep extends WorkflowStep { } model IfElseWorkflowStep extends WorkflowStep { - @visibility("read") + @visibility("none") __kind: "if_else" = "if_else"; /** The condition to evaluate */ `if`: CEL; /** The steps to run if the condition is true */ - then: YieldStep; + then: WorkflowStep; /** The steps to run if the condition is false */ - `else`: YieldStep; + `else`: WorkflowStep; } model ErrorWorkflowStep extends WorkflowStep { - @visibility("read") + @visibility("none") __kind: "error" = "error"; /** The error message */ @@ -119,7 +119,7 @@ model CreateWorkflowStep { } model Workflow { - @key name: identifierSafeUnicode; + @key name: validPythonIdentifier; /** The steps in the workflow */ steps: WorkflowStep[]; diff --git a/typespec/versions.tsp b/typespec/versions.tsp index 54b7b267c..590e07a59 100644 --- a/typespec/versions.tsp +++ b/typespec/versions.tsp @@ -1,5 +1,5 @@ namespace Versions; enum ApiVersions { - v0_3: "0.3.0", + v0_4: "0.4.0", } From 63ba26ff4d0fec210db5b6d0d4a9368301db9a53 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 15 Jul 2024 16:53:12 -0400 Subject: [PATCH 10/36] refactor: Remove mock_openapi.yaml and link openapi.yaml to the typespec generated file Signed-off-by: Diwank Tomer --- mock_openapi.yaml | 3044 ----------------------------- openapi.yaml | 3138 +----------------------------- scripts/generate_openapi_code.sh | 6 +- sdks/python/pyproject.toml | 6 - sdks/ts/package.json | 5 +- 5 files changed, 6 insertions(+), 6193 deletions(-) delete mode 100644 mock_openapi.yaml mode change 100644 => 120000 openapi.yaml diff --git a/mock_openapi.yaml b/mock_openapi.yaml deleted file mode 100644 index 7085f3a97..000000000 --- a/mock_openapi.yaml +++ /dev/null @@ -1,3044 +0,0 @@ -openapi: 3.0.3 -info: - title: Julep Agents API - description: Julep AI agents API allows creating agents with long-term memory easily. - termsOfService: '' - contact: - email: developers@julep.ai - name: Julep Developers - url: https://julep.ai - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - version: 1.0.0 -externalDocs: - description: Find out more about spec - url: https://docs.julep.ai -servers: - - url: https://api-alpha.julep.ai/api - description: '' - variables: {} -tags: - - name: Default - description: '' - externalDocs: - url: https://docs.julep.ai - description: https://docs.julep.ai -paths: - /api/sessions: - post: - summary: Create a new session - description: Create a session between an agent and a user - operationId: CreateSession - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSessionRequest' - description: Session options - description: Session initialization options - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - description: Session successfully created - security: - - api-key: [] - get: - summary: List sessions - description: >- - List sessions created (use limit/offset pagination to get large number - of sessions; sorted by descending order of `created_at` by default) - operationId: ListSessions - tags: [] - parameters: - - in: query - name: limit - description: Number of sessions to return - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: Number of sessions to skip (sorted created_at descending order) - schema: - type: integer - default: 0 - minimum: 0 - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Session' - required: - - items - description: >- - List of sessions (sorted created_at descending order) with - limit+offset pagination - security: - - api-key: [] - /api/users: - post: - summary: Create a new user - description: Create a new user - operationId: CreateUser - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUserRequest' - description: User create options - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - description: User successfully created - security: - - api-key: [] - get: - summary: List users - description: >- - List users created (use limit/offset pagination to get large number of - sessions; sorted by descending order of `created_at` by default) - operationId: ListUsers - tags: [] - parameters: - - in: query - name: limit - description: Number of items to return - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: Number of items to skip (sorted created_at descending order) - schema: - type: integer - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/User' - required: - - items - description: >- - List of users (sorted created_at descending order) with limit+offset - pagination - security: - - api-key: [] - /api/agents: - post: - summary: Create a new agent - description: Create a new agent - operationId: CreateAgent - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateAgentRequest' - description: Agent create options - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - description: Agent successfully created - security: - - api-key: [] - get: - summary: List agents - description: >- - List agents created (use limit/offset pagination to get large number of - sessions; sorted by descending order of `created_at` by default) - operationId: ListAgents - tags: [] - parameters: - - in: query - name: limit - description: Number of items to return - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: Number of items to skip (sorted created_at descending order) - schema: - type: integer - default: 0 - minimum: 0 - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - responses: - '200': - description: >- - List of agents (sorted created_at descending order) with - limit+offset pagination - content: - application/json: - schema: - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Agent' - required: - - items - security: - - api-key: [] - /api/sessions/{session_id}: - get: - summary: Get details of the session - description: '' - operationId: GetSession - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Session' - security: - - api-key: [] - delete: - summary: Delete session - description: '' - operationId: DeleteSession - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update session parameters - description: '' - operationId: UpdateSession - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSessionRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - patch: - summary: Patch Session parameters (merge instead of replace) - description: '' - operationId: PatchSession - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchSessionRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /api/sessions/{session_id}/suggestions: - get: - summary: Get autogenerated suggestions for session user and agent - description: Sorted (created_at descending) - operationId: GetSuggestions - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: '' - schema: - type: integer - default: 0 - minimum: 0 - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Suggestion' - security: - - api-key: [] - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - /api/sessions/{session_id}/history: - get: - summary: Get all messages in a session - description: Sorted (created_at ascending) - operationId: GetHistory - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: '' - schema: - type: integer - default: 0 - minimum: 0 - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/ChatMLMessage' - security: - - api-key: [] - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete session history (does NOT delete related memories) - description: '' - operationId: DeleteSessionHistory - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - /api/sessions/{session_id}/chat: - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Interact with the session - description: '' - operationId: Chat - tags: [] - parameters: - - in: header - name: Accept - description: '' - schema: - type: string - default: application/json - enum: - - application/json - - text/event-stream - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChatInput' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChatResponse' - security: - - api-key: [] - /api/agents/{agent_id}/memories: - get: - summary: Get memories of the agent - description: Sorted (created_at descending) - operationId: GetAgentMemories - tags: [] - parameters: - - in: query - name: query - description: '' - schema: - type: string - required: true - - in: query - name: user_id - description: '' - schema: - type: string - format: uuid - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Memory' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - /api/users/{user_id}: - get: - summary: Get details of the user - description: '' - operationId: GetUser - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - security: - - api-key: [] - delete: - summary: Delete user - description: '' - operationId: DeleteUser - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update user parameters - description: '' - operationId: UpdateUser - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: user_id - description: '' - schema: - type: string - format: uuid - required: true - patch: - summary: Patch User parameters (merge instead of replace) - description: '' - operationId: PatchUser - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchUserRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /api/agents/{agent_id}: - get: - summary: Get details of the agent - description: '' - operationId: GetAgent - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Agent' - security: - - api-key: [] - delete: - summary: Delete agent - description: '' - operationId: DeleteAgent - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update agent parameters - description: '' - operationId: UpdateAgent - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAgentRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - patch: - summary: Patch Agent parameters (merge instead of replace) - description: '' - operationId: PatchAgent - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchAgentRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /api/agents/{agent_id}/docs: - get: - summary: Get docs of the agent - description: Sorted (created_at descending) - operationId: GetAgentDocs - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - requestBody: - content: {} - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Doc' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Create doc of the agent - description: '' - operationId: CreateAgentDoc - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDoc' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - /api/users/{user_id}/docs: - get: - summary: Get docs of the user - description: Sorted (created_at descending) - operationId: GetUserDocs - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - requestBody: - content: {} - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Doc' - security: - - api-key: [] - parameters: - - in: path - name: user_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Create doc of the user - description: '' - operationId: CreateUserDoc - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDoc' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - /api/users/{user_id}/docs/{doc_id}: - parameters: - - in: path - name: user_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: doc_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete doc by id - description: '' - operationId: DeleteUserDoc - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - /api/agents/{agent_id}/docs/{doc_id}: - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: doc_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete doc by id - description: '' - operationId: DeleteAgentDoc - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - /api/agents/{agent_id}/memories/{memory_id}: - delete: - summary: Delete memory of the agent by id - description: '' - operationId: DeleteAgentMemory - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: memory_id - description: '' - schema: - type: string - format: uuid - required: true - /api/agents/{agent_id}/tools: - get: - summary: Get tools of the agent - description: Sorted (created_at descending) - operationId: GetAgentTools - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - requestBody: - content: {} - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Tool' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Create tool for the agent - description: '' - operationId: CreateAgentTool - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateToolRequest' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - /api/agents/{agent_id}/tools/{tool_id}: - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: tool_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete tool by id - description: '' - operationId: DeleteAgentTool - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update agent tool definition - description: '' - operationId: UpdateAgentTool - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateToolRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - patch: - summary: Patch Agent tool parameters (merge instead of replace) - description: '' - operationId: PatchAgentTool - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchToolRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /api/jobs/{job_id}: - get: - summary: Get status of the job - description: '' - operationId: GetJobStatus - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/JobStatus' - security: - - api-key: [] - parameters: - - in: path - name: job_id - description: '' - schema: - type: string - format: uuid - required: true - /api/agents/{agent_id}/tasks: - get: - summary: Get a list of tasks - description: '' - operationId: ListTasks - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Task' - security: - - api-key: [] - post: - summary: Create a Task - description: '' - operationId: CreateTask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTask' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: &ref_0 - type: string - required: true - /api/agents/{agent_id}/tasks/{task_id}/executions: - post: - summary: Create (or start) an execution of a Task - description: '' - operationId: StartTaskExecution - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateExecution' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - get: - summary: List Executions of a Task - description: '' - operationId: GetTaskExecution - responses: &ref_1 - '200': - description: '' - headers: {} - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Execution' - security: &ref_2 - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: *ref_0 - required: true - - in: path - name: task_id - description: '' - schema: &ref_3 - type: string - format: uuid - required: true - /api/agents/{agent_id}/tasks/{task_id}: - get: - summary: Get a Task by ID - description: '' - operationId: GetTask - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: *ref_0 - required: true - - in: path - name: task_id - description: '' - schema: - type: string - format: uuid - required: true - /api/executions/{execution_id}/transitions/{transition_id}: - get: - description: '' - operationId: GetExecutionTransition - responses: - '200': - description: '' - headers: &ref_4 {} - content: - application/json: - schema: - $ref: '#/components/schemas/ExecutionTransition' - security: &ref_5 - - api-key: [] - summary: Get an Execution Transition - parameters: - - &ref_6 - in: path - name: execution_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: transition_id - description: '' - schema: - type: string - required: true - put: - summary: '' - description: '' - operationId: ResumeToolExecution - requestBody: - content: - application/json: - schema: - type: object - properties: - responses: - type: array - items: - $ref: '#/components/schemas/ToolResponse' - required: - - responses - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /api/tasks/{task_id}/executions/{execution_id}: - get: - summary: Get Task Execution By ID - description: '' - operationId: GetTaskExecution - responses: *ref_1 - security: *ref_2 - parameters: - - in: path - name: task_id - description: '' - schema: *ref_0 - required: true - - in: path - name: execution_id - description: '' - schema: *ref_3 - required: true - /api/executions/{execution_id}/transitions/: - get: - description: '' - operationId: GetExecutionTransition - responses: - '200': - description: '' - headers: *ref_4 - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ExecutionTransition' - security: *ref_5 - summary: List Transitions of an Execution - parameters: - - *ref_6 -components: - schemas: - User: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the user - default: User - about: - type: string - description: About the user - created_at: - type: string - format: date-time - description: User created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: User updated at (RFC-3339 format) - id: - type: string - description: User id (UUID) - format: uuid - metadata: - type: object - properties: {} - additionalProperties: true - description: (Optional) metadata - required: - - id - Agent: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the agent - about: - type: string - description: About the agent - default: '' - created_at: - type: string - format: date-time - description: Agent created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: Agent updated at (RFC-3339 format) - id: - type: string - description: Agent id (UUID) - format: uuid - default_settings: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default settings for all sessions created by this agent - model: - type: string - description: The model to use with this agent - default: julep-ai/samantha-1-turbo - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - required: - - name - - id - - model - FunctionParameters: - type: object - description: The parameters the functions accepts, described as a JSON Schema object. - additionalProperties: true - properties: {} - FunctionDef: - type: object - properties: - description: - type: string - description: >- - A description of what the function does, used by the model to choose - when and how to call the function. - name: - type: string - description: >- - The name of the function to be called. Must be a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64. - parameters: - $ref: '#/components/schemas/FunctionParameters' - description: Parameters accepeted by this function - required: - - name - - parameters - Tool: - type: object - properties: - type: - type: string - enum: - - function - - webhook - description: >- - Whether this tool is a `function` or a `webhook` (Only `function` - tool supported right now) - function: - oneOf: - - $ref: '#/components/schemas/FunctionDef' - description: Function definition and parameters - id: - type: string - description: Tool ID - format: uuid - required: - - type - - function - - id - Session: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - id: - type: string - description: Session id (UUID) - format: uuid - user_id: - type: string - description: User ID of user associated with this session - format: uuid - agent_id: - type: string - description: Agent ID of agent associated with this session - format: uuid - situation: - type: string - description: A specific situation that sets the background for this session - summary: - type: string - description: >- - (null at the beginning) - generated automatically after every - interaction - created_at: - type: string - format: date-time - description: Session created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: Session updated at (RFC-3339 format) - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - render_templates: - type: boolean - description: Render system and assistant message content as jinja templates - default: false - token_budget: - type: integer - description: Threshold value for the adaptive context functionality - context_overflow: - type: string - description: Action to start on context window overflow - required: - - id - - agent_id - CreateUserRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the user - default: User - about: - type: string - description: About the user - docs: - type: array - items: - $ref: '#/components/schemas/CreateDoc' - description: Snippet that has information about the user - description: List of docs about user - metadata: - type: object - properties: {} - additionalProperties: true - description: (Optional) metadata - description: A valid request payload for creating a user - CreateSessionRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - user_id: - type: string - description: (Optional) User ID of user to associate with this session - format: uuid - agent_id: - type: string - description: Agent ID of agent to associate with this session - format: uuid - situation: - type: string - description: A specific situation that sets the background for this session - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - render_templates: - type: boolean - description: Render system and assistant message content as jinja templates - default: false - token_budget: - type: integer - description: Threshold value for the adaptive context functionality - context_overflow: - type: string - description: Action to start on context window overflow - required: - - agent_id - description: A valid request payload for creating a session - CreateAgentRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the agent - about: - type: string - description: About the agent - default: '' - tools: - type: array - items: - $ref: '#/components/schemas/CreateToolRequest' - description: >- - 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: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default model settings to start every session with - model: - type: string - description: Name of the model that the agent is supposed to use - default: julep-ai/samantha-1-turbo - docs: - type: array - items: - $ref: '#/components/schemas/CreateDoc' - description: Snippet that has information about the agent - description: List of docs about agent - metadata: - type: object - properties: {} - additionalProperties: true - description: (Optional) metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - required: - - name - description: A valid request payload for creating an agent - UpdateSessionRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - situation: - type: string - description: Updated situation for this session - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - token_budget: - type: integer - description: Threshold value for the adaptive context functionality - context_overflow: - type: string - description: Action to start on context window overflow - description: A valid request payload for updating a session - required: - - situation - UpdateAgentRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the agent - name: - type: string - description: Name of the agent - model: - type: string - description: Name of the model that the agent is supposed to use - default_settings: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default model settings to start every session with - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - description: A valid request payload for updating an agent - required: - - about - - name - UpdateUserRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the user - name: - type: string - description: Name of the user - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - description: A valid request payload for updating a user - required: - - about - - name - Suggestion: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - created_at: - type: string - description: Suggestion created at (RFC-3339 format) - format: date-time - target: - type: string - enum: - - user - - agent - description: Whether the suggestion is for the `agent` or a `user` - content: - type: string - description: The content of the suggestion - message_id: - type: string - description: The message that produced it - format: uuid - session_id: - type: string - description: Session this suggestion belongs to - format: uuid - required: - - message_id - - target - - content - - session_id - ChatMLMessage: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - role: - type: string - enum: - - user - - assistant - - system - - function_call - - function - description: ChatML role (system|assistant|user|function_call|function) - content: - oneOf: - - type: string - - type: array - items: - oneOf: - - $ref: '#/components/schemas/ChatMLTextContentPart' - - $ref: '#/components/schemas/ChatMLImageContentPart' - description: ChatML content - name: - type: string - description: ChatML name - created_at: - type: string - format: date-time - description: Message created at (RFC-3339 format) - id: - type: string - description: Message ID - format: uuid - required: - - id - - created_at - - content - - role - InputChatMLMessage: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - role: - type: string - enum: - - user - - assistant - - system - - function_call - - function - - auto - description: ChatML role (system|assistant|user|function_call|function|auto) - content: - oneOf: - - type: string - - type: array - items: - oneOf: - - $ref: '#/components/schemas/ChatMLTextContentPart' - - $ref: '#/components/schemas/ChatMLImageContentPart' - description: ChatML content - name: - type: string - description: ChatML name - continue: - type: boolean - default: false - description: Whether to continue this message or return a new one - required: - - content - - role - ChatInputData: - type: object - properties: - messages: - description: A list of new input messages comprising the conversation so far. - type: array - minItems: 1 - items: - $ref: '#/components/schemas/InputChatMLMessage' - tools: - type: array - nullable: true - description: >- - (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 - items: - $ref: '#/components/schemas/Tool' - tool_choice: - nullable: true - oneOf: - - $ref: '#/components/schemas/ToolChoiceOption' - - $ref: '#/components/schemas/NamedToolChoice' - description: >- - Can be one of existing tools given to the agent earlier or the ones - included in the request - required: - - messages - NamedToolChoice: - type: object - description: >- - Specifies a tool the model should use. Use to force the model to call a - specific function. - properties: - type: - type: string - enum: - - function - description: The type of the tool. Currently, only `function` is supported. - function: - type: object - properties: - name: - type: string - description: The name of the function to call. - required: - - name - required: - - type - - function - ToolChoiceOption: - description: > - Controls which (if any) function is called by the model. - - `none` means the model will not call a function and instead generates a - message. - - `auto` means the model can pick between generating a message or calling - a function. - - Specifying a particular function via `{"type: "function", "function": - {"name": "my_function"}}` forces the model to call that function. - - - `none` is the default when no functions are present. `auto` is the - default if functions are present. - oneOf: - - type: string - description: > - `none` means the model will not call a function and instead - generates a message. `auto` means the model can pick between - generating a message or calling a function. - enum: - - none - - auto - - $ref: '#/components/schemas/NamedToolChoice' - type: string - FunctionCallOption: - type: object - description: > - Specifying a particular function via `{"name": "my_function"}` forces - the model to call that function. - properties: - name: - type: string - description: The name of the function to call. - required: - - name - CompletionUsage: - type: object - description: Usage statistics for the completion request. - properties: - completion_tokens: - type: integer - description: Number of tokens in the generated completion. - prompt_tokens: - type: integer - description: Number of tokens in the prompt. - total_tokens: - type: integer - description: Total number of tokens used in the request (prompt + completion). - required: - - prompt_tokens - - completion_tokens - - total_tokens - ChatResponse: - type: object - description: >- - Represents a chat completion response returned by model, based on the - provided input. - properties: - id: - type: string - description: A unique identifier for the chat completion. - format: uuid - finish_reason: - type: string - description: >- - The reason the model stopped generating tokens. This will be `stop` - if the model hit a natural stop point or a provided stop sequence, - `length` if the maximum number of tokens specified in the request - was reached, `content_filter` if content was omitted due to a flag - from our content filters, `tool_calls` if the model called a tool, - or `function_call` (deprecated) if the model called a function. - enum: - - stop - - length - - tool_calls - - content_filter - - function_call - response: - type: array - description: A list of chat completion messages produced as a response. - items: - type: array - properties: - items: - $ref: '#/components/schemas/ChatMLMessage' - items: - $ref: '#/components/schemas/ChatMLMessage' - usage: - $ref: '#/components/schemas/CompletionUsage' - jobs: - type: array - items: - type: string - format: uuid - uniqueItems: true - description: IDs (if any) of jobs created as part of this request - doc_ids: - $ref: '#/components/schemas/DocIds' - required: - - usage - - response - - finish_reason - - id - - doc_ids - Memory: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - agent_id: - type: string - format: uuid - description: ID of the agent - user_id: - type: string - format: uuid - description: ID of the user - content: - type: string - description: Content of the memory - created_at: - type: string - format: date-time - description: Memory created at (RFC-3339 format) - last_accessed_at: - type: string - format: date-time - description: Memory last accessed at (RFC-3339 format) - timestamp: - type: string - description: Memory happened at (RFC-3339 format) - format: date-time - sentiment: - type: number - default: 0 - minimum: -1 - maximum: 1 - description: Sentiment (valence) of the memory on a scale of -1 to 1 - id: - type: string - description: Memory id (UUID) - format: uuid - entities: - type: array - items: - type: object - properties: {} - description: List of entities mentioned in the memory - required: - - type - - content - - created_at - - id - - agent_id - - user_id - - entities - ChatSettings: - type: object - properties: - frequency_penalty: - type: number - default: 0 - minimum: -1 - maximum: 1 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and - values larger than that penalize number of tokens generated. - logit_bias: - type: object - default: null - nullable: true - additionalProperties: - type: integer - description: > - 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. - properties: {} - max_tokens: - description: > - 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. - type: integer - nullable: true - default: 200 - minimum: 1 - maximum: 16384 - presence_penalty: - type: number - default: 0 - minimum: -1 - maximum: 1 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (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: - type: object - description: > - 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. - properties: - type: - type: string - enum: - - text - - json_object - - regex - example: json_object - default: text - description: Must be one of `"text"`, `"regex"` or `"json_object"`. - pattern: - type: string - description: Regular expression pattern to use if `type` is `"regex"` - schema: - type: object - properties: {} - default: {} - description: JSON Schema to use if `type` is `"json_object"` - seed: - type: integer - minimum: -1 - maximum: 9999 - nullable: true - description: > - 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: - description: | - Up to 4 sequences where the API will stop generating further tokens. - default: null - oneOf: - - type: string - nullable: true - - type: array - minItems: 1 - maxItems: 4 - items: - type: string - stream: - description: > - 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). - type: boolean - nullable: true - default: false - temperature: - type: number - minimum: 0 - maximum: 2 - default: 0.75 - example: 0.75 - nullable: true - description: >- - 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: - type: number - minimum: 0 - maximum: 1 - default: 1 - example: 1 - nullable: true - description: >- - 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. - exclusiveMinimum: true - min_p: - type: number - description: Minimum probability compared to leading token to be considered - exclusiveMaximum: true - maximum: 1 - exclusiveMinimum: false - minimum: 0 - example: 0.01 - default: 0.01 - preset: - type: string - description: >- - Generation preset name - (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) - enum: - - problem_solving - - conversational - - fun - - prose - - creative - - business - - deterministic - - code - - multilingual - model: - type: string - description: Model name - AgentDefaultSettings: - type: object - properties: - frequency_penalty: - type: number - default: 0 - minimum: -2 - maximum: 2 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and - values larger than that penalize number of tokens generated. - presence_penalty: - type: number - default: 0 - minimum: -1 - maximum: 1 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (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. - temperature: - type: number - minimum: 0 - maximum: 3 - default: 0.75 - example: 0.75 - nullable: true - description: >- - 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: - type: number - minimum: 0 - maximum: 1 - default: 1 - example: 1 - nullable: true - description: >- - 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. - min_p: - type: number - description: Minimum probability compared to leading token to be considered - exclusiveMaximum: true - maximum: 1 - exclusiveMinimum: false - minimum: 0 - example: 0.01 - default: 0.01 - preset: - type: string - description: >- - Generation preset name (one of: problem_solving, conversational, - fun, prose, creative, business, deterministic, code, multilingual) - enum: - - problem_solving - - conversational - - fun - - prose - - creative - - business - - deterministic - - code - - multilingual - ChatInput: - allOf: - - $ref: '#/components/schemas/ChatInputData' - - $ref: '#/components/schemas/ChatSettings' - - $ref: '#/components/schemas/MemoryAccessOptions' - Doc: - type: object - properties: - title: - type: string - description: Title describing what this bit of information contains - content: - oneOf: - - type: array - description: List of document chunks - items: - type: string - minItems: 1 - - type: string - description: A single document chunk - description: Information content - id: - type: string - description: ID of doc - format: uuid - created_at: - type: string - description: Doc created at - format: date-time - metadata: - type: object - properties: {} - additionalProperties: true - description: optional metadata - required: - - title - - content - - id - - created_at - CreateDoc: - type: object - properties: - title: - type: string - description: Title describing what this bit of information contains - content: - oneOf: - - type: array - description: List of document chunks - items: - type: string - minItems: 1 - - type: string - description: A single document chunk - description: Information content - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - required: - - title - - content - MemoryAccessOptions: - type: object - properties: - recall: - type: boolean - description: Whether previous memories should be recalled or not - default: true - record: - type: boolean - description: Whether this interaction should be recorded in history or not - default: true - remember: - type: boolean - description: Whether this interaction should form memories or not - default: true - CreateToolRequest: - type: object - properties: - type: - type: string - enum: - - function - - webhook - description: >- - Whether this tool is a `function` or a `webhook` (Only `function` - tool supported right now) - function: - oneOf: - - $ref: '#/components/schemas/FunctionDef' - description: Function definition and parameters - required: - - type - - function - UpdateToolRequest: - type: object - properties: - function: - $ref: '#/components/schemas/FunctionDef' - description: Function definition and parameters - required: - - function - ResourceCreatedResponse: - type: object - properties: - id: - type: string - format: uuid - created_at: - type: string - format: date-time - jobs: - type: array - items: - type: string - format: uuid - uniqueItems: true - description: IDs (if any) of jobs created as part of this request - required: - - id - - created_at - ResourceUpdatedResponse: - type: object - properties: - id: - type: string - format: uuid - updated_at: - type: string - format: date-time - jobs: - type: array - items: - type: string - format: uuid - description: IDs (if any) of jobs created as part of this request - uniqueItems: true - required: - - id - - updated_at - ResourceDeletedResponse: - type: object - properties: - id: - type: string - format: uuid - deleted_at: - type: string - format: date-time - jobs: - type: array - items: - type: string - format: uuid - description: IDs (if any) of jobs created as part of this request - uniqueItems: true - required: - - id - - deleted_at - JobStatus: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the job - reason: - type: string - description: Reason for current state - created_at: - type: string - format: date-time - description: Job created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: Job updated at (RFC-3339 format) - id: - type: string - description: Job id (UUID) - format: uuid - has_progress: - type: boolean - default: false - description: Whether this Job supports progress updates - progress: - type: number - description: Progress percentage - default: 0 - minimum: 0 - maximum: 100 - state: - type: string - description: >- - Current state (one of: pending, in_progress, retrying, succeeded, - aborted, failed) - enum: - - pending - - in_progress - - retrying - - succeeded - - aborted - - failed - - unknown - required: - - id - - name - - created_at - - state - PatchUserRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the user - name: - type: string - description: Name of the user - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - description: A request for patching a user - PatchAgentRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the agent - name: - type: string - description: Name of the agent - model: - type: string - description: Name of the model that the agent is supposed to use - default_settings: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default model settings to start every session with - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - description: A request for patching an agent - PatchSessionRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - situation: - type: string - description: Updated situation for this session - metadata: - type: object - properties: {} - additionalProperties: true - description: Optional metadata - token_budget: - type: integer - description: Threshold value for the adaptive context functionality - context_overflow: - type: string - description: Action to start on context window overflow - description: A request for patching a session - PatchToolRequest: - type: object - properties: - function: - $ref: '#/components/schemas/PartialFunctionDef' - description: Function definition and parameters - required: - - function - PartialFunctionDef: - type: object - properties: - description: - type: string - description: >- - A description of what the function does, used by the model to choose - when and how to call the function. - name: - type: string - description: >- - The name of the function to be called. Must be a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64. - parameters: - $ref: '#/components/schemas/FunctionParameters' - description: Parameters accepeted by this function - DocIds: - type: object - properties: - agent_doc_ids: - type: array - items: - type: string - user_doc_ids: - type: array - items: - type: string - required: - - agent_doc_ids - - user_doc_ids - ChatMLTextContentPart: - type: object - properties: - type: - type: string - description: Fixed to 'text' - default: text - pattern: '' - enum: - - text - text: - type: string - description: Text content part - required: - - type - - text - ChatMLImageContentPart: - type: object - properties: - type: - type: string - description: Fixed to 'image_url' - default: image_url - pattern: '' - enum: - - image_url - image_url: - type: object - properties: - url: - type: string - description: >- - URL or base64 data url (e.g. `data:image/jpeg;base64,`) - detail: - type: string - description: image detail to feed into the model can be low | high | auto - default: auto - pattern: '' - enum: - - low - - high - - auto - description: Image content part, can be a URL or a base64-encoded image - required: - - url - required: - - type - - image_url - Task: - type: object - properties: - name: - type: string - description: Name of the Task - description: - type: string - description: Optional Description of the Task - tools_available: - type: array - items: - type: string - description: Tool UUID - format: uuid - minItems: null - uniqueItems: true - description: Available Tools for the Task - input_schema: - type: object - properties: {} - additionalProperties: true - description: JSON Schema of parameters - main: - type: array - items: - $ref: '#/components/schemas/WorkflowStep' - description: Workflow steps - description: Entrypoint Workflow for the Task - id: - type: string - format: uuid - description: ID of the Task - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - agent_id: - type: string - format: uuid - additionalProperties: true - description: Describes a Task - required: - - name - - main - - id - - created_at - - agent_id - WorkflowStep: - anyOf: - - $ref: '#/components/schemas/PromptWorkflowStep' - description: Workflow Step for the Prompt - - $ref: '#/components/schemas/EvaluateWorkflowStep' - description: Workflow Step for the Evaluate using CEL - - $ref: '#/components/schemas/YieldWorkflowStep' - description: Workflow Step to call another Workflow - - $ref: '#/components/schemas/ToolCallWorkflowStep' - description: Workflow Step for calling a Tool - - $ref: '#/components/schemas/ErrorWorkflowStep' - description: Workflow Step for handling an Error - - $ref: '#/components/schemas/IfElseWorkflowStep' - description: Workflow Step for If, Then, Else - CreateTask: - type: object - properties: - name: - type: string - description: Name of the Task - description: - type: string - description: Optional Description of the Task - tools_available: - type: array - items: - type: string - description: Tool UUID - format: uuid - uniqueItems: true - description: Available Tools for the Task - input_schema: - type: object - properties: {} - additionalProperties: true - description: JSON Schema of parameters - main: - type: array - items: - $ref: '#/components/schemas/WorkflowStep' - description: Workflow steps - description: Entrypoint Workflow for the Task - description: Describes a Task - additionalProperties: true - required: - - name - - main - Execution: - type: object - properties: - id: - type: string - format: uuid - task_id: - type: string - format: uuid - status: - $ref: '#/components/schemas/ExecutionStatus' - arguments: - type: object - properties: {} - additionalProperties: true - description: JSON of parameters - user_id: - type: string - format: uuid - nullable: true - default: null - session_id: - type: string - format: uuid - nullable: true - default: null - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - required: - - id - - task_id - - status - - arguments - - created_at - - updated_at - ExecutionTransition: - type: object - properties: - id: - type: string - format: uuid - execution_id: - type: string - format: uuid - type: - $ref: '#/components/schemas/TransitionType' - from: - type: array - items: - - type: string - description: Canonical name of the workflow - - type: integer - description: Step index - to: - type: array - nullable: true - items: - - type: string - description: Canonical name of the workflow - - type: integer - description: Step index - task_token: - type: string - default: null - nullable: true - outputs: - type: object - additionalProperties: true - description: Outputs from an Execution Transition - metadata: - type: object - properties: {} - additionalProperties: true - description: (Optional) metadata - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - required: - - id - - execution_id - - type - - created_at - - outputs - - from - - to - PromptWorkflowStep: - type: object - properties: - prompt: - type: array - items: - $ref: '#/components/schemas/InputChatMLMessage' - description: List of ChatML Messages in Jinja Templates - settings: - $ref: '#/components/schemas/ChatSettings' - required: - - prompt - - settings - EvaluateWorkflowStep: - type: object - properties: - evaluate: - $ref: '#/components/schemas/CELObject' - required: - - evaluate - CELObject: - type: object - properties: {} - additionalProperties: true - YieldWorkflowStep: - type: object - properties: - workflow: - type: string - arguments: - $ref: '#/components/schemas/CELObject' - required: - - workflow - - arguments - ToolCallWorkflowStep: - type: object - properties: - tool_id: - type: string - arguments: - $ref: '#/components/schemas/CELObject' - required: - - tool_id - - arguments - ErrorWorkflowStep: - type: object - properties: - error: - type: string - required: - - error - IfElseWorkflowStep: - type: object - properties: - if: - type: string - then: - $ref: '#/components/schemas/YieldWorkflowStep' - else: - $ref: '#/components/schemas/YieldWorkflowStep' - required: - - if - - then - - else - TransitionType: - type: string - pattern: ^(finish|wait|error|step)$ - description: Execution Status - ExecutionStatus: - type: string - pattern: ^(queued|starting|running|awaiting_input|succeeded|failed)$ - description: Execution Status - CreateExecution: - type: object - properties: - task_id: - type: string - format: uuid - arguments: - type: object - properties: {} - additionalProperties: true - description: JSON Schema of parameters - status: - $ref: '#/components/schemas/ExecutionStatus' - required: - - id - - task_id - - arguments - - status - ToolResponse: - type: object - properties: - id: - type: string - description: Optional Tool ID - format: uuid - output: - type: object - properties: {} - additionalProperties: true - required: - - output - - id - securitySchemes: - api-key: - type: apiKey - scheme: basic - description: API Key Authentication - name: Authorization - in: header - parameters: - session_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - user_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - agent_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - message_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - doc_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - memory_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - tool_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - job_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - task_id: - in: path - required: false - description: '' - schema: - type: string - execution_id: - in: path - required: false - description: '' - schema: - type: string - name: execution_id - transition_id: - in: path - required: false - description: '' - schema: - type: string - name: transition_id - requestBodies: {} -security: - - api-key: [] diff --git a/openapi.yaml b/openapi.yaml deleted file mode 100644 index ff277180b..000000000 --- a/openapi.yaml +++ /dev/null @@ -1,3137 +0,0 @@ -openapi: 3.0.3 -info: - title: Julep Agents API - description: Julep AI agents API allows creating agents with long-term memory easily. - termsOfService: '' - contact: - email: developers@julep.ai - name: Julep Developers - url: https://julep.ai - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - version: 1.0.0 -externalDocs: - description: Find out more about spec - url: https://docs.julep.ai -servers: - - url: https://api-alpha.julep.ai/api - description: '' - variables: {} -tags: - - name: Default - description: '' - externalDocs: - url: https://docs.julep.ai - description: https://docs.julep.ai -paths: - /sessions: - post: - summary: Create a new session - description: Create a session between an agent and a user - operationId: CreateSession - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSessionRequest' - description: Session options - description: Session initialization options - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - description: Session successfully created - security: - - api-key: [] - get: - summary: List sessions - description: >- - List sessions created (use limit/offset pagination to get large number - of sessions; sorted by descending order of `created_at` by default) - operationId: ListSessions - tags: [] - parameters: - - in: query - name: limit - description: Number of sessions to return - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: Number of sessions to skip (sorted created_at descending order) - schema: - type: integer - default: 0 - minimum: 0 - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Session' - required: - - items - description: >- - List of sessions (sorted created_at descending order) with - limit+offset pagination - security: - - api-key: [] - /users: - post: - summary: Create a new user - description: Create a new user - operationId: CreateUser - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUserRequest' - description: User create options - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - description: User successfully created - security: - - api-key: [] - get: - summary: List users - description: >- - List users created (use limit/offset pagination to get large number of - sessions; sorted by descending order of `created_at` by default) - operationId: ListUsers - tags: [] - parameters: - - in: query - name: limit - description: Number of items to return - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: Number of items to skip (sorted created_at descending order) - schema: - type: integer - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/User' - required: - - items - description: >- - List of users (sorted created_at descending order) with limit+offset - pagination - security: - - api-key: [] - /agents: - post: - summary: Create a new agent - description: Create a new agent - operationId: CreateAgent - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateAgentRequest' - description: Agent create options - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - description: Agent successfully created - security: - - api-key: [] - get: - summary: List agents - description: >- - List agents created (use limit/offset pagination to get large number of - sessions; sorted by descending order of `created_at` by default) - operationId: ListAgents - tags: [] - parameters: - - in: query - name: limit - description: Number of items to return - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: Number of items to skip (sorted created_at descending order) - schema: - type: integer - default: 0 - minimum: 0 - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - responses: - '200': - description: >- - List of agents (sorted created_at descending order) with - limit+offset pagination - content: - application/json: - schema: - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Agent' - required: - - items - security: - - api-key: [] - /sessions/{session_id}: - get: - summary: Get details of the session - description: '' - operationId: GetSession - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Session' - security: - - api-key: [] - delete: - summary: Delete session - description: '' - operationId: DeleteSession - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update session parameters - description: '' - operationId: UpdateSession - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSessionRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - patch: - summary: Patch Session parameters (merge instead of replace) - description: '' - operationId: PatchSession - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchSessionRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /sessions/{session_id}/suggestions: - get: - summary: Get autogenerated suggestions for session user and agent - description: Sorted (created_at descending) - operationId: GetSuggestions - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: '' - schema: - type: integer - default: 0 - minimum: 0 - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Suggestion' - security: - - api-key: [] - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - /sessions/{session_id}/history: - get: - summary: Get all messages in a session - description: Sorted (created_at ascending) - operationId: GetHistory - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: '' - schema: - type: integer - default: 0 - minimum: 0 - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/ChatMLMessage' - security: - - api-key: [] - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete session history (does NOT delete related memories) - description: '' - operationId: DeleteSessionHistory - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - /sessions/{session_id}/chat: - parameters: - - in: path - name: session_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Interact with the session - description: '' - operationId: Chat - tags: [] - parameters: - - in: header - name: Accept - description: '' - schema: - type: string - default: application/json - enum: - - application/json - - text/event-stream - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChatInput' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChatResponse' - security: - - api-key: [] - /agents/{agent_id}/memories: - get: - summary: Get memories of the agent - description: Sorted (created_at descending) - operationId: GetAgentMemories - tags: [] - parameters: - - in: query - name: query - description: '' - schema: - type: string - required: true - - in: query - name: user_id - description: '' - schema: - type: string - format: uuid - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Memory' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - /users/{user_id}: - get: - summary: Get details of the user - description: '' - operationId: GetUser - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - security: - - api-key: [] - delete: - summary: Delete user - description: '' - operationId: DeleteUser - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update user parameters - description: '' - operationId: UpdateUser - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: user_id - description: '' - schema: - type: string - format: uuid - required: true - patch: - summary: Patch User parameters (merge instead of replace) - description: '' - operationId: PatchUser - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchUserRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /agents/{agent_id}: - get: - summary: Get details of the agent - description: '' - operationId: GetAgent - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Agent' - security: - - api-key: [] - delete: - summary: Delete agent - description: '' - operationId: DeleteAgent - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update agent parameters - description: '' - operationId: UpdateAgent - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAgentRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - patch: - summary: Patch Agent parameters (merge instead of replace) - description: '' - operationId: PatchAgent - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchAgentRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /agents/{agent_id}/docs: - get: - summary: Get docs of the agent - description: Sorted (created_at descending) - operationId: GetAgentDocs - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - requestBody: - content: {} - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Doc' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Create doc of the agent - description: '' - operationId: CreateAgentDoc - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDoc' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - /users/{user_id}/docs: - get: - summary: Get docs of the user - description: Sorted (created_at descending) - operationId: GetUserDocs - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - requestBody: - content: {} - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Doc' - security: - - api-key: [] - parameters: - - in: path - name: user_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Create doc of the user - description: '' - operationId: CreateUserDoc - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDoc' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - /users/{user_id}/docs/{doc_id}: - parameters: - - in: path - name: user_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: doc_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete doc by id - description: '' - operationId: DeleteUserDoc - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - /agents/{agent_id}/docs/{doc_id}: - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: doc_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete doc by id - description: '' - operationId: DeleteAgentDoc - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - /agents/{agent_id}/memories/{memory_id}: - delete: - summary: Delete memory of the agent by id - description: '' - operationId: DeleteAgentMemory - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: memory_id - description: '' - schema: - type: string - format: uuid - required: true - /agents/{agent_id}/tools: - get: - summary: Get tools of the agent - description: Sorted (created_at descending) - operationId: GetAgentTools - tags: [] - parameters: - - in: query - name: limit - description: '' - schema: - type: integer - - in: query - name: offset - description: '' - schema: - type: integer - requestBody: - content: {} - responses: - '200': - content: - application/json: - schema: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Tool' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - post: - summary: Create tool for the agent - description: '' - operationId: CreateAgentTool - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateToolRequest' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - /agents/{agent_id}/tools/{tool_id}: - parameters: - - in: path - name: agent_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: tool_id - description: '' - schema: - type: string - format: uuid - required: true - delete: - summary: Delete tool by id - description: '' - operationId: DeleteAgentTool - tags: [] - parameters: [] - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update agent tool definition - description: '' - operationId: UpdateAgentTool - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateToolRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - patch: - summary: Patch Agent tool parameters (merge instead of replace) - description: '' - operationId: PatchAgentTool - tags: [] - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchToolRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /jobs/{job_id}: - get: - summary: Get status of the job - description: '' - operationId: GetJobStatus - tags: [] - parameters: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/JobStatus' - security: - - api-key: [] - parameters: - - in: path - name: job_id - description: '' - schema: - type: string - format: uuid - required: true - - /agents/{agent_id}/tasks: - get: - summary: Get a list of tasks - description: '' - operationId: ListTasks - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Task' - security: - - api-key: [] - post: - summary: Create a Task - description: '' - operationId: CreateTask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTask' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: &ref_0 - type: string - required: true - /agents/{agent_id}/tasks/{task_id}: - get: - summary: Get a Task by ID - description: '' - operationId: GetTask - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - security: - - api-key: [] - delete: - summary: Delete a Task by ID - description: '' - operationId: DeleteTask - responses: - '202': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceDeletedResponse' - security: - - api-key: [] - put: - summary: Update a Task by ID (overwrite) - description: '' - operationId: UpdateTask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTask' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - patch: - summary: Update a Task by ID (merge) - description: '' - operationId: PatchTask - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTask' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: *ref_0 - required: true - - in: path - name: task_id - description: '' - schema: - type: string - format: uuid - required: true - /agents/{agent_id}/tasks/{task_id}/executions: - post: - summary: Start an execution of a Task - description: '' - operationId: StartTaskExecution - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateExecution' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceCreatedResponse' - security: - - api-key: [] - get: - summary: List Executions of a Task - description: '' - operationId: ListTaskExecutions - parameters: - - in: query - name: limit - description: Number of sessions to return - schema: - type: integer - default: 100 - minimum: 1 - maximum: 1000 - - in: query - name: offset - description: Number of sessions to skip (sorted created_at descending order) - schema: - type: integer - default: 0 - minimum: 0 - - in: query - name: metadata_filter - description: JSON object that should be used to filter objects by metadata - required: false - schema: - type: string - default: '{}' - - in: query - name: sort_by - description: 'Which field to sort by: `created_at` or `updated_at`' - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - - in: query - name: order - description: >- - Which order should the sort be: `asc` (ascending) or `desc` - (descending) - schema: - type: string - enum: - - asc - - desc - default: desc - responses: &ref_1 - '200': - description: '' - headers: {} - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Execution' - security: &ref_2 - - api-key: [] - parameters: - - in: path - name: agent_id - description: '' - schema: *ref_0 - required: true - - in: path - name: task_id - description: '' - schema: - type: string - format: uuid - required: true - /tasks/{task_id}/executions/{execution_id}: - get: - summary: Get Task Execution By ID - description: '' - operationId: GetTaskExecution - responses: *ref_1 - security: *ref_2 - parameters: - - in: path - name: task_id - description: '' - schema: *ref_0 - required: true - - in: path - name: execution_id - description: '' - schema: - type: string - format: uuid - required: true - put: - summary: Stop an Execution by ID - description: '' - operationId: StopExecution - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StopExecution' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - /executions/{execution_id}/transitions: - get: - description: '' - operationId: ListExecutionTransitions - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ExecutionTransition' - security: - - api-key: [] - summary: List Transitions of an Execution - parameters: - - in: path - name: execution_id - description: '' - schema: - type: string - format: uuid - required: true - /executions/{execution_id}/transitions/{transition_id}: - get: - description: '' - operationId: GetExecutionTransition - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ExecutionTransition' - security: - - api-key: [] - summary: Get an Execution Transition - parameters: - - in: path - name: execution_id - description: '' - schema: - type: string - format: uuid - required: true - - in: path - name: transition_id - description: '' - schema: - type: string - required: true - put: - summary: 'Resume an Execution which is waiting for input' - description: '' - operationId: ResumeTaskExecution - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResumeExecutionTransitionRequest' - responses: - '200': - description: '' - headers: {} - content: - application/json: - schema: - $ref: '#/components/schemas/ResourceUpdatedResponse' - security: - - api-key: [] - - -components: - schemas: - User: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the user - default: User - about: - type: string - description: About the user - created_at: - type: string - format: date-time - description: User created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: User updated at (RFC-3339 format) - id: - type: string - description: User id (UUID) - format: uuid - metadata: - type: object - properties: {} - description: (Optional) metadata - required: - - id - Agent: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the agent - about: - type: string - description: About the agent - default: '' - created_at: - type: string - format: date-time - description: Agent created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: Agent updated at (RFC-3339 format) - id: - type: string - description: Agent id (UUID) - format: uuid - default_settings: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default settings for all sessions created by this agent - model: - type: string - description: The model to use with this agent - default: julep-ai/samantha-1-turbo - metadata: - type: object - properties: {} - description: Optional metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - required: - - name - - id - - model - FunctionParameters: - type: object - description: The parameters the functions accepts, described as a JSON Schema object. - additionalProperties: true - properties: {} - FunctionDef: - type: object - properties: - description: - type: string - description: >- - A description of what the function does, used by the model to choose - when and how to call the function. - name: - type: string - description: >- - The name of the function to be called. Must be a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64. - parameters: - $ref: '#/components/schemas/FunctionParameters' - description: Parameters accepeted by this function - required: - - name - - parameters - Tool: - type: object - properties: - type: - type: string - enum: - - function - - webhook - description: >- - Whether this tool is a `function` or a `webhook` (Only `function` - tool supported right now) - function: - oneOf: - - $ref: '#/components/schemas/FunctionDef' - description: Function definition and parameters - id: - type: string - description: Tool ID - format: uuid - required: - - type - - function - - id - Session: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - id: - type: string - description: Session id (UUID) - format: uuid - user_id: - type: string - description: User ID of user associated with this session - format: uuid - agent_id: - type: string - description: Agent ID of agent associated with this session - format: uuid - situation: - type: string - description: A specific situation that sets the background for this session - summary: - type: string - description: >- - (null at the beginning) - generated automatically after every - interaction - created_at: - type: string - format: date-time - description: Session created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: Session updated at (RFC-3339 format) - metadata: - type: object - properties: {} - description: Optional metadata - render_templates: - type: boolean - description: Render system and assistant message content as jinja templates - default: false - required: - - id - - agent_id - CreateUserRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the user - default: User - about: - type: string - description: About the user - docs: - type: array - items: - $ref: '#/components/schemas/CreateDoc' - description: Snippet that has information about the user - description: List of docs about user - metadata: - type: object - properties: {} - description: (Optional) metadata - description: A valid request payload for creating a user - CreateSessionRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - user_id: - type: string - description: (Optional) User ID of user to associate with this session - format: uuid - agent_id: - type: string - description: Agent ID of agent to associate with this session - format: uuid - situation: - type: string - description: A specific situation that sets the background for this session - metadata: - type: object - properties: {} - description: Optional metadata - render_templates: - type: boolean - description: Render system and assistant message content as jinja templates - default: false - required: - - agent_id - description: A valid request payload for creating a session - CreateAgentRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the agent - about: - type: string - description: About the agent - default: '' - tools: - type: array - items: - $ref: '#/components/schemas/CreateToolRequest' - description: >- - 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: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default model settings to start every session with - model: - type: string - description: Name of the model that the agent is supposed to use - default: julep-ai/samantha-1-turbo - docs: - type: array - items: - $ref: '#/components/schemas/CreateDoc' - description: Snippet that has information about the agent - description: List of docs about agent - metadata: - type: object - properties: {} - description: (Optional) metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - required: - - name - description: A valid request payload for creating an agent - UpdateSessionRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - situation: - type: string - description: Updated situation for this session - metadata: - type: object - properties: {} - description: Optional metadata - description: A valid request payload for updating a session - required: - - situation - UpdateAgentRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the agent - name: - type: string - description: Name of the agent - model: - type: string - description: Name of the model that the agent is supposed to use - default_settings: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default model settings to start every session with - metadata: - type: object - properties: {} - description: Optional metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - description: A valid request payload for updating an agent - required: - - about - - name - UpdateUserRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the user - name: - type: string - description: Name of the user - metadata: - type: object - properties: {} - description: Optional metadata - description: A valid request payload for updating a user - required: - - about - - name - Suggestion: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - created_at: - type: string - description: Suggestion created at (RFC-3339 format) - format: date-time - target: - type: string - enum: - - user - - agent - description: Whether the suggestion is for the `agent` or a `user` - content: - type: string - description: The content of the suggestion - message_id: - type: string - description: The message that produced it - format: uuid - session_id: - type: string - description: Session this suggestion belongs to - format: uuid - required: - - message_id - - target - - content - - session_id - ChatMLMessage: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - role: - type: string - enum: - - user - - assistant - - system - - function_call - - function - description: ChatML role (system|assistant|user|function_call|function) - content: - oneOf: - - type: string - - type: array - items: - oneOf: - - $ref: '#/components/schemas/ChatMLTextContentPart' - - $ref: '#/components/schemas/ChatMLImageContentPart' - description: ChatML content - name: - type: string - description: ChatML name - created_at: - type: string - format: date-time - description: Message created at (RFC-3339 format) - id: - type: string - description: Message ID - format: uuid - required: - - id - - created_at - - content - - role - InputChatMLMessage: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - role: - type: string - enum: - - user - - assistant - - system - - function_call - - function - - auto - description: ChatML role (system|assistant|user|function_call|function|auto) - content: - oneOf: - - type: string - - type: array - items: - oneOf: - - $ref: '#/components/schemas/ChatMLTextContentPart' - - $ref: '#/components/schemas/ChatMLImageContentPart' - description: ChatML content - name: - type: string - description: ChatML name - continue: - type: boolean - default: false - description: Whether to continue this message or return a new one - required: - - content - - role - ChatInputData: - type: object - properties: - messages: - description: A list of new input messages comprising the conversation so far. - type: array - minItems: 1 - items: - $ref: '#/components/schemas/InputChatMLMessage' - tools: - type: array - nullable: true - description: >- - (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 - items: - $ref: '#/components/schemas/Tool' - tool_choice: - nullable: true - oneOf: - - $ref: '#/components/schemas/ToolChoiceOption' - - $ref: '#/components/schemas/NamedToolChoice' - description: >- - Can be one of existing tools given to the agent earlier or the ones - included in the request - required: - - messages - NamedToolChoice: - type: object - description: >- - Specifies a tool the model should use. Use to force the model to call a - specific function. - properties: - type: - type: string - enum: - - function - description: The type of the tool. Currently, only `function` is supported. - function: - type: object - properties: - name: - type: string - description: The name of the function to call. - required: - - name - required: - - type - - function - ToolChoiceOption: - description: > - Controls which (if any) function is called by the model. - - `none` means the model will not call a function and instead generates a - message. - - `auto` means the model can pick between generating a message or calling - a function. - - Specifying a particular function via `{"type: "function", "function": - {"name": "my_function"}}` forces the model to call that function. - - - `none` is the default when no functions are present. `auto` is the - default if functions are present. - oneOf: - - type: string - description: > - `none` means the model will not call a function and instead - generates a message. `auto` means the model can pick between - generating a message or calling a function. - enum: - - none - - auto - - $ref: '#/components/schemas/NamedToolChoice' - type: string - FunctionCallOption: - type: object - description: > - Specifying a particular function via `{"name": "my_function"}` forces - the model to call that function. - properties: - name: - type: string - description: The name of the function to call. - required: - - name - CompletionUsage: - type: object - description: Usage statistics for the completion request. - properties: - completion_tokens: - type: integer - description: Number of tokens in the generated completion. - prompt_tokens: - type: integer - description: Number of tokens in the prompt. - total_tokens: - type: integer - description: Total number of tokens used in the request (prompt + completion). - required: - - prompt_tokens - - completion_tokens - - total_tokens - ChatResponse: - type: object - description: >- - Represents a chat completion response returned by model, based on the - provided input. - properties: - id: - type: string - description: A unique identifier for the chat completion. - format: uuid - finish_reason: - type: string - description: >- - The reason the model stopped generating tokens. This will be `stop` - if the model hit a natural stop point or a provided stop sequence, - `length` if the maximum number of tokens specified in the request - was reached, `content_filter` if content was omitted due to a flag - from our content filters, `tool_calls` if the model called a tool, - or `function_call` (deprecated) if the model called a function. - enum: - - stop - - length - - tool_calls - - content_filter - - function_call - response: - type: array - description: A list of chat completion messages produced as a response. - items: - type: array - properties: - items: - $ref: '#/components/schemas/ChatMLMessage' - items: - $ref: '#/components/schemas/ChatMLMessage' - usage: - $ref: '#/components/schemas/CompletionUsage' - jobs: - type: array - items: - type: string - format: uuid - uniqueItems: true - description: IDs (if any) of jobs created as part of this request - doc_ids: - $ref: '#/components/schemas/DocIds' - required: - - usage - - response - - finish_reason - - id - - doc_ids - Memory: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - agent_id: - type: string - format: uuid - description: ID of the agent - user_id: - type: string - format: uuid - description: ID of the user - content: - type: string - description: Content of the memory - created_at: - type: string - format: date-time - description: Memory created at (RFC-3339 format) - last_accessed_at: - type: string - format: date-time - description: Memory last accessed at (RFC-3339 format) - timestamp: - type: string - description: Memory happened at (RFC-3339 format) - format: date-time - sentiment: - type: number - default: 0 - minimum: -1 - maximum: 1 - description: Sentiment (valence) of the memory on a scale of -1 to 1 - id: - type: string - description: Memory id (UUID) - format: uuid - entities: - type: array - items: - type: object - properties: {} - description: List of entities mentioned in the memory - required: - - type - - content - - created_at - - id - - agent_id - - user_id - - entities - ChatSettings: - type: object - properties: - frequency_penalty: - type: number - default: 0 - minimum: -1 - maximum: 1 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and - values larger than that penalize number of tokens generated. - logit_bias: - type: object - default: null - nullable: true - additionalProperties: - type: integer - description: > - 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. - properties: {} - max_tokens: - description: > - 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. - type: integer - nullable: true - default: 200 - minimum: 1 - maximum: 16384 - presence_penalty: - type: number - default: 0 - minimum: -1 - maximum: 1 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (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: - type: object - description: > - 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. - properties: - type: - type: string - enum: - - text - - json_object - - regex - example: json_object - default: text - description: Must be one of `"text"`, `"regex"` or `"json_object"`. - pattern: - type: string - description: Regular expression pattern to use if `type` is `"regex"` - schema: - type: object - properties: {} - default: {} - description: JSON Schema to use if `type` is `"json_object"` - seed: - type: integer - minimum: -1 - maximum: 9999 - nullable: true - description: > - 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: - description: | - Up to 4 sequences where the API will stop generating further tokens. - default: null - oneOf: - - type: string - nullable: true - - type: array - minItems: 1 - maxItems: 4 - items: - type: string - stream: - description: > - 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). - type: boolean - nullable: true - default: false - temperature: - type: number - minimum: 0 - maximum: 2 - default: 0.75 - example: 0.75 - nullable: true - description: >- - 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: - type: number - minimum: 0 - maximum: 1 - default: 1 - example: 1 - nullable: true - description: >- - 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. - exclusiveMinimum: true - min_p: - type: number - description: Minimum probability compared to leading token to be considered - exclusiveMaximum: true - maximum: 1 - exclusiveMinimum: false - minimum: 0 - example: 0.01 - default: 0.01 - preset: - type: string - description: >- - Generation preset name - (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) - enum: - - problem_solving - - conversational - - fun - - prose - - creative - - business - - deterministic - - code - - multilingual - model: - type: string - description: Model name - AgentDefaultSettings: - type: object - properties: - frequency_penalty: - type: number - default: 0 - minimum: -2 - maximum: 2 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and - values larger than that penalize number of tokens generated. - presence_penalty: - type: number - default: 0 - minimum: -1 - maximum: 1 - nullable: true - description: >- - (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: - type: number - default: 1 - minimum: 0 - maximum: 2 - nullable: true - description: >- - (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. - temperature: - type: number - minimum: 0 - maximum: 3 - default: 0.75 - example: 0.75 - nullable: true - description: >- - 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: - type: number - minimum: 0 - maximum: 1 - default: 1 - example: 1 - nullable: true - description: >- - 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. - min_p: - type: number - description: Minimum probability compared to leading token to be considered - exclusiveMaximum: true - maximum: 1 - exclusiveMinimum: false - minimum: 0 - example: 0.01 - default: 0.01 - preset: - type: string - description: >- - Generation preset name (one of: problem_solving, conversational, - fun, prose, creative, business, deterministic, code, multilingual) - enum: - - problem_solving - - conversational - - fun - - prose - - creative - - business - - deterministic - - code - - multilingual - ChatInput: - allOf: - - $ref: '#/components/schemas/ChatInputData' - - $ref: '#/components/schemas/ChatSettings' - - $ref: '#/components/schemas/MemoryAccessOptions' - Doc: - type: object - properties: - title: - type: string - description: Title describing what this bit of information contains - content: - oneOf: - - type: array - description: List of document chunks - items: - type: string - minItems: 1 - - type: string - description: A single document chunk - description: Information content - id: - type: string - description: ID of doc - format: uuid - created_at: - type: string - description: Doc created at - format: date-time - metadata: - type: object - properties: {} - description: optional metadata - required: - - title - - content - - id - - created_at - CreateDoc: - type: object - properties: - title: - type: string - description: Title describing what this bit of information contains - content: - oneOf: - - type: array - description: List of document chunks - items: - type: string - minItems: 1 - - type: string - description: A single document chunk - description: Information content - metadata: - type: object - properties: {} - description: Optional metadata - required: - - title - - content - MemoryAccessOptions: - type: object - properties: - recall: - type: boolean - description: Whether previous memories should be recalled or not - default: true - record: - type: boolean - description: Whether this interaction should be recorded in history or not - default: true - remember: - type: boolean - description: Whether this interaction should form memories or not - default: true - CreateToolRequest: - type: object - properties: - type: - type: string - enum: - - function - - webhook - description: >- - Whether this tool is a `function` or a `webhook` (Only `function` - tool supported right now) - function: - oneOf: - - $ref: '#/components/schemas/FunctionDef' - description: Function definition and parameters - required: - - type - - function - UpdateToolRequest: - type: object - properties: - function: - $ref: '#/components/schemas/FunctionDef' - description: Function definition and parameters - required: - - function - ResourceCreatedResponse: - type: object - properties: - id: - type: string - format: uuid - created_at: - type: string - format: date-time - jobs: - type: array - items: - type: string - format: uuid - uniqueItems: true - description: IDs (if any) of jobs created as part of this request - required: - - id - - created_at - ResourceUpdatedResponse: - type: object - properties: - id: - type: string - format: uuid - updated_at: - type: string - format: date-time - jobs: - type: array - items: - type: string - format: uuid - description: IDs (if any) of jobs created as part of this request - uniqueItems: true - required: - - id - - updated_at - ResourceDeletedResponse: - type: object - properties: - id: - type: string - format: uuid - deleted_at: - type: string - format: date-time - jobs: - type: array - items: - type: string - format: uuid - description: IDs (if any) of jobs created as part of this request - uniqueItems: true - required: - - id - - deleted_at - JobStatus: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - name: - type: string - description: Name of the job - reason: - type: string - description: Reason for current state - created_at: - type: string - format: date-time - description: Job created at (RFC-3339 format) - updated_at: - type: string - format: date-time - description: Job updated at (RFC-3339 format) - id: - type: string - description: Job id (UUID) - format: uuid - has_progress: - type: boolean - default: false - description: Whether this Job supports progress updates - progress: - type: number - description: Progress percentage - default: 0 - minimum: 0 - maximum: 100 - state: - type: string - description: >- - Current state (one of: pending, in_progress, retrying, succeeded, - aborted, failed) - enum: - - pending - - in_progress - - retrying - - succeeded - - aborted - - failed - - unknown - required: - - id - - name - - created_at - - state - PatchUserRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the user - name: - type: string - description: Name of the user - metadata: - type: object - properties: {} - description: Optional metadata - description: A request for patching a user - PatchAgentRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - about: - type: string - description: About the agent - name: - type: string - description: Name of the agent - model: - type: string - description: Name of the model that the agent is supposed to use - default_settings: - $ref: '#/components/schemas/AgentDefaultSettings' - description: Default model settings to start every session with - metadata: - type: object - properties: {} - description: Optional metadata - instructions: - oneOf: - - type: string - - type: array - items: - type: string - description: List of instructions for the agent - description: Instructions for the agent - description: A request for patching an agent - PatchSessionRequest: - $schema: http://json-schema.org/draft-04/schema# - type: object - properties: - situation: - type: string - description: Updated situation for this session - metadata: - type: object - properties: {} - description: Optional metadata - description: A request for patching a session - PatchToolRequest: - type: object - properties: - function: - $ref: '#/components/schemas/PartialFunctionDef' - description: Function definition and parameters - required: - - function - PartialFunctionDef: - type: object - properties: - description: - type: string - description: >- - A description of what the function does, used by the model to choose - when and how to call the function. - name: - type: string - description: >- - The name of the function to be called. Must be a-z, A-Z, 0-9, or - contain underscores and dashes, with a maximum length of 64. - parameters: - $ref: '#/components/schemas/FunctionParameters' - description: Parameters accepeted by this function - DocIds: - type: object - properties: - agent_doc_ids: - type: array - items: - type: string - user_doc_ids: - type: array - items: - type: string - required: - - agent_doc_ids - - user_doc_ids - ChatMLTextContentPart: - type: object - properties: - type: - type: string - description: Fixed to 'text' - default: text - pattern: '' - enum: - - text - text: - type: string - description: Text content part - required: - - type - - text - ChatMLImageContentPart: - type: object - properties: - type: - type: string - description: Fixed to 'image_url' - default: image_url - pattern: '' - enum: - - image_url - image_url: - type: object - properties: - url: - type: string - description: >- - URL or base64 data url (e.g. `data:image/jpeg;base64,`) - detail: - type: string - description: image detail to feed into the model can be low | high | auto - default: auto - pattern: '' - enum: - - low - - high - - auto - description: Image content part, can be a URL or a base64-encoded image - required: - - url - required: - - type - - image_url - ToolResponse: - type: object - properties: - id: - type: string - description: Optional Tool ID - format: uuid - output: - type: object - properties: {} - additionalProperties: true - required: - - output - - id - Task: - type: object - additionalProperties: true - properties: - name: - type: string - description: Name of the Task - description: - type: string - description: Optional Description of the Task - tools_available: - type: array - items: - type: string - description: Tool UUID - format: uuid - minItems: null - uniqueItems: true - description: Available Tools for the Task - input_schema: - type: object - properties: {} - additionalProperties: true - description: JSON Schema of parameters - main: - type: array - items: - $ref: '#/components/schemas/WorkflowStep' - description: Workflow steps - description: Entrypoint Workflow for the Task - id: - type: string - format: uuid - description: ID of the Task - created_at: - type: string - format: date-time - agent_id: - type: string - format: uuid - description: Describes a Task - required: - - name - - main - - id - - created_at - - agent_id - WorkflowStep: - anyOf: - - $ref: '#/components/schemas/PromptWorkflowStep' - description: Workflow Step for the Prompt - - $ref: '#/components/schemas/EvaluateWorkflowStep' - description: Workflow Step for the Evaluate using CEL - - $ref: '#/components/schemas/YieldWorkflowStep' - description: Workflow Step to call another Workflow - - $ref: '#/components/schemas/ToolCallWorkflowStep' - description: Workflow Step for calling a Tool - - $ref: '#/components/schemas/ErrorWorkflowStep' - description: Workflow Step for handling an Error - - $ref: '#/components/schemas/IfElseWorkflowStep' - description: Workflow Step for If, Then, Else - CreateTask: - type: object - properties: - name: - type: string - description: Name of the Task - description: - type: string - description: Optional Description of the Task - tools_available: - type: array - items: - type: string - description: Tool UUID - format: uuid - uniqueItems: true - description: Available Tools for the Task - input_schema: - type: object - properties: {} - additionalProperties: true - description: JSON Schema of parameters - main: - type: array - items: - $ref: '#/components/schemas/WorkflowStep' - description: Workflow steps - description: Entrypoint Workflow for the Task - description: Describes a Task - additionalProperties: true - required: - - name - - main - Execution: - type: object - properties: - id: - type: string - format: uuid - task_id: - type: string - format: uuid - created_at: - type: string - format: uuid - arguments: - type: object - properties: {} - additionalProperties: true - description: JSON Schema of parameters - status: - $ref: '#/components/schemas/ExecutionStatus' - required: - - id - - task_id - - created_at - - arguments - - status - ExecutionTransition: - type: object - properties: - id: - type: string - format: uuid - execution_id: - type: string - format: uuid - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - outputs: - type: object - additionalProperties: true - description: Outputs from an Execution Transition - current: - type: array - items: - - type: string - description: Canonical name of the workflow - - type: integer - description: Step index - next: - type: array - nullable: true - items: - - type: string - description: Canonical name of the workflow - - type: integer - description: Step index - type: - $ref: '#/components/schemas/TransitionType' - required: - - id - - execution_id - - type - - created_at - - updated_at - - outputs - - current - - next - PromptWorkflowStep: - type: object - properties: - prompt: - type: array - items: - $ref: '#/components/schemas/InputChatMLMessage' - description: List of ChatML Messages in Jinja Templates - settings: - $ref: '#/components/schemas/ChatSettings' - required: - - prompt - - settings - EvaluateWorkflowStep: - type: object - properties: - evaluate: - $ref: '#/components/schemas/CELObject' - required: - - evaluate - CELObject: - type: object - properties: - workflow: - type: string - arguments: - $ref: '#/components/schemas/CELObject' - - additionalProperties: true - required: - - workflow - - arguments - YieldWorkflowStep: - type: object - properties: - workflow: - type: string - arguments: - $ref: '#/components/schemas/CELObject' - required: - - workflow - - arguments - ToolCallWorkflowStep: - type: object - properties: - tool_id: - type: string - arguments: - $ref: '#/components/schemas/CELObject' - required: - - tool_id - - arguments - ErrorWorkflowStep: - type: object - properties: - error: - type: string - required: - - error - IfElseWorkflowStep: - type: object - properties: - if: - type: string - then: - $ref: '#/components/schemas/YieldWorkflowStep' - else: - $ref: '#/components/schemas/YieldWorkflowStep' - required: - - if - - then - - else - TransitionType: - type: string - enum: - - finish - - wait - - error - - step - - cancelled - description: Execution Status - ExecutionStatus: - type: string - enum: - - queued - - starting - - running - - awaiting_input - - succeeded - - failed - - cancelled - description: Execution Status - CreateExecution: - type: object - properties: - task_id: - type: string - format: uuid - arguments: - type: object - properties: {} - additionalProperties: true - description: JSON Schema of parameters - required: - - task_id - - arguments - StopExecution: - type: object - properties: - status: - type: string - enum: - - cancelled - description: Stop Execution Status - required: - - status - ResumeExecutionTransitionRequest: - type: object - properties: - task_token: - type: string - description: Task token - output: - type: object - additionalProperties: true - description: Output of the execution - description: Update execution transition request schema - required: - - task_token - - output - securitySchemes: - api-key: - type: apiKey - scheme: basic - description: API Key Authentication - name: Authorization - in: header - parameters: - session_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - user_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - agent_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - message_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - doc_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - memory_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - tool_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - job_id: - in: path - required: false - description: '' - schema: - type: string - format: uuid - task_id: - in: path - required: false - description: '' - schema: - type: string - execution_id: - in: path - required: false - description: '' - schema: - type: string - name: execution_id - transition_id: - in: path - required: false - description: '' - schema: - type: string - name: transition_id - requestBodies: {} -security: - - api-key: [] diff --git a/openapi.yaml b/openapi.yaml new file mode 120000 index 000000000..f381c1085 --- /dev/null +++ b/openapi.yaml @@ -0,0 +1 @@ +typespec/tsp-output/@typespec/openapi3/openapi-0.4.0.yaml \ No newline at end of file diff --git a/scripts/generate_openapi_code.sh b/scripts/generate_openapi_code.sh index 5f2482ee8..02969fea3 100644 --- a/scripts/generate_openapi_code.sh +++ b/scripts/generate_openapi_code.sh @@ -3,9 +3,11 @@ # Turn on echo command set -x -fern generate --local +cd typespec/ && \ + tsp . && \ + cd - -sed 's/ \// \/api\//' openapi.yaml > mock_openapi.yaml +fern generate --local cd sdks/python && \ poetry update && \ diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index b5e319a51..69c3f2547 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -41,15 +41,9 @@ check = [ "lint", "typecheck", ] -start_prism.shell = "prism mock ./tests/mock_openapi.yaml -p 8080 -v fatal 1> /dev/null &" -kill_prism.shell = "kill $(pgrep -f 'prism .*')" test = [ "check", - "start_prism", - { cmd = "echo 'Waiting for prism to start up'" }, - { cmd = "sleep 1" }, { cmd = "ward" }, - "kill_prism", ] generate_docstrings = "gpt4docstrings -k $OPENAI_API_KEY -v 1 -w -p -s -n -C -e api/ -m gpt-4-1106-preview julep/" doc = "handsdown julep --exclude julep/api/core --exclude julep/api/types --exclude julep/api/environment.py --exclude julep/env.py --exclude julep/managers/base.py --exclude julep/managers/types.py --exclude julep/managers/utils.py --cleanup -n 'Julep Python SDK' --toc-depth 2 -o ../../docs/python-sdk-docs" diff --git a/sdks/ts/package.json b/sdks/ts/package.json index 18b8f6f04..21d46084a 100644 --- a/sdks/ts/package.json +++ b/sdks/ts/package.json @@ -73,16 +73,13 @@ "build:bundle": "npx rollup --config rollup.bundle.config.ts --configPlugin typescript --bundleConfigAsCjs", "build:browser": "npx rollup --config rollup.browser.config.ts --configPlugin typescript --bundleConfigAsCjs", "build": "npm run build:node && npm run build:browser && npm run build:bundle", - "mock_api": "prism mock ./tests/mock_openapi.yaml -p 8080", - "start_mock_api": "prism mock ./tests/mock_openapi.yaml -p 8080 -v fatal 1> /dev/null &", - "kill_mock_api": "kill $(pgrep -f 'prism .*') || echo bye", "format": "prettier -w .", "openapi-codegen": "bash -c 'openapi -c axios --name JulepApiClient --useOptions --indent 2 -i <(yq -o=json \".\" ../../openapi.yaml) -o src/api --exportSchemas true --useUnionTypes true'", "codegen": "npm run openapi-codegen && npm run format", "generate-docs": "typedoc --plugin typedoc-plugin-markdown --out ../../docs/js-sdk-docs src/**/*.ts", "test-inspect": "node --inspect-brk node_modules/.bin/jest --runInBand", "prepublishOnly": "npm run build", - "test": "npm run format && npm run start_mock_api && sleep 1 && jest && npm run kill_mock_api", + "test": "npm run format && jest", "prepare": "ts-patch install && typia patch" }, "files": [ From aa4da043eae056edbbdcf9ab6753f103b9d7819a Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 15 Jul 2024 17:13:56 -0400 Subject: [PATCH 11/36] feat: Codegen for all new typespec stuff Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Agents.py | 194 + agents-api/agents_api/autogen/Chat.py | 91 + agents-api/agents_api/autogen/Common.py | 27 + agents-api/agents_api/autogen/Docs.py | 123 + agents-api/agents_api/autogen/Entries.py | 149 + agents-api/agents_api/autogen/Executions.py | 127 + agents-api/agents_api/autogen/Jobs.py | 62 + agents-api/agents_api/autogen/Sessions.py | 190 + agents-api/agents_api/autogen/Tasks.py | 376 ++ agents-api/agents_api/autogen/Tools.py | 214 + agents-api/agents_api/autogen/Users.py | 122 + agents-api/agents_api/autogen/__init__.py | 6 +- .../agents_api/autogen/openapi_model.py | 1298 ----- agents-api/poetry.lock | 840 +-- agents-api/pyproject.toml | 2 +- fern/fern.config.json | 2 +- scripts/generate_openapi_code.sh | 16 +- sdks/postman/collection.json | 2868 ++++++---- sdks/python/julep/api/__init__.py | 564 +- sdks/python/julep/api/client.py | 4919 ++++++++++------- sdks/python/julep/api/core/client_wrapper.py | 21 +- sdks/python/julep/api/types/__init__.py | 634 ++- .../types/agent_default_settings_preset.py | 53 - ...agent_docs_route_list_request_direction.py | 19 + .../agent_docs_route_list_request_sort_by.py | 25 + ...s.py => agent_docs_route_list_response.py} | 6 +- .../agent_tools_route_create_response.py | 43 + ...gent_tools_route_list_request_direction.py | 19 + .../agent_tools_route_list_request_sort_by.py | 25 + .../types/agent_tools_route_list_response.py | 37 + .../api/types/{agent.py => agents_agent.py} | 36 +- .../types/agents_agent_default_settings.py | 12 + ...ctions.py => agents_agent_instructions.py} | 2 +- .../api/types/agents_create_agent_request.py | 63 + ...s_create_agent_request_default_settings.py | 12 + ...ents_create_agent_request_instructions.py} | 2 +- ...r_update_agent_request_default_settings.py | 12 + ...te_or_update_agent_request_instructions.py | 5 + ...s_search_route_search_request_direction.py | 19 + ...ocs_search_route_search_request_sort_by.py | 25 + ...gents_docs_search_route_search_response.py | 37 + ...ts_patch_agent_request_default_settings.py | 12 + ...gents_patch_agent_request_instructions.py} | 2 +- .../agents_route_create_or_update_response.py | 43 + .../api/types/agents_route_create_response.py | 43 + .../api/types/agents_route_delete_response.py | 43 + ...=> agents_route_list_request_direction.py} | 6 +- ...y => agents_route_list_request_sort_by.py} | 10 +- .../api/types/agents_route_list_response.py | 37 + .../api/types/agents_route_patch_response.py | 43 + .../api/types/agents_route_update_response.py | 43 + ...s_update_agent_request_default_settings.py | 12 + ...gents_update_agent_request_instructions.py | 5 + ....py => chat_completion_response_format.py} | 9 +- ...> chat_completion_response_format_type.py} | 12 +- ...gs_preset.py => chat_generation_preset.py} | 22 +- .../types/chat_generation_preset_settings.py | 39 + .../python/julep/api/types/chat_input_data.py | 47 - .../api/types/chat_input_data_tool_choice.py | 9 - .../api/types/chat_ml_message_content.py | 13 - .../julep/api/types/chat_ml_message_role.py | 37 - .../julep/api/types/chat_open_ai_settings.py | 47 + sdks/python/julep/api/types/chat_response.py | 55 - .../api/types/chat_response_finish_reason.py | 37 - sdks/python/julep/api/types/chat_settings.py | 111 - .../types/chat_settings_response_format.py | 55 - ...ult_settings.py => chat_v_llm_settings.py} | 18 +- .../types/common_identifier_safe_unicode.py | 3 + .../{transition_type.py => common_limit.py} | 2 +- .../julep/api/types/common_logit_bias.py | 3 + .../{execution_status.py => common_offset.py} | 2 +- ...ol_choice_option.py => common_tool_ref.py} | 2 +- sdks/python/julep/api/types/common_uuid.py | 3 + .../types/common_valid_python_identifier.py | 3 + .../api/types/create_tool_request_type.py | 25 - sdks/python/julep/api/types/doc.py | 45 - sdks/python/julep/api/types/doc_content.py | 5 - ..._content_part_image_url.py => docs_doc.py} | 25 +- ...tion_parameters.py => docs_doc_content.py} | 2 +- sdks/python/julep/api/types/docs_doc_owner.py | 39 + ...stion_target.py => docs_doc_owner_role.py} | 10 +- ...pletion_usage.py => docs_doc_reference.py} | 20 +- .../api/types/docs_doc_search_request.py | 88 + ...ect.py => docs_doc_search_request_text.py} | 2 +- .../types/docs_doc_search_request_vector.py | 7 + .../types/docs_hybrid_doc_search_request.py | 43 + ...=> docs_hybrid_doc_search_request_text.py} | 2 +- .../docs_hybrid_doc_search_request_vector.py | 7 + ...y => docs_text_only_doc_search_request.py} | 10 +- ...docs_text_only_doc_search_request_text.py} | 2 +- .../types/docs_vector_doc_search_request.py | 39 + .../docs_vector_doc_search_request_vector.py | 7 + ...y => entries_base_chat_ml_content_part.py} | 28 +- .../entries_chat_ml_image_content_part.py | 37 + ...essage_role.py => entries_chat_ml_role.py} | 32 +- ...y => entries_chat_ml_text_content_part.py} | 4 +- sdks/python/julep/api/types/entries_entry.py | 50 + .../julep/api/types/entries_entry_content.py | 29 + .../api/types/entries_entry_content_item.py | 27 + ....py => entries_entry_content_item_item.py} | 12 +- .../julep/api/types/entries_entry_source.py | 37 + .../{execution.py => entries_history.py} | 20 +- ..._url_detail.py => entries_image_detail.py} | 10 +- .../julep/api/types/entries_image_url.py | 42 + ...ge.py => entries_input_chat_ml_message.py} | 21 +- .../entries_input_chat_ml_message_content.py | 15 + ...ies_input_chat_ml_message_content_item.py} | 13 +- .../julep/api/types/entries_relation.py | 39 + ...ransitions_route_list_request_direction.py | 19 + ..._transitions_route_list_request_sort_by.py | 25 + ...cution_transitions_route_list_response.py} | 11 +- ...itions_route_list_response_results_item.py | 37 + ..._ml_message.py => executions_execution.py} | 31 +- .../api/types/executions_execution_status.py | 45 + .../executions_resume_execution_request.py | 38 + .../types/executions_route_update_response.py | 43 + .../executions_stop_execution_request.py | 38 + .../julep/api/types/executions_transition.py | 49 + .../api/types/executions_transition_type.py | 33 + .../executions_update_execution_request.py | 33 + sdks/python/julep/api/types/function_def.py | 45 - .../api/types/get_agent_docs_response.py | 37 - .../api/types/get_agent_memories_response.py | 37 - .../api/types/get_agent_tools_response.py | 37 - .../julep/api/types/get_history_response.py | 37 - .../api/types/get_suggestions_response.py | 37 - .../julep/api/types/get_user_docs_response.py | 37 - .../types/history_route_delete_response.py | 43 + ...> history_route_list_request_direction.py} | 6 +- ... => history_route_list_request_sort_by.py} | 10 +- .../api/types/history_route_list_response.py | 37 + .../individual_docs_route_delete_response.py | 43 + .../types/input_chat_ml_message_content.py | 15 - ...{job_status_state.py => jobs_job_state.py} | 16 +- .../{job_status.py => jobs_job_status.py} | 28 +- .../julep/api/types/list_agents_response.py | 37 - .../julep/api/types/list_sessions_response.py | 37 - .../api/types/list_users_request_order.py | 19 - .../api/types/list_users_request_sort_by.py | 21 - .../julep/api/types/list_users_response.py | 37 - sdks/python/julep/api/types/memory.py | 55 - .../julep/api/types/memory_access_options.py | 44 - .../julep/api/types/memory_entities_item.py | 34 - .../julep/api/types/partial_function_def.py | 45 - .../types/patch_agent_request_instructions.py | 5 - sdks/python/julep/api/types/session.py | 66 - ...sessions_multi_agent_multi_user_session.py | 38 + ...> sessions_multi_agent_no_user_session.py} | 7 +- ...essions_multi_agent_single_user_session.py | 38 + ...essions_route_create_or_update_response.py | 43 + .../types/sessions_route_create_response.py | 43 + .../types/sessions_route_delete_response.py | 43 + .../sessions_route_list_request_direction.py | 19 + .../sessions_route_list_request_sort_by.py | 25 + .../api/types/sessions_route_list_response.py | 37 + .../types/sessions_route_patch_response.py | 43 + .../types/sessions_route_update_response.py | 43 + .../julep/api/types/sessions_session.py | 139 + ...essions_single_agent_multi_user_session.py | 38 + .../sessions_single_agent_no_user_session.py | 37 + ...ssions_single_agent_single_user_session.py | 38 + sdks/python/julep/api/types/suggestion.py | 45 - .../task_executions_route_create_response.py | 43 + ...executions_route_list_request_direction.py | 19 + ...k_executions_route_list_request_sort_by.py | 25 + .../task_executions_route_list_response.py | 37 + ..._route_resume_with_task_token_response.py} | 14 +- sdks/python/julep/api/types/tasks_cel.py | 3 + ...t_part.py => tasks_error_workflow_step.py} | 4 +- .../julep/api/types/tasks_evaluate_step.py | 39 + ...tion.py => tasks_if_else_workflow_step.py} | 28 +- .../julep/api/types/tasks_prompt_step.py | 41 + .../api/types/tasks_prompt_step_prompt.py | 16 + .../api/types/tasks_prompt_step_settings.py | 22 + ..._prompt_step_settings_frequency_penalty.py | 71 + ...sks_prompt_step_settings_length_penalty.py | 74 + .../tasks_prompt_step_settings_preset.py | 63 + .../tasks_route_create_or_update_response.py | 43 + .../api/types/tasks_route_create_response.py | 43 + .../api/types/tasks_route_delete_response.py | 43 + ... => tasks_route_list_request_direction.py} | 6 +- ...py => tasks_route_list_request_sort_by.py} | 10 +- .../api/types/tasks_route_list_response.py | 37 + ...e_doc.py => tasks_route_patch_response.py} | 14 +- .../api/types/tasks_route_update_response.py | 43 + sdks/python/julep/api/types/tasks_task.py | 64 + ...ontent_part.py => tasks_tool_call_step.py} | 9 +- .../julep/api/types/tasks_workflow_step.py | 82 + ...eleted_response.py => tasks_yield_step.py} | 10 +- sdks/python/julep/api/types/tool.py | 44 - .../api/types/tool_call_workflow_step.py | 38 - sdks/python/julep/api/types/tool_response.py | 37 - .../api/types/tool_route_delete_response.py | 43 + ...sponse.py => tool_route_patch_response.py} | 11 +- .../api/types/tool_route_update_response.py | 43 + sdks/python/julep/api/types/tool_type.py | 25 - .../api/types/tools_chosen_function_call.py | 39 + .../julep/api/types/tools_chosen_tool_call.py | 59 + .../api/types/tools_create_tool_request.py | 54 + ...ction.py => tools_function_call_option.py} | 4 +- ...d_tool_choice.py => tools_function_def.py} | 20 +- .../{task.py => tools_function_def_update.py} | 27 +- .../julep/api/types/tools_function_tool.py | 39 + sdks/python/julep/api/types/tools_tool.py | 73 + .../julep/api/types/tools_tool_response.py | 40 + .../python/julep/api/types/tools_tool_type.py | 29 + sdks/python/julep/api/types/user.py | 47 - .../user_docs_route_list_request_direction.py | 19 + .../user_docs_route_list_request_sort_by.py | 25 + ...ep.py => user_docs_route_list_response.py} | 6 +- ...s_search_route_search_request_direction.py | 19 + ...ocs_search_route_search_request_sort_by.py | 25 + .../user_docs_search_route_search_response.py | 37 + .../users_route_create_or_update_response.py | 43 + .../api/types/users_route_create_response.py | 43 + .../api/types/users_route_delete_response.py | 43 + ... => users_route_list_request_direction.py} | 6 +- ...py => users_route_list_request_sort_by.py} | 10 +- .../api/types/users_route_list_response.py | 37 + .../api/types/users_route_patch_response.py | 43 + .../api/types/users_route_update_response.py | 43 + sdks/python/julep/api/types/users_user.py | 47 + sdks/python/julep/api/types/workflow_step.py | 36 - .../julep/api/types/yield_workflow_step.py | 38 - sdks/python/poetry.lock | 512 +- sdks/ts/src/api/JulepApiClient.ts | 2 +- sdks/ts/src/api/core/OpenAPI.ts | 2 +- sdks/ts/src/api/index.ts | 306 +- sdks/ts/src/api/models/Agent.ts | 43 - .../ts/src/api/models/AgentDefaultSettings.ts | 47 - sdks/ts/src/api/models/Agents_Agent.ts | 44 + .../api/models/Agents_CreateAgentRequest.ts | 41 + .../Agents_CreateOrUpdateAgentRequest.ts | 36 + .../api/models/Agents_PatchAgentRequest.ts | 37 + .../api/models/Agents_UpdateAgentRequest.ts | 37 + sdks/ts/src/api/models/ChatInput.ts | 8 - sdks/ts/src/api/models/ChatInputData.ts | 22 - .../src/api/models/ChatMLImageContentPart.ts | 23 - sdks/ts/src/api/models/ChatMLMessage.ts | 26 - sdks/ts/src/api/models/ChatResponse.ts | 35 - sdks/ts/src/api/models/ChatSettings.ts | 104 - ...rt.ts => Chat_CompletionResponseFormat.ts} | 10 +- .../src/api/models/Chat_GenerationPreset.ts | 17 + .../models/Chat_GenerationPresetSettings.ts | 11 + sdks/ts/src/api/models/Chat_OpenAISettings.ts | 22 + sdks/ts/src/api/models/Chat_vLLMSettings.ts | 26 + .../models/Common_identifierSafeUnicode.ts | 10 + .../api/models/{Task.ts => Common_limit.ts} | 4 +- .../{execution_id.ts => Common_logit_bias.ts} | 2 +- .../{CreateTask.ts => Common_offset.ts} | 4 +- sdks/ts/src/api/models/Common_toolRef.ts | 8 + .../api/models/{job_id.ts => Common_uuid.ts} | 2 +- ...ype.ts => Common_validPythonIdentifier.ts} | 4 +- sdks/ts/src/api/models/CompletionUsage.ts | 21 - sdks/ts/src/api/models/CreateAgentRequest.ts | 44 - sdks/ts/src/api/models/CreateDoc.ts | 18 - sdks/ts/src/api/models/CreateExecution.ts | 13 - sdks/ts/src/api/models/CreateToolRequest.ts | 15 - sdks/ts/src/api/models/CreateUserRequest.ts | 26 - sdks/ts/src/api/models/Doc.ts | 26 - sdks/ts/src/api/models/DocIds.ts | 8 - sdks/ts/src/api/models/Docs_Doc.ts | 22 + ...{ErrorWorkflowStep.ts => Docs_DocOwner.ts} | 6 +- sdks/ts/src/api/models/Docs_DocReference.ts | 22 + .../src/api/models/Docs_DocSearchRequest.ts | 28 + .../api/models/Docs_HybridDocSearchRequest.ts | 16 + .../models/Docs_TextOnlyDocSearchRequest.ts | 13 + .../api/models/Docs_VectorDocSearchRequest.ts | 13 + .../models/Entries_BaseChatMLContentPart.ts | 13 + .../models/Entries_ChatMLImageContentPart.ts | 17 + sdks/ts/src/api/models/Entries_ChatMLRole.ts | 15 + .../models/Entries_ChatMLTextContentPart.ts | 13 + sdks/ts/src/api/models/Entries_Entry.ts | 30 + sdks/ts/src/api/models/Entries_History.ts | 16 + ...cutionStatus.ts => Entries_ImageDetail.ts} | 4 +- sdks/ts/src/api/models/Entries_ImageURL.ts | 15 + ...ssage.ts => Entries_InputChatMLMessage.ts} | 13 +- sdks/ts/src/api/models/Entries_Relation.ts | 10 + sdks/ts/src/api/models/Execution.ts | 18 - sdks/ts/src/api/models/ExecutionTransition.ts | 23 - .../Executions_CreateExecutionRequest.ts | 13 + .../ts/src/api/models/Executions_Execution.ts | 35 + .../Executions_ResumeExecutionRequest.ts | 13 + .../models/Executions_StopExecutionRequest.ts | 13 + ...cutions_TaskTokenResumeExecutionRequest.ts | 15 + .../src/api/models/Executions_Transition.ts | 21 + .../Executions_UpdateExecutionRequest.ts | 14 + sdks/ts/src/api/models/FunctionCallOption.ts | 14 - sdks/ts/src/api/models/FunctionDef.ts | 19 - sdks/ts/src/api/models/FunctionParameters.ts | 8 - sdks/ts/src/api/models/IfElseWorkflowStep.ts | 10 - sdks/ts/src/api/models/JobStatus.ts | 45 - sdks/ts/src/api/models/Jobs_JobState.ts | 15 + sdks/ts/src/api/models/Jobs_JobStatus.ts | 38 + sdks/ts/src/api/models/Memory.ts | 42 - sdks/ts/src/api/models/MemoryAccessOptions.ts | 18 - sdks/ts/src/api/models/NamedToolChoice.ts | 19 - sdks/ts/src/api/models/PartialFunctionDef.ts | 19 - sdks/ts/src/api/models/PatchAgentRequest.ts | 34 - sdks/ts/src/api/models/PatchSessionRequest.ts | 25 - sdks/ts/src/api/models/PatchToolRequest.ts | 11 - sdks/ts/src/api/models/PromptWorkflowStep.ts | 13 - .../src/api/models/ResourceCreatedResponse.ts | 12 - .../src/api/models/ResourceDeletedResponse.ts | 12 - .../src/api/models/ResourceUpdatedResponse.ts | 12 - ... Sessions_CreateOrUpdateSessionRequest.ts} | 39 +- .../models/Sessions_CreateSessionRequest.ts | 37 + .../Sessions_MultiAgentMultiUserSession.ts | 10 + .../Sessions_MultiAgentNoUserSession.ts | 9 + .../Sessions_MultiAgentSingleUserSession.ts | 10 + ...est.ts => Sessions_PatchSessionRequest.ts} | 21 +- sdks/ts/src/api/models/Sessions_Session.ts | 41 + .../Sessions_SingleAgentMultiUserSession.ts | 10 + .../Sessions_SingleAgentNoUserSession.ts | 9 + .../Sessions_SingleAgentSingleUserSession.ts | 10 + ...st.ts => Sessions_UpdateSessionRequest.ts} | 15 +- sdks/ts/src/api/models/Suggestion.ts | 26 - sdks/ts/src/api/models/Tasks_CEL.ts | 8 + .../models/Tasks_CreateOrUpdateTaskRequest.ts | 9 + .../src/api/models/Tasks_CreateTaskRequest.ts | 9 + .../src/api/models/Tasks_ErrorWorkflowStep.ts | 11 + sdks/ts/src/api/models/Tasks_EvaluateStep.ts | 12 + .../api/models/Tasks_IfElseWorkflowStep.ts | 20 + .../src/api/models/Tasks_PatchTaskRequest.ts | 9 + sdks/ts/src/api/models/Tasks_PromptStep.ts | 150 + sdks/ts/src/api/models/Tasks_Task.ts | 9 + sdks/ts/src/api/models/Tasks_ToolCallStep.ts | 16 + .../src/api/models/Tasks_UpdateTaskRequest.ts | 9 + ...eWorkflowStep.ts => Tasks_WorkflowStep.ts} | 8 +- sdks/ts/src/api/models/Tasks_YieldStep.ts | 16 + sdks/ts/src/api/models/Tool.ts | 19 - .../ts/src/api/models/ToolCallWorkflowStep.ts | 9 - sdks/ts/src/api/models/ToolChoiceOption.ts | 15 - .../api/models/Tools_ChosenFunctionCall.ts | 14 + .../ts/src/api/models/Tools_ChosenToolCall.ts | 21 + .../src/api/models/Tools_CreateToolRequest.ts | 27 + ...esponse.ts => Tools_FunctionCallOption.ts} | 7 +- sdks/ts/src/api/models/Tools_FunctionDef.ts | 23 + .../src/api/models/Tools_FunctionDefUpdate.ts | 23 + sdks/ts/src/api/models/Tools_FunctionTool.ts | 16 + .../src/api/models/Tools_PatchToolRequest.ts | 27 + sdks/ts/src/api/models/Tools_Tool.ts | 34 + sdks/ts/src/api/models/Tools_ToolResponse.ts | 12 + .../{CELObject.ts => Tools_ToolType.ts} | 2 +- .../src/api/models/Tools_UpdateToolRequest.ts | 27 + sdks/ts/src/api/models/UpdateAgentRequest.ts | 34 - sdks/ts/src/api/models/UpdateToolRequest.ts | 11 - sdks/ts/src/api/models/User.ts | 30 - .../models/Users_CreateOrUpdateUserRequest.ts | 18 + .../src/api/models/Users_CreateUserRequest.ts | 23 + ...erRequest.ts => Users_PatchUserRequest.ts} | 16 +- ...rRequest.ts => Users_UpdateUserRequest.ts} | 16 +- sdks/ts/src/api/models/Users_User.ts | 26 + sdks/ts/src/api/models/WorkflowStep.ts | 17 - sdks/ts/src/api/models/YieldWorkflowStep.ts | 9 - sdks/ts/src/api/models/agent_id.ts | 5 - sdks/ts/src/api/models/doc_id.ts | 5 - sdks/ts/src/api/models/memory_id.ts | 5 - sdks/ts/src/api/models/message_id.ts | 5 - sdks/ts/src/api/models/session_id.ts | 5 - sdks/ts/src/api/models/task_id.ts | 5 - sdks/ts/src/api/models/tool_id.ts | 5 - sdks/ts/src/api/models/transition_id.ts | 5 - sdks/ts/src/api/models/user_id.ts | 5 - .../src/api/schemas/$AgentDefaultSettings.ts | 55 - sdks/ts/src/api/schemas/$Agents_Agent.ts | 89 + ...quest.ts => $Agents_CreateAgentRequest.ts} | 68 +- ... => $Agents_CreateOrUpdateAgentRequest.ts} | 57 +- ...equest.ts => $Agents_PatchAgentRequest.ts} | 52 +- ...Agent.ts => $Agents_UpdateAgentRequest.ts} | 61 +- sdks/ts/src/api/schemas/$ChatInputData.ts | 35 - .../api/schemas/$ChatMLImageContentPart.ts | 26 - sdks/ts/src/api/schemas/$ChatMLMessage.ts | 38 - sdks/ts/src/api/schemas/$ChatResponse.ts | 44 - sdks/ts/src/api/schemas/$ChatSettings.ts | 128 - ...p.ts => $Chat_CompletionResponseFormat.ts} | 6 +- .../src/api/schemas/$Chat_GenerationPreset.ts | 7 + .../schemas/$Chat_GenerationPresetSettings.ts | 17 + .../src/api/schemas/$Chat_OpenAISettings.ts | 34 + sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts | 38 + .../schemas/$Common_identifierSafeUnicode.ts | 12 + sdks/ts/src/api/schemas/$Common_limit.ts | 12 + sdks/ts/src/api/schemas/$Common_logit_bias.ts | 10 + sdks/ts/src/api/schemas/$Common_offset.ts | 9 + sdks/ts/src/api/schemas/$Common_toolRef.ts | 9 + .../schemas/{$job_id.ts => $Common_uuid.ts} | 2 +- ...pe.ts => $Common_validPythonIdentifier.ts} | 6 +- sdks/ts/src/api/schemas/$CompletionUsage.ts | 24 - sdks/ts/src/api/schemas/$CreateDoc.ts | 37 - sdks/ts/src/api/schemas/$CreateToolRequest.ts | 22 - sdks/ts/src/api/schemas/$DocIds.ts | 22 - .../src/api/schemas/{$Doc.ts => $Docs_Doc.ts} | 64 +- sdks/ts/src/api/schemas/$Docs_DocOwner.ts | 36 + sdks/ts/src/api/schemas/$Docs_DocReference.ts | 43 + .../src/api/schemas/$Docs_DocSearchRequest.ts | 67 + .../schemas/$Docs_HybridDocSearchRequest.ts | 56 + .../schemas/$Docs_TextOnlyDocSearchRequest.ts | 51 + .../schemas/$Docs_VectorDocSearchRequest.ts | 63 + ...t.ts => $Entries_BaseChatMLContentPart.ts} | 10 +- .../$Entries_ChatMLImageContentPart.ts | 34 + ...ransition_id.ts => $Entries_ChatMLRole.ts} | 4 +- .../schemas/$Entries_ChatMLTextContentPart.ts | 28 + sdks/ts/src/api/schemas/$Entries_Entry.ts | 62 + sdks/ts/src/api/schemas/$Entries_History.ts | 39 + .../src/api/schemas/$Entries_ImageDetail.ts | 7 + sdks/ts/src/api/schemas/$Entries_ImageURL.ts | 24 + ...sage.ts => $Entries_InputChatMLMessage.ts} | 22 +- ...seWorkflowStep.ts => $Entries_Relation.ts} | 14 +- sdks/ts/src/api/schemas/$Execution.ts | 49 - sdks/ts/src/api/schemas/$ExecutionStatus.ts | 9 - ... => $Executions_CreateExecutionRequest.ts} | 13 +- .../src/api/schemas/$Executions_Execution.ts | 55 + .../$Executions_ResumeExecutionRequest.ts | 26 + .../$Executions_StopExecutionRequest.ts | 26 + ...utions_TaskTokenResumeExecutionRequest.ts} | 17 +- ...ransition.ts => $Executions_Transition.ts} | 59 +- ... => $Executions_UpdateExecutionRequest.ts} | 6 +- .../ts/src/api/schemas/$FunctionCallOption.ts | 15 - sdks/ts/src/api/schemas/$FunctionDef.ts | 22 - sdks/ts/src/api/schemas/$JobStatus.ts | 47 - .../{$task_id.ts => $Jobs_JobState.ts} | 4 +- sdks/ts/src/api/schemas/$Jobs_JobStatus.ts | 69 + sdks/ts/src/api/schemas/$Memory.ts | 60 - .../src/api/schemas/$MemoryAccessOptions.ts | 20 - sdks/ts/src/api/schemas/$NamedToolChoice.ts | 23 - .../ts/src/api/schemas/$PartialFunctionDef.ts | 20 - sdks/ts/src/api/schemas/$PatchToolRequest.ts | 13 - .../api/schemas/$ResourceCreatedResponse.ts | 25 - .../api/schemas/$ResourceDeletedResponse.ts | 25 - .../api/schemas/$ResourceUpdatedResponse.ts | 25 - ...$Sessions_CreateOrUpdateSessionRequest.ts} | 72 +- .../schemas/$Sessions_CreateSessionRequest.ts | 68 + .../$Sessions_MultiAgentMultiUserSession.ts | 30 + .../$Sessions_MultiAgentNoUserSession.ts | 23 + .../$Sessions_MultiAgentSingleUserSession.ts | 27 + ...st.ts => $Sessions_PatchSessionRequest.ts} | 23 +- sdks/ts/src/api/schemas/$Sessions_Session.ts | 72 + .../$Sessions_SingleAgentMultiUserSession.ts | 27 + ... => $Sessions_SingleAgentNoUserSession.ts} | 14 +- .../$Sessions_SingleAgentSingleUserSession.ts | 24 + ...t.ts => $Sessions_UpdateSessionRequest.ts} | 34 +- sdks/ts/src/api/schemas/$Suggestion.ts | 34 - sdks/ts/src/api/schemas/$Tasks_CEL.ts | 8 + .../$Tasks_CreateOrUpdateTaskRequest.ts | 13 + ...ateTask.ts => $Tasks_CreateTaskRequest.ts} | 7 +- .../api/schemas/$Tasks_ErrorWorkflowStep.ts | 21 + .../ts/src/api/schemas/$Tasks_EvaluateStep.ts | 23 + .../api/schemas/$Tasks_IfElseWorkflowStep.ts | 46 + ...rameters.ts => $Tasks_PatchTaskRequest.ts} | 7 +- sdks/ts/src/api/schemas/$Tasks_PromptStep.ts | 260 + .../schemas/{$CELObject.ts => $Tasks_Task.ts} | 7 +- .../ts/src/api/schemas/$Tasks_ToolCallStep.ts | 33 + .../{$Task.ts => $Tasks_UpdateTaskRequest.ts} | 7 +- ...WorkflowStep.ts => $Tasks_WorkflowStep.ts} | 10 +- sdks/ts/src/api/schemas/$Tasks_YieldStep.ts | 28 + sdks/ts/src/api/schemas/$Tool.ts | 28 - sdks/ts/src/api/schemas/$ToolChoiceOption.ts | 21 - .../api/schemas/$Tools_ChosenFunctionCall.ts | 34 + .../src/api/schemas/$Tools_ChosenToolCall.ts | 41 + .../api/schemas/$Tools_CreateToolRequest.ts | 41 + ...owStep.ts => $Tools_FunctionCallOption.ts} | 9 +- sdks/ts/src/api/schemas/$Tools_FunctionDef.ts | 34 + .../api/schemas/$Tools_FunctionDefUpdate.ts | 33 + .../ts/src/api/schemas/$Tools_FunctionTool.ts | 42 + .../api/schemas/$Tools_PatchToolRequest.ts | 38 + sdks/ts/src/api/schemas/$Tools_Tool.ts | 64 + ...ToolResponse.ts => $Tools_ToolResponse.ts} | 6 +- .../{$execution_id.ts => $Tools_ToolType.ts} | 4 +- .../api/schemas/$Tools_UpdateToolRequest.ts | 41 + .../src/api/schemas/$UpdateSessionRequest.ts | 28 - sdks/ts/src/api/schemas/$UpdateToolRequest.ts | 13 - ...ts => $Users_CreateOrUpdateUserRequest.ts} | 34 +- .../{$User.ts => $Users_CreateUserRequest.ts} | 37 +- ...rRequest.ts => $Users_PatchUserRequest.ts} | 25 +- ...Request.ts => $Users_UpdateUserRequest.ts} | 29 +- sdks/ts/src/api/schemas/$Users_User.ts | 53 + sdks/ts/src/api/schemas/$WorkflowStep.ts | 33 - sdks/ts/src/api/schemas/$agent_id.ts | 8 - sdks/ts/src/api/schemas/$doc_id.ts | 8 - sdks/ts/src/api/schemas/$memory_id.ts | 8 - sdks/ts/src/api/schemas/$message_id.ts | 8 - sdks/ts/src/api/schemas/$session_id.ts | 8 - sdks/ts/src/api/schemas/$tool_id.ts | 8 - sdks/ts/src/api/schemas/$user_id.ts | 8 - sdks/ts/src/api/services/DefaultService.ts | 2020 ++++--- typespec/main.tsp | 6 +- typespec/sessions/models.tsp | 16 +- typespec/tasks/models.tsp | 16 +- 488 files changed, 17712 insertions(+), 10594 deletions(-) create mode 100644 agents-api/agents_api/autogen/Agents.py create mode 100644 agents-api/agents_api/autogen/Chat.py create mode 100644 agents-api/agents_api/autogen/Common.py create mode 100644 agents-api/agents_api/autogen/Docs.py create mode 100644 agents-api/agents_api/autogen/Entries.py create mode 100644 agents-api/agents_api/autogen/Executions.py create mode 100644 agents-api/agents_api/autogen/Jobs.py create mode 100644 agents-api/agents_api/autogen/Sessions.py create mode 100644 agents-api/agents_api/autogen/Tasks.py create mode 100644 agents-api/agents_api/autogen/Tools.py create mode 100644 agents-api/agents_api/autogen/Users.py delete mode 100644 agents-api/agents_api/autogen/openapi_model.py delete mode 100644 sdks/python/julep/api/types/agent_default_settings_preset.py create mode 100644 sdks/python/julep/api/types/agent_docs_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py rename sdks/python/julep/api/types/{doc_ids.py => agent_docs_route_list_response.py} (88%) create mode 100644 sdks/python/julep/api/types/agent_tools_route_create_response.py create mode 100644 sdks/python/julep/api/types/agent_tools_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py create mode 100644 sdks/python/julep/api/types/agent_tools_route_list_response.py rename sdks/python/julep/api/types/{agent.py => agents_agent.py} (51%) create mode 100644 sdks/python/julep/api/types/agents_agent_default_settings.py rename sdks/python/julep/api/types/{agent_instructions.py => agents_agent_instructions.py} (56%) create mode 100644 sdks/python/julep/api/types/agents_create_agent_request.py create mode 100644 sdks/python/julep/api/types/agents_create_agent_request_default_settings.py rename sdks/python/julep/api/types/{create_agent_request_instructions.py => agents_create_agent_request_instructions.py} (51%) create mode 100644 sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py create mode 100644 sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py create mode 100644 sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py create mode 100644 sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py create mode 100644 sdks/python/julep/api/types/agents_docs_search_route_search_response.py create mode 100644 sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py rename sdks/python/julep/api/types/{chat_settings_stop.py => agents_patch_agent_request_instructions.py} (51%) create mode 100644 sdks/python/julep/api/types/agents_route_create_or_update_response.py create mode 100644 sdks/python/julep/api/types/agents_route_create_response.py create mode 100644 sdks/python/julep/api/types/agents_route_delete_response.py rename sdks/python/julep/api/types/{list_sessions_request_order.py => agents_route_list_request_direction.py} (66%) rename sdks/python/julep/api/types/{list_sessions_request_sort_by.py => agents_route_list_request_sort_by.py} (54%) create mode 100644 sdks/python/julep/api/types/agents_route_list_response.py create mode 100644 sdks/python/julep/api/types/agents_route_patch_response.py create mode 100644 sdks/python/julep/api/types/agents_route_update_response.py create mode 100644 sdks/python/julep/api/types/agents_update_agent_request_default_settings.py create mode 100644 sdks/python/julep/api/types/agents_update_agent_request_instructions.py rename sdks/python/julep/api/types/{resource_created_response.py => chat_completion_response_format.py} (78%) rename sdks/python/julep/api/types/{chat_settings_response_format_type.py => chat_completion_response_format_type.py} (51%) rename sdks/python/julep/api/types/{chat_settings_preset.py => chat_generation_preset.py} (65%) create mode 100644 sdks/python/julep/api/types/chat_generation_preset_settings.py delete mode 100644 sdks/python/julep/api/types/chat_input_data.py delete mode 100644 sdks/python/julep/api/types/chat_input_data_tool_choice.py delete mode 100644 sdks/python/julep/api/types/chat_ml_message_content.py delete mode 100644 sdks/python/julep/api/types/chat_ml_message_role.py create mode 100644 sdks/python/julep/api/types/chat_open_ai_settings.py delete mode 100644 sdks/python/julep/api/types/chat_response.py delete mode 100644 sdks/python/julep/api/types/chat_response_finish_reason.py delete mode 100644 sdks/python/julep/api/types/chat_settings.py delete mode 100644 sdks/python/julep/api/types/chat_settings_response_format.py rename sdks/python/julep/api/types/{agent_default_settings.py => chat_v_llm_settings.py} (58%) create mode 100644 sdks/python/julep/api/types/common_identifier_safe_unicode.py rename sdks/python/julep/api/types/{transition_type.py => common_limit.py} (75%) create mode 100644 sdks/python/julep/api/types/common_logit_bias.py rename sdks/python/julep/api/types/{execution_status.py => common_offset.py} (74%) rename sdks/python/julep/api/types/{tool_choice_option.py => common_tool_ref.py} (73%) create mode 100644 sdks/python/julep/api/types/common_uuid.py create mode 100644 sdks/python/julep/api/types/common_valid_python_identifier.py delete mode 100644 sdks/python/julep/api/types/create_tool_request_type.py delete mode 100644 sdks/python/julep/api/types/doc.py delete mode 100644 sdks/python/julep/api/types/doc_content.py rename sdks/python/julep/api/types/{chat_ml_image_content_part_image_url.py => docs_doc.py} (60%) rename sdks/python/julep/api/types/{function_parameters.py => docs_doc_content.py} (60%) create mode 100644 sdks/python/julep/api/types/docs_doc_owner.py rename sdks/python/julep/api/types/{suggestion_target.py => docs_doc_owner_role.py} (63%) rename sdks/python/julep/api/types/{completion_usage.py => docs_doc_reference.py} (66%) create mode 100644 sdks/python/julep/api/types/docs_doc_search_request.py rename sdks/python/julep/api/types/{cel_object.py => docs_doc_search_request_text.py} (55%) create mode 100644 sdks/python/julep/api/types/docs_doc_search_request_vector.py create mode 100644 sdks/python/julep/api/types/docs_hybrid_doc_search_request.py rename sdks/python/julep/api/types/{update_agent_request_instructions.py => docs_hybrid_doc_search_request_text.py} (57%) create mode 100644 sdks/python/julep/api/types/docs_hybrid_doc_search_request_vector.py rename sdks/python/julep/api/types/{prompt_workflow_step.py => docs_text_only_doc_search_request.py} (75%) rename sdks/python/julep/api/types/{create_doc_content.py => docs_text_only_doc_search_request_text.py} (52%) create mode 100644 sdks/python/julep/api/types/docs_vector_doc_search_request.py create mode 100644 sdks/python/julep/api/types/docs_vector_doc_search_request_vector.py rename sdks/python/julep/api/types/{if_else_workflow_step.py => entries_base_chat_ml_content_part.py} (59%) create mode 100644 sdks/python/julep/api/types/entries_chat_ml_image_content_part.py rename sdks/python/julep/api/types/{input_chat_ml_message_role.py => entries_chat_ml_role.py} (50%) rename sdks/python/julep/api/types/{error_workflow_step.py => entries_chat_ml_text_content_part.py} (92%) create mode 100644 sdks/python/julep/api/types/entries_entry.py create mode 100644 sdks/python/julep/api/types/entries_entry_content.py create mode 100644 sdks/python/julep/api/types/entries_entry_content_item.py rename sdks/python/julep/api/types/{input_chat_ml_message_content_item.py => entries_entry_content_item_item.py} (53%) create mode 100644 sdks/python/julep/api/types/entries_entry_source.py rename sdks/python/julep/api/types/{execution.py => entries_history.py} (70%) rename sdks/python/julep/api/types/{chat_ml_image_content_part_image_url_detail.py => entries_image_detail.py} (59%) create mode 100644 sdks/python/julep/api/types/entries_image_url.py rename sdks/python/julep/api/types/{input_chat_ml_message.py => entries_input_chat_ml_message.py} (65%) create mode 100644 sdks/python/julep/api/types/entries_input_chat_ml_message_content.py rename sdks/python/julep/api/types/{chat_ml_message_content_item.py => entries_input_chat_ml_message_content_item.py} (50%) create mode 100644 sdks/python/julep/api/types/entries_relation.py create mode 100644 sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py rename sdks/python/julep/api/types/{function_call_option.py => execution_transitions_route_list_response.py} (77%) create mode 100644 sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py rename sdks/python/julep/api/types/{chat_ml_message.py => executions_execution.py} (58%) create mode 100644 sdks/python/julep/api/types/executions_execution_status.py create mode 100644 sdks/python/julep/api/types/executions_resume_execution_request.py create mode 100644 sdks/python/julep/api/types/executions_route_update_response.py create mode 100644 sdks/python/julep/api/types/executions_stop_execution_request.py create mode 100644 sdks/python/julep/api/types/executions_transition.py create mode 100644 sdks/python/julep/api/types/executions_transition_type.py create mode 100644 sdks/python/julep/api/types/executions_update_execution_request.py delete mode 100644 sdks/python/julep/api/types/function_def.py delete mode 100644 sdks/python/julep/api/types/get_agent_docs_response.py delete mode 100644 sdks/python/julep/api/types/get_agent_memories_response.py delete mode 100644 sdks/python/julep/api/types/get_agent_tools_response.py delete mode 100644 sdks/python/julep/api/types/get_history_response.py delete mode 100644 sdks/python/julep/api/types/get_suggestions_response.py delete mode 100644 sdks/python/julep/api/types/get_user_docs_response.py create mode 100644 sdks/python/julep/api/types/history_route_delete_response.py rename sdks/python/julep/api/types/{list_agents_request_order.py => history_route_list_request_direction.py} (66%) rename sdks/python/julep/api/types/{get_user_docs_request_sort_by.py => history_route_list_request_sort_by.py} (53%) create mode 100644 sdks/python/julep/api/types/history_route_list_response.py create mode 100644 sdks/python/julep/api/types/individual_docs_route_delete_response.py delete mode 100644 sdks/python/julep/api/types/input_chat_ml_message_content.py rename sdks/python/julep/api/types/{job_status_state.py => jobs_job_state.py} (74%) rename sdks/python/julep/api/types/{job_status.py => jobs_job_status.py} (57%) delete mode 100644 sdks/python/julep/api/types/list_agents_response.py delete mode 100644 sdks/python/julep/api/types/list_sessions_response.py delete mode 100644 sdks/python/julep/api/types/list_users_request_order.py delete mode 100644 sdks/python/julep/api/types/list_users_request_sort_by.py delete mode 100644 sdks/python/julep/api/types/list_users_response.py delete mode 100644 sdks/python/julep/api/types/memory.py delete mode 100644 sdks/python/julep/api/types/memory_access_options.py delete mode 100644 sdks/python/julep/api/types/memory_entities_item.py delete mode 100644 sdks/python/julep/api/types/partial_function_def.py delete mode 100644 sdks/python/julep/api/types/patch_agent_request_instructions.py delete mode 100644 sdks/python/julep/api/types/session.py create mode 100644 sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py rename sdks/python/julep/api/types/{chat_settings_response_format_schema.py => sessions_multi_agent_no_user_session.py} (87%) create mode 100644 sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_route_create_or_update_response.py create mode 100644 sdks/python/julep/api/types/sessions_route_create_response.py create mode 100644 sdks/python/julep/api/types/sessions_route_delete_response.py create mode 100644 sdks/python/julep/api/types/sessions_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/sessions_route_list_request_sort_by.py create mode 100644 sdks/python/julep/api/types/sessions_route_list_response.py create mode 100644 sdks/python/julep/api/types/sessions_route_patch_response.py create mode 100644 sdks/python/julep/api/types/sessions_route_update_response.py create mode 100644 sdks/python/julep/api/types/sessions_session.py create mode 100644 sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_single_agent_no_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_single_agent_single_user_session.py delete mode 100644 sdks/python/julep/api/types/suggestion.py create mode 100644 sdks/python/julep/api/types/task_executions_route_create_response.py create mode 100644 sdks/python/julep/api/types/task_executions_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py create mode 100644 sdks/python/julep/api/types/task_executions_route_list_response.py rename sdks/python/julep/api/types/{create_tool_request.py => task_executions_route_resume_with_task_token_response.py} (68%) create mode 100644 sdks/python/julep/api/types/tasks_cel.py rename sdks/python/julep/api/types/{chat_ml_text_content_part.py => tasks_error_workflow_step.py} (88%) create mode 100644 sdks/python/julep/api/types/tasks_evaluate_step.py rename sdks/python/julep/api/types/{execution_transition.py => tasks_if_else_workflow_step.py} (61%) create mode 100644 sdks/python/julep/api/types/tasks_prompt_step.py create mode 100644 sdks/python/julep/api/types/tasks_prompt_step_prompt.py create mode 100644 sdks/python/julep/api/types/tasks_prompt_step_settings.py create mode 100644 sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py create mode 100644 sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py create mode 100644 sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py create mode 100644 sdks/python/julep/api/types/tasks_route_create_or_update_response.py create mode 100644 sdks/python/julep/api/types/tasks_route_create_response.py create mode 100644 sdks/python/julep/api/types/tasks_route_delete_response.py rename sdks/python/julep/api/types/{get_agent_docs_request_order.py => tasks_route_list_request_direction.py} (67%) rename sdks/python/julep/api/types/{get_agent_docs_request_sort_by.py => tasks_route_list_request_sort_by.py} (54%) create mode 100644 sdks/python/julep/api/types/tasks_route_list_response.py rename sdks/python/julep/api/types/{create_doc.py => tasks_route_patch_response.py} (69%) create mode 100644 sdks/python/julep/api/types/tasks_route_update_response.py create mode 100644 sdks/python/julep/api/types/tasks_task.py rename sdks/python/julep/api/types/{chat_ml_image_content_part.py => tasks_tool_call_step.py} (76%) create mode 100644 sdks/python/julep/api/types/tasks_workflow_step.py rename sdks/python/julep/api/types/{resource_deleted_response.py => tasks_yield_step.py} (77%) delete mode 100644 sdks/python/julep/api/types/tool.py delete mode 100644 sdks/python/julep/api/types/tool_call_workflow_step.py delete mode 100644 sdks/python/julep/api/types/tool_response.py create mode 100644 sdks/python/julep/api/types/tool_route_delete_response.py rename sdks/python/julep/api/types/{resource_updated_response.py => tool_route_patch_response.py} (74%) create mode 100644 sdks/python/julep/api/types/tool_route_update_response.py delete mode 100644 sdks/python/julep/api/types/tool_type.py create mode 100644 sdks/python/julep/api/types/tools_chosen_function_call.py create mode 100644 sdks/python/julep/api/types/tools_chosen_tool_call.py create mode 100644 sdks/python/julep/api/types/tools_create_tool_request.py rename sdks/python/julep/api/types/{named_tool_choice_function.py => tools_function_call_option.py} (93%) rename sdks/python/julep/api/types/{named_tool_choice.py => tools_function_def.py} (58%) rename sdks/python/julep/api/types/{task.py => tools_function_def_update.py} (57%) create mode 100644 sdks/python/julep/api/types/tools_function_tool.py create mode 100644 sdks/python/julep/api/types/tools_tool.py create mode 100644 sdks/python/julep/api/types/tools_tool_response.py create mode 100644 sdks/python/julep/api/types/tools_tool_type.py delete mode 100644 sdks/python/julep/api/types/user.py create mode 100644 sdks/python/julep/api/types/user_docs_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py rename sdks/python/julep/api/types/{evaluate_workflow_step.py => user_docs_route_list_response.py} (88%) create mode 100644 sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py create mode 100644 sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py create mode 100644 sdks/python/julep/api/types/user_docs_search_route_search_response.py create mode 100644 sdks/python/julep/api/types/users_route_create_or_update_response.py create mode 100644 sdks/python/julep/api/types/users_route_create_response.py create mode 100644 sdks/python/julep/api/types/users_route_delete_response.py rename sdks/python/julep/api/types/{get_user_docs_request_order.py => users_route_list_request_direction.py} (67%) rename sdks/python/julep/api/types/{list_agents_request_sort_by.py => users_route_list_request_sort_by.py} (54%) create mode 100644 sdks/python/julep/api/types/users_route_list_response.py create mode 100644 sdks/python/julep/api/types/users_route_patch_response.py create mode 100644 sdks/python/julep/api/types/users_route_update_response.py create mode 100644 sdks/python/julep/api/types/users_user.py delete mode 100644 sdks/python/julep/api/types/workflow_step.py delete mode 100644 sdks/python/julep/api/types/yield_workflow_step.py delete mode 100644 sdks/ts/src/api/models/Agent.ts delete mode 100644 sdks/ts/src/api/models/AgentDefaultSettings.ts create mode 100644 sdks/ts/src/api/models/Agents_Agent.ts create mode 100644 sdks/ts/src/api/models/Agents_CreateAgentRequest.ts create mode 100644 sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts create mode 100644 sdks/ts/src/api/models/Agents_PatchAgentRequest.ts create mode 100644 sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts delete mode 100644 sdks/ts/src/api/models/ChatInput.ts delete mode 100644 sdks/ts/src/api/models/ChatInputData.ts delete mode 100644 sdks/ts/src/api/models/ChatMLImageContentPart.ts delete mode 100644 sdks/ts/src/api/models/ChatMLMessage.ts delete mode 100644 sdks/ts/src/api/models/ChatResponse.ts delete mode 100644 sdks/ts/src/api/models/ChatSettings.ts rename sdks/ts/src/api/models/{ChatMLTextContentPart.ts => Chat_CompletionResponseFormat.ts} (53%) create mode 100644 sdks/ts/src/api/models/Chat_GenerationPreset.ts create mode 100644 sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts create mode 100644 sdks/ts/src/api/models/Chat_OpenAISettings.ts create mode 100644 sdks/ts/src/api/models/Chat_vLLMSettings.ts create mode 100644 sdks/ts/src/api/models/Common_identifierSafeUnicode.ts rename sdks/ts/src/api/models/{Task.ts => Common_limit.ts} (67%) rename sdks/ts/src/api/models/{execution_id.ts => Common_logit_bias.ts} (76%) rename sdks/ts/src/api/models/{CreateTask.ts => Common_offset.ts} (66%) create mode 100644 sdks/ts/src/api/models/Common_toolRef.ts rename sdks/ts/src/api/models/{job_id.ts => Common_uuid.ts} (79%) rename sdks/ts/src/api/models/{TransitionType.ts => Common_validPythonIdentifier.ts} (62%) delete mode 100644 sdks/ts/src/api/models/CompletionUsage.ts delete mode 100644 sdks/ts/src/api/models/CreateAgentRequest.ts delete mode 100644 sdks/ts/src/api/models/CreateDoc.ts delete mode 100644 sdks/ts/src/api/models/CreateExecution.ts delete mode 100644 sdks/ts/src/api/models/CreateToolRequest.ts delete mode 100644 sdks/ts/src/api/models/CreateUserRequest.ts delete mode 100644 sdks/ts/src/api/models/Doc.ts delete mode 100644 sdks/ts/src/api/models/DocIds.ts create mode 100644 sdks/ts/src/api/models/Docs_Doc.ts rename sdks/ts/src/api/models/{ErrorWorkflowStep.ts => Docs_DocOwner.ts} (51%) create mode 100644 sdks/ts/src/api/models/Docs_DocReference.ts create mode 100644 sdks/ts/src/api/models/Docs_DocSearchRequest.ts create mode 100644 sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts create mode 100644 sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts create mode 100644 sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts create mode 100644 sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts create mode 100644 sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts create mode 100644 sdks/ts/src/api/models/Entries_ChatMLRole.ts create mode 100644 sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts create mode 100644 sdks/ts/src/api/models/Entries_Entry.ts create mode 100644 sdks/ts/src/api/models/Entries_History.ts rename sdks/ts/src/api/models/{ExecutionStatus.ts => Entries_ImageDetail.ts} (63%) create mode 100644 sdks/ts/src/api/models/Entries_ImageURL.ts rename sdks/ts/src/api/models/{InputChatMLMessage.ts => Entries_InputChatMLMessage.ts} (53%) create mode 100644 sdks/ts/src/api/models/Entries_Relation.ts delete mode 100644 sdks/ts/src/api/models/Execution.ts delete mode 100644 sdks/ts/src/api/models/ExecutionTransition.ts create mode 100644 sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts create mode 100644 sdks/ts/src/api/models/Executions_Execution.ts create mode 100644 sdks/ts/src/api/models/Executions_ResumeExecutionRequest.ts create mode 100644 sdks/ts/src/api/models/Executions_StopExecutionRequest.ts create mode 100644 sdks/ts/src/api/models/Executions_TaskTokenResumeExecutionRequest.ts create mode 100644 sdks/ts/src/api/models/Executions_Transition.ts create mode 100644 sdks/ts/src/api/models/Executions_UpdateExecutionRequest.ts delete mode 100644 sdks/ts/src/api/models/FunctionCallOption.ts delete mode 100644 sdks/ts/src/api/models/FunctionDef.ts delete mode 100644 sdks/ts/src/api/models/FunctionParameters.ts delete mode 100644 sdks/ts/src/api/models/IfElseWorkflowStep.ts delete mode 100644 sdks/ts/src/api/models/JobStatus.ts create mode 100644 sdks/ts/src/api/models/Jobs_JobState.ts create mode 100644 sdks/ts/src/api/models/Jobs_JobStatus.ts delete mode 100644 sdks/ts/src/api/models/Memory.ts delete mode 100644 sdks/ts/src/api/models/MemoryAccessOptions.ts delete mode 100644 sdks/ts/src/api/models/NamedToolChoice.ts delete mode 100644 sdks/ts/src/api/models/PartialFunctionDef.ts delete mode 100644 sdks/ts/src/api/models/PatchAgentRequest.ts delete mode 100644 sdks/ts/src/api/models/PatchSessionRequest.ts delete mode 100644 sdks/ts/src/api/models/PatchToolRequest.ts delete mode 100644 sdks/ts/src/api/models/PromptWorkflowStep.ts delete mode 100644 sdks/ts/src/api/models/ResourceCreatedResponse.ts delete mode 100644 sdks/ts/src/api/models/ResourceDeletedResponse.ts delete mode 100644 sdks/ts/src/api/models/ResourceUpdatedResponse.ts rename sdks/ts/src/api/models/{Session.ts => Sessions_CreateOrUpdateSessionRequest.ts} (53%) create mode 100644 sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts create mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts rename sdks/ts/src/api/models/{CreateSessionRequest.ts => Sessions_PatchSessionRequest.ts} (59%) create mode 100644 sdks/ts/src/api/models/Sessions_Session.ts create mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts rename sdks/ts/src/api/models/{UpdateSessionRequest.ts => Sessions_UpdateSessionRequest.ts} (53%) delete mode 100644 sdks/ts/src/api/models/Suggestion.ts create mode 100644 sdks/ts/src/api/models/Tasks_CEL.ts create mode 100644 sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts create mode 100644 sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts create mode 100644 sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts create mode 100644 sdks/ts/src/api/models/Tasks_EvaluateStep.ts create mode 100644 sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts create mode 100644 sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts create mode 100644 sdks/ts/src/api/models/Tasks_PromptStep.ts create mode 100644 sdks/ts/src/api/models/Tasks_Task.ts create mode 100644 sdks/ts/src/api/models/Tasks_ToolCallStep.ts create mode 100644 sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts rename sdks/ts/src/api/models/{EvaluateWorkflowStep.ts => Tasks_WorkflowStep.ts} (55%) create mode 100644 sdks/ts/src/api/models/Tasks_YieldStep.ts delete mode 100644 sdks/ts/src/api/models/Tool.ts delete mode 100644 sdks/ts/src/api/models/ToolCallWorkflowStep.ts delete mode 100644 sdks/ts/src/api/models/ToolChoiceOption.ts create mode 100644 sdks/ts/src/api/models/Tools_ChosenFunctionCall.ts create mode 100644 sdks/ts/src/api/models/Tools_ChosenToolCall.ts create mode 100644 sdks/ts/src/api/models/Tools_CreateToolRequest.ts rename sdks/ts/src/api/models/{ToolResponse.ts => Tools_FunctionCallOption.ts} (60%) create mode 100644 sdks/ts/src/api/models/Tools_FunctionDef.ts create mode 100644 sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts create mode 100644 sdks/ts/src/api/models/Tools_FunctionTool.ts create mode 100644 sdks/ts/src/api/models/Tools_PatchToolRequest.ts create mode 100644 sdks/ts/src/api/models/Tools_Tool.ts create mode 100644 sdks/ts/src/api/models/Tools_ToolResponse.ts rename sdks/ts/src/api/models/{CELObject.ts => Tools_ToolType.ts} (61%) create mode 100644 sdks/ts/src/api/models/Tools_UpdateToolRequest.ts delete mode 100644 sdks/ts/src/api/models/UpdateAgentRequest.ts delete mode 100644 sdks/ts/src/api/models/UpdateToolRequest.ts delete mode 100644 sdks/ts/src/api/models/User.ts create mode 100644 sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts create mode 100644 sdks/ts/src/api/models/Users_CreateUserRequest.ts rename sdks/ts/src/api/models/{PatchUserRequest.ts => Users_PatchUserRequest.ts} (57%) rename sdks/ts/src/api/models/{UpdateUserRequest.ts => Users_UpdateUserRequest.ts} (57%) create mode 100644 sdks/ts/src/api/models/Users_User.ts delete mode 100644 sdks/ts/src/api/models/WorkflowStep.ts delete mode 100644 sdks/ts/src/api/models/YieldWorkflowStep.ts delete mode 100644 sdks/ts/src/api/models/agent_id.ts delete mode 100644 sdks/ts/src/api/models/doc_id.ts delete mode 100644 sdks/ts/src/api/models/memory_id.ts delete mode 100644 sdks/ts/src/api/models/message_id.ts delete mode 100644 sdks/ts/src/api/models/session_id.ts delete mode 100644 sdks/ts/src/api/models/task_id.ts delete mode 100644 sdks/ts/src/api/models/tool_id.ts delete mode 100644 sdks/ts/src/api/models/transition_id.ts delete mode 100644 sdks/ts/src/api/models/user_id.ts delete mode 100644 sdks/ts/src/api/schemas/$AgentDefaultSettings.ts create mode 100644 sdks/ts/src/api/schemas/$Agents_Agent.ts rename sdks/ts/src/api/schemas/{$CreateAgentRequest.ts => $Agents_CreateAgentRequest.ts} (51%) rename sdks/ts/src/api/schemas/{$UpdateAgentRequest.ts => $Agents_CreateOrUpdateAgentRequest.ts} (53%) rename sdks/ts/src/api/schemas/{$PatchAgentRequest.ts => $Agents_PatchAgentRequest.ts} (54%) rename sdks/ts/src/api/schemas/{$Agent.ts => $Agents_UpdateAgentRequest.ts} (61%) delete mode 100644 sdks/ts/src/api/schemas/$ChatInputData.ts delete mode 100644 sdks/ts/src/api/schemas/$ChatMLImageContentPart.ts delete mode 100644 sdks/ts/src/api/schemas/$ChatMLMessage.ts delete mode 100644 sdks/ts/src/api/schemas/$ChatResponse.ts delete mode 100644 sdks/ts/src/api/schemas/$ChatSettings.ts rename sdks/ts/src/api/schemas/{$EvaluateWorkflowStep.ts => $Chat_CompletionResponseFormat.ts} (71%) create mode 100644 sdks/ts/src/api/schemas/$Chat_GenerationPreset.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts create mode 100644 sdks/ts/src/api/schemas/$Common_identifierSafeUnicode.ts create mode 100644 sdks/ts/src/api/schemas/$Common_limit.ts create mode 100644 sdks/ts/src/api/schemas/$Common_logit_bias.ts create mode 100644 sdks/ts/src/api/schemas/$Common_offset.ts create mode 100644 sdks/ts/src/api/schemas/$Common_toolRef.ts rename sdks/ts/src/api/schemas/{$job_id.ts => $Common_uuid.ts} (85%) rename sdks/ts/src/api/schemas/{$TransitionType.ts => $Common_validPythonIdentifier.ts} (56%) delete mode 100644 sdks/ts/src/api/schemas/$CompletionUsage.ts delete mode 100644 sdks/ts/src/api/schemas/$CreateDoc.ts delete mode 100644 sdks/ts/src/api/schemas/$CreateToolRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$DocIds.ts rename sdks/ts/src/api/schemas/{$Doc.ts => $Docs_Doc.ts} (57%) create mode 100644 sdks/ts/src/api/schemas/$Docs_DocOwner.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_DocReference.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_DocSearchRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts rename sdks/ts/src/api/schemas/{$ChatMLTextContentPart.ts => $Entries_BaseChatMLContentPart.ts} (59%) create mode 100644 sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts rename sdks/ts/src/api/schemas/{$transition_id.ts => $Entries_ChatMLRole.ts} (73%) create mode 100644 sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts create mode 100644 sdks/ts/src/api/schemas/$Entries_Entry.ts create mode 100644 sdks/ts/src/api/schemas/$Entries_History.ts create mode 100644 sdks/ts/src/api/schemas/$Entries_ImageDetail.ts create mode 100644 sdks/ts/src/api/schemas/$Entries_ImageURL.ts rename sdks/ts/src/api/schemas/{$InputChatMLMessage.ts => $Entries_InputChatMLMessage.ts} (54%) rename sdks/ts/src/api/schemas/{$IfElseWorkflowStep.ts => $Entries_Relation.ts} (67%) delete mode 100644 sdks/ts/src/api/schemas/$Execution.ts delete mode 100644 sdks/ts/src/api/schemas/$ExecutionStatus.ts rename sdks/ts/src/api/schemas/{$PromptWorkflowStep.ts => $Executions_CreateExecutionRequest.ts} (54%) create mode 100644 sdks/ts/src/api/schemas/$Executions_Execution.ts create mode 100644 sdks/ts/src/api/schemas/$Executions_ResumeExecutionRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Executions_StopExecutionRequest.ts rename sdks/ts/src/api/schemas/{$CreateExecution.ts => $Executions_TaskTokenResumeExecutionRequest.ts} (63%) rename sdks/ts/src/api/schemas/{$ExecutionTransition.ts => $Executions_Transition.ts} (56%) rename sdks/ts/src/api/schemas/{$ErrorWorkflowStep.ts => $Executions_UpdateExecutionRequest.ts} (69%) delete mode 100644 sdks/ts/src/api/schemas/$FunctionCallOption.ts delete mode 100644 sdks/ts/src/api/schemas/$FunctionDef.ts delete mode 100644 sdks/ts/src/api/schemas/$JobStatus.ts rename sdks/ts/src/api/schemas/{$task_id.ts => $Jobs_JobState.ts} (75%) create mode 100644 sdks/ts/src/api/schemas/$Jobs_JobStatus.ts delete mode 100644 sdks/ts/src/api/schemas/$Memory.ts delete mode 100644 sdks/ts/src/api/schemas/$MemoryAccessOptions.ts delete mode 100644 sdks/ts/src/api/schemas/$NamedToolChoice.ts delete mode 100644 sdks/ts/src/api/schemas/$PartialFunctionDef.ts delete mode 100644 sdks/ts/src/api/schemas/$PatchToolRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$ResourceCreatedResponse.ts delete mode 100644 sdks/ts/src/api/schemas/$ResourceDeletedResponse.ts delete mode 100644 sdks/ts/src/api/schemas/$ResourceUpdatedResponse.ts rename sdks/ts/src/api/schemas/{$Session.ts => $Sessions_CreateOrUpdateSessionRequest.ts} (61%) create mode 100644 sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts rename sdks/ts/src/api/schemas/{$PatchSessionRequest.ts => $Sessions_PatchSessionRequest.ts} (58%) create mode 100644 sdks/ts/src/api/schemas/$Sessions_Session.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts rename sdks/ts/src/api/schemas/{$ChatInput.ts => $Sessions_SingleAgentNoUserSession.ts} (50%) create mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts rename sdks/ts/src/api/schemas/{$CreateSessionRequest.ts => $Sessions_UpdateSessionRequest.ts} (67%) delete mode 100644 sdks/ts/src/api/schemas/$Suggestion.ts create mode 100644 sdks/ts/src/api/schemas/$Tasks_CEL.ts create mode 100644 sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts rename sdks/ts/src/api/schemas/{$CreateTask.ts => $Tasks_CreateTaskRequest.ts} (61%) create mode 100644 sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts create mode 100644 sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts create mode 100644 sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts rename sdks/ts/src/api/schemas/{$FunctionParameters.ts => $Tasks_PatchTaskRequest.ts} (61%) create mode 100644 sdks/ts/src/api/schemas/$Tasks_PromptStep.ts rename sdks/ts/src/api/schemas/{$CELObject.ts => $Tasks_Task.ts} (63%) create mode 100644 sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts rename sdks/ts/src/api/schemas/{$Task.ts => $Tasks_UpdateTaskRequest.ts} (61%) rename sdks/ts/src/api/schemas/{$ToolCallWorkflowStep.ts => $Tasks_WorkflowStep.ts} (56%) create mode 100644 sdks/ts/src/api/schemas/$Tasks_YieldStep.ts delete mode 100644 sdks/ts/src/api/schemas/$Tool.ts delete mode 100644 sdks/ts/src/api/schemas/$ToolChoiceOption.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_ChosenFunctionCall.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_ChosenToolCall.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts rename sdks/ts/src/api/schemas/{$YieldWorkflowStep.ts => $Tools_FunctionCallOption.ts} (63%) create mode 100644 sdks/ts/src/api/schemas/$Tools_FunctionDef.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_FunctionTool.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_Tool.ts rename sdks/ts/src/api/schemas/{$ToolResponse.ts => $Tools_ToolResponse.ts} (74%) rename sdks/ts/src/api/schemas/{$execution_id.ts => $Tools_ToolType.ts} (74%) create mode 100644 sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$UpdateSessionRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$UpdateToolRequest.ts rename sdks/ts/src/api/schemas/{$CreateUserRequest.ts => $Users_CreateOrUpdateUserRequest.ts} (59%) rename sdks/ts/src/api/schemas/{$User.ts => $Users_CreateUserRequest.ts} (52%) rename sdks/ts/src/api/schemas/{$PatchUserRequest.ts => $Users_PatchUserRequest.ts} (66%) rename sdks/ts/src/api/schemas/{$UpdateUserRequest.ts => $Users_UpdateUserRequest.ts} (68%) create mode 100644 sdks/ts/src/api/schemas/$Users_User.ts delete mode 100644 sdks/ts/src/api/schemas/$WorkflowStep.ts delete mode 100644 sdks/ts/src/api/schemas/$agent_id.ts delete mode 100644 sdks/ts/src/api/schemas/$doc_id.ts delete mode 100644 sdks/ts/src/api/schemas/$memory_id.ts delete mode 100644 sdks/ts/src/api/schemas/$message_id.ts delete mode 100644 sdks/ts/src/api/schemas/$session_id.ts delete mode 100644 sdks/ts/src/api/schemas/$tool_id.ts delete mode 100644 sdks/ts/src/api/schemas/$user_id.ts diff --git a/agents-api/agents_api/autogen/Agents.py b/agents-api/agents_api/autogen/Agents.py new file mode 100644 index 000000000..03397c4bf --- /dev/null +++ b/agents-api/agents_api/autogen/Agents.py @@ -0,0 +1,194 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from typing import Annotated, Any, Dict, List +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + +from . import Chat + + +class Agent(BaseModel): + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + metadata: Dict[str, Any] | None = None + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the agent + """ + about: str + """ + About the agent + """ + model: str + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | List[str] + """ + Instructions for the agent + """ + default_settings: ( + Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + + +class CreateAgentRequest(BaseModel): + """ + Payload for creating a agent (and associated documents) + """ + + metadata: Dict[str, Any] | None = None + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the agent + """ + about: str + """ + About the agent + """ + model: str + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | List[str] + """ + Instructions for the agent + """ + default_settings: ( + Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + docs: Annotated[List, Field(max_length=100)] + """ + Documents to index for this agent. (Max: 100 items) + """ + + +class CreateOrUpdateAgentRequest(BaseModel): + id: UUID + metadata: Dict[str, Any] | None = None + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the agent + """ + about: str + """ + About the agent + """ + model: str + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | List[str] + """ + Instructions for the agent + """ + default_settings: ( + Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + + +class PatchAgentRequest(BaseModel): + """ + Payload for patching a agent + """ + + metadata: Dict[str, Any] | None = None + name: Annotated[ + str | None, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the agent + """ + about: str | None = "" + """ + About the agent + """ + model: str | None = "" + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | List[str] | None = "" + """ + Instructions for the agent + """ + default_settings: ( + Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + + +class UpdateAgentRequest(BaseModel): + """ + Payload for updating a agent + """ + + metadata: Dict[str, Any] | None = None + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the agent + """ + about: str + """ + About the agent + """ + model: str + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | List[str] + """ + Instructions for the agent + """ + default_settings: ( + Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py new file mode 100644 index 000000000..844f8c48f --- /dev/null +++ b/agents-api/agents_api/autogen/Chat.py @@ -0,0 +1,91 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Annotated + +from pydantic import BaseModel, Field + + +class Type(str, Enum): + """ + The format of the response + """ + + text = "text" + json_object = "json_object" + + +class CompletionResponseFormat(BaseModel): + type: Type + """ + The format of the response + """ + + +class GenerationPreset(str, Enum): + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ + + problem_solving = "problem_solving" + conversational = "conversational" + fun = "fun" + prose = "prose" + creative = "creative" + business = "business" + deterministic = "deterministic" + code = "code" + multilingual = "multilingual" + + +class GenerationPresetSettings(BaseModel): + preset: GenerationPreset | None = None + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ + + +class OpenAISettings(BaseModel): + frequency_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + presence_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + + +class VLLMSettings(BaseModel): + repetition_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + 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. + """ + length_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + min_p: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + Minimum probability compared to leading token to be considered + """ diff --git a/agents-api/agents_api/autogen/Common.py b/agents-api/agents_api/autogen/Common.py new file mode 100644 index 000000000..6c4ee61df --- /dev/null +++ b/agents-api/agents_api/autogen/Common.py @@ -0,0 +1,27 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from typing import Annotated + +from pydantic import Field, RootModel + + +class Limit(RootModel[int]): + root: Annotated[int, Field(ge=1, lt=1000)] + """ + Limit the number of results + """ + + +class LogitBias(RootModel[float]): + root: Annotated[float, Field(ge=-100.0, le=100.0)] + + +class Offset(RootModel[int]): + root: Annotated[int, Field(ge=0)] + """ + Offset to apply to the results + """ diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py new file mode 100644 index 000000000..ceeef0443 --- /dev/null +++ b/agents-api/agents_api/autogen/Docs.py @@ -0,0 +1,123 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Annotated, Any, Dict, List, Literal +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + + +class Doc(BaseModel): + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + metadata: Dict[str, Any] | None = None + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + title: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Title describing what this document contains + """ + content: str | List[str] + """ + Contents of the document + """ + + +class Role(str, Enum): + user = "user" + agent = "agent" + + +class DocOwner(BaseModel): + id: UUID + role: Role + + +class DocReference(BaseModel): + owner: DocOwner + """ + The owner of this document. + """ + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + """ + ID of the document + """ + snippet_index: List[int] + """ + Snippets referred to of the document + """ + title: str | None = None + snippet: str | None = None + + +class Mode(str, Enum): + """ + The search mode + """ + + vector = "vector" + text = "text" + hybrid = "hybrid" + + +class DocSearchRequest(BaseModel): + text: str | List[str] | None = None + vector: List[float] | List[List[float]] | None = None + mode: Mode + """ + The search mode + """ + confidence: Annotated[float, Field(ge=0.0, le=1.0)] + """ + The confidence cutoff level + """ + alpha: Annotated[float, Field(ge=0.0, le=1.0)] + """ + The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + """ + mmr: bool + """ + Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. + """ + lang: Literal["en-US"] = "en-US" + """ + The language to be used for text-only search. Support for other languages coming soon. + """ + + +class HybridDocSearchRequest(DocSearchRequest): + text: str | List[str] | None = None + """ + Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. + """ + vector: List[float] | List[List[float]] | None = None + """ + Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + """ + mode: Literal["hybrid"] = "hybrid" + + +class TextOnlyDocSearchRequest(DocSearchRequest): + text: str | List[str] + """ + Text or texts to use in the search. In `text` search mode, only BM25 is used. + """ + mode: Literal["text"] = "text" + + +class VectorDocSearchRequest(DocSearchRequest): + vector: List[float] | List[List[float]] + """ + Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + """ + mode: Literal["vector"] = "vector" diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py new file mode 100644 index 000000000..7d6fcc54b --- /dev/null +++ b/agents-api/agents_api/autogen/Entries.py @@ -0,0 +1,149 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Annotated, List, Literal +from uuid import UUID + +from pydantic import AnyUrl, AwareDatetime, BaseModel, Field + +from . import Tools + + +class ChatMLRole(str, Enum): + """ + ChatML role (system|assistant|user|function_call|function|function_response|auto) + """ + + user = "user" + agent = "agent" + system = "system" + function = "function" + function_response = "function_response" + function_call = "function_call" + auto = "auto" + + +class Source(str, Enum): + api_request = "api_request" + api_response = "api_response" + tool_response = "tool_response" + internal = "internal" + summarizer = "summarizer" + meta = "meta" + + +class ImageDetail(str, Enum): + """ + Image detail level + """ + + low = "low" + high = "high" + auto = "auto" + + +class ImageURL(BaseModel): + url: AnyUrl + """ + Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + """ + detail: ImageDetail + """ + The detail level of the image + """ + + +class Relation(BaseModel): + head: UUID + relation: str + tail: UUID + + +class BaseChatMLContentPart(BaseModel): + type: str + """ + The type of content part + """ + text: str | None = None + image_url: ImageURL | None = None + + +class ChatMLImageContentPart(BaseChatMLContentPart): + image_url: ImageURL + """ + The image URL + """ + type: Literal["image_url"] = "image_url" + """ + The type (fixed to 'image_url') + """ + + +class ChatMLTextContentPart(BaseChatMLContentPart): + text: str + type: Literal["text"] = "text" + """ + The type (fixed to 'text') + """ + + +class InputChatMLMessage(BaseModel): + role: ChatMLRole + """ + The role of the message + """ + content: str | List[str] | List[ChatMLTextContentPart | ChatMLImageContentPart] + """ + The content parts of the message + """ + name: str | None = None + """ + Name + """ + continue_: Annotated[bool | None, Field(None, alias="continue")] + """ + Whether to continue this message or return a new one + """ + + +class Entry(BaseModel): + role: ChatMLRole + name: str + content: ( + List[ChatMLTextContentPart | ChatMLImageContentPart] + | Tools.Tool + | Tools.ChosenToolCall + | str + | Tools.ToolResponse + | List[ + List[ChatMLTextContentPart | ChatMLImageContentPart] + | Tools.Tool + | Tools.ChosenToolCall + | str + | Tools.ToolResponse + ] + ) + source: Source + timestamp: int + """ + This is the time that this event refers to. + """ + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + + +class History(BaseModel): + entries: List[Entry] + relations: List[Relation] + session_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ diff --git a/agents-api/agents_api/autogen/Executions.py b/agents-api/agents_api/autogen/Executions.py new file mode 100644 index 000000000..233a3337a --- /dev/null +++ b/agents-api/agents_api/autogen/Executions.py @@ -0,0 +1,127 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Annotated, Any, Dict, List, Literal +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + + +class CreateExecutionRequest(BaseModel): + """ + Payload for creating an execution + """ + + input: Dict[str, Any] + """ + The input to the execution + """ + + +class Status(str, Enum): + """ + The status of the execution + """ + + queued = "queued" + starting = "starting" + running = "running" + awaiting_input = "awaiting_input" + succeeded = "succeeded" + failed = "failed" + cancelled = "cancelled" + + +class Execution(BaseModel): + task_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + """ + The ID of the task that the execution is running + """ + status: Annotated[Status, Field(json_schema_extra={"readOnly": True})] + """ + The status of the execution + """ + input: Dict[str, Any] + """ + The input to the execution + """ + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + + +class TaskTokenResumeExecutionRequest(BaseModel): + status: Literal["running"] = "running" + task_token: str + """ + A Task Token is a unique identifier for a specific Task Execution. + """ + input: Dict[str, Any] | None = None + """ + The input to resume the execution with + """ + + +class Type(str, Enum): + finish = "finish" + wait = "wait" + error = "error" + step = "step" + cancelled = "cancelled" + + +class Transition(BaseModel): + type: Annotated[Type, Field(json_schema_extra={"readOnly": True})] + execution_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + outputs: Annotated[Dict[str, Any], Field(json_schema_extra={"readOnly": True})] + current: Annotated[List, Field(json_schema_extra={"readOnly": True})] + next: Annotated[List, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + + +class StatusModel(str, Enum): + queued = "queued" + starting = "starting" + running = "running" + awaiting_input = "awaiting_input" + succeeded = "succeeded" + failed = "failed" + cancelled = "cancelled" + + +class UpdateExecutionRequest(BaseModel): + status: StatusModel + + +class ResumeExecutionRequest(UpdateExecutionRequest): + status: Literal["running"] = "running" + input: Dict[str, Any] | None = None + """ + The input to resume the execution with + """ + + +class StopExecutionRequest(UpdateExecutionRequest): + status: Literal["cancelled"] = "cancelled" + reason: str + """ + The reason for stopping the execution + """ diff --git a/agents-api/agents_api/autogen/Jobs.py b/agents-api/agents_api/autogen/Jobs.py new file mode 100644 index 000000000..04e128546 --- /dev/null +++ b/agents-api/agents_api/autogen/Jobs.py @@ -0,0 +1,62 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Annotated +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + + +class JobState(str, Enum): + """ + Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) + """ + + pending = "pending" + in_progress = "in_progress" + retrying = "retrying" + succeeded = "succeeded" + aborted = "aborted" + failed = "failed" + unknown = "unknown" + + +class JobStatus(BaseModel): + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the job + """ + reason: str + """ + Reason for the current state of the job + """ + has_progress: bool + """ + Whether this Job supports progress updates + """ + progress: Annotated[float, Field(ge=0.0, le=100.0)] + """ + Progress percentage + """ + state: JobState + """ + Current state of the job + """ diff --git a/agents-api/agents_api/autogen/Sessions.py b/agents-api/agents_api/autogen/Sessions.py new file mode 100644 index 000000000..caab97c3f --- /dev/null +++ b/agents-api/agents_api/autogen/Sessions.py @@ -0,0 +1,190 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from typing import Annotated, Any, Dict, List +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + + +class CreateOrUpdateSessionRequest(BaseModel): + id: UUID + user: UUID | None = None + """ + User ID of user associated with this session + """ + users: List[UUID] | None = None + agent: UUID | None = None + """ + Agent ID of agent associated with this session + """ + agents: List[UUID] | None = None + situation: str + """ + A specific situation that sets the background for this session + """ + render_templates: bool + """ + Render system and assistant message content as jinja templates + """ + token_budget: int + """ + Threshold value for the adaptive context functionality + """ + context_overflow: str + """ + Action to start on context window overflow + """ + metadata: Dict[str, Any] | None = None + + +class CreateSessionRequest(BaseModel): + """ + Payload for creating a session + """ + + user: UUID | None = None + """ + User ID of user associated with this session + """ + users: List[UUID] | None = None + agent: UUID | None = None + """ + Agent ID of agent associated with this session + """ + agents: List[UUID] | None = None + situation: str + """ + A specific situation that sets the background for this session + """ + render_templates: bool + """ + Render system and assistant message content as jinja templates + """ + token_budget: int + """ + Threshold value for the adaptive context functionality + """ + context_overflow: str + """ + Action to start on context window overflow + """ + metadata: Dict[str, Any] | None = None + + +class PatchSessionRequest(BaseModel): + """ + Payload for patching a session + """ + + situation: str | None = ( + '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' + ) + """ + A specific situation that sets the background for this session + """ + render_templates: bool | None = False + """ + Render system and assistant message content as jinja templates + """ + token_budget: int | None = None + """ + Threshold value for the adaptive context functionality + """ + context_overflow: str | None = None + """ + Action to start on context window overflow + """ + metadata: Dict[str, Any] | None = None + + +class Session(BaseModel): + situation: str + """ + A specific situation that sets the background for this session + """ + summary: Annotated[str, Field(json_schema_extra={"readOnly": True})] + """ + Summary (null at the beginning) - generated automatically after every interaction + """ + render_templates: bool + """ + Render system and assistant message content as jinja templates + """ + token_budget: int + """ + Threshold value for the adaptive context functionality + """ + context_overflow: str + """ + Action to start on context window overflow + """ + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + metadata: Dict[str, Any] | None = None + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + kind: str | None = None + """ + Discriminator property for Session. + """ + + +class SingleAgentMultiUserSession(Session): + agent: UUID + users: List[UUID] + + +class SingleAgentNoUserSession(Session): + agent: UUID + + +class SingleAgentSingleUserSession(Session): + agent: UUID + user: UUID + + +class UpdateSessionRequest(BaseModel): + """ + Payload for updating a session + """ + + situation: str + """ + A specific situation that sets the background for this session + """ + render_templates: bool + """ + Render system and assistant message content as jinja templates + """ + token_budget: int + """ + Threshold value for the adaptive context functionality + """ + context_overflow: str + """ + Action to start on context window overflow + """ + metadata: Dict[str, Any] | None = None + + +class MultiAgentMultiUserSession(Session): + agents: List[UUID] + users: List[UUID] + + +class MultiAgentNoUserSession(Session): + agents: List[UUID] + + +class MultiAgentSingleUserSession(Session): + agents: List[UUID] + user: UUID diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py new file mode 100644 index 000000000..707d0ea50 --- /dev/null +++ b/agents-api/agents_api/autogen/Tasks.py @@ -0,0 +1,376 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from typing import Annotated, Any, Dict, List +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + +from . import Chat, Common, Entries, Tools + + +class Settings(BaseModel): + """ + Settings for the prompt + """ + + model: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Identifier of the model to be used + """ + stream: bool + """ + Indicates if the server should stream the response as it's generated + """ + stop: Annotated[List[str] | None, Field(None, max_length=4, min_length=1)] + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + seed: Annotated[int | None, Field(None, ge=-1, le=1000)] + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + max_tokens: Annotated[int | None, Field(None, ge=1)] + """ + The maximum number of tokens to generate in the chat completion + """ + logit_bias: Dict[str, Common.LogitBias] | None = None + """ + Modify the likelihood of specified tokens appearing in the completion + """ + response_format: Chat.CompletionResponseFormat | None = None + """ + Response format (set to `json_object` to restrict output to JSON) + """ + preset: Chat.GenerationPreset | None = None + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ + + +class SettingsModel(BaseModel): + """ + Settings for the prompt + """ + + model: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Identifier of the model to be used + """ + stream: bool + """ + Indicates if the server should stream the response as it's generated + """ + stop: Annotated[List[str] | None, Field(None, max_length=4, min_length=1)] + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + seed: Annotated[int | None, Field(None, ge=-1, le=1000)] + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + max_tokens: Annotated[int | None, Field(None, ge=1)] + """ + The maximum number of tokens to generate in the chat completion + """ + logit_bias: Dict[str, Common.LogitBias] | None = None + """ + Modify the likelihood of specified tokens appearing in the completion + """ + response_format: Chat.CompletionResponseFormat | None = None + """ + Response format (set to `json_object` to restrict output to JSON) + """ + frequency_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + presence_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + + +class SettingsModel1(BaseModel): + """ + Settings for the prompt + """ + + model: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Identifier of the model to be used + """ + stream: bool + """ + Indicates if the server should stream the response as it's generated + """ + stop: Annotated[List[str] | None, Field(None, max_length=4, min_length=1)] + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + seed: Annotated[int | None, Field(None, ge=-1, le=1000)] + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + max_tokens: Annotated[int | None, Field(None, ge=1)] + """ + The maximum number of tokens to generate in the chat completion + """ + logit_bias: Dict[str, Common.LogitBias] | None = None + """ + Modify the likelihood of specified tokens appearing in the completion + """ + response_format: Chat.CompletionResponseFormat | None = None + """ + Response format (set to `json_object` to restrict output to JSON) + """ + repetition_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + 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. + """ + length_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + min_p: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + Minimum probability compared to leading token to be considered + """ + + +class WorkflowStep(BaseModel): + kind: str | None = None + """ + Discriminator property for WorkflowStep. + """ + + +class YieldStep(WorkflowStep): + workflow: str + """ + The subworkflow to run + """ + arguments: Dict[str, str] + """ + The input parameters for the subworkflow + """ + + +class ErrorWorkflowStep(WorkflowStep): + error: str + """ + The error message + """ + + +class EvaluateStep(WorkflowStep): + evaluate: Dict[str, str] + """ + The expression to evaluate + """ + + +class IfElseWorkflowStep(WorkflowStep): + if_: Annotated[str, Field(alias="if")] + """ + The condition to evaluate + """ + then: WorkflowStep + """ + The steps to run if the condition is true + """ + else_: Annotated[WorkflowStep, Field(alias="else")] + """ + The steps to run if the condition is false + """ + + +class PromptStep(WorkflowStep): + prompt: str | List[Entries.InputChatMLMessage] + """ + The prompt to run + """ + settings: Settings | SettingsModel | SettingsModel1 + """ + Settings for the prompt + """ + + +class ToolCallStep(WorkflowStep): + tool: Annotated[ + str, Field(pattern="^(function|integration|system|api_call)\\.(\\w+)$") + ] + """ + The tool to run + """ + arguments: Dict[str, Any] + """ + The input parameters for the tool + """ + + +class CreateOrUpdateTaskRequest(BaseModel): + id: UUID + name: str + description: str + main: List[WorkflowStep] + """ + The entrypoint of the task. + """ + input_schema: Dict[str, Any] + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: List[Tools.CreateToolRequest] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + + +class CreateTaskRequest(BaseModel): + """ + Payload for creating a task + """ + + name: str + description: str + main: List[WorkflowStep] + """ + The entrypoint of the task. + """ + input_schema: Dict[str, Any] + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: List[Tools.CreateToolRequest] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + + +class PatchTaskRequest(BaseModel): + """ + Payload for patching a task + """ + + description: str | None = "" + main: List[WorkflowStep] | None = None + """ + The entrypoint of the task. + """ + input_schema: Dict[str, Any] | None = None + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: List[Tools.CreateToolRequest] | None = [] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool | None = True + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + + +class Task(BaseModel): + """ + Object describing a Task + """ + + name: str + description: str + main: List[WorkflowStep] + """ + The entrypoint of the task. + """ + input_schema: Dict[str, Any] + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: List[Tools.CreateToolRequest] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + agent_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + + +class UpdateTaskRequest(BaseModel): + """ + Payload for updating a task + """ + + description: str + main: List[WorkflowStep] + """ + The entrypoint of the task. + """ + input_schema: Dict[str, Any] + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: List[Tools.CreateToolRequest] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py new file mode 100644 index 000000000..ace4e0b51 --- /dev/null +++ b/agents-api/agents_api/autogen/Tools.py @@ -0,0 +1,214 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Annotated, Any, Dict, Literal +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + + +class FunctionCallOption(BaseModel): + name: str + """ + The name of the function + """ + + +class FunctionDef(BaseModel): + """ + Function definition + """ + + name: Annotated[str | None, Field("overriden", pattern="^[^\\W0-9]\\w*$")] + """ + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + """ + parameters: Dict[str, Any] + """ + The parameters the function accepts + """ + description: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Description of the function + """ + + +class FunctionDefUpdate(BaseModel): + """ + Function definition + """ + + name: Annotated[str | None, Field("overriden", pattern="^[^\\W0-9]\\w*$")] + """ + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + """ + parameters: Dict[str, Any] | None = None + """ + The parameters the function accepts + """ + description: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Description of the function + """ + + +class ToolResponse(BaseModel): + id: UUID + output: Dict[str, Any] + """ + The output of the tool + """ + + +class ToolType(str, Enum): + function = "function" + integration = "integration" + system = "system" + api_call = "api_call" + + +class UpdateToolRequest(BaseModel): + """ + Payload for updating a tool + """ + + type: ToolType + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + background: bool + """ + The tool should be run in the background (not supported at the moment) + """ + interactive: bool + """ + Whether the tool that can be run interactively (response should contain "stop" boolean field) + """ + function: FunctionDef | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + +class ChosenToolCall(BaseModel): + """ + The response tool value generated by the model + """ + + type: ToolType + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + function: FunctionCallOption | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + + +class CreateToolRequest(BaseModel): + """ + Payload for creating a tool + """ + + type: ToolType + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + background: bool + """ + The tool should be run in the background (not supported at the moment) + """ + interactive: bool + """ + Whether the tool that can be run interactively (response should contain "stop" boolean field) + """ + function: FunctionDef | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + +class PatchToolRequest(BaseModel): + """ + Payload for patching a tool + """ + + type: ToolType | None = None + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + background: bool | None = False + """ + The tool should be run in the background (not supported at the moment) + """ + interactive: bool | None = False + """ + Whether the tool that can be run interactively (response should contain "stop" boolean field) + """ + function: FunctionDefUpdate | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + +class Tool(BaseModel): + type: ToolType + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + background: bool + """ + The tool should be run in the background (not supported at the moment) + """ + interactive: bool + """ + Whether the tool that can be run interactively (response should contain "stop" boolean field) + """ + function: FunctionDef | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + + +class ChosenFunctionCall(ChosenToolCall): + type: Literal["function"] = "function" + function: FunctionCallOption + """ + The function to call + """ + + +class FunctionTool(Tool): + type: Literal["function"] = "function" + background: Literal[False] = False + interactive: Literal[False] = False + function: FunctionDef + """ + The function to call + """ diff --git a/agents-api/agents_api/autogen/Users.py b/agents-api/agents_api/autogen/Users.py new file mode 100644 index 000000000..884b48a95 --- /dev/null +++ b/agents-api/agents_api/autogen/Users.py @@ -0,0 +1,122 @@ +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 + +from __future__ import annotations + +from typing import Annotated, Any, Dict, List +from uuid import UUID + +from pydantic import AwareDatetime, BaseModel, Field + + +class CreateOrUpdateUserRequest(BaseModel): + id: UUID + metadata: Dict[str, Any] | None = None + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the user + """ + about: str + """ + About the user + """ + + +class CreateUserRequest(BaseModel): + """ + Payload for creating a user (and associated documents) + """ + + metadata: Dict[str, Any] | None = None + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the user + """ + about: str + """ + About the user + """ + docs: Annotated[List, Field(max_length=100)] + """ + Documents to index for this user. (Max: 100 items) + """ + + +class PatchUserRequest(BaseModel): + """ + Payload for patching a user + """ + + metadata: Dict[str, Any] | None = None + name: Annotated[ + str | None, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the user + """ + about: str | None = "" + """ + About the user + """ + + +class UpdateUserRequest(BaseModel): + """ + Payload for updating a user + """ + + metadata: Dict[str, Any] | None = None + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the user + """ + about: str + """ + About the user + """ + + +class User(BaseModel): + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + metadata: Dict[str, Any] | None = None + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + name: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] + """ + Name of the user + """ + about: str + """ + About the user + """ diff --git a/agents-api/agents_api/autogen/__init__.py b/agents-api/agents_api/autogen/__init__.py index 1db9bf447..4c26f83b8 100644 --- a/agents-api/agents_api/autogen/__init__.py +++ b/agents-api/agents_api/autogen/__init__.py @@ -1,3 +1,3 @@ -""" -This module contains automatically generated models based on the OpenAPI specification for the agents-api project. It includes definitions for key entities such as Users, Sessions, Agents, Tools, and their respective interactions. These models play a crucial role in defining the structure and constraints of data exchanged with the API endpoints, ensuring consistency and validation across the service. Generated models cover a wide range of functionalities from user management, session handling, agent configuration, to tool definitions, providing a comprehensive schema for the API's operations. -""" +# generated by datamodel-codegen: +# filename: openapi-0.4.0.yaml +# timestamp: 2024-07-15T21:10:09+00:00 diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py deleted file mode 100644 index 142f9886a..000000000 --- a/agents-api/agents_api/autogen/openapi_model.py +++ /dev/null @@ -1,1298 +0,0 @@ -# generated by datamodel-codegen: -# filename: openapi.yaml -# timestamp: 2024-07-10T09:10:51+00:00 - -from __future__ import annotations - -from enum import Enum -from typing import Annotated, Any, Dict, List, Literal, Set -from uuid import UUID - -from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel - - -class User(BaseModel): - name: str | None = "User" - """ - Name of the user - """ - about: str | None = None - """ - About the user - """ - created_at: AwareDatetime | None = None - """ - User created at (RFC-3339 format) - """ - updated_at: AwareDatetime | None = None - """ - User updated at (RFC-3339 format) - """ - id: UUID - """ - User id (UUID) - """ - metadata: Dict[str, Any] | None = None - """ - (Optional) metadata - """ - - -class FunctionParameters(BaseModel): - """ - The parameters the functions accepts, described as a JSON Schema object. - """ - - model_config = ConfigDict( - extra="allow", - ) - - -class FunctionDef(BaseModel): - description: str | None = None - """ - A description of what the function does, used by the model to choose when and how to call the function. - """ - name: str - """ - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - """ - parameters: FunctionParameters - """ - Parameters accepeted by this function - """ - - -class Type(str, Enum): - """ - Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now) - """ - - function = "function" - webhook = "webhook" - - -class Tool(BaseModel): - type: Type - """ - Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now) - """ - function: FunctionDef - """ - Function definition and parameters - """ - id: UUID - """ - Tool ID - """ - - -class Session(BaseModel): - id: UUID - """ - Session id (UUID) - """ - user_id: UUID | None = None - """ - User ID of user associated with this session - """ - agent_id: UUID - """ - Agent ID of agent associated with this session - """ - situation: str | None = None - """ - A specific situation that sets the background for this session - """ - summary: str | None = None - """ - (null at the beginning) - generated automatically after every interaction - """ - created_at: AwareDatetime | None = None - """ - Session created at (RFC-3339 format) - """ - updated_at: AwareDatetime | None = None - """ - Session updated at (RFC-3339 format) - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - render_templates: bool | None = False - """ - Render system and assistant message content as jinja templates - """ - token_budget: int | None = None - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str | None = None - """ - Action to start on context window overflow - """ - - -class CreateSessionRequest(BaseModel): - """ - A valid request payload for creating a session - """ - - user_id: UUID | None = None - """ - (Optional) User ID of user to associate with this session - """ - agent_id: UUID - """ - Agent ID of agent to associate with this session - """ - situation: str | None = None - """ - A specific situation that sets the background for this session - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - render_templates: bool | None = False - """ - Render system and assistant message content as jinja templates - """ - token_budget: int | None = None - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str | None = None - """ - Action to start on context window overflow - """ - - -class UpdateSessionRequest(BaseModel): - """ - A valid request payload for updating a session - """ - - situation: str - """ - Updated situation for this session - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - token_budget: int | None = None - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str | None = None - """ - Action to start on context window overflow - """ - - -class UpdateUserRequest(BaseModel): - """ - A valid request payload for updating a user - """ - - about: str - """ - About the user - """ - name: str - """ - Name of the user - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - - -class Target(str, Enum): - """ - Whether the suggestion is for the `agent` or a `user` - """ - - user = "user" - agent = "agent" - - -class Suggestion(BaseModel): - created_at: AwareDatetime | None = None - """ - Suggestion created at (RFC-3339 format) - """ - target: Target - """ - Whether the suggestion is for the `agent` or a `user` - """ - content: str - """ - The content of the suggestion - """ - message_id: UUID - """ - The message that produced it - """ - session_id: UUID - """ - Session this suggestion belongs to - """ - - -class Role(str, Enum): - """ - ChatML role (system|assistant|user|function_call|function) - """ - - user = "user" - assistant = "assistant" - system = "system" - function_call = "function_call" - function = "function" - - -class Role1(str, Enum): - """ - ChatML role (system|assistant|user|function_call|function|auto) - """ - - user = "user" - assistant = "assistant" - system = "system" - function_call = "function_call" - function = "function" - auto = "auto" - - -class Function(BaseModel): - name: str - """ - The name of the function to call. - """ - - -class NamedToolChoice(BaseModel): - """ - Specifies a tool the model should use. Use to force the model to call a specific function. - """ - - type: Literal["function"] = "function" - """ - The type of the tool. Currently, only `function` is supported. - """ - function: Function - - -class ToolChoiceOption1(str, Enum): - """ - `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. - - """ - - none = "none" - auto = "auto" - - -class FunctionCallOption(BaseModel): - """ - Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. - - """ - - name: str - """ - The name of the function to call. - """ - - -class CompletionUsage(BaseModel): - """ - Usage statistics for the completion request. - """ - - completion_tokens: int - """ - Number of tokens in the generated completion. - """ - prompt_tokens: int - """ - Number of tokens in the prompt. - """ - total_tokens: int - """ - Total number of tokens used in the request (prompt + completion). - """ - - -class FinishReason(str, Enum): - """ - The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. - """ - - stop = "stop" - length = "length" - tool_calls = "tool_calls" - content_filter = "content_filter" - function_call = "function_call" - - -class Memory(BaseModel): - agent_id: UUID - """ - ID of the agent - """ - user_id: UUID - """ - ID of the user - """ - content: str - """ - Content of the memory - """ - created_at: AwareDatetime - """ - Memory created at (RFC-3339 format) - """ - last_accessed_at: AwareDatetime | None = None - """ - Memory last accessed at (RFC-3339 format) - """ - timestamp: AwareDatetime | None = None - """ - Memory happened at (RFC-3339 format) - """ - sentiment: Annotated[float | None, Field(0, ge=-1.0, le=1.0)] - """ - Sentiment (valence) of the memory on a scale of -1 to 1 - """ - id: UUID - """ - Memory id (UUID) - """ - entities: List[Dict[str, Any]] - """ - List of entities mentioned in the memory - """ - - -class Type1(str, Enum): - """ - Must be one of `"text"`, `"regex"` or `"json_object"`. - """ - - text = "text" - json_object = "json_object" - regex = "regex" - - -class ResponseFormat(BaseModel): - """ - 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. - - """ - - type: Annotated[Type1 | None, Field("text", examples=["json_object"])] - """ - Must be one of `"text"`, `"regex"` or `"json_object"`. - """ - pattern: str | None = None - """ - Regular expression pattern to use if `type` is `"regex"` - """ - schema_: Annotated[Dict[str, Any] | None, Field({}, alias="schema")] - """ - JSON Schema to use if `type` is `"json_object"` - """ - - -class Stop(RootModel[List[Any]]): - root: Annotated[List[Any], Field(max_length=4, min_length=1)] - """ - Up to 4 sequences where the API will stop generating further tokens. - - """ - - -class Preset(str, Enum): - """ - Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) - """ - - problem_solving = "problem_solving" - conversational = "conversational" - fun = "fun" - prose = "prose" - creative = "creative" - business = "business" - deterministic = "deterministic" - code = "code" - multilingual = "multilingual" - - -class ChatSettings(BaseModel): - frequency_penalty: Annotated[float | None, Field(0, ge=-1.0, le=1.0)] - """ - (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: Annotated[float | None, Field(1, ge=0.0, le=2.0)] - """ - (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - """ - logit_bias: Dict[str, int] | None = None - """ - 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: Annotated[int | None, Field(200, ge=1, le=16384)] - """ - 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: Annotated[float | None, Field(0, ge=-1.0, le=1.0)] - """ - (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: Annotated[float | None, Field(1, ge=0.0, le=2.0)] - """ - (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: ResponseFormat | None = None - """ - 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: Annotated[int | None, Field(None, ge=-1, le=9999)] - """ - 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: str | Stop | None = None - """ - Up to 4 sequences where the API will stop generating further tokens. - - """ - stream: bool | None = False - """ - 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: Annotated[float | None, Field(0.75, examples=[0.75], ge=0.0, le=2.0)] - """ - 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: Annotated[float | None, Field(1, examples=[1], gt=0.0, le=1.0)] - """ - 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. - """ - min_p: Annotated[float | None, Field(0.01, examples=[0.01], ge=0.0, lt=1.0)] - """ - Minimum probability compared to leading token to be considered - """ - preset: Preset | None = None - """ - Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) - """ - model: str | None = None - """ - Model name - """ - - -class Preset1(str, Enum): - """ - Generation preset name (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - """ - - problem_solving = "problem_solving" - conversational = "conversational" - fun = "fun" - prose = "prose" - creative = "creative" - business = "business" - deterministic = "deterministic" - code = "code" - multilingual = "multilingual" - - -class AgentDefaultSettings(BaseModel): - frequency_penalty: Annotated[float | None, Field(0, ge=-2.0, le=2.0)] - """ - (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: Annotated[float | None, Field(1, ge=0.0, le=2.0)] - """ - (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - """ - presence_penalty: Annotated[float | None, Field(0, ge=-1.0, le=1.0)] - """ - (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: Annotated[float | None, Field(1, ge=0.0, le=2.0)] - """ - (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. - """ - temperature: Annotated[float | None, Field(0.75, examples=[0.75], ge=0.0, le=3.0)] - """ - 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: Annotated[float | None, Field(1, examples=[1], ge=0.0, le=1.0)] - """ - 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. - """ - min_p: Annotated[float | None, Field(0.01, examples=[0.01], ge=0.0, lt=1.0)] - """ - Minimum probability compared to leading token to be considered - """ - preset: Preset1 | None = None - """ - Generation preset name (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - """ - - -class ContentItem(RootModel[str]): - root: Annotated[str, Field(min_length=1)] - - -class Doc(BaseModel): - title: str - """ - Title describing what this bit of information contains - """ - content: List[ContentItem] | str - """ - Information content - """ - id: UUID - """ - ID of doc - """ - created_at: AwareDatetime - """ - Doc created at - """ - metadata: Dict[str, Any] | None = None - """ - optional metadata - """ - - -class CreateDoc(BaseModel): - title: str - """ - Title describing what this bit of information contains - """ - content: List[ContentItem] | str - """ - Information content - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - - -class MemoryAccessOptions(BaseModel): - recall: bool | None = True - """ - Whether previous memories should be recalled or not - """ - record: bool | None = True - """ - Whether this interaction should be recorded in history or not - """ - remember: bool | None = True - """ - Whether this interaction should form memories or not - """ - - -class CreateToolRequest(BaseModel): - type: Type - """ - Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now) - """ - function: FunctionDef - """ - Function definition and parameters - """ - - -class UpdateToolRequest(BaseModel): - function: FunctionDef - """ - Function definition and parameters - """ - - -class ResourceCreatedResponse(BaseModel): - id: UUID - created_at: AwareDatetime - jobs: Set[UUID] | None = None - """ - IDs (if any) of jobs created as part of this request - """ - - -class ResourceUpdatedResponse(BaseModel): - id: UUID - updated_at: AwareDatetime - jobs: Set[UUID] | None = None - """ - IDs (if any) of jobs created as part of this request - """ - - -class ResourceDeletedResponse(BaseModel): - id: UUID - deleted_at: AwareDatetime - jobs: Set[UUID] | None = None - """ - IDs (if any) of jobs created as part of this request - """ - - -class State(str, Enum): - """ - Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) - """ - - pending = "pending" - in_progress = "in_progress" - retrying = "retrying" - succeeded = "succeeded" - aborted = "aborted" - failed = "failed" - unknown = "unknown" - - -class JobStatus(BaseModel): - name: str - """ - Name of the job - """ - reason: str | None = None - """ - Reason for current state - """ - created_at: AwareDatetime - """ - Job created at (RFC-3339 format) - """ - updated_at: AwareDatetime | None = None - """ - Job updated at (RFC-3339 format) - """ - id: UUID - """ - Job id (UUID) - """ - has_progress: bool | None = False - """ - Whether this Job supports progress updates - """ - progress: Annotated[float | None, Field(0, ge=0.0, le=100.0)] - """ - Progress percentage - """ - state: State - """ - Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) - """ - - -class PatchUserRequest(BaseModel): - """ - A request for patching a user - """ - - about: str | None = None - """ - About the user - """ - name: str | None = None - """ - Name of the user - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - - -class PatchAgentRequest(BaseModel): - """ - A request for patching an agent - """ - - about: str | None = None - """ - About the agent - """ - name: str | None = None - """ - Name of the agent - """ - model: str | None = None - """ - Name of the model that the agent is supposed to use - """ - default_settings: AgentDefaultSettings | None = None - """ - Default model settings to start every session with - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - instructions: str | List[str] | None = None - """ - Instructions for the agent - """ - - -class PatchSessionRequest(BaseModel): - """ - A request for patching a session - """ - - situation: str | None = None - """ - Updated situation for this session - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - token_budget: int | None = None - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str | None = None - """ - Action to start on context window overflow - """ - - -class PartialFunctionDef(BaseModel): - description: str | None = None - """ - A description of what the function does, used by the model to choose when and how to call the function. - """ - name: str | None = None - """ - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - """ - parameters: FunctionParameters | None = None - """ - Parameters accepeted by this function - """ - - -class DocIds(BaseModel): - agent_doc_ids: List[str] - user_doc_ids: List[str] - - -class ChatMLTextContentPart(BaseModel): - type: Literal["text"] = "text" - """ - Fixed to 'text' - """ - text: str - """ - Text content part - """ - - -class Detail(str, Enum): - """ - image detail to feed into the model can be low | high | auto - """ - - low = "low" - high = "high" - auto = "auto" - - -class ImageUrl(BaseModel): - """ - Image content part, can be a URL or a base64-encoded image - """ - - url: str - """ - URL or base64 data url (e.g. `data:image/jpeg;base64,`) - """ - detail: Detail | None = "auto" # pytype: disable=annotation-type-mismatch - """ - image detail to feed into the model can be low | high | auto - """ - - -class ChatMLImageContentPart(BaseModel): - type: Literal["image_url"] = "image_url" - """ - Fixed to 'image_url' - """ - image_url: ImageUrl - """ - Image content part, can be a URL or a base64-encoded image - """ - - -class CELObject(BaseModel): - workflow: str - arguments: CELObject - - -class YieldWorkflowStep(CELObject): - pass - - -class ToolCallWorkflowStep(BaseModel): - tool_id: str - arguments: CELObject - - -class ErrorWorkflowStep(BaseModel): - error: str - - -class IfElseWorkflowStep(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - if_: Annotated[str, Field(alias="if")] - then: YieldWorkflowStep - else_: Annotated[YieldWorkflowStep, Field(alias="else")] - - -class CreateExecution(BaseModel): - task_id: UUID - arguments: Dict[str, Any] - """ - JSON Schema of parameters - """ - - -class ToolResponse(BaseModel): - id: UUID - """ - Optional Tool ID - """ - output: Dict[str, Any] - - -class Type3(str, Enum): - """ - Transition type - """ - - finish = "finish" - wait = "wait" - error = "error" - step = "step" - - -class UpdateExecutionTransitionRequest(BaseModel): - """ - Update execution transition request schema - """ - - type: Type3 - """ - Transition type - """ - from_: Annotated[List[str | int], Field(alias="from", max_length=2, min_length=2)] - """ - From state - """ - to: Annotated[List[str | int] | None, Field(None, max_length=2, min_length=2)] - """ - To state - """ - output: Dict[str, Any] - """ - Execution output - """ - task_token: str | None = None - """ - Task token - """ - metadata: Dict[str, Any] | None = None - """ - Custom metadata - """ - - -class Agent(BaseModel): - name: str - """ - Name of the agent - """ - about: str | None = "" - """ - About the agent - """ - created_at: AwareDatetime | None = None - """ - Agent created at (RFC-3339 format) - """ - updated_at: AwareDatetime | None = None - """ - Agent updated at (RFC-3339 format) - """ - id: UUID - """ - Agent id (UUID) - """ - default_settings: AgentDefaultSettings | None = None - """ - Default settings for all sessions created by this agent - """ - model: str - """ - The model to use with this agent - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - instructions: str | List[str] | None = None - """ - Instructions for the agent - """ - - -class CreateUserRequest(BaseModel): - """ - A valid request payload for creating a user - """ - - name: str | None = "User" - """ - Name of the user - """ - about: str | None = None - """ - About the user - """ - docs: List[CreateDoc] | None = None - """ - List of docs about user - """ - metadata: Dict[str, Any] | None = None - """ - (Optional) metadata - """ - - -class CreateAgentRequest(BaseModel): - """ - A valid request payload for creating an agent - """ - - name: str - """ - Name of the agent - """ - about: str | None = "" - """ - About the agent - """ - tools: List[CreateToolRequest] | None = None - """ - 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: AgentDefaultSettings | None = None - """ - Default model settings to start every session with - """ - model: str | None = "julep-ai/samantha-1-turbo" - """ - Name of the model that the agent is supposed to use - """ - docs: List[CreateDoc] | None = None - """ - List of docs about agent - """ - metadata: Dict[str, Any] | None = None - """ - (Optional) metadata - """ - instructions: str | List[str] | None = None - """ - Instructions for the agent - """ - - -class UpdateAgentRequest(BaseModel): - """ - A valid request payload for updating an agent - """ - - about: str - """ - About the agent - """ - name: str - """ - Name of the agent - """ - model: str | None = None - """ - Name of the model that the agent is supposed to use - """ - default_settings: AgentDefaultSettings | None = None - """ - Default model settings to start every session with - """ - metadata: Dict[str, Any] | None = None - """ - Optional metadata - """ - instructions: str | List[str] | None = None - """ - Instructions for the agent - """ - - -class ChatMLMessage(BaseModel): - role: Role - """ - ChatML role (system|assistant|user|function_call|function) - """ - content: str | List[ChatMLTextContentPart | ChatMLImageContentPart] - """ - ChatML content - """ - name: str | None = None - """ - ChatML name - """ - created_at: AwareDatetime - """ - Message created at (RFC-3339 format) - """ - id: UUID - """ - Message ID - """ - - -class InputChatMLMessage(BaseModel): - role: Role1 - """ - ChatML role (system|assistant|user|function_call|function|auto) - """ - content: str | List[ChatMLTextContentPart | ChatMLImageContentPart] - """ - ChatML content - """ - name: str | None = None - """ - ChatML name - """ - continue_: Annotated[bool | None, Field(False, alias="continue")] - """ - Whether to continue this message or return a new one - """ - - -class ChatInputData(BaseModel): - messages: Annotated[List[InputChatMLMessage], Field(min_length=1)] - """ - A list of new input messages comprising the conversation so far. - """ - tools: List[Tool] | None = None - """ - (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: NamedToolChoice | ToolChoiceOption1 | NamedToolChoice | None = None - """ - Can be one of existing tools given to the agent earlier or the ones included in the request - """ - - -class Response(BaseModel): - items: ChatMLMessage | None = None - - -class ChatResponse(BaseModel): - """ - Represents a chat completion response returned by model, based on the provided input. - """ - - id: UUID - """ - A unique identifier for the chat completion. - """ - finish_reason: FinishReason - """ - The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. - """ - response: List[List[ChatMLMessage] | Response] - """ - A list of chat completion messages produced as a response. - """ - usage: CompletionUsage - jobs: Set[UUID] | None = None - """ - IDs (if any) of jobs created as part of this request - """ - doc_ids: DocIds - - -class ChatInput(ChatInputData, ChatSettings, MemoryAccessOptions): - pass - - -class PatchToolRequest(BaseModel): - function: PartialFunctionDef - """ - Function definition and parameters - """ - - -class Execution(BaseModel): - id: UUID - task_id: UUID - created_at: UUID - arguments: Dict[str, Any] - """ - JSON Schema of parameters - """ - status: Annotated[ - str, - Field(pattern="^(queued|starting|running|awaiting_input|succeeded|failed)$"), - ] - """ - Execution Status - """ - - -class ExecutionTransition(BaseModel): - id: UUID - execution_id: UUID - created_at: AwareDatetime - outputs: Dict[str, Any] - """ - Outputs from an Execution Transition - """ - from_: Annotated[List[str | int], Field(alias="from")] - to: List[str | int] - type: Annotated[str, Field(pattern="^(finish|wait|error|step)$")] - """ - Execution Status - """ - - -class PromptWorkflowStep(BaseModel): - prompt: List[InputChatMLMessage] - """ - List of ChatML Messages in Jinja Templates - """ - settings: ChatSettings - - -class EvaluateWorkflowStep(BaseModel): - evaluate: CELObject - - -class CreateTask(BaseModel): - """ - Describes a Task - """ - - model_config = ConfigDict( - extra="allow", - ) - name: str - """ - Name of the Task - """ - description: str | None = None - """ - Optional Description of the Task - """ - tools_available: Set[UUID] | None = None - """ - Available Tools for the Task - """ - input_schema: Dict[str, Any] | None = None - """ - JSON Schema of parameters - """ - main: List[ - PromptWorkflowStep - | EvaluateWorkflowStep - | YieldWorkflowStep - | ToolCallWorkflowStep - | ErrorWorkflowStep - | IfElseWorkflowStep - ] - """ - Entrypoint Workflow for the Task - """ - - -class Task(BaseModel): - """ - Describes a Task - """ - - name: str - """ - Name of the Task - """ - description: str | None = None - """ - Optional Description of the Task - """ - tools_available: Set[UUID] | None = None - """ - Available Tools for the Task - """ - input_schema: Dict[str, Any] | None = None - """ - JSON Schema of parameters - """ - main: List[ - PromptWorkflowStep - | EvaluateWorkflowStep - | YieldWorkflowStep - | ToolCallWorkflowStep - | ErrorWorkflowStep - | IfElseWorkflowStep - ] - """ - Entrypoint Workflow for the Task - """ - id: UUID - """ - ID of the Task - """ - created_at: AwareDatetime - agent_id: UUID - - -CELObject.model_rebuild() -YieldWorkflowStep.model_rebuild() diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index b2302ca02..8b5946446 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -443,13 +443,13 @@ css = ["tinycss2 (>=1.1.0,<1.3)"] [[package]] name = "cachetools" -version = "5.3.3" +version = "5.4.0" description = "Extensible memoizing collections and decorators" optional = false python-versions = ">=3.7" files = [ - {file = "cachetools-5.3.3-py3-none-any.whl", hash = "sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945"}, - {file = "cachetools-5.3.3.tar.gz", hash = "sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105"}, + {file = "cachetools-5.4.0-py3-none-any.whl", hash = "sha256:3ae3b49a3d5e28a77a0be2b37dbcb89005058959cb2323858c2657c4a8cab474"}, + {file = "cachetools-5.4.0.tar.gz", hash = "sha256:b8adc2e7c07f105ced7bc56dbb6dfbe7c4a00acce20e2227b3f355be89bc6827"}, ] [[package]] @@ -474,13 +474,13 @@ urllib3 = ">=1.26.4" [[package]] name = "certifi" -version = "2024.6.2" +version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, - {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, + {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, + {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, ] [[package]] @@ -782,32 +782,32 @@ develop = ["coverage", "invoke", "path.py", "pylint", "pytest (>=3.2)", "pytest- [[package]] name = "dask" -version = "2024.6.2" +version = "2024.7.0" description = "Parallel PyData with Task Scheduling" optional = false python-versions = ">=3.9" files = [ - {file = "dask-2024.6.2-py3-none-any.whl", hash = "sha256:81b80ee015b2e057b93bb2d1bf13a866136e762e2b24bf54b6b621e8b86b7708"}, - {file = "dask-2024.6.2.tar.gz", hash = "sha256:d429d6b19e85fd1306ac37c188aaf99d03bbe69a6fe59d2b42882b2ac188686f"}, + {file = "dask-2024.7.0-py3-none-any.whl", hash = "sha256:0f30f218a1fe1c8e9a6ba8add1207088ba9ff049098d4ea4ce045fd5ff7ca914"}, + {file = "dask-2024.7.0.tar.gz", hash = "sha256:0060bae9a58b5b3ce7e0d97040e903b4d3db09ba49222101cfc40f9834a8a6bc"}, ] [package.dependencies] click = ">=8.1" cloudpickle = ">=1.5.0" -distributed = {version = "2024.6.2", optional = true, markers = "extra == \"distributed\""} +distributed = {version = "2024.7.0", optional = true, markers = "extra == \"distributed\""} fsspec = ">=2021.09.0" importlib-metadata = {version = ">=4.13.0", markers = "python_version < \"3.12\""} packaging = ">=20.0" -partd = ">=1.2.0" +partd = ">=1.4.0" pyyaml = ">=5.3.1" toolz = ">=0.10.0" [package.extras] array = ["numpy (>=1.21)"] complete = ["dask[array,dataframe,diagnostics,distributed]", "lz4 (>=4.3.2)", "pyarrow (>=7.0)", "pyarrow-hotfix"] -dataframe = ["dask-expr (>=1.1,<1.2)", "dask[array]", "pandas (>=1.3)"] +dataframe = ["dask-expr (>=1.1,<1.2)", "dask[array]", "pandas (>=2.0)"] diagnostics = ["bokeh (>=2.4.2)", "jinja2 (>=2.10.3)"] -distributed = ["distributed (==2024.6.2)"] +distributed = ["distributed (==2024.7.0)"] test = ["pandas[test]", "pre-commit", "pytest", "pytest-cov", "pytest-rerunfailures", "pytest-timeout", "pytest-xdist"] [[package]] @@ -827,13 +827,13 @@ typing-inspect = ">=0.4.0,<1" [[package]] name = "datamodel-code-generator" -version = "0.25.7" +version = "0.25.8" description = "Datamodel Code Generator" optional = false python-versions = "<4.0,>=3.7" files = [ - {file = "datamodel_code_generator-0.25.7-py3-none-any.whl", hash = "sha256:0b890a0c2bfe8c250f1ddc9656fabeb85db289d4d497a616c19bd80db004dd9a"}, - {file = "datamodel_code_generator-0.25.7.tar.gz", hash = "sha256:975079cb3776f10a71d6aa9914b73149c3fdf4c71825b0977951a959fefc77f6"}, + {file = "datamodel_code_generator-0.25.8-py3-none-any.whl", hash = "sha256:f9b216efad84d8dcb517273d2728875b6052b7e8dc4e5c13a597441cef236f6e"}, + {file = "datamodel_code_generator-0.25.8.tar.gz", hash = "sha256:b7838122b8133dae6e46f36a1cf25c0ccc66745da057988f490d00ab71121de7"}, ] [package.dependencies] @@ -856,33 +856,33 @@ validation = ["openapi-spec-validator (>=0.2.8,<0.7.0)", "prance (>=0.18.2)"] [[package]] name = "debugpy" -version = "1.8.1" +version = "1.8.2" description = "An implementation of the Debug Adapter Protocol for Python" optional = false python-versions = ">=3.8" files = [ - {file = "debugpy-1.8.1-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:3bda0f1e943d386cc7a0e71bfa59f4137909e2ed947fb3946c506e113000f741"}, - {file = "debugpy-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dda73bf69ea479c8577a0448f8c707691152e6c4de7f0c4dec5a4bc11dee516e"}, - {file = "debugpy-1.8.1-cp310-cp310-win32.whl", hash = "sha256:3a79c6f62adef994b2dbe9fc2cc9cc3864a23575b6e387339ab739873bea53d0"}, - {file = "debugpy-1.8.1-cp310-cp310-win_amd64.whl", hash = "sha256:7eb7bd2b56ea3bedb009616d9e2f64aab8fc7000d481faec3cd26c98a964bcdd"}, - {file = "debugpy-1.8.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:016a9fcfc2c6b57f939673c874310d8581d51a0fe0858e7fac4e240c5eb743cb"}, - {file = "debugpy-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd97ed11a4c7f6d042d320ce03d83b20c3fb40da892f994bc041bbc415d7a099"}, - {file = "debugpy-1.8.1-cp311-cp311-win32.whl", hash = "sha256:0de56aba8249c28a300bdb0672a9b94785074eb82eb672db66c8144fff673146"}, - {file = "debugpy-1.8.1-cp311-cp311-win_amd64.whl", hash = "sha256:1a9fe0829c2b854757b4fd0a338d93bc17249a3bf69ecf765c61d4c522bb92a8"}, - {file = "debugpy-1.8.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3ebb70ba1a6524d19fa7bb122f44b74170c447d5746a503e36adc244a20ac539"}, - {file = "debugpy-1.8.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a2e658a9630f27534e63922ebf655a6ab60c370f4d2fc5c02a5b19baf4410ace"}, - {file = "debugpy-1.8.1-cp312-cp312-win32.whl", hash = "sha256:caad2846e21188797a1f17fc09c31b84c7c3c23baf2516fed5b40b378515bbf0"}, - {file = "debugpy-1.8.1-cp312-cp312-win_amd64.whl", hash = "sha256:edcc9f58ec0fd121a25bc950d4578df47428d72e1a0d66c07403b04eb93bcf98"}, - {file = "debugpy-1.8.1-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:7a3afa222f6fd3d9dfecd52729bc2e12c93e22a7491405a0ecbf9e1d32d45b39"}, - {file = "debugpy-1.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d915a18f0597ef685e88bb35e5d7ab968964b7befefe1aaea1eb5b2640b586c7"}, - {file = "debugpy-1.8.1-cp38-cp38-win32.whl", hash = "sha256:92116039b5500633cc8d44ecc187abe2dfa9b90f7a82bbf81d079fcdd506bae9"}, - {file = "debugpy-1.8.1-cp38-cp38-win_amd64.whl", hash = "sha256:e38beb7992b5afd9d5244e96ad5fa9135e94993b0c551ceebf3fe1a5d9beb234"}, - {file = "debugpy-1.8.1-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:bfb20cb57486c8e4793d41996652e5a6a885b4d9175dd369045dad59eaacea42"}, - {file = "debugpy-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efd3fdd3f67a7e576dd869c184c5dd71d9aaa36ded271939da352880c012e703"}, - {file = "debugpy-1.8.1-cp39-cp39-win32.whl", hash = "sha256:58911e8521ca0c785ac7a0539f1e77e0ce2df753f786188f382229278b4cdf23"}, - {file = "debugpy-1.8.1-cp39-cp39-win_amd64.whl", hash = "sha256:6df9aa9599eb05ca179fb0b810282255202a66835c6efb1d112d21ecb830ddd3"}, - {file = "debugpy-1.8.1-py2.py3-none-any.whl", hash = "sha256:28acbe2241222b87e255260c76741e1fbf04fdc3b6d094fcf57b6c6f75ce1242"}, - {file = "debugpy-1.8.1.zip", hash = "sha256:f696d6be15be87aef621917585f9bb94b1dc9e8aced570db1b8a6fc14e8f9b42"}, + {file = "debugpy-1.8.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:7ee2e1afbf44b138c005e4380097d92532e1001580853a7cb40ed84e0ef1c3d2"}, + {file = "debugpy-1.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f8c3f7c53130a070f0fc845a0f2cee8ed88d220d6b04595897b66605df1edd6"}, + {file = "debugpy-1.8.2-cp310-cp310-win32.whl", hash = "sha256:f179af1e1bd4c88b0b9f0fa153569b24f6b6f3de33f94703336363ae62f4bf47"}, + {file = "debugpy-1.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:0600faef1d0b8d0e85c816b8bb0cb90ed94fc611f308d5fde28cb8b3d2ff0fe3"}, + {file = "debugpy-1.8.2-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:8a13417ccd5978a642e91fb79b871baded925d4fadd4dfafec1928196292aa0a"}, + {file = "debugpy-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acdf39855f65c48ac9667b2801234fc64d46778021efac2de7e50907ab90c634"}, + {file = "debugpy-1.8.2-cp311-cp311-win32.whl", hash = "sha256:2cbd4d9a2fc5e7f583ff9bf11f3b7d78dfda8401e8bb6856ad1ed190be4281ad"}, + {file = "debugpy-1.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:d3408fddd76414034c02880e891ea434e9a9cf3a69842098ef92f6e809d09afa"}, + {file = "debugpy-1.8.2-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:5d3ccd39e4021f2eb86b8d748a96c766058b39443c1f18b2dc52c10ac2757835"}, + {file = "debugpy-1.8.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62658aefe289598680193ff655ff3940e2a601765259b123dc7f89c0239b8cd3"}, + {file = "debugpy-1.8.2-cp312-cp312-win32.whl", hash = "sha256:bd11fe35d6fd3431f1546d94121322c0ac572e1bfb1f6be0e9b8655fb4ea941e"}, + {file = "debugpy-1.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:15bc2f4b0f5e99bf86c162c91a74c0631dbd9cef3c6a1d1329c946586255e859"}, + {file = "debugpy-1.8.2-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:5a019d4574afedc6ead1daa22736c530712465c0c4cd44f820d803d937531b2d"}, + {file = "debugpy-1.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40f062d6877d2e45b112c0bbade9a17aac507445fd638922b1a5434df34aed02"}, + {file = "debugpy-1.8.2-cp38-cp38-win32.whl", hash = "sha256:c78ba1680f1015c0ca7115671fe347b28b446081dada3fedf54138f44e4ba031"}, + {file = "debugpy-1.8.2-cp38-cp38-win_amd64.whl", hash = "sha256:cf327316ae0c0e7dd81eb92d24ba8b5e88bb4d1b585b5c0d32929274a66a5210"}, + {file = "debugpy-1.8.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:1523bc551e28e15147815d1397afc150ac99dbd3a8e64641d53425dba57b0ff9"}, + {file = "debugpy-1.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e24ccb0cd6f8bfaec68d577cb49e9c680621c336f347479b3fce060ba7c09ec1"}, + {file = "debugpy-1.8.2-cp39-cp39-win32.whl", hash = "sha256:7f8d57a98c5a486c5c7824bc0b9f2f11189d08d73635c326abef268f83950326"}, + {file = "debugpy-1.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:16c8dcab02617b75697a0a925a62943e26a0330da076e2a10437edd9f0bf3755"}, + {file = "debugpy-1.8.2-py2.py3-none-any.whl", hash = "sha256:16e16df3a98a35c63c3ab1e4d19be4cbc7fdda92d9ddc059294f18910928e0ca"}, + {file = "debugpy-1.8.2.zip", hash = "sha256:95378ed08ed2089221896b9b3a8d021e642c24edc8fef20e5d4342ca8be65c00"}, ] [[package]] @@ -920,19 +920,19 @@ files = [ [[package]] name = "distributed" -version = "2024.6.2" +version = "2024.7.0" description = "Distributed scheduler for Dask" optional = false python-versions = ">=3.9" files = [ - {file = "distributed-2024.6.2-py3-none-any.whl", hash = "sha256:0c1f8ccb1da71273ad8c53c598147dc37e60bef17142fd466cb72618a521880f"}, - {file = "distributed-2024.6.2.tar.gz", hash = "sha256:bb43b766ada860b163956607c80f99871d823c645e326c2b5e35f020351adc55"}, + {file = "distributed-2024.7.0-py3-none-any.whl", hash = "sha256:7c9e84c121bb8cac28d7391857ca6555acbe5edfb707d3fb2f54d2c04a0bf751"}, + {file = "distributed-2024.7.0.tar.gz", hash = "sha256:c8a1a71e14e73b340abee443ece5c8119465f97bdb8a00ff6933b945840a0052"}, ] [package.dependencies] click = ">=8.0" cloudpickle = ">=1.5.0" -dask = "2024.6.2" +dask = "2024.7.0" jinja2 = ">=2.10.3" locket = ">=1.0.0" msgpack = ">=1.0.0" @@ -1026,13 +1026,13 @@ tests = ["environs[django]", "pytest"] [[package]] name = "exceptiongroup" -version = "1.2.1" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, - {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -1125,13 +1125,13 @@ devel = ["colorama", "json-spec", "jsonschema", "pylint", "pytest", "pytest-benc [[package]] name = "filelock" -version = "3.15.3" +version = "3.15.4" description = "A platform independent file lock." optional = false python-versions = ">=3.8" files = [ - {file = "filelock-3.15.3-py3-none-any.whl", hash = "sha256:0151273e5b5d6cf753a61ec83b3a9b7d8821c39ae9af9d7ecf2f9e2f17404103"}, - {file = "filelock-3.15.3.tar.gz", hash = "sha256:e1199bf5194a2277273dacd50269f0d87d0682088a3c561c15674ea9005d8635"}, + {file = "filelock-3.15.4-py3-none-any.whl", hash = "sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7"}, + {file = "filelock-3.15.4.tar.gz", hash = "sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb"}, ] [package.extras] @@ -1252,13 +1252,13 @@ files = [ [[package]] name = "fsspec" -version = "2024.6.0" +version = "2024.6.1" description = "File-system specification" optional = false python-versions = ">=3.8" files = [ - {file = "fsspec-2024.6.0-py3-none-any.whl", hash = "sha256:58d7122eb8a1a46f7f13453187bfea4972d66bf01618d37366521b1998034cee"}, - {file = "fsspec-2024.6.0.tar.gz", hash = "sha256:f579960a56e6d8038a9efc8f9c77279ec12e6299aa86b0769a7e9c46b94527c2"}, + {file = "fsspec-2024.6.1-py3-none-any.whl", hash = "sha256:3cb443f8bcd2efb31295a5b9fdb02aee81d8452c80d28f97a6d0959e6cee101e"}, + {file = "fsspec-2024.6.1.tar.gz", hash = "sha256:fad7d7e209dd4c1208e3bbfda706620e0da5142bebbd9c384afb95b07e798e49"}, ] [package.extras] @@ -1302,13 +1302,13 @@ files = [ [[package]] name = "google-api-core" -version = "2.19.0" +version = "2.19.1" description = "Google API client core library" optional = false python-versions = ">=3.7" files = [ - {file = "google-api-core-2.19.0.tar.gz", hash = "sha256:cf1b7c2694047886d2af1128a03ae99e391108a08804f87cfd35970e49c9cd10"}, - {file = "google_api_core-2.19.0-py3-none-any.whl", hash = "sha256:8661eec4078c35428fd3f69a2c7ee29e342896b70f01d1a1cbcb334372dd6251"}, + {file = "google-api-core-2.19.1.tar.gz", hash = "sha256:f4695f1e3650b316a795108a76a1c416e6afb036199d1c1f1f110916df479ffd"}, + {file = "google_api_core-2.19.1-py3-none-any.whl", hash = "sha256:f12a9b8309b5e21d92483bbd47ce2c445861ec7d269ef6784ecc0ea8c1fa6125"}, ] [package.dependencies] @@ -1317,7 +1317,7 @@ googleapis-common-protos = ">=1.56.2,<2.0.dev0" grpcio = {version = ">=1.33.2,<2.0dev", optional = true, markers = "extra == \"grpc\""} grpcio-status = {version = ">=1.33.2,<2.0.dev0", optional = true, markers = "extra == \"grpc\""} proto-plus = ">=1.22.3,<2.0.0dev" -protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0.dev0" +protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0.dev0" requests = ">=2.18.0,<3.0.0.dev0" [package.extras] @@ -1327,13 +1327,13 @@ grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0.dev0)"] [[package]] name = "google-auth" -version = "2.30.0" +version = "2.32.0" description = "Google Authentication Library" optional = false python-versions = ">=3.7" files = [ - {file = "google-auth-2.30.0.tar.gz", hash = "sha256:ab630a1320f6720909ad76a7dbdb6841cdf5c66b328d690027e4867bdfb16688"}, - {file = "google_auth-2.30.0-py2.py3-none-any.whl", hash = "sha256:8df7da660f62757388b8a7f249df13549b3373f24388cb5d2f1dd91cc18180b5"}, + {file = "google_auth-2.32.0-py2.py3-none-any.whl", hash = "sha256:53326ea2ebec768070a94bee4e1b9194c9646ea0c2bd72422785bd0f9abfad7b"}, + {file = "google_auth-2.32.0.tar.gz", hash = "sha256:49315be72c55a6a37d62819e3573f6b416aca00721f7e3e31a008d928bf64022"}, ] [package.dependencies] @@ -1350,13 +1350,13 @@ requests = ["requests (>=2.20.0,<3.0.0.dev0)"] [[package]] name = "google-cloud-aiplatform" -version = "1.56.0" +version = "1.59.0" description = "Vertex AI API client library" optional = false python-versions = ">=3.8" files = [ - {file = "google-cloud-aiplatform-1.56.0.tar.gz", hash = "sha256:d4cfb085427dac01142915f523949ac2955d6c7f148d95017d3286a77caf5d5e"}, - {file = "google_cloud_aiplatform-1.56.0-py2.py3-none-any.whl", hash = "sha256:ee1ab3bd115c3caebf8ddfd3e47eeb8396a3ec2fc5f5baf1a5c295c8d64333ab"}, + {file = "google-cloud-aiplatform-1.59.0.tar.gz", hash = "sha256:2bebb59c0ba3e3b4b568305418ca1b021977988adbee8691a5bed09b037e7e63"}, + {file = "google_cloud_aiplatform-1.59.0-py2.py3-none-any.whl", hash = "sha256:549e6eb1844b0f853043309138ebe2db00de4bbd8197b3bde26804ac163ef52a"}, ] [package.dependencies] @@ -1367,7 +1367,7 @@ google-cloud-bigquery = ">=1.15.0,<3.20.0 || >3.20.0,<4.0.0dev" google-cloud-resource-manager = ">=1.3.3,<3.0.0dev" google-cloud-storage = ">=1.32.0,<3.0.0dev" packaging = ">=14.3" -proto-plus = ">=1.22.0,<2.0.0dev" +proto-plus = ">=1.22.3,<2.0.0dev" protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0dev" pydantic = "<3" shapely = "<3.0.0dev" @@ -1377,7 +1377,7 @@ autologging = ["mlflow (>=1.27.0,<=2.1.1)"] cloud-profiler = ["tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "werkzeug (>=2.0.0,<2.1.0dev)"] datasets = ["pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)"] endpoint = ["requests (>=2.28.1)"] -full = ["cloudpickle (<3.0)", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.109.1)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-cloud-logging (<4.0)", "google-vizier (>=0.1.6)", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.1.1)", "nest-asyncio (>=1.0.0,<1.6.0)", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "requests (>=2.28.1)", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0dev)"] +full = ["cloudpickle (<3.0)", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.109.1)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-cloud-logging (<4.0)", "google-vizier (>=0.1.6)", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.1.1)", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "requests (>=2.28.1)", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0dev)"] langchain = ["langchain (>=0.1.16,<0.3)", "langchain-core (<0.2)", "langchain-google-vertexai (<2)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)", "tenacity (<=8.3)"] langchain-testing = ["absl-py", "cloudpickle (>=3.0,<4.0)", "langchain (>=0.1.16,<0.3)", "langchain-core (<0.2)", "langchain-google-vertexai (<2)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)", "pytest-xdist", "tenacity (<=8.3)"] lit = ["explainable-ai-sdk (>=1.0.0)", "lit-nlp (==0.4.0)", "pandas (>=1.0.0)", "tensorflow (>=2.3.0,<3.0.0dev)"] @@ -1386,12 +1386,13 @@ pipelines = ["pyyaml (>=5.3.1,<7)"] prediction = ["docker (>=5.0.3)", "fastapi (>=0.71.0,<=0.109.1)", "httpx (>=0.23.0,<0.25.0)", "starlette (>=0.17.1)", "uvicorn[standard] (>=0.16.0)"] preview = ["cloudpickle (<3.0)", "google-cloud-logging (<4.0)"] private-endpoints = ["requests (>=2.28.1)", "urllib3 (>=1.21.1,<1.27)"] -rapid-evaluation = ["nest-asyncio (>=1.0.0,<1.6.0)", "pandas (>=1.0.0,<2.2.0)"] +rapid-evaluation = ["pandas (>=1.0.0,<2.2.0)", "tqdm (>=4.23.0)"] ray = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=6.0.1)", "pydantic (<2)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "setuptools (<70.0.0)"] ray-testing = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pytest-xdist", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "ray[train] (==2.9.3)", "scikit-learn", "setuptools (<70.0.0)", "tensorflow", "torch (>=2.0.0,<2.1.0)", "xgboost", "xgboost-ray"] reasoningengine = ["cloudpickle (>=3.0,<4.0)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)"] tensorboard = ["tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "werkzeug (>=2.0.0,<2.1.0dev)"] -testing = ["bigframes", "cloudpickle (<3.0)", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.109.1)", "google-api-core (>=2.11,<3.0.0)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-cloud-logging (<4.0)", "google-vizier (>=0.1.6)", "grpcio-testing", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "ipython", "kfp (>=2.6.0,<3.0.0)", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.1.1)", "nest-asyncio (>=1.0.0,<1.6.0)", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pyfakefs", "pytest-asyncio", "pytest-xdist", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "requests (>=2.28.1)", "requests-toolbelt (<1.0.0)", "scikit-learn", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (==2.13.0)", "tensorflow (==2.16.1)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "torch (>=2.0.0,<2.1.0)", "torch (>=2.2.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0dev)", "xgboost"] +testing = ["bigframes", "cloudpickle (<3.0)", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.109.1)", "google-api-core (>=2.11,<3.0.0)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-cloud-logging (<4.0)", "google-vizier (>=0.1.6)", "grpcio-testing", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "ipython", "kfp (>=2.6.0,<3.0.0)", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.1.1)", "nltk", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pyfakefs", "pytest-asyncio", "pytest-xdist", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "requests (>=2.28.1)", "requests-toolbelt (<1.0.0)", "scikit-learn", "sentencepiece (>=0.2.0)", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (==2.13.0)", "tensorflow (==2.16.1)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "torch (>=2.0.0,<2.1.0)", "torch (>=2.2.0)", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0dev)", "xgboost"] +tokenization = ["sentencepiece (>=0.2.0)"] vizier = ["google-vizier (>=0.1.6)"] xai = ["tensorflow (>=2.3.0,<3.0.0dev)"] @@ -1446,13 +1447,13 @@ grpc = ["grpcio (>=1.38.0,<2.0dev)", "grpcio-status (>=1.38.0,<2.0.dev0)"] [[package]] name = "google-cloud-resource-manager" -version = "1.12.3" +version = "1.12.4" description = "Google Cloud Resource Manager API client library" optional = false python-versions = ">=3.7" files = [ - {file = "google-cloud-resource-manager-1.12.3.tar.gz", hash = "sha256:809851824119834e4f2310b2c4f38621c1d16b2bb14d5b9f132e69c79d355e7f"}, - {file = "google_cloud_resource_manager-1.12.3-py2.py3-none-any.whl", hash = "sha256:92be7d6959927b76d90eafc4028985c37975a46ded5466a018f02e8649e113d4"}, + {file = "google-cloud-resource-manager-1.12.4.tar.gz", hash = "sha256:3eda914a925e92465ef80faaab7e0f7a9312d486dd4e123d2c76e04bac688ff0"}, + {file = "google_cloud_resource_manager-1.12.4-py2.py3-none-any.whl", hash = "sha256:0b6663585f7f862166c0fb4c55fdda721fce4dc2dc1d5b52d03ee4bf2653a85f"}, ] [package.dependencies] @@ -1460,7 +1461,7 @@ google-api-core = {version = ">=1.34.1,<2.0.dev0 || >=2.11.dev0,<3.0.0dev", extr google-auth = ">=2.14.1,<2.24.0 || >2.24.0,<2.25.0 || >2.25.0,<3.0.0dev" grpc-google-iam-v1 = ">=0.12.4,<1.0.0dev" proto-plus = ">=1.22.3,<2.0.0dev" -protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0dev" +protobuf = ">=3.20.2,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0dev" [[package]] name = "google-cloud-storage" @@ -1584,18 +1585,18 @@ requests = ["requests (>=2.18.0,<3.0.0dev)"] [[package]] name = "googleapis-common-protos" -version = "1.63.1" +version = "1.63.2" description = "Common protobufs used in Google APIs" optional = false python-versions = ">=3.7" files = [ - {file = "googleapis-common-protos-1.63.1.tar.gz", hash = "sha256:c6442f7a0a6b2a80369457d79e6672bb7dcbaab88e0848302497e3ec80780a6a"}, - {file = "googleapis_common_protos-1.63.1-py2.py3-none-any.whl", hash = "sha256:0e1c2cdfcbc354b76e4a211a35ea35d6926a835cba1377073c4861db904a1877"}, + {file = "googleapis-common-protos-1.63.2.tar.gz", hash = "sha256:27c5abdffc4911f28101e635de1533fb4cfd2c37fbaa9174587c799fac90aa87"}, + {file = "googleapis_common_protos-1.63.2-py2.py3-none-any.whl", hash = "sha256:27a2499c7e8aff199665b22741997e485eccc8645aa9176c7c988e6fae507945"}, ] [package.dependencies] grpcio = {version = ">=1.44.0,<2.0.0.dev0", optional = true, markers = "extra == \"grpc\""} -protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0.dev0" +protobuf = ">=3.20.2,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0.dev0" [package.extras] grpc = ["grpcio (>=1.44.0,<2.0.0.dev0)"] @@ -1673,19 +1674,19 @@ test = ["objgraph", "psutil"] [[package]] name = "grpc-google-iam-v1" -version = "0.13.0" +version = "0.13.1" description = "IAM API client library" optional = false python-versions = ">=3.7" files = [ - {file = "grpc-google-iam-v1-0.13.0.tar.gz", hash = "sha256:fad318608b9e093258fbf12529180f400d1c44453698a33509cc6ecf005b294e"}, - {file = "grpc_google_iam_v1-0.13.0-py2.py3-none-any.whl", hash = "sha256:53902e2af7de8df8c1bd91373d9be55b0743ec267a7428ea638db3775becae89"}, + {file = "grpc-google-iam-v1-0.13.1.tar.gz", hash = "sha256:3ff4b2fd9d990965e410965253c0da6f66205d5a8291c4c31c6ebecca18a9001"}, + {file = "grpc_google_iam_v1-0.13.1-py2.py3-none-any.whl", hash = "sha256:c3e86151a981811f30d5e7330f271cee53e73bb87755e88cc3b6f0c7b5fe374e"}, ] [package.dependencies] googleapis-common-protos = {version = ">=1.56.0,<2.0.0dev", extras = ["grpc"]} grpcio = ">=1.44.0,<2.0.0dev" -protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0dev" +protobuf = ">=3.20.2,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0dev" [[package]] name = "grpcio" @@ -1889,13 +1890,13 @@ networkx = ">=2" [[package]] name = "importlib-metadata" -version = "7.2.0" +version = "8.0.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-7.2.0-py3-none-any.whl", hash = "sha256:04e4aad329b8b948a5711d394fa8759cb80f009225441b4f2a02bd4d8e5f426c"}, - {file = "importlib_metadata-7.2.0.tar.gz", hash = "sha256:3ff4519071ed42740522d494d04819b666541b9752c43012f85afb2cc220fcc6"}, + {file = "importlib_metadata-8.0.0-py3-none-any.whl", hash = "sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f"}, + {file = "importlib_metadata-8.0.0.tar.gz", hash = "sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812"}, ] [package.dependencies] @@ -1923,13 +1924,13 @@ testing = ["pygments", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdo [[package]] name = "ipykernel" -version = "6.29.4" +version = "6.29.5" description = "IPython Kernel for Jupyter" optional = false python-versions = ">=3.8" files = [ - {file = "ipykernel-6.29.4-py3-none-any.whl", hash = "sha256:1181e653d95c6808039c509ef8e67c4126b3b3af7781496c7cbfb5ed938a27da"}, - {file = "ipykernel-6.29.4.tar.gz", hash = "sha256:3d44070060f9475ac2092b760123fadf105d2e2493c24848b6691a7c4f42af5c"}, + {file = "ipykernel-6.29.5-py3-none-any.whl", hash = "sha256:afdb66ba5aa354b09b91379bac28ae4afebbb30e8b39510c9690afb7a10421b5"}, + {file = "ipykernel-6.29.5.tar.gz", hash = "sha256:f093a22c4a40f8828f8e330a9c297cb93dcab13bd9678ded6de8e5cf81c56215"}, ] [package.dependencies] @@ -1956,13 +1957,13 @@ test = ["flaky", "ipyparallel", "pre-commit", "pytest (>=7.0)", "pytest-asyncio [[package]] name = "ipython" -version = "8.25.0" +version = "8.26.0" description = "IPython: Productive Interactive Computing" optional = false python-versions = ">=3.10" files = [ - {file = "ipython-8.25.0-py3-none-any.whl", hash = "sha256:53eee7ad44df903a06655871cbab66d156a051fd86f3ec6750470ac9604ac1ab"}, - {file = "ipython-8.25.0.tar.gz", hash = "sha256:c6ed726a140b6e725b911528f80439c534fac915246af3efc39440a6b0f9d716"}, + {file = "ipython-8.26.0-py3-none-any.whl", hash = "sha256:e6b347c27bdf9c32ee9d31ae85defc525755a1869f14057e900675b9e8d6e6ff"}, + {file = "ipython-8.26.0.tar.gz", hash = "sha256:1cec0fbba8404af13facebe83d04436a7434c7400e59f47acf467c64abd0956c"}, ] [package.dependencies] @@ -1989,7 +1990,7 @@ nbformat = ["nbformat"] notebook = ["ipywidgets", "notebook"] parallel = ["ipyparallel"] qtconsole = ["qtconsole"] -test = ["pickleshare", "pytest", "pytest-asyncio (<0.22)", "testpath"] +test = ["packaging", "pickleshare", "pytest", "pytest-asyncio (<0.22)", "testpath"] test-extra = ["curio", "ipython[test]", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.23)", "pandas", "trio"] [[package]] @@ -2153,13 +2154,13 @@ files = [ [[package]] name = "jsonschema" -version = "4.22.0" +version = "4.23.0" description = "An implementation of JSON Schema validation for Python" optional = false python-versions = ">=3.8" files = [ - {file = "jsonschema-4.22.0-py3-none-any.whl", hash = "sha256:ff4cfd6b1367a40e7bc6411caec72effadd3db0bbe5017de188f2d6108335802"}, - {file = "jsonschema-4.22.0.tar.gz", hash = "sha256:5b22d434a45935119af990552c862e5d6d564e8f6601206b305a61fdf661a2b7"}, + {file = "jsonschema-4.23.0-py3-none-any.whl", hash = "sha256:fbadb6f8b144a8f8cf9f0b89ba94501d143e50411a1278633f56a7acf7fd5566"}, + {file = "jsonschema-4.23.0.tar.gz", hash = "sha256:d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4"}, ] [package.dependencies] @@ -2174,11 +2175,11 @@ rfc3339-validator = {version = "*", optional = true, markers = "extra == \"forma rfc3986-validator = {version = ">0.1.0", optional = true, markers = "extra == \"format-nongpl\""} rpds-py = ">=0.7.1" uri-template = {version = "*", optional = true, markers = "extra == \"format-nongpl\""} -webcolors = {version = ">=1.11", optional = true, markers = "extra == \"format-nongpl\""} +webcolors = {version = ">=24.6.0", optional = true, markers = "extra == \"format-nongpl\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] -format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] +format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=24.6.0)"] [[package]] name = "jsonschema-specifications" @@ -2215,20 +2216,20 @@ typing-extensions = ">=4.0.0,<5.0.0" [[package]] name = "jupyter-ai" -version = "2.18.1" +version = "2.19.0" description = "A generative AI extension for JupyterLab" optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_ai-2.18.1-py3-none-any.whl", hash = "sha256:f6eb5af6d5db3d74c69753ea27f2fa63b4fb66f52e00cd92fee95d12ea087691"}, - {file = "jupyter_ai-2.18.1.tar.gz", hash = "sha256:d2fecbbc7c25b020f6edef4335e48ed4ce5c8c429dfb7c7cd6a950a44ca3d537"}, + {file = "jupyter_ai-2.19.0-py3-none-any.whl", hash = "sha256:d03540ea42b181946ccad7287b4306bd8f37af09d9f7b3e45b0adc0eb0449b34"}, + {file = "jupyter_ai-2.19.0.tar.gz", hash = "sha256:746220ac7205f57047cb8c7bb1c94c7a02cdbad9af0c534762cd06168cd66b8e"}, ] [package.dependencies] aiosqlite = ">=0.18" dask = {version = "*", extras = ["distributed"]} deepmerge = ">=1.0" -faiss-cpu = "*" +faiss-cpu = "<=1.8.0" importlib-metadata = ">=5.2.0" jupyter-ai-magics = ">=2.13.0" jupyter-server = ">=1.6,<3" @@ -2348,13 +2349,13 @@ jupyter-server = ">=1.1.2" [[package]] name = "jupyter-server" -version = "2.14.1" +version = "2.14.2" description = "The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications." optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_server-2.14.1-py3-none-any.whl", hash = "sha256:16f7177c3a4ea8fe37784e2d31271981a812f0b2874af17339031dc3510cc2a5"}, - {file = "jupyter_server-2.14.1.tar.gz", hash = "sha256:12558d158ec7a0653bf96cc272bc7ad79e0127d503b982ed144399346694f726"}, + {file = "jupyter_server-2.14.2-py3-none-any.whl", hash = "sha256:47ff506127c2f7851a17bf4713434208fc490955d0e8632e95014a9a9afbeefd"}, + {file = "jupyter_server-2.14.2.tar.gz", hash = "sha256:66095021aa9638ced276c248b1d81862e4c50f292d575920bbe960de1c56b12b"}, ] [package.dependencies] @@ -2403,13 +2404,13 @@ test = ["jupyter-server (>=2.0.0)", "pytest (>=7.0)", "pytest-jupyter[server] (> [[package]] name = "jupyterlab" -version = "4.2.2" +version = "4.2.3" description = "JupyterLab computational environment" optional = false python-versions = ">=3.8" files = [ - {file = "jupyterlab-4.2.2-py3-none-any.whl", hash = "sha256:59ee9b839f43308c3dfd55d72d1f1a299ed42a7f91f2d1afe9c12a783f9e525f"}, - {file = "jupyterlab-4.2.2.tar.gz", hash = "sha256:a534b6a25719a92a40d514fb133a9fe8f0d9981b0bbce5d8a5fcaa33344a3038"}, + {file = "jupyterlab-4.2.3-py3-none-any.whl", hash = "sha256:0b59d11808e84bb84105c73364edfa867dd475492429ab34ea388a52f2e2e596"}, + {file = "jupyterlab-4.2.3.tar.gz", hash = "sha256:df6e46969ea51d66815167f23d92f105423b7f1f06fa604d4f44aeb018c82c7b"}, ] [package.dependencies] @@ -2605,18 +2606,18 @@ extended-testing = ["beautifulsoup4 (>=4.12.3,<5.0.0)", "lxml (>=4.9.3,<6.0)"] [[package]] name = "langsmith" -version = "0.1.81" +version = "0.1.85" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = "<4.0,>=3.8.1" files = [ - {file = "langsmith-0.1.81-py3-none-any.whl", hash = "sha256:3251d823225eef23ee541980b9d9e506367eabbb7f985a086b5d09e8f78ba7e9"}, - {file = "langsmith-0.1.81.tar.gz", hash = "sha256:585ef3a2251380bd2843a664c9a28da4a7d28432e3ee8bcebf291ffb8e1f0af0"}, + {file = "langsmith-0.1.85-py3-none-any.whl", hash = "sha256:c1f94384f10cea96f7b4d33fd3db7ec180c03c7468877d50846f881d2017ff94"}, + {file = "langsmith-0.1.85.tar.gz", hash = "sha256:acff31f9e53efa48586cf8e32f65625a335c74d7c4fa306d1655ac18452296f6"}, ] [package.dependencies] orjson = ">=3.9.14,<4.0.0" -pydantic = ">=1,<3" +pydantic = {version = ">=1,<3", markers = "python_full_version < \"3.12.4\""} requests = ">=2,<3" [[package]] @@ -3287,13 +3288,13 @@ files = [ [[package]] name = "openai" -version = "1.35.3" +version = "1.35.13" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.35.3-py3-none-any.whl", hash = "sha256:7b26544cef80f125431c073ffab3811d2421fbb9e30d3bd5c2436aba00b042d5"}, - {file = "openai-1.35.3.tar.gz", hash = "sha256:d6177087f150b381d49499be782d764213fdf638d391b29ca692b84dd675a389"}, + {file = "openai-1.35.13-py3-none-any.whl", hash = "sha256:36ec3e93e0d1f243f69be85c89b9221a471c3e450dfd9df16c9829e3cdf63e60"}, + {file = "openai-1.35.13.tar.gz", hash = "sha256:c684f3945608baf7d2dcc0ef3ee6f3e27e4c66f21076df0b47be45d57e6ae6e4"}, ] [package.dependencies] @@ -3310,57 +3311,62 @@ datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] [[package]] name = "orjson" -version = "3.10.5" +version = "3.10.6" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" optional = false python-versions = ">=3.8" files = [ - {file = "orjson-3.10.5-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:545d493c1f560d5ccfc134803ceb8955a14c3fcb47bbb4b2fee0232646d0b932"}, - {file = "orjson-3.10.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f4324929c2dd917598212bfd554757feca3e5e0fa60da08be11b4aa8b90013c1"}, - {file = "orjson-3.10.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8c13ca5e2ddded0ce6a927ea5a9f27cae77eee4c75547b4297252cb20c4d30e6"}, - {file = "orjson-3.10.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b6c8e30adfa52c025f042a87f450a6b9ea29649d828e0fec4858ed5e6caecf63"}, - {file = "orjson-3.10.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:338fd4f071b242f26e9ca802f443edc588fa4ab60bfa81f38beaedf42eda226c"}, - {file = "orjson-3.10.5-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:6970ed7a3126cfed873c5d21ece1cd5d6f83ca6c9afb71bbae21a0b034588d96"}, - {file = "orjson-3.10.5-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:235dadefb793ad12f7fa11e98a480db1f7c6469ff9e3da5e73c7809c700d746b"}, - {file = "orjson-3.10.5-cp310-none-win32.whl", hash = "sha256:be79e2393679eda6a590638abda16d167754393f5d0850dcbca2d0c3735cebe2"}, - {file = "orjson-3.10.5-cp310-none-win_amd64.whl", hash = "sha256:c4a65310ccb5c9910c47b078ba78e2787cb3878cdded1702ac3d0da71ddc5228"}, - {file = "orjson-3.10.5-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:cdf7365063e80899ae3a697def1277c17a7df7ccfc979990a403dfe77bb54d40"}, - {file = "orjson-3.10.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b68742c469745d0e6ca5724506858f75e2f1e5b59a4315861f9e2b1df77775a"}, - {file = "orjson-3.10.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7d10cc1b594951522e35a3463da19e899abe6ca95f3c84c69e9e901e0bd93d38"}, - {file = "orjson-3.10.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dcbe82b35d1ac43b0d84072408330fd3295c2896973112d495e7234f7e3da2e1"}, - {file = "orjson-3.10.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10c0eb7e0c75e1e486c7563fe231b40fdd658a035ae125c6ba651ca3b07936f5"}, - {file = "orjson-3.10.5-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:53ed1c879b10de56f35daf06dbc4a0d9a5db98f6ee853c2dbd3ee9d13e6f302f"}, - {file = "orjson-3.10.5-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:099e81a5975237fda3100f918839af95f42f981447ba8f47adb7b6a3cdb078fa"}, - {file = "orjson-3.10.5-cp311-none-win32.whl", hash = "sha256:1146bf85ea37ac421594107195db8bc77104f74bc83e8ee21a2e58596bfb2f04"}, - {file = "orjson-3.10.5-cp311-none-win_amd64.whl", hash = "sha256:36a10f43c5f3a55c2f680efe07aa93ef4a342d2960dd2b1b7ea2dd764fe4a37c"}, - {file = "orjson-3.10.5-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:68f85ecae7af14a585a563ac741b0547a3f291de81cd1e20903e79f25170458f"}, - {file = "orjson-3.10.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28afa96f496474ce60d3340fe8d9a263aa93ea01201cd2bad844c45cd21f5268"}, - {file = "orjson-3.10.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9cd684927af3e11b6e754df80b9ffafd9fb6adcaa9d3e8fdd5891be5a5cad51e"}, - {file = "orjson-3.10.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d21b9983da032505f7050795e98b5d9eee0df903258951566ecc358f6696969"}, - {file = "orjson-3.10.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ad1de7fef79736dde8c3554e75361ec351158a906d747bd901a52a5c9c8d24b"}, - {file = "orjson-3.10.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2d97531cdfe9bdd76d492e69800afd97e5930cb0da6a825646667b2c6c6c0211"}, - {file = "orjson-3.10.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d69858c32f09c3e1ce44b617b3ebba1aba030e777000ebdf72b0d8e365d0b2b3"}, - {file = "orjson-3.10.5-cp312-none-win32.whl", hash = "sha256:64c9cc089f127e5875901ac05e5c25aa13cfa5dbbbd9602bda51e5c611d6e3e2"}, - {file = "orjson-3.10.5-cp312-none-win_amd64.whl", hash = "sha256:b2efbd67feff8c1f7728937c0d7f6ca8c25ec81373dc8db4ef394c1d93d13dc5"}, - {file = "orjson-3.10.5-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:03b565c3b93f5d6e001db48b747d31ea3819b89abf041ee10ac6988886d18e01"}, - {file = "orjson-3.10.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:584c902ec19ab7928fd5add1783c909094cc53f31ac7acfada817b0847975f26"}, - {file = "orjson-3.10.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5a35455cc0b0b3a1eaf67224035f5388591ec72b9b6136d66b49a553ce9eb1e6"}, - {file = "orjson-3.10.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1670fe88b116c2745a3a30b0f099b699a02bb3482c2591514baf5433819e4f4d"}, - {file = "orjson-3.10.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:185c394ef45b18b9a7d8e8f333606e2e8194a50c6e3c664215aae8cf42c5385e"}, - {file = "orjson-3.10.5-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ca0b3a94ac8d3886c9581b9f9de3ce858263865fdaa383fbc31c310b9eac07c9"}, - {file = "orjson-3.10.5-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:dfc91d4720d48e2a709e9c368d5125b4b5899dced34b5400c3837dadc7d6271b"}, - {file = "orjson-3.10.5-cp38-none-win32.whl", hash = "sha256:c05f16701ab2a4ca146d0bca950af254cb7c02f3c01fca8efbbad82d23b3d9d4"}, - {file = "orjson-3.10.5-cp38-none-win_amd64.whl", hash = "sha256:8a11d459338f96a9aa7f232ba95679fc0c7cedbd1b990d736467894210205c09"}, - {file = "orjson-3.10.5-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:85c89131d7b3218db1b24c4abecea92fd6c7f9fab87441cfc342d3acc725d807"}, - {file = "orjson-3.10.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb66215277a230c456f9038d5e2d84778141643207f85336ef8d2a9da26bd7ca"}, - {file = "orjson-3.10.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:51bbcdea96cdefa4a9b4461e690c75ad4e33796530d182bdd5c38980202c134a"}, - {file = "orjson-3.10.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbead71dbe65f959b7bd8cf91e0e11d5338033eba34c114f69078d59827ee139"}, - {file = "orjson-3.10.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5df58d206e78c40da118a8c14fc189207fffdcb1f21b3b4c9c0c18e839b5a214"}, - {file = "orjson-3.10.5-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c4057c3b511bb8aef605616bd3f1f002a697c7e4da6adf095ca5b84c0fd43595"}, - {file = "orjson-3.10.5-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b39e006b00c57125ab974362e740c14a0c6a66ff695bff44615dcf4a70ce2b86"}, - {file = "orjson-3.10.5-cp39-none-win32.whl", hash = "sha256:eded5138cc565a9d618e111c6d5c2547bbdd951114eb822f7f6309e04db0fb47"}, - {file = "orjson-3.10.5-cp39-none-win_amd64.whl", hash = "sha256:cc28e90a7cae7fcba2493953cff61da5a52950e78dc2dacfe931a317ee3d8de7"}, - {file = "orjson-3.10.5.tar.gz", hash = "sha256:7a5baef8a4284405d96c90c7c62b755e9ef1ada84c2406c24a9ebec86b89f46d"}, + {file = "orjson-3.10.6-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:fb0ee33124db6eaa517d00890fc1a55c3bfe1cf78ba4a8899d71a06f2d6ff5c7"}, + {file = "orjson-3.10.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c1c4b53b24a4c06547ce43e5fee6ec4e0d8fe2d597f4647fc033fd205707365"}, + {file = "orjson-3.10.6-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eadc8fd310edb4bdbd333374f2c8fec6794bbbae99b592f448d8214a5e4050c0"}, + {file = "orjson-3.10.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:61272a5aec2b2661f4fa2b37c907ce9701e821b2c1285d5c3ab0207ebd358d38"}, + {file = "orjson-3.10.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57985ee7e91d6214c837936dc1608f40f330a6b88bb13f5a57ce5257807da143"}, + {file = "orjson-3.10.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:633a3b31d9d7c9f02d49c4ab4d0a86065c4a6f6adc297d63d272e043472acab5"}, + {file = "orjson-3.10.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:1c680b269d33ec444afe2bdc647c9eb73166fa47a16d9a75ee56a374f4a45f43"}, + {file = "orjson-3.10.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f759503a97a6ace19e55461395ab0d618b5a117e8d0fbb20e70cfd68a47327f2"}, + {file = "orjson-3.10.6-cp310-none-win32.whl", hash = "sha256:95a0cce17f969fb5391762e5719575217bd10ac5a189d1979442ee54456393f3"}, + {file = "orjson-3.10.6-cp310-none-win_amd64.whl", hash = "sha256:df25d9271270ba2133cc88ee83c318372bdc0f2cd6f32e7a450809a111efc45c"}, + {file = "orjson-3.10.6-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:b1ec490e10d2a77c345def52599311849fc063ae0e67cf4f84528073152bb2ba"}, + {file = "orjson-3.10.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55d43d3feb8f19d07e9f01e5b9be4f28801cf7c60d0fa0d279951b18fae1932b"}, + {file = "orjson-3.10.6-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ac3045267e98fe749408eee1593a142e02357c5c99be0802185ef2170086a863"}, + {file = "orjson-3.10.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c27bc6a28ae95923350ab382c57113abd38f3928af3c80be6f2ba7eb8d8db0b0"}, + {file = "orjson-3.10.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d27456491ca79532d11e507cadca37fb8c9324a3976294f68fb1eff2dc6ced5a"}, + {file = "orjson-3.10.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05ac3d3916023745aa3b3b388e91b9166be1ca02b7c7e41045da6d12985685f0"}, + {file = "orjson-3.10.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1335d4ef59ab85cab66fe73fd7a4e881c298ee7f63ede918b7faa1b27cbe5212"}, + {file = "orjson-3.10.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4bbc6d0af24c1575edc79994c20e1b29e6fb3c6a570371306db0993ecf144dc5"}, + {file = "orjson-3.10.6-cp311-none-win32.whl", hash = "sha256:450e39ab1f7694465060a0550b3f6d328d20297bf2e06aa947b97c21e5241fbd"}, + {file = "orjson-3.10.6-cp311-none-win_amd64.whl", hash = "sha256:227df19441372610b20e05bdb906e1742ec2ad7a66ac8350dcfd29a63014a83b"}, + {file = "orjson-3.10.6-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:ea2977b21f8d5d9b758bb3f344a75e55ca78e3ff85595d248eee813ae23ecdfb"}, + {file = "orjson-3.10.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b6f3d167d13a16ed263b52dbfedff52c962bfd3d270b46b7518365bcc2121eed"}, + {file = "orjson-3.10.6-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f710f346e4c44a4e8bdf23daa974faede58f83334289df80bc9cd12fe82573c7"}, + {file = "orjson-3.10.6-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7275664f84e027dcb1ad5200b8b18373e9c669b2a9ec33d410c40f5ccf4b257e"}, + {file = "orjson-3.10.6-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0943e4c701196b23c240b3d10ed8ecd674f03089198cf503105b474a4f77f21f"}, + {file = "orjson-3.10.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:446dee5a491b5bc7d8f825d80d9637e7af43f86a331207b9c9610e2f93fee22a"}, + {file = "orjson-3.10.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:64c81456d2a050d380786413786b057983892db105516639cb5d3ee3c7fd5148"}, + {file = "orjson-3.10.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:960db0e31c4e52fa0fc3ecbaea5b2d3b58f379e32a95ae6b0ebeaa25b93dfd34"}, + {file = "orjson-3.10.6-cp312-none-win32.whl", hash = "sha256:a6ea7afb5b30b2317e0bee03c8d34c8181bc5a36f2afd4d0952f378972c4efd5"}, + {file = "orjson-3.10.6-cp312-none-win_amd64.whl", hash = "sha256:874ce88264b7e655dde4aeaacdc8fd772a7962faadfb41abe63e2a4861abc3dc"}, + {file = "orjson-3.10.6-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:66680eae4c4e7fc193d91cfc1353ad6d01b4801ae9b5314f17e11ba55e934183"}, + {file = "orjson-3.10.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:caff75b425db5ef8e8f23af93c80f072f97b4fb3afd4af44482905c9f588da28"}, + {file = "orjson-3.10.6-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3722fddb821b6036fd2a3c814f6bd9b57a89dc6337b9924ecd614ebce3271394"}, + {file = "orjson-3.10.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c2c116072a8533f2fec435fde4d134610f806bdac20188c7bd2081f3e9e0133f"}, + {file = "orjson-3.10.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6eeb13218c8cf34c61912e9df2de2853f1d009de0e46ea09ccdf3d757896af0a"}, + {file = "orjson-3.10.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:965a916373382674e323c957d560b953d81d7a8603fbeee26f7b8248638bd48b"}, + {file = "orjson-3.10.6-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:03c95484d53ed8e479cade8628c9cea00fd9d67f5554764a1110e0d5aa2de96e"}, + {file = "orjson-3.10.6-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:e060748a04cccf1e0a6f2358dffea9c080b849a4a68c28b1b907f272b5127e9b"}, + {file = "orjson-3.10.6-cp38-none-win32.whl", hash = "sha256:738dbe3ef909c4b019d69afc19caf6b5ed0e2f1c786b5d6215fbb7539246e4c6"}, + {file = "orjson-3.10.6-cp38-none-win_amd64.whl", hash = "sha256:d40f839dddf6a7d77114fe6b8a70218556408c71d4d6e29413bb5f150a692ff7"}, + {file = "orjson-3.10.6-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:697a35a083c4f834807a6232b3e62c8b280f7a44ad0b759fd4dce748951e70db"}, + {file = "orjson-3.10.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd502f96bf5ea9a61cbc0b2b5900d0dd68aa0da197179042bdd2be67e51a1e4b"}, + {file = "orjson-3.10.6-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f215789fb1667cdc874c1b8af6a84dc939fd802bf293a8334fce185c79cd359b"}, + {file = "orjson-3.10.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2debd8ddce948a8c0938c8c93ade191d2f4ba4649a54302a7da905a81f00b56"}, + {file = "orjson-3.10.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5410111d7b6681d4b0d65e0f58a13be588d01b473822483f77f513c7f93bd3b2"}, + {file = "orjson-3.10.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb1f28a137337fdc18384079fa5726810681055b32b92253fa15ae5656e1dddb"}, + {file = "orjson-3.10.6-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:bf2fbbce5fe7cd1aa177ea3eab2b8e6a6bc6e8592e4279ed3db2d62e57c0e1b2"}, + {file = "orjson-3.10.6-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:79b9b9e33bd4c517445a62b90ca0cc279b0f1f3970655c3df9e608bc3f91741a"}, + {file = "orjson-3.10.6-cp39-none-win32.whl", hash = "sha256:30b0a09a2014e621b1adf66a4f705f0809358350a757508ee80209b2d8dae219"}, + {file = "orjson-3.10.6-cp39-none-win_amd64.whl", hash = "sha256:49e3bc615652617d463069f91b867a4458114c5b104e13b7ae6872e5f79d0844"}, + {file = "orjson-3.10.6.tar.gz", hash = "sha256:e54b63d0a7c6c54a5f5f726bc93a2078111ef060fec4ecbf34c5db800ca3b3a7"}, ] [[package]] @@ -3751,13 +3757,13 @@ pyasn1 = ">=0.4.6,<0.7.0" [[package]] name = "pycnite" -version = "2024.6.13" +version = "2024.7.9" description = "Python bytecode utilities" optional = false python-versions = ">=3.8" files = [ - {file = "pycnite-2024.6.13-py3-none-any.whl", hash = "sha256:7346099b2313894db65ffca177f9e6eb3251fdfedb019eb6da02822c2ff8c1e1"}, - {file = "pycnite-2024.6.13.tar.gz", hash = "sha256:301c5d7e2e2f61e5535d0af7c4486f3ea4f5083c4808a7645a55ddb45cb25027"}, + {file = "pycnite-2024.7.9-py3-none-any.whl", hash = "sha256:aece401e70e8b6bf369b3b33867c79a1b8bf584e68da9790de2f821503cebcf8"}, + {file = "pycnite-2024.7.9.tar.gz", hash = "sha256:f07bea393ee4d5820013fae66db6cc091e8dc01fd3f6b367595108752f264872"}, ] [[package]] @@ -3792,110 +3798,120 @@ files = [ [[package]] name = "pydantic" -version = "2.7.4" +version = "2.8.2" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.7.4-py3-none-any.whl", hash = "sha256:ee8538d41ccb9c0a9ad3e0e5f07bf15ed8015b481ced539a1759d8cc89ae90d0"}, - {file = "pydantic-2.7.4.tar.gz", hash = "sha256:0c84efd9548d545f63ac0060c1e4d39bb9b14db8b3c0652338aecc07b5adec52"}, + {file = "pydantic-2.8.2-py3-none-any.whl", hash = "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8"}, + {file = "pydantic-2.8.2.tar.gz", hash = "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a"}, ] [package.dependencies] annotated-types = ">=0.4.0" email-validator = {version = ">=2.0.0", optional = true, markers = "extra == \"email\""} -pydantic-core = "2.18.4" -typing-extensions = ">=4.6.1" +pydantic-core = "2.20.1" +typing-extensions = {version = ">=4.6.1", markers = "python_version < \"3.13\""} [package.extras] email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.18.4" +version = "2.20.1" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.18.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:f76d0ad001edd426b92233d45c746fd08f467d56100fd8f30e9ace4b005266e4"}, - {file = "pydantic_core-2.18.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:59ff3e89f4eaf14050c8022011862df275b552caef8082e37b542b066ce1ff26"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a55b5b16c839df1070bc113c1f7f94a0af4433fcfa1b41799ce7606e5c79ce0a"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4d0dcc59664fcb8974b356fe0a18a672d6d7cf9f54746c05f43275fc48636851"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8951eee36c57cd128f779e641e21eb40bc5073eb28b2d23f33eb0ef14ffb3f5d"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4701b19f7e3a06ea655513f7938de6f108123bf7c86bbebb1196eb9bd35cf724"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e00a3f196329e08e43d99b79b286d60ce46bed10f2280d25a1718399457e06be"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:97736815b9cc893b2b7f663628e63f436018b75f44854c8027040e05230eeddb"}, - {file = "pydantic_core-2.18.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6891a2ae0e8692679c07728819b6e2b822fb30ca7445f67bbf6509b25a96332c"}, - {file = "pydantic_core-2.18.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bc4ff9805858bd54d1a20efff925ccd89c9d2e7cf4986144b30802bf78091c3e"}, - {file = "pydantic_core-2.18.4-cp310-none-win32.whl", hash = "sha256:1b4de2e51bbcb61fdebd0ab86ef28062704f62c82bbf4addc4e37fa4b00b7cbc"}, - {file = "pydantic_core-2.18.4-cp310-none-win_amd64.whl", hash = "sha256:6a750aec7bf431517a9fd78cb93c97b9b0c496090fee84a47a0d23668976b4b0"}, - {file = "pydantic_core-2.18.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:942ba11e7dfb66dc70f9ae66b33452f51ac7bb90676da39a7345e99ffb55402d"}, - {file = "pydantic_core-2.18.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b2ebef0e0b4454320274f5e83a41844c63438fdc874ea40a8b5b4ecb7693f1c4"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a642295cd0c8df1b86fc3dced1d067874c353a188dc8e0f744626d49e9aa51c4"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f09baa656c904807e832cf9cce799c6460c450c4ad80803517032da0cd062e2"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:98906207f29bc2c459ff64fa007afd10a8c8ac080f7e4d5beff4c97086a3dabd"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:19894b95aacfa98e7cb093cd7881a0c76f55731efad31073db4521e2b6ff5b7d"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fbbdc827fe5e42e4d196c746b890b3d72876bdbf160b0eafe9f0334525119c8"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f85d05aa0918283cf29a30b547b4df2fbb56b45b135f9e35b6807cb28bc47951"}, - {file = "pydantic_core-2.18.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e85637bc8fe81ddb73fda9e56bab24560bdddfa98aa64f87aaa4e4b6730c23d2"}, - {file = "pydantic_core-2.18.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2f5966897e5461f818e136b8451d0551a2e77259eb0f73a837027b47dc95dab9"}, - {file = "pydantic_core-2.18.4-cp311-none-win32.whl", hash = "sha256:44c7486a4228413c317952e9d89598bcdfb06399735e49e0f8df643e1ccd0558"}, - {file = "pydantic_core-2.18.4-cp311-none-win_amd64.whl", hash = "sha256:8a7164fe2005d03c64fd3b85649891cd4953a8de53107940bf272500ba8a788b"}, - {file = "pydantic_core-2.18.4-cp311-none-win_arm64.whl", hash = "sha256:4e99bc050fe65c450344421017f98298a97cefc18c53bb2f7b3531eb39bc7805"}, - {file = "pydantic_core-2.18.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6f5c4d41b2771c730ea1c34e458e781b18cc668d194958e0112455fff4e402b2"}, - {file = "pydantic_core-2.18.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2fdf2156aa3d017fddf8aea5adfba9f777db1d6022d392b682d2a8329e087cef"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4748321b5078216070b151d5271ef3e7cc905ab170bbfd27d5c83ee3ec436695"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:847a35c4d58721c5dc3dba599878ebbdfd96784f3fb8bb2c356e123bdcd73f34"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c40d4eaad41f78e3bbda31b89edc46a3f3dc6e171bf0ecf097ff7a0ffff7cb1"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:21a5e440dbe315ab9825fcd459b8814bb92b27c974cbc23c3e8baa2b76890077"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01dd777215e2aa86dfd664daed5957704b769e726626393438f9c87690ce78c3"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4b06beb3b3f1479d32befd1f3079cc47b34fa2da62457cdf6c963393340b56e9"}, - {file = "pydantic_core-2.18.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:564d7922e4b13a16b98772441879fcdcbe82ff50daa622d681dd682175ea918c"}, - {file = "pydantic_core-2.18.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0eb2a4f660fcd8e2b1c90ad566db2b98d7f3f4717c64fe0a83e0adb39766d5b8"}, - {file = "pydantic_core-2.18.4-cp312-none-win32.whl", hash = "sha256:8b8bab4c97248095ae0c4455b5a1cd1cdd96e4e4769306ab19dda135ea4cdb07"}, - {file = "pydantic_core-2.18.4-cp312-none-win_amd64.whl", hash = "sha256:14601cdb733d741b8958224030e2bfe21a4a881fb3dd6fbb21f071cabd48fa0a"}, - {file = "pydantic_core-2.18.4-cp312-none-win_arm64.whl", hash = "sha256:c1322d7dd74713dcc157a2b7898a564ab091ca6c58302d5c7b4c07296e3fd00f"}, - {file = "pydantic_core-2.18.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:823be1deb01793da05ecb0484d6c9e20baebb39bd42b5d72636ae9cf8350dbd2"}, - {file = "pydantic_core-2.18.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ebef0dd9bf9b812bf75bda96743f2a6c5734a02092ae7f721c048d156d5fabae"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ae1d6df168efb88d7d522664693607b80b4080be6750c913eefb77e34c12c71a"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f9899c94762343f2cc2fc64c13e7cae4c3cc65cdfc87dd810a31654c9b7358cc"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99457f184ad90235cfe8461c4d70ab7dd2680e28821c29eca00252ba90308c78"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18f469a3d2a2fdafe99296a87e8a4c37748b5080a26b806a707f25a902c040a8"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b7cdf28938ac6b8b49ae5e92f2735056a7ba99c9b110a474473fd71185c1af5d"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:938cb21650855054dc54dfd9120a851c974f95450f00683399006aa6e8abb057"}, - {file = "pydantic_core-2.18.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:44cd83ab6a51da80fb5adbd9560e26018e2ac7826f9626bc06ca3dc074cd198b"}, - {file = "pydantic_core-2.18.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:972658f4a72d02b8abfa2581d92d59f59897d2e9f7e708fdabe922f9087773af"}, - {file = "pydantic_core-2.18.4-cp38-none-win32.whl", hash = "sha256:1d886dc848e60cb7666f771e406acae54ab279b9f1e4143babc9c2258213daa2"}, - {file = "pydantic_core-2.18.4-cp38-none-win_amd64.whl", hash = "sha256:bb4462bd43c2460774914b8525f79b00f8f407c945d50881568f294c1d9b4443"}, - {file = "pydantic_core-2.18.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:44a688331d4a4e2129140a8118479443bd6f1905231138971372fcde37e43528"}, - {file = "pydantic_core-2.18.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a2fdd81edd64342c85ac7cf2753ccae0b79bf2dfa063785503cb85a7d3593223"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:86110d7e1907ab36691f80b33eb2da87d780f4739ae773e5fc83fb272f88825f"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:46387e38bd641b3ee5ce247563b60c5ca098da9c56c75c157a05eaa0933ed154"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:123c3cec203e3f5ac7b000bd82235f1a3eced8665b63d18be751f115588fea30"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dc1803ac5c32ec324c5261c7209e8f8ce88e83254c4e1aebdc8b0a39f9ddb443"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53db086f9f6ab2b4061958d9c276d1dbe3690e8dd727d6abf2321d6cce37fa94"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:abc267fa9837245cc28ea6929f19fa335f3dc330a35d2e45509b6566dc18be23"}, - {file = "pydantic_core-2.18.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a0d829524aaefdebccb869eed855e2d04c21d2d7479b6cada7ace5448416597b"}, - {file = "pydantic_core-2.18.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:509daade3b8649f80d4e5ff21aa5673e4ebe58590b25fe42fac5f0f52c6f034a"}, - {file = "pydantic_core-2.18.4-cp39-none-win32.whl", hash = "sha256:ca26a1e73c48cfc54c4a76ff78df3727b9d9f4ccc8dbee4ae3f73306a591676d"}, - {file = "pydantic_core-2.18.4-cp39-none-win_amd64.whl", hash = "sha256:c67598100338d5d985db1b3d21f3619ef392e185e71b8d52bceacc4a7771ea7e"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:574d92eac874f7f4db0ca653514d823a0d22e2354359d0759e3f6a406db5d55d"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1f4d26ceb5eb9eed4af91bebeae4b06c3fb28966ca3a8fb765208cf6b51102ab"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77450e6d20016ec41f43ca4a6c63e9fdde03f0ae3fe90e7c27bdbeaece8b1ed4"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d323a01da91851a4f17bf592faf46149c9169d68430b3146dcba2bb5e5719abc"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:43d447dd2ae072a0065389092a231283f62d960030ecd27565672bd40746c507"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:578e24f761f3b425834f297b9935e1ce2e30f51400964ce4801002435a1b41ef"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:81b5efb2f126454586d0f40c4d834010979cb80785173d1586df845a632e4e6d"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ab86ce7c8f9bea87b9d12c7f0af71102acbf5ecbc66c17796cff45dae54ef9a5"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:90afc12421df2b1b4dcc975f814e21bc1754640d502a2fbcc6d41e77af5ec312"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:51991a89639a912c17bef4b45c87bd83593aee0437d8102556af4885811d59f5"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:293afe532740370aba8c060882f7d26cfd00c94cae32fd2e212a3a6e3b7bc15e"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b48ece5bde2e768197a2d0f6e925f9d7e3e826f0ad2271120f8144a9db18d5c8"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:eae237477a873ab46e8dd748e515c72c0c804fb380fbe6c85533c7de51f23a8f"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:834b5230b5dfc0c1ec37b2fda433b271cbbc0e507560b5d1588e2cc1148cf1ce"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e858ac0a25074ba4bce653f9b5d0a85b7456eaddadc0ce82d3878c22489fa4ee"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2fd41f6eff4c20778d717af1cc50eca52f5afe7805ee530a4fbd0bae284f16e9"}, - {file = "pydantic_core-2.18.4.tar.gz", hash = "sha256:ec3beeada09ff865c344ff3bc2f427f5e6c26401cc6113d77e372c3fdac73864"}, + {file = "pydantic_core-2.20.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3"}, + {file = "pydantic_core-2.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f239eb799a2081495ea659d8d4a43a8f42cd1fe9ff2e7e436295c38a10c286a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53e431da3fc53360db73eedf6f7124d1076e1b4ee4276b36fb25514544ceb4a3"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1f62b2413c3a0e846c3b838b2ecd6c7a19ec6793b2a522745b0869e37ab5bc1"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5d41e6daee2813ecceea8eda38062d69e280b39df793f5a942fa515b8ed67953"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d482efec8b7dc6bfaedc0f166b2ce349df0011f5d2f1f25537ced4cfc34fd98"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e93e1a4b4b33daed65d781a57a522ff153dcf748dee70b40c7258c5861e1768a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e7c4ea22b6739b162c9ecaaa41d718dfad48a244909fe7ef4b54c0b530effc5a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4f2790949cf385d985a31984907fecb3896999329103df4e4983a4a41e13e840"}, + {file = "pydantic_core-2.20.1-cp310-none-win32.whl", hash = "sha256:5e999ba8dd90e93d57410c5e67ebb67ffcaadcea0ad973240fdfd3a135506250"}, + {file = "pydantic_core-2.20.1-cp310-none-win_amd64.whl", hash = "sha256:512ecfbefef6dac7bc5eaaf46177b2de58cdf7acac8793fe033b24ece0b9566c"}, + {file = "pydantic_core-2.20.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:d2a8fa9d6d6f891f3deec72f5cc668e6f66b188ab14bb1ab52422fe8e644f312"}, + {file = "pydantic_core-2.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:175873691124f3d0da55aeea1d90660a6ea7a3cfea137c38afa0a5ffabe37b88"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37eee5b638f0e0dcd18d21f59b679686bbd18917b87db0193ae36f9c23c355fc"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25e9185e2d06c16ee438ed39bf62935ec436474a6ac4f9358524220f1b236e43"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:150906b40ff188a3260cbee25380e7494ee85048584998c1e66df0c7a11c17a6"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ad4aeb3e9a97286573c03df758fc7627aecdd02f1da04516a86dc159bf70121"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3f3ed29cd9f978c604708511a1f9c2fdcb6c38b9aae36a51905b8811ee5cbf1"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b0dae11d8f5ded51699c74d9548dcc5938e0804cc8298ec0aa0da95c21fff57b"}, + {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27"}, + {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9dc1b507c12eb0481d071f3c1808f0529ad41dc415d0ca11f7ebfc666e66a18b"}, + {file = "pydantic_core-2.20.1-cp311-none-win32.whl", hash = "sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a"}, + {file = "pydantic_core-2.20.1-cp311-none-win_amd64.whl", hash = "sha256:40a783fb7ee353c50bd3853e626f15677ea527ae556429453685ae32280c19c2"}, + {file = "pydantic_core-2.20.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:595ba5be69b35777474fa07f80fc260ea71255656191adb22a8c53aba4479231"}, + {file = "pydantic_core-2.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a4f55095ad087474999ee28d3398bae183a66be4823f753cd7d67dd0153427c9"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e97fdf088d4b31ff4ba35db26d9cc472ac7ef4a2ff2badeabf8d727b3377fc52"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc633a9fe1eb87e250b5c57d389cf28998e4292336926b0b6cdaee353f89a237"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d573faf8eb7e6b1cbbcb4f5b247c60ca8be39fe2c674495df0eb4318303137fe"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26dc97754b57d2fd00ac2b24dfa341abffc380b823211994c4efac7f13b9e90e"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:33499e85e739a4b60c9dac710c20a08dc73cb3240c9a0e22325e671b27b70d24"}, + {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bebb4d6715c814597f85297c332297c6ce81e29436125ca59d1159b07f423eb1"}, + {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:516d9227919612425c8ef1c9b869bbbee249bc91912c8aaffb66116c0b447ebd"}, + {file = "pydantic_core-2.20.1-cp312-none-win32.whl", hash = "sha256:469f29f9093c9d834432034d33f5fe45699e664f12a13bf38c04967ce233d688"}, + {file = "pydantic_core-2.20.1-cp312-none-win_amd64.whl", hash = "sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d"}, + {file = "pydantic_core-2.20.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686"}, + {file = "pydantic_core-2.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19c0fa39fa154e7e0b7f82f88ef85faa2a4c23cc65aae2f5aea625e3c13c735a"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa223cd1e36b642092c326d694d8bf59b71ddddc94cdb752bbbb1c5c91d833b"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c336a6d235522a62fef872c6295a42ecb0c4e1d0f1a3e500fe949415761b8a19"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7eb6a0587eded33aeefea9f916899d42b1799b7b14b8f8ff2753c0ac1741edac"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:70c8daf4faca8da5a6d655f9af86faf6ec2e1768f4b8b9d0226c02f3d6209703"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9fa4c9bf273ca41f940bceb86922a7667cd5bf90e95dbb157cbb8441008482c"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11b71d67b4725e7e2a9f6e9c0ac1239bbc0c48cce3dc59f98635efc57d6dac83"}, + {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:270755f15174fb983890c49881e93f8f1b80f0b5e3a3cc1394a255706cabd203"}, + {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c81131869240e3e568916ef4c307f8b99583efaa60a8112ef27a366eefba8ef0"}, + {file = "pydantic_core-2.20.1-cp313-none-win32.whl", hash = "sha256:b91ced227c41aa29c672814f50dbb05ec93536abf8f43cd14ec9521ea09afe4e"}, + {file = "pydantic_core-2.20.1-cp313-none-win_amd64.whl", hash = "sha256:65db0f2eefcaad1a3950f498aabb4875c8890438bc80b19362cf633b87a8ab20"}, + {file = "pydantic_core-2.20.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:4745f4ac52cc6686390c40eaa01d48b18997cb130833154801a442323cc78f91"}, + {file = "pydantic_core-2.20.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a8ad4c766d3f33ba8fd692f9aa297c9058970530a32c728a2c4bfd2616d3358b"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41e81317dd6a0127cabce83c0c9c3fbecceae981c8391e6f1dec88a77c8a569a"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:04024d270cf63f586ad41fff13fde4311c4fc13ea74676962c876d9577bcc78f"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eaad4ff2de1c3823fddf82f41121bdf453d922e9a238642b1dedb33c4e4f98ad"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26ab812fa0c845df815e506be30337e2df27e88399b985d0bb4e3ecfe72df31c"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c5ebac750d9d5f2706654c638c041635c385596caf68f81342011ddfa1e5598"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2aafc5a503855ea5885559eae883978c9b6d8c8993d67766ee73d82e841300dd"}, + {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:4868f6bd7c9d98904b748a2653031fc9c2f85b6237009d475b1008bfaeb0a5aa"}, + {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa2f457b4af386254372dfa78a2eda2563680d982422641a85f271c859df1987"}, + {file = "pydantic_core-2.20.1-cp38-none-win32.whl", hash = "sha256:225b67a1f6d602de0ce7f6c1c3ae89a4aa25d3de9be857999e9124f15dab486a"}, + {file = "pydantic_core-2.20.1-cp38-none-win_amd64.whl", hash = "sha256:6b507132dcfc0dea440cce23ee2182c0ce7aba7054576efc65634f080dbe9434"}, + {file = "pydantic_core-2.20.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:b03f7941783b4c4a26051846dea594628b38f6940a2fdc0df00b221aed39314c"}, + {file = "pydantic_core-2.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1eedfeb6089ed3fad42e81a67755846ad4dcc14d73698c120a82e4ccf0f1f9f6"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:635fee4e041ab9c479e31edda27fcf966ea9614fff1317e280d99eb3e5ab6fe2"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:77bf3ac639c1ff567ae3b47f8d4cc3dc20f9966a2a6dd2311dcc055d3d04fb8a"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ed1b0132f24beeec5a78b67d9388656d03e6a7c837394f99257e2d55b461611"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c6514f963b023aeee506678a1cf821fe31159b925c4b76fe2afa94cc70b3222b"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10d4204d8ca33146e761c79f83cc861df20e7ae9f6487ca290a97702daf56006"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2d036c7187b9422ae5b262badb87a20a49eb6c5238b2004e96d4da1231badef1"}, + {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9ebfef07dbe1d93efb94b4700f2d278494e9162565a54f124c404a5656d7ff09"}, + {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6b9d9bb600328a1ce523ab4f454859e9d439150abb0906c5a1983c146580ebab"}, + {file = "pydantic_core-2.20.1-cp39-none-win32.whl", hash = "sha256:784c1214cb6dd1e3b15dd8b91b9a53852aed16671cc3fbe4786f4f1db07089e2"}, + {file = "pydantic_core-2.20.1-cp39-none-win_amd64.whl", hash = "sha256:d2fe69c5434391727efa54b47a1e7986bb0186e72a41b203df8f5b0a19a4f669"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a45f84b09ac9c3d35dfcf6a27fd0634d30d183205230a0ebe8373a0e8cfa0906"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d02a72df14dfdbaf228424573a07af10637bd490f0901cee872c4f434a735b94"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2b27e6af28f07e2f195552b37d7d66b150adbaa39a6d327766ffd695799780f"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:242b8feb3c493ab78be289c034a1f659e8826e2233786e36f2893a950a719bb6"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:38cf1c40a921d05c5edc61a785c0ddb4bed67827069f535d794ce6bcded919fc"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e0bbdd76ce9aa5d4209d65f2b27fc6e5ef1312ae6c5333c26db3f5ade53a1e99"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:254ec27fdb5b1ee60684f91683be95e5133c994cc54e86a0b0963afa25c8f8a6"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:407653af5617f0757261ae249d3fba09504d7a71ab36ac057c938572d1bc9331"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:c693e916709c2465b02ca0ad7b387c4f8423d1db7b4649c551f27a529181c5ad"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b5ff4911aea936a47d9376fd3ab17e970cc543d1b68921886e7f64bd28308d1"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177f55a886d74f1808763976ac4efd29b7ed15c69f4d838bbd74d9d09cf6fa86"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:964faa8a861d2664f0c7ab0c181af0bea66098b1919439815ca8803ef136fc4e"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:4dd484681c15e6b9a977c785a345d3e378d72678fd5f1f3c0509608da24f2ac0"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f6d6cff3538391e8486a431569b77921adfcdef14eb18fbf19b7c0a5294d4e6a"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a6d511cc297ff0883bc3708b465ff82d7560193169a8b93260f74ecb0a5e08a7"}, + {file = "pydantic_core-2.20.1.tar.gz", hash = "sha256:26ca695eeee5f9f1aeeb211ffc12f10bcb6f71e2989988fda61dabd65db878d4"}, ] [package.dependencies] @@ -4115,7 +4131,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -4419,110 +4434,110 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "rpds-py" -version = "0.18.1" +version = "0.19.0" description = "Python bindings to Rust's persistent data structures (rpds)" optional = false python-versions = ">=3.8" files = [ - {file = "rpds_py-0.18.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:d31dea506d718693b6b2cffc0648a8929bdc51c70a311b2770f09611caa10d53"}, - {file = "rpds_py-0.18.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:732672fbc449bab754e0b15356c077cc31566df874964d4801ab14f71951ea80"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a98a1f0552b5f227a3d6422dbd61bc6f30db170939bd87ed14f3c339aa6c7c9"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7f1944ce16401aad1e3f7d312247b3d5de7981f634dc9dfe90da72b87d37887d"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:38e14fb4e370885c4ecd734f093a2225ee52dc384b86fa55fe3f74638b2cfb09"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:08d74b184f9ab6289b87b19fe6a6d1a97fbfea84b8a3e745e87a5de3029bf944"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d70129cef4a8d979caa37e7fe957202e7eee8ea02c5e16455bc9808a59c6b2f0"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ce0bb20e3a11bd04461324a6a798af34d503f8d6f1aa3d2aa8901ceaf039176d"}, - {file = "rpds_py-0.18.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:81c5196a790032e0fc2464c0b4ab95f8610f96f1f2fa3d4deacce6a79852da60"}, - {file = "rpds_py-0.18.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:f3027be483868c99b4985fda802a57a67fdf30c5d9a50338d9db646d590198da"}, - {file = "rpds_py-0.18.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d44607f98caa2961bab4fa3c4309724b185b464cdc3ba6f3d7340bac3ec97cc1"}, - {file = "rpds_py-0.18.1-cp310-none-win32.whl", hash = "sha256:c273e795e7a0f1fddd46e1e3cb8be15634c29ae8ff31c196debb620e1edb9333"}, - {file = "rpds_py-0.18.1-cp310-none-win_amd64.whl", hash = "sha256:8352f48d511de5f973e4f2f9412736d7dea76c69faa6d36bcf885b50c758ab9a"}, - {file = "rpds_py-0.18.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6b5ff7e1d63a8281654b5e2896d7f08799378e594f09cf3674e832ecaf396ce8"}, - {file = "rpds_py-0.18.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8927638a4d4137a289e41d0fd631551e89fa346d6dbcfc31ad627557d03ceb6d"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:154bf5c93d79558b44e5b50cc354aa0459e518e83677791e6adb0b039b7aa6a7"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:07f2139741e5deb2c5154a7b9629bc5aa48c766b643c1a6750d16f865a82c5fc"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8c7672e9fba7425f79019db9945b16e308ed8bc89348c23d955c8c0540da0a07"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:489bdfe1abd0406eba6b3bb4fdc87c7fa40f1031de073d0cfb744634cc8fa261"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c20f05e8e3d4fc76875fc9cb8cf24b90a63f5a1b4c5b9273f0e8225e169b100"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:967342e045564cef76dfcf1edb700b1e20838d83b1aa02ab313e6a497cf923b8"}, - {file = "rpds_py-0.18.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2cc7c1a47f3a63282ab0f422d90ddac4aa3034e39fc66a559ab93041e6505da7"}, - {file = "rpds_py-0.18.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f7afbfee1157e0f9376c00bb232e80a60e59ed716e3211a80cb8506550671e6e"}, - {file = "rpds_py-0.18.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9e6934d70dc50f9f8ea47081ceafdec09245fd9f6032669c3b45705dea096b88"}, - {file = "rpds_py-0.18.1-cp311-none-win32.whl", hash = "sha256:c69882964516dc143083d3795cb508e806b09fc3800fd0d4cddc1df6c36e76bb"}, - {file = "rpds_py-0.18.1-cp311-none-win_amd64.whl", hash = "sha256:70a838f7754483bcdc830444952fd89645569e7452e3226de4a613a4c1793fb2"}, - {file = "rpds_py-0.18.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3dd3cd86e1db5aadd334e011eba4e29d37a104b403e8ca24dcd6703c68ca55b3"}, - {file = "rpds_py-0.18.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:05f3d615099bd9b13ecf2fc9cf2d839ad3f20239c678f461c753e93755d629ee"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35b2b771b13eee8729a5049c976197ff58a27a3829c018a04341bcf1ae409b2b"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ee17cd26b97d537af8f33635ef38be873073d516fd425e80559f4585a7b90c43"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b646bf655b135ccf4522ed43d6902af37d3f5dbcf0da66c769a2b3938b9d8184"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:19ba472b9606c36716062c023afa2484d1e4220548751bda14f725a7de17b4f6"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e30ac5e329098903262dc5bdd7e2086e0256aa762cc8b744f9e7bf2a427d3f8"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d58ad6317d188c43750cb76e9deacf6051d0f884d87dc6518e0280438648a9ac"}, - {file = "rpds_py-0.18.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e1735502458621921cee039c47318cb90b51d532c2766593be6207eec53e5c4c"}, - {file = "rpds_py-0.18.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:f5bab211605d91db0e2995a17b5c6ee5edec1270e46223e513eaa20da20076ac"}, - {file = "rpds_py-0.18.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2fc24a329a717f9e2448f8cd1f960f9dac4e45b6224d60734edeb67499bab03a"}, - {file = "rpds_py-0.18.1-cp312-none-win32.whl", hash = "sha256:1805d5901779662d599d0e2e4159d8a82c0b05faa86ef9222bf974572286b2b6"}, - {file = "rpds_py-0.18.1-cp312-none-win_amd64.whl", hash = "sha256:720edcb916df872d80f80a1cc5ea9058300b97721efda8651efcd938a9c70a72"}, - {file = "rpds_py-0.18.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:c827576e2fa017a081346dce87d532a5310241648eb3700af9a571a6e9fc7e74"}, - {file = "rpds_py-0.18.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:aa3679e751408d75a0b4d8d26d6647b6d9326f5e35c00a7ccd82b78ef64f65f8"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0abeee75434e2ee2d142d650d1e54ac1f8b01e6e6abdde8ffd6eeac6e9c38e20"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed402d6153c5d519a0faf1bb69898e97fb31613b49da27a84a13935ea9164dfc"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:338dee44b0cef8b70fd2ef54b4e09bb1b97fc6c3a58fea5db6cc083fd9fc2724"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7750569d9526199c5b97e5a9f8d96a13300950d910cf04a861d96f4273d5b104"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:607345bd5912aacc0c5a63d45a1f73fef29e697884f7e861094e443187c02be5"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:207c82978115baa1fd8d706d720b4a4d2b0913df1c78c85ba73fe6c5804505f0"}, - {file = "rpds_py-0.18.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6d1e42d2735d437e7e80bab4d78eb2e459af48c0a46e686ea35f690b93db792d"}, - {file = "rpds_py-0.18.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:5463c47c08630007dc0fe99fb480ea4f34a89712410592380425a9b4e1611d8e"}, - {file = "rpds_py-0.18.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:06d218939e1bf2ca50e6b0ec700ffe755e5216a8230ab3e87c059ebb4ea06afc"}, - {file = "rpds_py-0.18.1-cp38-none-win32.whl", hash = "sha256:312fe69b4fe1ffbe76520a7676b1e5ac06ddf7826d764cc10265c3b53f96dbe9"}, - {file = "rpds_py-0.18.1-cp38-none-win_amd64.whl", hash = "sha256:9437ca26784120a279f3137ee080b0e717012c42921eb07861b412340f85bae2"}, - {file = "rpds_py-0.18.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:19e515b78c3fc1039dd7da0a33c28c3154458f947f4dc198d3c72db2b6b5dc93"}, - {file = "rpds_py-0.18.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a7b28c5b066bca9a4eb4e2f2663012debe680f097979d880657f00e1c30875a0"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:673fdbbf668dd958eff750e500495ef3f611e2ecc209464f661bc82e9838991e"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d960de62227635d2e61068f42a6cb6aae91a7fe00fca0e3aeed17667c8a34611"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:352a88dc7892f1da66b6027af06a2e7e5d53fe05924cc2cfc56495b586a10b72"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4e0ee01ad8260184db21468a6e1c37afa0529acc12c3a697ee498d3c2c4dcaf3"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4c39ad2f512b4041343ea3c7894339e4ca7839ac38ca83d68a832fc8b3748ab"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:aaa71ee43a703c321906813bb252f69524f02aa05bf4eec85f0c41d5d62d0f4c"}, - {file = "rpds_py-0.18.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:6cd8098517c64a85e790657e7b1e509b9fe07487fd358e19431cb120f7d96338"}, - {file = "rpds_py-0.18.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4adec039b8e2928983f885c53b7cc4cda8965b62b6596501a0308d2703f8af1b"}, - {file = "rpds_py-0.18.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:32b7daaa3e9389db3695964ce8e566e3413b0c43e3394c05e4b243a4cd7bef26"}, - {file = "rpds_py-0.18.1-cp39-none-win32.whl", hash = "sha256:2625f03b105328729f9450c8badda34d5243231eef6535f80064d57035738360"}, - {file = "rpds_py-0.18.1-cp39-none-win_amd64.whl", hash = "sha256:bf18932d0003c8c4d51a39f244231986ab23ee057d235a12b2684ea26a353590"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:cbfbea39ba64f5e53ae2915de36f130588bba71245b418060ec3330ebf85678e"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:a3d456ff2a6a4d2adcdf3c1c960a36f4fd2fec6e3b4902a42a384d17cf4e7a65"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7700936ef9d006b7ef605dc53aa364da2de5a3aa65516a1f3ce73bf82ecfc7ae"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:51584acc5916212e1bf45edd17f3a6b05fe0cbb40482d25e619f824dccb679de"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:942695a206a58d2575033ff1e42b12b2aece98d6003c6bc739fbf33d1773b12f"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b906b5f58892813e5ba5c6056d6a5ad08f358ba49f046d910ad992196ea61397"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6f8e3fecca256fefc91bb6765a693d96692459d7d4c644660a9fff32e517843"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7732770412bab81c5a9f6d20aeb60ae943a9b36dcd990d876a773526468e7163"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:bd1105b50ede37461c1d51b9698c4f4be6e13e69a908ab7751e3807985fc0346"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:618916f5535784960f3ecf8111581f4ad31d347c3de66d02e728de460a46303c"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:17c6d2155e2423f7e79e3bb18151c686d40db42d8645e7977442170c360194d4"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:6c4c4c3f878df21faf5fac86eda32671c27889e13570645a9eea0a1abdd50922"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:fab6ce90574645a0d6c58890e9bcaac8d94dff54fb51c69e5522a7358b80ab64"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:531796fb842b53f2695e94dc338929e9f9dbf473b64710c28af5a160b2a8927d"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:740884bc62a5e2bbb31e584f5d23b32320fd75d79f916f15a788d527a5e83644"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:998125738de0158f088aef3cb264a34251908dd2e5d9966774fdab7402edfab7"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e2be6e9dd4111d5b31ba3b74d17da54a8319d8168890fbaea4b9e5c3de630ae5"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0cee71bc618cd93716f3c1bf56653740d2d13ddbd47673efa8bf41435a60daa"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2c3caec4ec5cd1d18e5dd6ae5194d24ed12785212a90b37f5f7f06b8bedd7139"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:27bba383e8c5231cd559affe169ca0b96ec78d39909ffd817f28b166d7ddd4d8"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:a888e8bdb45916234b99da2d859566f1e8a1d2275a801bb8e4a9644e3c7e7909"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6031b25fb1b06327b43d841f33842b383beba399884f8228a6bb3df3088485ff"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:48c2faaa8adfacefcbfdb5f2e2e7bdad081e5ace8d182e5f4ade971f128e6bb3"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:d85164315bd68c0806768dc6bb0429c6f95c354f87485ee3593c4f6b14def2bd"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6afd80f6c79893cfc0574956f78a0add8c76e3696f2d6a15bca2c66c415cf2d4"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa242ac1ff583e4ec7771141606aafc92b361cd90a05c30d93e343a0c2d82a89"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21be4770ff4e08698e1e8e0bce06edb6ea0626e7c8f560bc08222880aca6a6f"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c45a639e93a0c5d4b788b2613bd637468edd62f8f95ebc6fcc303d58ab3f0a8"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:910e71711d1055b2768181efa0a17537b2622afeb0424116619817007f8a2b10"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b9bb1f182a97880f6078283b3505a707057c42bf55d8fca604f70dedfdc0772a"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:1d54f74f40b1f7aaa595a02ff42ef38ca654b1469bef7d52867da474243cc633"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:8d2e182c9ee01135e11e9676e9a62dfad791a7a467738f06726872374a83db49"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:636a15acc588f70fda1661234761f9ed9ad79ebed3f2125d44be0862708b666e"}, - {file = "rpds_py-0.18.1.tar.gz", hash = "sha256:dc48b479d540770c811fbd1eb9ba2bb66951863e448efec2e2c102625328e92f"}, + {file = "rpds_py-0.19.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:fb37bd599f031f1a6fb9e58ec62864ccf3ad549cf14bac527dbfa97123edcca4"}, + {file = "rpds_py-0.19.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3384d278df99ec2c6acf701d067147320b864ef6727405d6470838476e44d9e8"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e54548e0be3ac117595408fd4ca0ac9278fde89829b0b518be92863b17ff67a2"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8eb488ef928cdbc05a27245e52de73c0d7c72a34240ef4d9893fdf65a8c1a955"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a5da93debdfe27b2bfc69eefb592e1831d957b9535e0943a0ee8b97996de21b5"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:79e205c70afddd41f6ee79a8656aec738492a550247a7af697d5bd1aee14f766"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:959179efb3e4a27610e8d54d667c02a9feaa86bbabaf63efa7faa4dfa780d4f1"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a6e605bb9edcf010f54f8b6a590dd23a4b40a8cb141255eec2a03db249bc915b"}, + {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9133d75dc119a61d1a0ded38fb9ba40a00ef41697cc07adb6ae098c875195a3f"}, + {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dd36b712d35e757e28bf2f40a71e8f8a2d43c8b026d881aa0c617b450d6865c9"}, + {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:354f3a91718489912f2e0fc331c24eaaf6a4565c080e00fbedb6015857c00582"}, + {file = "rpds_py-0.19.0-cp310-none-win32.whl", hash = "sha256:ebcbf356bf5c51afc3290e491d3722b26aaf5b6af3c1c7f6a1b757828a46e336"}, + {file = "rpds_py-0.19.0-cp310-none-win_amd64.whl", hash = "sha256:75a6076289b2df6c8ecb9d13ff79ae0cad1d5fb40af377a5021016d58cd691ec"}, + {file = "rpds_py-0.19.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6d45080095e585f8c5097897313def60caa2046da202cdb17a01f147fb263b81"}, + {file = "rpds_py-0.19.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5c9581019c96f865483d031691a5ff1cc455feb4d84fc6920a5ffc48a794d8a"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1540d807364c84516417115c38f0119dfec5ea5c0dd9a25332dea60b1d26fc4d"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9e65489222b410f79711dc3d2d5003d2757e30874096b2008d50329ea4d0f88c"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9da6f400eeb8c36f72ef6646ea530d6d175a4f77ff2ed8dfd6352842274c1d8b"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37f46bb11858717e0efa7893c0f7055c43b44c103e40e69442db5061cb26ed34"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:071d4adc734de562bd11d43bd134330fb6249769b2f66b9310dab7460f4bf714"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9625367c8955e4319049113ea4f8fee0c6c1145192d57946c6ffcd8fe8bf48dd"}, + {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e19509145275d46bc4d1e16af0b57a12d227c8253655a46bbd5ec317e941279d"}, + {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d438e4c020d8c39961deaf58f6913b1bf8832d9b6f62ec35bd93e97807e9cbc"}, + {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:90bf55d9d139e5d127193170f38c584ed3c79e16638890d2e36f23aa1630b952"}, + {file = "rpds_py-0.19.0-cp311-none-win32.whl", hash = "sha256:8d6ad132b1bc13d05ffe5b85e7a01a3998bf3a6302ba594b28d61b8c2cf13aaf"}, + {file = "rpds_py-0.19.0-cp311-none-win_amd64.whl", hash = "sha256:7ec72df7354e6b7f6eb2a17fa6901350018c3a9ad78e48d7b2b54d0412539a67"}, + {file = "rpds_py-0.19.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:5095a7c838a8647c32aa37c3a460d2c48debff7fc26e1136aee60100a8cd8f68"}, + {file = "rpds_py-0.19.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f2f78ef14077e08856e788fa482107aa602636c16c25bdf59c22ea525a785e9"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7cc6cb44f8636fbf4a934ca72f3e786ba3c9f9ba4f4d74611e7da80684e48d2"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cf902878b4af334a09de7a45badbff0389e7cf8dc2e4dcf5f07125d0b7c2656d"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:688aa6b8aa724db1596514751ffb767766e02e5c4a87486ab36b8e1ebc1aedac"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57dbc9167d48e355e2569346b5aa4077f29bf86389c924df25c0a8b9124461fb"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b4cf5a9497874822341c2ebe0d5850fed392034caadc0bad134ab6822c0925b"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8a790d235b9d39c70a466200d506bb33a98e2ee374a9b4eec7a8ac64c2c261fa"}, + {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1d16089dfa58719c98a1c06f2daceba6d8e3fb9b5d7931af4a990a3c486241cb"}, + {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:bc9128e74fe94650367fe23f37074f121b9f796cabbd2f928f13e9661837296d"}, + {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c8f77e661ffd96ff104bebf7d0f3255b02aa5d5b28326f5408d6284c4a8b3248"}, + {file = "rpds_py-0.19.0-cp312-none-win32.whl", hash = "sha256:5f83689a38e76969327e9b682be5521d87a0c9e5a2e187d2bc6be4765f0d4600"}, + {file = "rpds_py-0.19.0-cp312-none-win_amd64.whl", hash = "sha256:06925c50f86da0596b9c3c64c3837b2481337b83ef3519e5db2701df695453a4"}, + {file = "rpds_py-0.19.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:52e466bea6f8f3a44b1234570244b1cff45150f59a4acae3fcc5fd700c2993ca"}, + {file = "rpds_py-0.19.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e21cc693045fda7f745c790cb687958161ce172ffe3c5719ca1764e752237d16"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b31f059878eb1f5da8b2fd82480cc18bed8dcd7fb8fe68370e2e6285fa86da6"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1dd46f309e953927dd018567d6a9e2fb84783963650171f6c5fe7e5c41fd5666"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34a01a4490e170376cd79258b7f755fa13b1a6c3667e872c8e35051ae857a92b"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bcf426a8c38eb57f7bf28932e68425ba86def6e756a5b8cb4731d8e62e4e0223"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68eea5df6347d3f1378ce992d86b2af16ad7ff4dcb4a19ccdc23dea901b87fb"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dab8d921b55a28287733263c0e4c7db11b3ee22aee158a4de09f13c93283c62d"}, + {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6fe87efd7f47266dfc42fe76dae89060038f1d9cb911f89ae7e5084148d1cc08"}, + {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:535d4b52524a961d220875688159277f0e9eeeda0ac45e766092bfb54437543f"}, + {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:8b1a94b8afc154fbe36978a511a1f155f9bd97664e4f1f7a374d72e180ceb0ae"}, + {file = "rpds_py-0.19.0-cp38-none-win32.whl", hash = "sha256:7c98298a15d6b90c8f6e3caa6457f4f022423caa5fa1a1ca7a5e9e512bdb77a4"}, + {file = "rpds_py-0.19.0-cp38-none-win_amd64.whl", hash = "sha256:b0da31853ab6e58a11db3205729133ce0df26e6804e93079dee095be3d681dc1"}, + {file = "rpds_py-0.19.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:5039e3cef7b3e7a060de468a4a60a60a1f31786da94c6cb054e7a3c75906111c"}, + {file = "rpds_py-0.19.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab1932ca6cb8c7499a4d87cb21ccc0d3326f172cfb6a64021a889b591bb3045c"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2afd2164a1e85226fcb6a1da77a5c8896c18bfe08e82e8ceced5181c42d2179"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b1c30841f5040de47a0046c243fc1b44ddc87d1b12435a43b8edff7e7cb1e0d0"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f757f359f30ec7dcebca662a6bd46d1098f8b9fb1fcd661a9e13f2e8ce343ba1"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15e65395a59d2e0e96caf8ee5389ffb4604e980479c32742936ddd7ade914b22"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb0f6eb3a320f24b94d177e62f4074ff438f2ad9d27e75a46221904ef21a7b05"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b228e693a2559888790936e20f5f88b6e9f8162c681830eda303bad7517b4d5a"}, + {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2575efaa5d949c9f4e2cdbe7d805d02122c16065bfb8d95c129372d65a291a0b"}, + {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5c872814b77a4e84afa293a1bee08c14daed1068b2bb1cc312edbf020bbbca2b"}, + {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:850720e1b383df199b8433a20e02b25b72f0fded28bc03c5bd79e2ce7ef050be"}, + {file = "rpds_py-0.19.0-cp39-none-win32.whl", hash = "sha256:ce84a7efa5af9f54c0aa7692c45861c1667080814286cacb9958c07fc50294fb"}, + {file = "rpds_py-0.19.0-cp39-none-win_amd64.whl", hash = "sha256:1c26da90b8d06227d7769f34915913911222d24ce08c0ab2d60b354e2d9c7aff"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:75969cf900d7be665ccb1622a9aba225cf386bbc9c3bcfeeab9f62b5048f4a07"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:8445f23f13339da640d1be8e44e5baf4af97e396882ebbf1692aecd67f67c479"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5a7c1062ef8aea3eda149f08120f10795835fc1c8bc6ad948fb9652a113ca55"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:462b0c18fbb48fdbf980914a02ee38c423a25fcc4cf40f66bacc95a2d2d73bc8"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3208f9aea18991ac7f2b39721e947bbd752a1abbe79ad90d9b6a84a74d44409b"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3444fe52b82f122d8a99bf66777aed6b858d392b12f4c317da19f8234db4533"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88cb4bac7185a9f0168d38c01d7a00addece9822a52870eee26b8d5b61409213"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6b130bd4163c93798a6b9bb96be64a7c43e1cec81126ffa7ffaa106e1fc5cef5"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:a707b158b4410aefb6b054715545bbb21aaa5d5d0080217290131c49c2124a6e"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:dc9ac4659456bde7c567107556ab065801622396b435a3ff213daef27b495388"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:81ea573aa46d3b6b3d890cd3c0ad82105985e6058a4baed03cf92518081eec8c"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3f148c3f47f7f29a79c38cc5d020edcb5ca780020fab94dbc21f9af95c463581"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0906357f90784a66e89ae3eadc2654f36c580a7d65cf63e6a616e4aec3a81be"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f629ecc2db6a4736b5ba95a8347b0089240d69ad14ac364f557d52ad68cf94b0"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6feacd1d178c30e5bc37184526e56740342fd2aa6371a28367bad7908d454fc"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae8b6068ee374fdfab63689be0963333aa83b0815ead5d8648389a8ded593378"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78d57546bad81e0da13263e4c9ce30e96dcbe720dbff5ada08d2600a3502e526"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8b6683a37338818646af718c9ca2a07f89787551057fae57c4ec0446dc6224b"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e8481b946792415adc07410420d6fc65a352b45d347b78fec45d8f8f0d7496f0"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:bec35eb20792ea64c3c57891bc3ca0bedb2884fbac2c8249d9b731447ecde4fa"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:aa5476c3e3a402c37779e95f7b4048db2cb5b0ed0b9d006983965e93f40fe05a"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:19d02c45f2507b489fd4df7b827940f1420480b3e2e471e952af4d44a1ea8e34"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a3e2fd14c5d49ee1da322672375963f19f32b3d5953f0615b175ff7b9d38daed"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:93a91c2640645303e874eada51f4f33351b84b351a689d470f8108d0e0694210"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5b9fc03bf76a94065299d4a2ecd8dfbae4ae8e2e8098bbfa6ab6413ca267709"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5a4b07cdf3f84310c08c1de2c12ddadbb7a77568bcb16e95489f9c81074322ed"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba0ed0dc6763d8bd6e5de5cf0d746d28e706a10b615ea382ac0ab17bb7388633"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:474bc83233abdcf2124ed3f66230a1c8435896046caa4b0b5ab6013c640803cc"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329c719d31362355a96b435f4653e3b4b061fcc9eba9f91dd40804ca637d914e"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ef9101f3f7b59043a34f1dccbb385ca760467590951952d6701df0da9893ca0c"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:0121803b0f424ee2109d6e1f27db45b166ebaa4b32ff47d6aa225642636cd834"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:8344127403dea42f5970adccf6c5957a71a47f522171fafaf4c6ddb41b61703a"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:443cec402ddd650bb2b885113e1dcedb22b1175c6be223b14246a714b61cd521"}, + {file = "rpds_py-0.19.0.tar.gz", hash = "sha256:4fdc9afadbeb393b4bbbad75481e0ea78e4469f2e1d713a90811700830b553a9"}, ] [[package]] @@ -4753,67 +4768,62 @@ tornado = ["tornado (>=5)"] [[package]] name = "setuptools" -version = "70.1.0" +version = "70.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.1.0-py3-none-any.whl", hash = "sha256:d9b8b771455a97c8a9f3ab3448ebe0b29b5e105f1228bba41028be116985a267"}, - {file = "setuptools-70.1.0.tar.gz", hash = "sha256:01a1e793faa5bd89abc851fa15d0a0db26f160890c7102cd8dce643e886b47f5"}, + {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, + {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shapely" -version = "2.0.4" +version = "2.0.5" description = "Manipulation and analysis of geometric objects" optional = false python-versions = ">=3.7" files = [ - {file = "shapely-2.0.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:011b77153906030b795791f2fdfa2d68f1a8d7e40bce78b029782ade3afe4f2f"}, - {file = "shapely-2.0.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9831816a5d34d5170aa9ed32a64982c3d6f4332e7ecfe62dc97767e163cb0b17"}, - {file = "shapely-2.0.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5c4849916f71dc44e19ed370421518c0d86cf73b26e8656192fcfcda08218fbd"}, - {file = "shapely-2.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:841f93a0e31e4c64d62ea570d81c35de0f6cea224568b2430d832967536308e6"}, - {file = "shapely-2.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b4431f522b277c79c34b65da128029a9955e4481462cbf7ebec23aab61fc58"}, - {file = "shapely-2.0.4-cp310-cp310-win32.whl", hash = "sha256:92a41d936f7d6743f343be265ace93b7c57f5b231e21b9605716f5a47c2879e7"}, - {file = "shapely-2.0.4-cp310-cp310-win_amd64.whl", hash = "sha256:30982f79f21bb0ff7d7d4a4e531e3fcaa39b778584c2ce81a147f95be1cd58c9"}, - {file = "shapely-2.0.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:de0205cb21ad5ddaef607cda9a3191eadd1e7a62a756ea3a356369675230ac35"}, - {file = "shapely-2.0.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7d56ce3e2a6a556b59a288771cf9d091470116867e578bebced8bfc4147fbfd7"}, - {file = "shapely-2.0.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:58b0ecc505bbe49a99551eea3f2e8a9b3b24b3edd2a4de1ac0dc17bc75c9ec07"}, - {file = "shapely-2.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:790a168a808bd00ee42786b8ba883307c0e3684ebb292e0e20009588c426da47"}, - {file = "shapely-2.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4310b5494271e18580d61022c0857eb85d30510d88606fa3b8314790df7f367d"}, - {file = "shapely-2.0.4-cp311-cp311-win32.whl", hash = "sha256:63f3a80daf4f867bd80f5c97fbe03314348ac1b3b70fb1c0ad255a69e3749879"}, - {file = "shapely-2.0.4-cp311-cp311-win_amd64.whl", hash = "sha256:c52ed79f683f721b69a10fb9e3d940a468203f5054927215586c5d49a072de8d"}, - {file = "shapely-2.0.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:5bbd974193e2cc274312da16b189b38f5f128410f3377721cadb76b1e8ca5328"}, - {file = "shapely-2.0.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:41388321a73ba1a84edd90d86ecc8bfed55e6a1e51882eafb019f45895ec0f65"}, - {file = "shapely-2.0.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0776c92d584f72f1e584d2e43cfc5542c2f3dd19d53f70df0900fda643f4bae6"}, - {file = "shapely-2.0.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c75c98380b1ede1cae9a252c6dc247e6279403fae38c77060a5e6186c95073ac"}, - {file = "shapely-2.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3e700abf4a37b7b8b90532fa6ed5c38a9bfc777098bc9fbae5ec8e618ac8f30"}, - {file = "shapely-2.0.4-cp312-cp312-win32.whl", hash = "sha256:4f2ab0faf8188b9f99e6a273b24b97662194160cc8ca17cf9d1fb6f18d7fb93f"}, - {file = "shapely-2.0.4-cp312-cp312-win_amd64.whl", hash = "sha256:03152442d311a5e85ac73b39680dd64a9892fa42bb08fd83b3bab4fe6999bfa0"}, - {file = "shapely-2.0.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:994c244e004bc3cfbea96257b883c90a86e8cbd76e069718eb4c6b222a56f78b"}, - {file = "shapely-2.0.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:05ffd6491e9e8958b742b0e2e7c346635033d0a5f1a0ea083547fcc854e5d5cf"}, - {file = "shapely-2.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2fbdc1140a7d08faa748256438291394967aa54b40009f54e8d9825e75ef6113"}, - {file = "shapely-2.0.4-cp37-cp37m-win32.whl", hash = "sha256:5af4cd0d8cf2912bd95f33586600cac9c4b7c5053a036422b97cfe4728d2eb53"}, - {file = "shapely-2.0.4-cp37-cp37m-win_amd64.whl", hash = "sha256:464157509ce4efa5ff285c646a38b49f8c5ef8d4b340f722685b09bb033c5ccf"}, - {file = "shapely-2.0.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:489c19152ec1f0e5c5e525356bcbf7e532f311bff630c9b6bc2db6f04da6a8b9"}, - {file = "shapely-2.0.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b79bbd648664aa6f44ef018474ff958b6b296fed5c2d42db60078de3cffbc8aa"}, - {file = "shapely-2.0.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:674d7baf0015a6037d5758496d550fc1946f34bfc89c1bf247cabdc415d7747e"}, - {file = "shapely-2.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6cd4ccecc5ea5abd06deeaab52fcdba372f649728050c6143cc405ee0c166679"}, - {file = "shapely-2.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb5cdcbbe3080181498931b52a91a21a781a35dcb859da741c0345c6402bf00c"}, - {file = "shapely-2.0.4-cp38-cp38-win32.whl", hash = "sha256:55a38dcd1cee2f298d8c2ebc60fc7d39f3b4535684a1e9e2f39a80ae88b0cea7"}, - {file = "shapely-2.0.4-cp38-cp38-win_amd64.whl", hash = "sha256:ec555c9d0db12d7fd777ba3f8b75044c73e576c720a851667432fabb7057da6c"}, - {file = "shapely-2.0.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3f9103abd1678cb1b5f7e8e1af565a652e036844166c91ec031eeb25c5ca8af0"}, - {file = "shapely-2.0.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:263bcf0c24d7a57c80991e64ab57cba7a3906e31d2e21b455f493d4aab534aaa"}, - {file = "shapely-2.0.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ddf4a9bfaac643e62702ed662afc36f6abed2a88a21270e891038f9a19bc08fc"}, - {file = "shapely-2.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:485246fcdb93336105c29a5cfbff8a226949db37b7473c89caa26c9bae52a242"}, - {file = "shapely-2.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8de4578e838a9409b5b134a18ee820730e507b2d21700c14b71a2b0757396acc"}, - {file = "shapely-2.0.4-cp39-cp39-win32.whl", hash = "sha256:9dab4c98acfb5fb85f5a20548b5c0abe9b163ad3525ee28822ffecb5c40e724c"}, - {file = "shapely-2.0.4-cp39-cp39-win_amd64.whl", hash = "sha256:31c19a668b5a1eadab82ff070b5a260478ac6ddad3a5b62295095174a8d26398"}, - {file = "shapely-2.0.4.tar.gz", hash = "sha256:5dc736127fac70009b8d309a0eeb74f3e08979e530cf7017f2f507ef62e6cfb8"}, + {file = "shapely-2.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:89d34787c44f77a7d37d55ae821f3a784fa33592b9d217a45053a93ade899375"}, + {file = "shapely-2.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:798090b426142df2c5258779c1d8d5734ec6942f778dab6c6c30cfe7f3bf64ff"}, + {file = "shapely-2.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45211276900c4790d6bfc6105cbf1030742da67594ea4161a9ce6812a6721e68"}, + {file = "shapely-2.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e119444bc27ca33e786772b81760f2028d930ac55dafe9bc50ef538b794a8e1"}, + {file = "shapely-2.0.5-cp310-cp310-win32.whl", hash = "sha256:9a4492a2b2ccbeaebf181e7310d2dfff4fdd505aef59d6cb0f217607cb042fb3"}, + {file = "shapely-2.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:1e5cb5ee72f1bc7ace737c9ecd30dc174a5295fae412972d3879bac2e82c8fae"}, + {file = "shapely-2.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5bbfb048a74cf273db9091ff3155d373020852805a37dfc846ab71dde4be93ec"}, + {file = "shapely-2.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:93be600cbe2fbaa86c8eb70656369f2f7104cd231f0d6585c7d0aa555d6878b8"}, + {file = "shapely-2.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f8e71bb9a46814019f6644c4e2560a09d44b80100e46e371578f35eaaa9da1c"}, + {file = "shapely-2.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5251c28a29012e92de01d2e84f11637eb1d48184ee8f22e2df6c8c578d26760"}, + {file = "shapely-2.0.5-cp311-cp311-win32.whl", hash = "sha256:35110e80070d664781ec7955c7de557456b25727a0257b354830abb759bf8311"}, + {file = "shapely-2.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:6c6b78c0007a34ce7144f98b7418800e0a6a5d9a762f2244b00ea560525290c9"}, + {file = "shapely-2.0.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:03bd7b5fa5deb44795cc0a503999d10ae9d8a22df54ae8d4a4cd2e8a93466195"}, + {file = "shapely-2.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2ff9521991ed9e201c2e923da014e766c1aa04771bc93e6fe97c27dcf0d40ace"}, + {file = "shapely-2.0.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b65365cfbf657604e50d15161ffcc68de5cdb22a601bbf7823540ab4918a98d"}, + {file = "shapely-2.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21f64e647a025b61b19585d2247137b3a38a35314ea68c66aaf507a1c03ef6fe"}, + {file = "shapely-2.0.5-cp312-cp312-win32.whl", hash = "sha256:3ac7dc1350700c139c956b03d9c3df49a5b34aaf91d024d1510a09717ea39199"}, + {file = "shapely-2.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:30e8737983c9d954cd17feb49eb169f02f1da49e24e5171122cf2c2b62d65c95"}, + {file = "shapely-2.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:ff7731fea5face9ec08a861ed351734a79475631b7540ceb0b66fb9732a5f529"}, + {file = "shapely-2.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ff9e520af0c5a578e174bca3c18713cd47a6c6a15b6cf1f50ac17dc8bb8db6a2"}, + {file = "shapely-2.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49b299b91557b04acb75e9732645428470825061f871a2edc36b9417d66c1fc5"}, + {file = "shapely-2.0.5-cp37-cp37m-win32.whl", hash = "sha256:b5870633f8e684bf6d1ae4df527ddcb6f3895f7b12bced5c13266ac04f47d231"}, + {file = "shapely-2.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:401cb794c5067598f50518e5a997e270cd7642c4992645479b915c503866abed"}, + {file = "shapely-2.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e91ee179af539100eb520281ba5394919067c6b51824e6ab132ad4b3b3e76dd0"}, + {file = "shapely-2.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8af6f7260f809c0862741ad08b1b89cb60c130ae30efab62320bbf4ee9cc71fa"}, + {file = "shapely-2.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f5456dd522800306ba3faef77c5ba847ec30a0bd73ab087a25e0acdd4db2514f"}, + {file = "shapely-2.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b714a840402cde66fd7b663bb08cacb7211fa4412ea2a209688f671e0d0631fd"}, + {file = "shapely-2.0.5-cp38-cp38-win32.whl", hash = "sha256:7e8cf5c252fac1ea51b3162be2ec3faddedc82c256a1160fc0e8ddbec81b06d2"}, + {file = "shapely-2.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:4461509afdb15051e73ab178fae79974387f39c47ab635a7330d7fee02c68a3f"}, + {file = "shapely-2.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7545a39c55cad1562be302d74c74586f79e07b592df8ada56b79a209731c0219"}, + {file = "shapely-2.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4c83a36f12ec8dee2066946d98d4d841ab6512a6ed7eb742e026a64854019b5f"}, + {file = "shapely-2.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89e640c2cd37378480caf2eeda9a51be64201f01f786d127e78eaeff091ec897"}, + {file = "shapely-2.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06efe39beafde3a18a21dde169d32f315c57da962826a6d7d22630025200c5e6"}, + {file = "shapely-2.0.5-cp39-cp39-win32.whl", hash = "sha256:8203a8b2d44dcb366becbc8c3d553670320e4acf0616c39e218c9561dd738d92"}, + {file = "shapely-2.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:7fed9dbfbcfec2682d9a047b9699db8dcc890dfca857ecba872c42185fc9e64e"}, + {file = "shapely-2.0.5.tar.gz", hash = "sha256:bff2366bc786bfa6cb353d6b47d0443c570c32776612e527ee47b6df63fcfe32"}, ] [package.dependencies] @@ -5053,13 +5063,13 @@ opentelemetry = ["opentelemetry-api (>=1.11.1,<2.0.0)", "opentelemetry-sdk (>=1. [[package]] name = "tenacity" -version = "8.4.1" +version = "8.5.0" description = "Retry code until it succeeds" optional = false python-versions = ">=3.8" files = [ - {file = "tenacity-8.4.1-py3-none-any.whl", hash = "sha256:28522e692eda3e1b8f5e99c51464efcc0b9fc86933da92415168bc1c4e2308fa"}, - {file = "tenacity-8.4.1.tar.gz", hash = "sha256:54b1412b878ddf7e1f1577cd49527bad8cdef32421bd599beac0c6c3f10582fd"}, + {file = "tenacity-8.5.0-py3-none-any.whl", hash = "sha256:b594c2a5945830c267ce6b79a166228323ed52718f30302c1359836112346687"}, + {file = "tenacity-8.5.0.tar.gz", hash = "sha256:8bc6c0c8a09b31e6cad13c47afbed1a567518250a9a171418582ed8d9c20ca78"}, ] [package.extras] @@ -5378,19 +5388,19 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "transformers" -version = "4.41.2" +version = "4.42.4" description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow" optional = false python-versions = ">=3.8.0" files = [ - {file = "transformers-4.41.2-py3-none-any.whl", hash = "sha256:05555d20e43f808de1ef211ab64803cdb513170cef70d29a888b589caebefc67"}, - {file = "transformers-4.41.2.tar.gz", hash = "sha256:80a4db216533d573e9cc7388646c31ed9480918feb7c55eb211249cb23567f87"}, + {file = "transformers-4.42.4-py3-none-any.whl", hash = "sha256:6d59061392d0f1da312af29c962df9017ff3c0108c681a56d1bc981004d16d24"}, + {file = "transformers-4.42.4.tar.gz", hash = "sha256:f956e25e24df851f650cb2c158b6f4352dfae9d702f04c113ed24fc36ce7ae2d"}, ] [package.dependencies] filelock = "*" -huggingface-hub = ">=0.23.0,<1.0" -numpy = ">=1.17" +huggingface-hub = ">=0.23.2,<1.0" +numpy = ">=1.17,<2.0" packaging = ">=20.0" pyyaml = ">=5.1" regex = "!=2019.12.17" @@ -5402,14 +5412,15 @@ tqdm = ">=4.27" [package.extras] accelerate = ["accelerate (>=0.21.0)"] agents = ["Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "datasets (!=2.5.0)", "diffusers", "opencv-python", "sentencepiece (>=0.1.91,!=0.1.92)", "torch"] -all = ["Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "phonemizer", "protobuf", "pyctcdecode (>=0.4.0)", "ray[tune] (>=2.7.0)", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timm", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision"] +all = ["Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "phonemizer", "protobuf", "pyctcdecode (>=0.4.0)", "ray[tune] (>=2.7.0)", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision"] audio = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] +benchmark = ["optimum-benchmark (>=0.2.0)"] codecarbon = ["codecarbon (==1.2.0)"] deepspeed = ["accelerate (>=0.21.0)", "deepspeed (>=0.9.3)"] -deepspeed-testing = ["GitPython (<3.1.19)", "accelerate (>=0.21.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "deepspeed (>=0.9.3)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "nltk", "optuna", "parameterized", "protobuf", "psutil", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.1.5)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "timeout-decorator"] -dev = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "beautifulsoup4", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "decord (==0.6.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "flax (>=0.4.1,<=0.7.0)", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "ray[tune] (>=2.7.0)", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.1.5)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "timm", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] -dev-tensorflow = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "isort (>=5.5.4)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.1.5)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "tokenizers (>=0.19,<0.20)", "urllib3 (<2.0.0)"] -dev-torch = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "beautifulsoup4", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "kenlm", "librosa", "nltk", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "ray[tune] (>=2.7.0)", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.1.5)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorboard", "timeout-decorator", "timm", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] +deepspeed-testing = ["GitPython (<3.1.19)", "accelerate (>=0.21.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "deepspeed (>=0.9.3)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "nltk", "optuna", "parameterized", "protobuf", "psutil", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "timeout-decorator"] +dev = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "beautifulsoup4", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "decord (==0.6.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "flax (>=0.4.1,<=0.7.0)", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "ray[tune] (>=2.7.0)", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] +dev-tensorflow = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "isort (>=5.5.4)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "tokenizers (>=0.19,<0.20)", "urllib3 (<2.0.0)"] +dev-torch = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "beautifulsoup4", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "kenlm", "librosa", "nltk", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "ray[tune] (>=2.7.0)", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorboard", "timeout-decorator", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] flax = ["flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "optax (>=0.0.8,<=0.1.4)", "scipy (<1.13.0)"] flax-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] ftfy = ["ftfy"] @@ -5420,25 +5431,26 @@ natten = ["natten (>=0.14.6,<0.15.0)"] onnx = ["onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "tf2onnx"] onnxruntime = ["onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)"] optuna = ["optuna"] -quality = ["GitPython (<3.1.19)", "datasets (!=2.5.0)", "isort (>=5.5.4)", "ruff (==0.1.5)", "urllib3 (<2.0.0)"] +quality = ["GitPython (<3.1.19)", "datasets (!=2.5.0)", "isort (>=5.5.4)", "ruff (==0.4.4)", "urllib3 (<2.0.0)"] ray = ["ray[tune] (>=2.7.0)"] retrieval = ["datasets (!=2.5.0)", "faiss-cpu"] +ruff = ["ruff (==0.4.4)"] sagemaker = ["sagemaker (>=2.31.0)"] sentencepiece = ["protobuf", "sentencepiece (>=0.1.91,!=0.1.92)"] serving = ["fastapi", "pydantic", "starlette", "uvicorn"] sigopt = ["sigopt"] sklearn = ["scikit-learn"] speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"] -testing = ["GitPython (<3.1.19)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "nltk", "parameterized", "psutil", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.1.5)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "timeout-decorator"] +testing = ["GitPython (<3.1.19)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "nltk", "parameterized", "psutil", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "timeout-decorator"] tf = ["keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx"] -tf-cpu = ["keras (>2.9,<2.16)", "keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow-cpu (>2.9,<2.16)", "tensorflow-probability (<2.16)", "tensorflow-text (<2.16)", "tf2onnx"] +tf-cpu = ["keras (>2.9,<2.16)", "keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow-cpu (>2.9,<2.16)", "tensorflow-probability (<0.24)", "tensorflow-text (<2.16)", "tf2onnx"] tf-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] -timm = ["timm"] +timm = ["timm (<=0.9.16)"] tokenizers = ["tokenizers (>=0.19,<0.20)"] torch = ["accelerate (>=0.21.0)", "torch"] torch-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"] torch-vision = ["Pillow (>=10.0.1,<=15.0)", "torchvision"] -torchhub = ["filelock", "huggingface-hub (>=0.23.0,<1.0)", "importlib-metadata", "numpy (>=1.17)", "packaging (>=20.0)", "protobuf", "regex (!=2019.12.17)", "requests", "sentencepiece (>=0.1.91,!=0.1.92)", "tokenizers (>=0.19,<0.20)", "torch", "tqdm (>=4.27)"] +torchhub = ["filelock", "huggingface-hub (>=0.23.2,<1.0)", "importlib-metadata", "numpy (>=1.17,<2.0)", "packaging (>=20.0)", "protobuf", "regex (!=2019.12.17)", "requests", "sentencepiece (>=0.1.91,!=0.1.92)", "tokenizers (>=0.19,<0.20)", "torch", "tqdm (>=4.27)"] video = ["av (==9.2.0)", "decord (==0.6.0)"] vision = ["Pillow (>=10.0.1,<=15.0)"] @@ -5461,13 +5473,13 @@ typing-extensions = ">=3.7.4.3" [[package]] name = "types-protobuf" -version = "5.26.0.20240422" +version = "5.27.0.20240626" description = "Typing stubs for protobuf" optional = false python-versions = ">=3.8" files = [ - {file = "types-protobuf-5.26.0.20240422.tar.gz", hash = "sha256:e6074178109f97efe9f0b20a035ba61d7c3b03e867eb47d254d2b2ab6a805e36"}, - {file = "types_protobuf-5.26.0.20240422-py3-none-any.whl", hash = "sha256:e4dc2554d342501d5aebc3c71203868b51118340e105fc190e3a64ca1be43831"}, + {file = "types-protobuf-5.27.0.20240626.tar.gz", hash = "sha256:683ba14043bade6785e3f937a7498f243b37881a91ac8d81b9202ecf8b191e9c"}, + {file = "types_protobuf-5.27.0.20240626-py3-none-any.whl", hash = "sha256:688e8f7e8d9295db26bc560df01fb731b27a25b77cbe4c1ce945647f7024f5c1"}, ] [[package]] diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index 7f12f971e..29a68c56e 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -68,4 +68,4 @@ check = [ "typecheck", ] test = "ward" -codegen = "datamodel-codegen --input ../openapi.yaml --input-file-type openapi --output agents_api/autogen/openapi_model.py --use-operation-id-as-name --use-double-quotes --use-schema-description --target-python-version 3.10 --reuse-model --collapse-root-models --use-field-description --field-include-all-keys --use-unique-items-as-set --use-subclass-enum --use-union-operator --use-one-literal-as-default --use-annotated --enum-field-as-literal one --output-model-type pydantic_v2.BaseModel" +codegen = "datamodel-codegen --input ../openapi.yaml --input-file-type openapi --output agents_api/autogen/ --use-operation-id-as-name --use-double-quotes --use-schema-description --target-python-version 3.10 --reuse-model --collapse-root-models --use-field-description --field-include-all-keys --use-unique-items-as-set --use-subclass-enum --use-union-operator --use-one-literal-as-default --use-annotated --enum-field-as-literal one --output-model-type pydantic_v2.BaseModel" diff --git a/fern/fern.config.json b/fern/fern.config.json index 35afd3157..80bdcfd1e 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "julep", - "version": "0.30.10" + "version": "0.31.24" } \ No newline at end of file diff --git a/scripts/generate_openapi_code.sh b/scripts/generate_openapi_code.sh index 02969fea3..b58b8ed45 100644 --- a/scripts/generate_openapi_code.sh +++ b/scripts/generate_openapi_code.sh @@ -4,22 +4,22 @@ set -x cd typespec/ && \ - tsp . && \ - cd - + tsp compile . +cd - fern generate --local cd sdks/python && \ poetry update && \ - poetry run poe format && \ - cd - + poetry run poe format +cd - cd agents-api && \ poetry update && \ poetry run poe codegen && \ - poetry run poe format && \ - cd - + poetry run poe format +cd - cd sdks/ts && \ - npm i && npm run codegen && \ - cd - + npm i && npm run codegen +cd - diff --git a/sdks/postman/collection.json b/sdks/postman/collection.json index b23fef1e9..a2a1e7f55 100644 --- a/sdks/postman/collection.json +++ b/sdks/postman/collection.json @@ -1,6 +1,6 @@ { "info": { - "name": "Julep Agents API", + "name": "Julep API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "description": null }, @@ -39,18 +39,44 @@ "item": [ { "_type": "endpoint", - "name": "List sessions", + "name": "Agents Route List", "request": { - "description": "List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default)", + "description": "List undefined items", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [] }, "header": [ @@ -76,16 +102,42 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default)", + "description": "List undefined items", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [] }, "header": [ @@ -105,24 +157,24 @@ "auth": null, "body": null }, - "description": "List of sessions (sorted created_at descending order) with limit+offset pagination", - "body": "{\n \"items\": [\n {\n \"id\": \"id\",\n \"user_id\": \"user_id\",\n \"agent_id\": \"agent_id\",\n \"situation\": \"situation\",\n \"summary\": \"summary\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"render_templates\": true,\n \"token_budget\": 1,\n \"context_overflow\": \"context_overflow\"\n }\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Create a new session", + "name": "Agents Route Create", "request": { - "description": "Create a session between an agent and a user", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents" ], "query": [], "variable": [] @@ -144,7 +196,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"agent_id\": \"agent_id\"\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", "options": { "raw": { "language": "json" @@ -158,14 +210,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create a session between an agent and a user", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents" ], "query": [], "variable": [] @@ -187,7 +239,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"agent_id\": \"agent_id\"\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", "options": { "raw": { "language": "json" @@ -195,7 +247,7 @@ } } }, - "description": "Session successfully created", + "description": "The request has succeeded and a new resource has been created as a result.", "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } @@ -203,90 +255,16 @@ }, { "_type": "endpoint", - "name": "List users", - "request": { - "description": "List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default)", - "url": { - "raw": "{{baseUrl}}/users", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default)", - "url": { - "raw": "{{baseUrl}}/users", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "List of users (sorted created_at descending order) with limit+offset pagination", - "body": "{\n \"items\": [\n {\n \"name\": \"name\",\n \"about\": \"about\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Create a new user", + "name": "Agents Route Create Or Update", "request": { - "description": "Create a new user", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/users", + "raw": "{{baseUrl}}/agents", "host": [ "{{baseUrl}}" ], "path": [ - "users" + "agents" ], "query": [], "variable": [] @@ -304,11 +282,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", "options": { "raw": { "language": "json" @@ -322,14 +300,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create a new user", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/users", + "raw": "{{baseUrl}}/agents", "host": [ "{{baseUrl}}" ], "path": [ - "users" + "agents" ], "query": [], "variable": [] @@ -347,11 +325,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", "options": { "raw": { "language": "json" @@ -359,27 +337,34 @@ } } }, - "description": "User successfully created", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "List agents", + "name": "Agents Route Get", "request": { - "description": "List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default)", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/agents", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents" + "agents", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the undefined", + "value": "id" + } + ] }, "header": [ { @@ -404,17 +389,24 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default)", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/agents", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents" + "agents", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the undefined", + "value": "id" + } + ] }, "header": [ { @@ -433,27 +425,34 @@ "auth": null, "body": null }, - "description": "List of agents (sorted created_at descending order) with limit+offset pagination", - "body": "{\n \"items\": [\n {\n \"name\": \"name\",\n \"about\": \"about\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\",\n \"default_settings\": {\n \"min_p\": 0.01\n },\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n }\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"default_settings\": {\n \"preset\": \"problem_solving\"\n }\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Create a new agent", + "name": "Agents Route Update", "request": { - "description": "Create a new agent", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents" + "agents", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the undefined", + "value": "id" + } + ] }, "header": [ { @@ -468,11 +467,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\"\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", "options": { "raw": { "language": "json" @@ -486,17 +485,24 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create a new agent", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents" + "agents", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the undefined", + "value": "id" + } + ] }, "header": [ { @@ -511,11 +517,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\"\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", "options": { "raw": { "language": "json" @@ -523,32 +529,32 @@ } } }, - "description": "Agent successfully created", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get details of the session", + "name": "Agents Route Delete", "request": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id" + "agents", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -565,7 +571,7 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, @@ -575,22 +581,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id" + "agents", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -607,36 +613,36 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, - "description": null, - "body": "{\n \"id\": \"id\",\n \"user_id\": \"user_id\",\n \"agent_id\": \"agent_id\",\n \"situation\": \"situation\",\n \"summary\": \"summary\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"render_templates\": true,\n \"token_budget\": 1,\n \"context_overflow\": \"context_overflow\"\n}", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Update session parameters", + "name": "Agents Route Patch", "request": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/sessions/:session_id", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id" + "agents", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -653,11 +659,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"situation\": \"situation\"\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -671,22 +677,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/sessions/:session_id", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id" + "agents", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -703,11 +709,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"situation\": \"situation\"\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -715,7 +721,7 @@ } } }, - "description": null, + "description": "The request has succeeded.", "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } @@ -723,24 +729,51 @@ }, { "_type": "endpoint", - "name": "Delete session", + "name": "Agent Docs Route List", "request": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/sessions/:session_id", + "raw": "{{baseUrl}}/agents/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id" + "agents", + ":id", + "docs" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -757,7 +790,7 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, @@ -767,22 +800,49 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/sessions/:session_id", + "raw": "{{baseUrl}}/agents/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id" + "agents", + ":id", + "docs" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -799,36 +859,63 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, - "description": null, - "body": "", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Patch Session parameters (merge instead of replace)", + "name": "Agents Docs Search Route Search", "request": { - "description": "", + "description": "Search for documents owned by undefined", "url": { - "raw": "{{baseUrl}}/sessions/:session_id", + "raw": "{{baseUrl}}/agents/:id/search?limit=&offset=&sort_by=&direction=&metadata_filter=", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id" + "agents", + ":id", + "search" + ], + "query": [ + { + "key": "limit", + "value": "", + "description": "Limit the number of undefined items returned" + }, + { + "key": "offset", + "value": "", + "description": "Offset the undefined items returned" + }, + { + "key": "sort_by", + "value": "", + "description": "Sort by a field" + }, + { + "key": "direction", + "value": "", + "description": "Sort direction" + }, + { + "key": "metadata_filter", + "value": "", + "description": "JSON string of object that should be used to filter objects by metadata" + } ], - "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "value": "", + "description": "ID of the undefined" } ] }, @@ -838,18 +925,13 @@ "value": "{{apiKey}}", "type": "string", "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" } ], - "method": "PATCH", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{}", + "raw": "{\n \"body\": {\n \"mode\": \"vector\",\n \"vector\": [\n 0\n ]\n }\n}", "options": { "raw": { "language": "json" @@ -857,28 +939,124 @@ } } }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "", - "url": { - "raw": "{{baseUrl}}/sessions/:session_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":session_id" - ], - "query": [], - "variable": [ - { - "key": "session_id", - "description": "", - "value": "session_id" + "response": [] + }, + { + "_type": "endpoint", + "name": "Agent Tools Route List", + "request": { + "description": "List undefined items of parent undefined", + "url": { + "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "agents", + ":id", + "tools" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], + "variable": [ + { + "key": "id", + "description": "ID of parent undefined", + "value": "id" + } + ] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "GET", + "auth": null, + "body": null + }, + "response": [ + { + "name": "Success", + "status": "OK", + "code": 200, + "originalRequest": { + "description": "List undefined items of parent undefined", + "url": { + "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "agents", + ":id", + "tools" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], + "variable": [ + { + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -895,45 +1073,37 @@ "value": "application/json" } ], - "method": "PATCH", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, - "description": "", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": []\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get autogenerated suggestions for session user and agent", + "name": "Agent Tools Route Create", "request": { - "description": "Sorted (created_at descending)", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/suggestions", + "raw": "{{baseUrl}}/agents/:id/tools", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "suggestions" + "agents", + ":id", + "tools" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -950,9 +1120,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -960,23 +1138,23 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Sorted (created_at descending)", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/suggestions", + "raw": "{{baseUrl}}/agents/:id/tools", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "suggestions" + "agents", + ":id", + "tools" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -993,37 +1171,44 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": null, - "body": "{\n \"items\": [\n {\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"target\": \"user\",\n \"content\": \"content\",\n \"message_id\": \"message_id\",\n \"session_id\": \"session_id\"\n }\n ]\n}", + "description": "The request has succeeded and a new resource has been created as a result.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get all messages in a session", + "name": "Individual Docs Route Get", "request": { - "description": "Sorted (created_at ascending)", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/history", + "raw": "{{baseUrl}}/docs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "history" + "docs", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1050,23 +1235,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Sorted (created_at ascending)", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/history", + "raw": "{{baseUrl}}/docs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "history" + "docs", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1087,33 +1271,32 @@ "auth": null, "body": null }, - "description": null, - "body": "{\n \"items\": [\n {\n \"role\": \"user\",\n \"content\": \"content\",\n \"name\": \"name\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Delete session history (does NOT delete related memories)", + "name": "Individual Docs Route Delete", "request": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/history", + "raw": "{{baseUrl}}/docs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "history" + "docs", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1140,23 +1323,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/history", + "raw": "{{baseUrl}}/docs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "history" + "docs", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1177,33 +1359,32 @@ "auth": null, "body": null }, - "description": null, - "body": "", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Interact with the session", + "name": "Executions Route Get", "request": { - "description": "", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/chat", + "raw": "{{baseUrl}}/executions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "chat" + "executions", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1214,29 +1395,15 @@ "type": "string", "description": null }, - { - "key": "Accept", - "description": "", - "type": "text", - "value": "\"application/json\"" - }, { "type": "text", "key": "Content-Type", "value": "application/json" } ], - "method": "POST", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"content\"\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -1244,23 +1411,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/sessions/:session_id/chat", + "raw": "{{baseUrl}}/executions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":session_id", - "chat" + "executions", + ":id" ], "query": [], "variable": [ { - "key": "session_id", - "description": "", - "value": "session_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1271,63 +1437,114 @@ "type": "string", "description": null }, - { - "key": "Accept", - "description": "", - "type": "text", - "value": "\"application/json\"" - }, { "type": "text", "key": "Content-Type", "value": "application/json" } ], - "method": "POST", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"content\"\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, - "description": null, - "body": "{\n \"id\": \"id\",\n \"finish_reason\": \"stop\",\n \"response\": [\n [\n {\n \"role\": \"user\",\n \"content\": \"content\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ]\n ],\n \"usage\": {\n \"completion_tokens\": 1,\n \"prompt_tokens\": 1,\n \"total_tokens\": 1\n },\n \"jobs\": [\n \"jobs\"\n ],\n \"doc_ids\": {\n \"agent_doc_ids\": [\n \"agent_doc_ids\"\n ],\n \"user_doc_ids\": [\n \"user_doc_ids\"\n ]\n }\n}", + "description": "The request has succeeded.", + "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"input\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get memories of the agent", + "name": "Executions Route Update", "request": { - "description": "Sorted (created_at descending)", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/memories?query=query", + "raw": "{{baseUrl}}/executions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "memories" + "executions", + ":id" + ], + "query": [], + "variable": [ + { + "key": "id", + "value": "", + "description": "ID of the undefined" + } + ] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + } + ], + "method": "PUT", + "auth": null, + "body": { + "mode": "raw", + "raw": "{\n \"status\": \"cancelled\",\n \"reason\": \"example\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [] + }, + { + "_type": "endpoint", + "name": "Execution Transitions Route List", + "request": { + "description": "List undefined items of parent undefined", + "url": { + "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "executions", + ":id", + "transitions" ], "query": [ { - "key": "query", - "description": "", - "value": "query" + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" } ], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -1354,29 +1571,49 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Sorted (created_at descending)", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/memories?query=query", + "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "memories" + "executions", + ":id", + "transitions" ], "query": [ { - "key": "query", - "description": "", - "value": "query" + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" } ], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -1397,32 +1634,32 @@ "auth": null, "body": null }, - "description": null, - "body": "{\n \"items\": [\n {\n \"agent_id\": \"agent_id\",\n \"user_id\": \"user_id\",\n \"content\": \"content\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"last_accessed_at\": \"2024-01-15T09:30:00Z\",\n \"timestamp\": \"2024-01-15T09:30:00Z\",\n \"sentiment\": 1.1,\n \"id\": \"id\",\n \"entities\": [\n {}\n ]\n }\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"transitions\": [\n {\n \"type\": \"finish\",\n \"execution_id\": \"execution_id\",\n \"outputs\": {},\n \"current\": [],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get details of the user", + "name": "Job Route Get", "request": { - "description": "", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/jobs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "jobs", + ":id" ], "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1449,22 +1686,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/jobs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "jobs", + ":id" ], "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1485,34 +1722,53 @@ "auth": null, "body": null }, - "description": null, - "body": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n }\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"reason\": \"reason\",\n \"has_progress\": true,\n \"progress\": 1.1,\n \"state\": \"pending\"\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Update user parameters", + "name": "Sessions Route List", "request": { - "description": "", + "description": "List undefined items", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "sessions" ], - "query": [], - "variable": [ + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, { - "key": "user_id", - "description": "", - "value": "user_id" + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" } - ] + ], + "variable": [] }, "header": [ { @@ -1527,11 +1783,111 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", + "auth": null, + "body": null + }, + "response": [ + { + "name": "Success", + "status": "OK", + "code": 200, + "originalRequest": { + "description": "List undefined items", + "url": { + "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "sessions" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], + "variable": [] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "GET", + "auth": null, + "body": null + }, + "description": "The request has succeeded.", + "body": "{\n \"results\": []\n}", + "_postman_previewlanguage": "json" + } + ] + }, + { + "_type": "endpoint", + "name": "Sessions Route Create", + "request": { + "description": "Create new undefined", + "url": { + "raw": "{{baseUrl}}/sessions", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "sessions" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"about\": \"about\",\n \"name\": \"name\"\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -1545,24 +1901,17 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/sessions", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "sessions" ], "query": [], - "variable": [ - { - "key": "user_id", - "description": "", - "value": "user_id" - } - ] + "variable": [] }, "header": [ { @@ -1577,11 +1926,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"about\": \"about\",\n \"name\": \"name\"\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -1589,34 +1938,27 @@ } } }, - "description": null, - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded and a new resource has been created as a result.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Delete user", + "name": "Sessions Route Create Or Update", "request": { - "description": "", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/sessions", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "sessions" ], "query": [], - "variable": [ - { - "key": "user_id", - "description": "", - "value": "user_id" - } - ] + "variable": [] }, "header": [ { @@ -1631,9 +1973,17 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"id\",\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -1641,24 +1991,17 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/sessions", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "sessions" ], "query": [], - "variable": [ - { - "key": "user_id", - "description": "", - "value": "user_id" - } - ] + "variable": [] }, "header": [ { @@ -1673,36 +2016,71 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"id\",\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": null, - "body": "", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Patch User parameters (merge instead of replace)", + "name": "History Route List", "request": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/sessions/history/:id?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "sessions", + "history", + ":id" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -1719,17 +2097,9 @@ "value": "application/json" } ], - "method": "PATCH", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -1737,22 +2107,49 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/users/:user_id", + "raw": "{{baseUrl}}/sessions/history/:id?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id" + "sessions", + "history", + ":id" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -1769,44 +2166,37 @@ "value": "application/json" } ], - "method": "PATCH", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, - "description": "", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"entries\": [\n {\n \"role\": \"user\",\n \"content\": [],\n \"source\": \"api_request\",\n \"timestamp\": 1,\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ],\n \"relations\": [\n {\n \"head\": \"head\",\n \"relation\": \"relation\",\n \"tail\": \"tail\"\n }\n ],\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get details of the agent", + "name": "History Route Delete", "request": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/history/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + "history", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1823,7 +2213,7 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, @@ -1833,22 +2223,23 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/history/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + "history", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1865,36 +2256,73 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, - "description": null, - "body": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\",\n \"default_settings\": {\n \"frequency_penalty\": 1.1,\n \"length_penalty\": 1.1,\n \"presence_penalty\": 1.1,\n \"repetition_penalty\": 1.1,\n \"temperature\": 0.75,\n \"top_p\": 1,\n \"min_p\": 0.01,\n \"preset\": \"problem_solving\"\n },\n \"model\": \"model\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"instructions\": \"instructions\"\n}", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Update agent parameters", + "name": "Sessions Route Get", "request": { - "description": "", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "value": "", + "description": "ID of the undefined" + } + ] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + } + ], + "method": "GET", + "auth": null, + "body": null + }, + "response": [] + }, + { + "_type": "endpoint", + "name": "Sessions Route Update", + "request": { + "description": "Update undefined by id (overwrite)", + "url": { + "raw": "{{baseUrl}}/sessions/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "sessions", + ":id" + ], + "query": [], + "variable": [ + { + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1915,7 +2343,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"about\": \"about\",\n \"name\": \"name\"\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -1929,22 +2357,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -1965,7 +2393,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"about\": \"about\",\n \"name\": \"name\"\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -1973,7 +2401,7 @@ } } }, - "description": null, + "description": "The request has succeeded.", "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } @@ -1981,24 +2409,24 @@ }, { "_type": "endpoint", - "name": "Delete agent", + "name": "Sessions Route Delete", "request": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2025,22 +2453,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2061,32 +2489,32 @@ "auth": null, "body": null }, - "description": null, - "body": "", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Patch Agent parameters (merge instead of replace)", + "name": "Sessions Route Patch", "request": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2121,22 +2549,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id" + "sessions", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2165,7 +2593,7 @@ } } }, - "description": "", + "description": "The request has succeeded.", "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } @@ -2173,27 +2601,45 @@ }, { "_type": "endpoint", - "name": "Get docs of the agent", + "name": "Tasks Route List", "request": { - "description": "Sorted (created_at descending)", + "description": "List undefined items", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/docs", + "raw": "{{baseUrl}}/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "docs" + "tasks" ], - "query": [], - "variable": [ + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" } - ] + ], + "variable": [] }, "header": [ { @@ -2218,25 +2664,43 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Sorted (created_at descending)", + "description": "List undefined items", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/docs", + "raw": "{{baseUrl}}/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "docs" + "tasks" ], - "query": [], - "variable": [ + "query": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" } - ] + ], + "variable": [] }, "header": [ { @@ -2255,35 +2719,27 @@ "auth": null, "body": null }, - "description": null, - "body": "{\n \"items\": [\n {\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Create doc of the agent", + "name": "Tasks Route Create", "request": { - "description": "", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/docs", + "raw": "{{baseUrl}}/tasks", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "docs" + "tasks" ], "query": [], - "variable": [ - { - "key": "agent_id", - "description": "", - "value": "agent_id" - } - ] + "variable": [] }, "header": [ { @@ -2302,7 +2758,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2316,25 +2772,17 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/docs", + "raw": "{{baseUrl}}/tasks", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "docs" + "tasks" ], "query": [], - "variable": [ - { - "key": "agent_id", - "description": "", - "value": "agent_id" - } - ] + "variable": [] }, "header": [ { @@ -2353,7 +2801,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2361,7 +2809,7 @@ } } }, - "description": null, + "description": "The request has succeeded and a new resource has been created as a result.", "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } @@ -2369,27 +2817,19 @@ }, { "_type": "endpoint", - "name": "Get docs of the user", + "name": "Tasks Route Create Or Update", "request": { - "description": "Sorted (created_at descending)", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/users/:user_id/docs", + "raw": "{{baseUrl}}/tasks", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id", - "docs" + "tasks" ], "query": [], - "variable": [ - { - "key": "user_id", - "description": "", - "value": "user_id" - } - ] + "variable": [] }, "header": [ { @@ -2404,9 +2844,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -2414,25 +2862,17 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Sorted (created_at descending)", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/users/:user_id/docs", + "raw": "{{baseUrl}}/tasks", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id", - "docs" + "tasks" ], "query": [], - "variable": [ - { - "key": "user_id", - "description": "", - "value": "user_id" - } - ] + "variable": [] }, "header": [ { @@ -2447,37 +2887,44 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": null, - "body": "{\n \"items\": [\n {\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Create doc of the user", + "name": "Tasks Route Update", "request": { - "description": "", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/users/:user_id/docs", + "raw": "{{baseUrl}}/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id", - "docs" + "tasks", + ":id" ], "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2494,11 +2941,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2512,23 +2959,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/users/:user_id/docs", + "raw": "{{baseUrl}}/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id", - "docs" + "tasks", + ":id" ], "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2545,11 +2991,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"title\": \"title\",\n \"content\": [\n \"content\"\n ]\n}", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2557,39 +3003,32 @@ } } }, - "description": null, - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Delete doc by id", + "name": "Tasks Route Delete", "request": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/users/:user_id/docs/:doc_id", + "raw": "{{baseUrl}}/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id", - "docs", - ":doc_id" + "tasks", + ":id" ], "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" - }, - { - "key": "doc_id", - "description": "", - "value": "doc_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2616,29 +3055,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/users/:user_id/docs/:doc_id", + "raw": "{{baseUrl}}/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users", - ":user_id", - "docs", - ":doc_id" + "tasks", + ":id" ], "query": [], "variable": [ { - "key": "user_id", - "description": "", - "value": "user_id" - }, - { - "key": "doc_id", - "description": "", - "value": "doc_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2659,39 +3091,32 @@ "auth": null, "body": null }, - "description": null, - "body": "", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Delete doc by id", + "name": "Tasks Route Patch", "request": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/docs/:doc_id", + "raw": "{{baseUrl}}/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "docs", - ":doc_id" + "tasks", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "doc_id", - "description": "", - "value": "doc_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2708,9 +3133,17 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "PATCH", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -2718,29 +3151,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/docs/:doc_id", + "raw": "{{baseUrl}}/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "docs", - ":doc_id" + "tasks", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "doc_id", - "description": "", - "value": "doc_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -2757,43 +3183,71 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "PATCH", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": null, - "body": "", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Delete memory of the agent by id", + "name": "Task Executions Route List", "request": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/memories/:memory_id", + "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "memories", - ":memory_id" + "tasks", + ":id", + "executions" ], - "query": [], - "variable": [ + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "direction", + "description": "Sort direction", + "value": "asc" }, { - "key": "memory_id", - "description": "", - "value": "memory_id" + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], + "variable": [ + { + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -2810,7 +3264,7 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, @@ -2820,29 +3274,49 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/memories/:memory_id", + "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "memories", - ":memory_id" + "tasks", + ":id", + "executions" ], - "query": [], - "variable": [ + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "direction", + "description": "Sort direction", + "value": "asc" }, { - "key": "memory_id", - "description": "", - "value": "memory_id" + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], + "variable": [ + { + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -2859,37 +3333,37 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, - "description": null, - "body": "", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {},\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get tools of the agent", + "name": "Task Executions Route Create", "request": { - "description": "Sorted (created_at descending)", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tools" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -2906,9 +3380,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"input\": {}\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -2916,23 +3398,23 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Sorted (created_at descending)", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tools" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -2949,37 +3431,45 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"input\": {}\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": null, - "body": "{\n \"items\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"name\",\n \"parameters\": {}\n },\n \"id\": \"id\"\n }\n ]\n}", + "description": "The request has succeeded and a new resource has been created as a result.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Create tool for the agent", + "name": "Task Executions Route Resume With Task Token", "request": { - "description": "", + "description": "Resume an execution with a task token", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tools" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of parent Task", + "value": "id" } ] }, @@ -2996,11 +3486,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"function\": {\n \"name\": \"name\",\n \"parameters\": {}\n }\n}", + "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", "options": { "raw": { "language": "json" @@ -3014,23 +3504,23 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Resume an execution with a task token", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tools" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" + "key": "id", + "description": "ID of parent Task", + "value": "id" } ] }, @@ -3047,11 +3537,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"function\": {\n \"name\": \"name\",\n \"parameters\": {}\n }\n}", + "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", "options": { "raw": { "language": "json" @@ -3059,39 +3549,32 @@ } } }, - "description": null, - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Update agent tool definition", + "name": "Tool Route Update", "request": { - "description": "", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools/:tool_id", + "raw": "{{baseUrl}}/tools/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", "tools", - ":tool_id" + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "tool_id", - "description": "", - "value": "tool_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3112,7 +3595,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"function\": {\n \"name\": \"name\",\n \"parameters\": {}\n }\n}", + "raw": "{\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n}", "options": { "raw": { "language": "json" @@ -3126,29 +3609,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools/:tool_id", + "raw": "{{baseUrl}}/tools/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", "tools", - ":tool_id" + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "tool_id", - "description": "", - "value": "tool_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3169,7 +3645,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"function\": {\n \"name\": \"name\",\n \"parameters\": {}\n }\n}", + "raw": "{\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n}", "options": { "raw": { "language": "json" @@ -3177,7 +3653,7 @@ } } }, - "description": null, + "description": "The request has succeeded.", "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } @@ -3185,31 +3661,24 @@ }, { "_type": "endpoint", - "name": "Delete tool by id", + "name": "Tool Route Delete", "request": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools/:tool_id", + "raw": "{{baseUrl}}/tools/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", "tools", - ":tool_id" + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "tool_id", - "description": "", - "value": "tool_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3236,29 +3705,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools/:tool_id", + "raw": "{{baseUrl}}/tools/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", "tools", - ":tool_id" + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "tool_id", - "description": "", - "value": "tool_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3279,39 +3741,32 @@ "auth": null, "body": null }, - "description": null, - "body": "", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Patch Agent tool parameters (merge instead of replace)", + "name": "Tool Route Patch", "request": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools/:tool_id", + "raw": "{{baseUrl}}/tools/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", "tools", - ":tool_id" + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "tool_id", - "description": "", - "value": "tool_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3332,7 +3787,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"function\": {}\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -3346,29 +3801,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tools/:tool_id", + "raw": "{{baseUrl}}/tools/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", "tools", - ":tool_id" + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "tool_id", - "description": "", - "value": "tool_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3389,7 +3837,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"function\": {}\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -3397,7 +3845,7 @@ } } }, - "description": "", + "description": "The request has succeeded.", "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } @@ -3405,26 +3853,45 @@ }, { "_type": "endpoint", - "name": "Get status of the job", + "name": "Users Route List", "request": { - "description": "", + "description": "List undefined items", "url": { - "raw": "{{baseUrl}}/jobs/:job_id", + "raw": "{{baseUrl}}/users?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "jobs", - ":job_id" + "users" ], - "query": [], - "variable": [ + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, { - "key": "job_id", - "description": "", - "value": "job_id" + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" } - ] + ], + "variable": [] }, "header": [ { @@ -3449,24 +3916,43 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "List undefined items", "url": { - "raw": "{{baseUrl}}/jobs/:job_id", + "raw": "{{baseUrl}}/users?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "jobs", - ":job_id" + "users" ], - "query": [], - "variable": [ + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, { - "key": "job_id", - "description": "", - "value": "job_id" + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" } - ] + ], + "variable": [] }, "header": [ { @@ -3485,35 +3971,27 @@ "auth": null, "body": null }, - "description": null, - "body": "{\n \"name\": \"name\",\n \"reason\": \"reason\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\",\n \"has_progress\": true,\n \"progress\": 1.1,\n \"state\": \"pending\"\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get a list of tasks", + "name": "Users Route Create", "request": { - "description": "", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks", + "raw": "{{baseUrl}}/users", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks" + "users" ], "query": [], - "variable": [ - { - "key": "agent_id", - "description": "", - "value": "agent_id" - } - ] + "variable": [] }, "header": [ { @@ -3528,9 +4006,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"docs\": []\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -3538,25 +4024,17 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Create new undefined", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks", + "raw": "{{baseUrl}}/users", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks" + "users" ], "query": [], - "variable": [ - { - "key": "agent_id", - "description": "", - "value": "agent_id" - } - ] + "variable": [] }, "header": [ { @@ -3571,39 +4049,39 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"docs\": []\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": "", - "body": "[\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"tools_available\": [\n \"tools_available\"\n ],\n \"input_schema\": {\n \"input_schema\": {\n \"key\": \"value\"\n }\n },\n \"main\": [\n {\n \"prompt\": [\n {\n \"role\": \"user\",\n \"content\": \"content\"\n }\n ],\n \"settings\": {\n \"min_p\": 0.01\n }\n }\n ],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"agent_id\": \"agent_id\"\n }\n]", + "description": "The request has succeeded and a new resource has been created as a result.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Create a Task", + "name": "Users Route Create Or Update", "request": { - "description": "", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks", + "raw": "{{baseUrl}}/users", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks" + "users" ], "query": [], - "variable": [ - { - "key": "agent_id", - "description": "", - "value": "agent_id" - } - ] + "variable": [] }, "header": [ { @@ -3618,11 +4096,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"main\": [\n {\n \"prompt\": [\n {\n \"role\": \"user\",\n \"content\": \"content\"\n }\n ],\n \"settings\": {}\n }\n ]\n}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", "options": { "raw": { "language": "json" @@ -3636,25 +4114,17 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks", + "raw": "{{baseUrl}}/users", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks" + "users" ], "query": [], - "variable": [ - { - "key": "agent_id", - "description": "", - "value": "agent_id" - } - ] + "variable": [] }, "header": [ { @@ -3669,11 +4139,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"main\": [\n {\n \"prompt\": [\n {\n \"role\": \"user\",\n \"content\": \"content\"\n }\n ],\n \"settings\": {}\n }\n ]\n}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", "options": { "raw": { "language": "json" @@ -3681,39 +4151,32 @@ } } }, - "description": "", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get Task Execution By ID", + "name": "Users Route Get", "request": { - "description": "", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/tasks/:task_id/executions/:execution_id", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", - ":task_id", - "executions", - ":execution_id" + "users", + ":id" ], "query": [], "variable": [ { - "key": "task_id", - "description": "", - "value": "task_id" - }, - { - "key": "execution_id", - "description": "", - "value": "execution_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3740,29 +4203,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Get undefined by id", "url": { - "raw": "{{baseUrl}}/tasks/:task_id/executions/:execution_id", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", - ":task_id", - "executions", - ":execution_id" + "users", + ":id" ], "query": [], "variable": [ { - "key": "task_id", - "description": "", - "value": "task_id" - }, - { - "key": "execution_id", - "description": "", - "value": "execution_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3783,40 +4239,32 @@ "auth": null, "body": null }, - "description": "", - "body": "[\n {\n \"id\": \"id\",\n \"task_id\": \"task_id\",\n \"status\": \"status\",\n \"arguments\": {\n \"arguments\": {\n \"key\": \"value\"\n }\n },\n \"user_id\": \"user_id\",\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n]", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Create (or start) an execution of a Task", + "name": "Users Route Update", "request": { - "description": "", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks/:task_id/executions", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks", - ":task_id", - "executions" + "users", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "task_id", - "description": "", - "value": "task_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3833,11 +4281,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"task_id\": \"task_id\",\n \"arguments\": {},\n \"status\": \"status\"\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", "options": { "raw": { "language": "json" @@ -3851,30 +4299,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Update undefined by id (overwrite)", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks/:task_id/executions", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks", - ":task_id", - "executions" + "users", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "task_id", - "description": "", - "value": "task_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3891,11 +4331,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"task_id\": \"task_id\",\n \"arguments\": {},\n \"status\": \"status\"\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", "options": { "raw": { "language": "json" @@ -3903,39 +4343,32 @@ } } }, - "description": "", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Get a Task by ID", + "name": "Users Route Delete", "request": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks/:task_id", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks", - ":task_id" + "users", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "task_id", - "description": "", - "value": "task_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -3952,7 +4385,7 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, @@ -3962,29 +4395,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Delete undefined by id", "url": { - "raw": "{{baseUrl}}/agents/:agent_id/tasks/:task_id", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents", - ":agent_id", - "tasks", - ":task_id" + "users", + ":id" ], "query": [], "variable": [ { - "key": "agent_id", - "description": "", - "value": "agent_id" - }, - { - "key": "task_id", - "description": "", - "value": "task_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -4001,37 +4427,36 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, - "description": "", - "body": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"tools_available\": [\n \"tools_available\"\n ],\n \"input_schema\": {\n \"input_schema\": {\n \"key\": \"value\"\n }\n },\n \"main\": [\n {\n \"prompt\": [\n {\n \"role\": \"user\",\n \"content\": \"content\"\n }\n ],\n \"settings\": {\n \"min_p\": 0.01\n }\n }\n ],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"agent_id\": \"agent_id\"\n}", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "List Transitions of an Execution", + "name": "Users Route Patch", "request": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/executions/:execution_id/transitions", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "executions", - ":execution_id", - "transitions" + "users", + ":id" ], "query": [], "variable": [ { - "key": "execution_id", - "description": "", - "value": "execution_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -4048,9 +4473,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "PATCH", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -4058,23 +4491,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "Patch undefined by id (merge changes)", "url": { - "raw": "{{baseUrl}}/executions/:execution_id/transitions", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "executions", - ":execution_id", - "transitions" + "users", + ":id" ], "query": [], "variable": [ { - "key": "execution_id", - "description": "", - "value": "execution_id" + "key": "id", + "description": "ID of the undefined", + "value": "id" } ] }, @@ -4091,43 +4523,71 @@ "value": "application/json" } ], - "method": "GET", + "method": "PATCH", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": "", - "body": "[\n {\n \"id\": \"id\",\n \"execution_id\": \"execution_id\",\n \"type\": \"type\",\n \"from\": [\n {\n \"key\": \"value\"\n }\n ],\n \"to\": [\n {\n \"key\": \"value\"\n }\n ],\n \"task_token\": \"task_token\",\n \"outputs\": {\n \"outputs\": {\n \"key\": \"value\"\n }\n },\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n]", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "", + "name": "User Docs Route List", "request": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/executions/:execution_id/transitions/:transition_id", + "raw": "{{baseUrl}}/users/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "executions", - ":execution_id", - "transitions", - ":transition_id" + "users", + ":id", + "docs" ], - "query": [], - "variable": [ + "query": [ { - "key": "execution_id", - "description": "", - "value": "execution_id" + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" }, { - "key": "transition_id", - "description": "", - "value": "transition_id" + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], + "variable": [ + { + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -4144,17 +4604,9 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"responses\": [\n {\n \"id\": \"id\",\n \"output\": {}\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -4162,29 +4614,49 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "", + "description": "List undefined items of parent undefined", "url": { - "raw": "{{baseUrl}}/executions/:execution_id/transitions/:transition_id", + "raw": "{{baseUrl}}/users/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "executions", - ":execution_id", - "transitions", - ":transition_id" + "users", + ":id", + "docs" ], - "query": [], - "variable": [ + "query": [ + { + "key": "limit", + "description": "Limit the number of undefined items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the undefined items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, { - "key": "execution_id", - "description": "", - "value": "execution_id" + "key": "direction", + "description": "Sort direction", + "value": "asc" }, { - "key": "transition_id", - "description": "", - "value": "transition_id" + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], + "variable": [ + { + "key": "id", + "description": "ID of parent undefined", + "value": "id" } ] }, @@ -4201,23 +4673,87 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"responses\": [\n {\n \"id\": \"id\",\n \"output\": {}\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, - "description": "", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] + }, + { + "_type": "endpoint", + "name": "User Docs Search Route Search", + "request": { + "description": "Search for documents owned by undefined", + "url": { + "raw": "{{baseUrl}}/users/:id/search?limit=&offset=&sort_by=&direction=&metadata_filter=", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + ":id", + "search" + ], + "query": [ + { + "key": "limit", + "value": "", + "description": "Limit the number of undefined items returned" + }, + { + "key": "offset", + "value": "", + "description": "Offset the undefined items returned" + }, + { + "key": "sort_by", + "value": "", + "description": "Sort by a field" + }, + { + "key": "direction", + "value": "", + "description": "Sort direction" + }, + { + "key": "metadata_filter", + "value": "", + "description": "JSON string of object that should be used to filter objects by metadata" + } + ], + "variable": [ + { + "key": "id", + "value": "", + "description": "ID of the undefined" + } + ] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + } + ], + "method": "POST", + "auth": null, + "body": { + "mode": "raw", + "raw": "{\n \"body\": {\n \"mode\": \"vector\",\n \"vector\": [\n 0\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [] } ] } \ No newline at end of file diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 1474b6085..93fbde930 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -1,199 +1,383 @@ # This file was auto-generated by Fern from our API Definition. from .types import ( - Agent, - AgentDefaultSettings, - AgentDefaultSettingsPreset, - AgentInstructions, - CelObject, - ChatInputData, - ChatInputDataToolChoice, - ChatMlImageContentPart, - ChatMlImageContentPartImageUrl, - ChatMlImageContentPartImageUrlDetail, - ChatMlMessage, - ChatMlMessageContent, - ChatMlMessageContentItem, - ChatMlMessageContentItem_ImageUrl, - ChatMlMessageContentItem_Text, - ChatMlMessageRole, - ChatMlTextContentPart, - ChatResponse, - ChatResponseFinishReason, - ChatSettings, - ChatSettingsPreset, - ChatSettingsResponseFormat, - ChatSettingsResponseFormatSchema, - ChatSettingsResponseFormatType, - ChatSettingsStop, - CompletionUsage, - CreateAgentRequestInstructions, - CreateDoc, - CreateDocContent, - CreateToolRequest, - CreateToolRequestType, - Doc, - DocContent, - DocIds, - ErrorWorkflowStep, - EvaluateWorkflowStep, - Execution, - ExecutionStatus, - ExecutionTransition, - FunctionCallOption, - FunctionDef, - FunctionParameters, - GetAgentDocsRequestOrder, - GetAgentDocsRequestSortBy, - GetAgentDocsResponse, - GetAgentMemoriesResponse, - GetAgentToolsResponse, - GetHistoryResponse, - GetSuggestionsResponse, - GetUserDocsRequestOrder, - GetUserDocsRequestSortBy, - GetUserDocsResponse, - IfElseWorkflowStep, - InputChatMlMessage, - InputChatMlMessageContent, - InputChatMlMessageContentItem, - InputChatMlMessageContentItem_ImageUrl, - InputChatMlMessageContentItem_Text, - InputChatMlMessageRole, - JobStatus, - JobStatusState, - ListAgentsRequestOrder, - ListAgentsRequestSortBy, - ListAgentsResponse, - ListSessionsRequestOrder, - ListSessionsRequestSortBy, - ListSessionsResponse, - ListUsersRequestOrder, - ListUsersRequestSortBy, - ListUsersResponse, - Memory, - MemoryAccessOptions, - MemoryEntitiesItem, - NamedToolChoice, - NamedToolChoiceFunction, - PartialFunctionDef, - PatchAgentRequestInstructions, - PromptWorkflowStep, - ResourceCreatedResponse, - ResourceDeletedResponse, - ResourceUpdatedResponse, - Session, - Suggestion, - SuggestionTarget, - Task, - Tool, - ToolCallWorkflowStep, - ToolChoiceOption, - ToolResponse, - ToolType, - TransitionType, - UpdateAgentRequestInstructions, - User, - WorkflowStep, - YieldWorkflowStep, + AgentDocsRouteListRequestDirection, + AgentDocsRouteListRequestSortBy, + AgentDocsRouteListResponse, + AgentToolsRouteCreateResponse, + AgentToolsRouteListRequestDirection, + AgentToolsRouteListRequestSortBy, + AgentToolsRouteListResponse, + AgentsAgent, + AgentsAgentDefaultSettings, + AgentsAgentInstructions, + AgentsCreateAgentRequest, + AgentsCreateAgentRequestDefaultSettings, + AgentsCreateAgentRequestInstructions, + AgentsCreateOrUpdateAgentRequestDefaultSettings, + AgentsCreateOrUpdateAgentRequestInstructions, + AgentsDocsSearchRouteSearchRequestDirection, + AgentsDocsSearchRouteSearchRequestSortBy, + AgentsDocsSearchRouteSearchResponse, + AgentsPatchAgentRequestDefaultSettings, + AgentsPatchAgentRequestInstructions, + AgentsRouteCreateOrUpdateResponse, + AgentsRouteCreateResponse, + AgentsRouteDeleteResponse, + AgentsRouteListRequestDirection, + AgentsRouteListRequestSortBy, + AgentsRouteListResponse, + AgentsRoutePatchResponse, + AgentsRouteUpdateResponse, + AgentsUpdateAgentRequestDefaultSettings, + AgentsUpdateAgentRequestInstructions, + ChatCompletionResponseFormat, + ChatCompletionResponseFormatType, + ChatGenerationPreset, + ChatGenerationPresetSettings, + ChatOpenAiSettings, + ChatVLlmSettings, + CommonIdentifierSafeUnicode, + CommonLimit, + CommonLogitBias, + CommonOffset, + CommonToolRef, + CommonUuid, + CommonValidPythonIdentifier, + DocsDoc, + DocsDocContent, + DocsDocOwner, + DocsDocOwnerRole, + DocsDocReference, + DocsDocSearchRequest, + DocsDocSearchRequestText, + DocsDocSearchRequestVector, + DocsDocSearchRequest_Hybrid, + DocsDocSearchRequest_Text, + DocsDocSearchRequest_Vector, + DocsHybridDocSearchRequest, + DocsHybridDocSearchRequestText, + DocsHybridDocSearchRequestVector, + DocsTextOnlyDocSearchRequest, + DocsTextOnlyDocSearchRequestText, + DocsVectorDocSearchRequest, + DocsVectorDocSearchRequestVector, + EntriesBaseChatMlContentPart, + EntriesBaseChatMlContentPart_ImageUrl, + EntriesChatMlImageContentPart, + EntriesChatMlRole, + EntriesChatMlTextContentPart, + EntriesEntry, + EntriesEntryContent, + EntriesEntryContentItem, + EntriesEntryContentItemItem, + EntriesEntryContentItemItem_ImageUrl, + EntriesEntryContentItemItem_Text, + EntriesEntrySource, + EntriesHistory, + EntriesImageDetail, + EntriesImageUrl, + EntriesInputChatMlMessage, + EntriesInputChatMlMessageContent, + EntriesInputChatMlMessageContentItem, + EntriesInputChatMlMessageContentItem_ImageUrl, + EntriesInputChatMlMessageContentItem_Text, + EntriesRelation, + ExecutionTransitionsRouteListRequestDirection, + ExecutionTransitionsRouteListRequestSortBy, + ExecutionTransitionsRouteListResponse, + ExecutionTransitionsRouteListResponseResultsItem, + ExecutionsExecution, + ExecutionsExecutionStatus, + ExecutionsResumeExecutionRequest, + ExecutionsRouteUpdateResponse, + ExecutionsStopExecutionRequest, + ExecutionsTransition, + ExecutionsTransitionType, + ExecutionsUpdateExecutionRequest, + ExecutionsUpdateExecutionRequest_Cancelled, + ExecutionsUpdateExecutionRequest_Running, + HistoryRouteDeleteResponse, + HistoryRouteListRequestDirection, + HistoryRouteListRequestSortBy, + HistoryRouteListResponse, + IndividualDocsRouteDeleteResponse, + JobsJobState, + JobsJobStatus, + SessionsMultiAgentMultiUserSession, + SessionsMultiAgentNoUserSession, + SessionsMultiAgentSingleUserSession, + SessionsRouteCreateOrUpdateResponse, + SessionsRouteCreateResponse, + SessionsRouteDeleteResponse, + SessionsRouteListRequestDirection, + SessionsRouteListRequestSortBy, + SessionsRouteListResponse, + SessionsRoutePatchResponse, + SessionsRouteUpdateResponse, + SessionsSession, + SessionsSession_MultiAgentMultiUser, + SessionsSession_MultiAgentNoUser, + SessionsSession_MultiAgentSingleUser, + SessionsSession_SingleAgentMultiUser, + SessionsSession_SingleAgentNoUser, + SessionsSession_SingleAgentSingleUser, + SessionsSingleAgentMultiUserSession, + SessionsSingleAgentNoUserSession, + SessionsSingleAgentSingleUserSession, + TaskExecutionsRouteCreateResponse, + TaskExecutionsRouteListRequestDirection, + TaskExecutionsRouteListRequestSortBy, + TaskExecutionsRouteListResponse, + TaskExecutionsRouteResumeWithTaskTokenResponse, + TasksCel, + TasksErrorWorkflowStep, + TasksEvaluateStep, + TasksIfElseWorkflowStep, + TasksPromptStep, + TasksPromptStepPrompt, + TasksPromptStepSettings, + TasksPromptStepSettingsFrequencyPenalty, + TasksPromptStepSettingsLengthPenalty, + TasksPromptStepSettingsPreset, + TasksRouteCreateOrUpdateResponse, + TasksRouteCreateResponse, + TasksRouteDeleteResponse, + TasksRouteListRequestDirection, + TasksRouteListRequestSortBy, + TasksRouteListResponse, + TasksRoutePatchResponse, + TasksRouteUpdateResponse, + TasksTask, + TasksToolCallStep, + TasksWorkflowStep, + TasksWorkflowStep_Error, + TasksWorkflowStep_Evaluate, + TasksWorkflowStep_IfElse, + TasksWorkflowStep_Prompt, + TasksWorkflowStep_ToolCall, + TasksWorkflowStep_Yield, + TasksYieldStep, + ToolRouteDeleteResponse, + ToolRoutePatchResponse, + ToolRouteUpdateResponse, + ToolsChosenFunctionCall, + ToolsChosenToolCall, + ToolsChosenToolCall_Function, + ToolsCreateToolRequest, + ToolsFunctionCallOption, + ToolsFunctionDef, + ToolsFunctionDefUpdate, + ToolsFunctionTool, + ToolsTool, + ToolsToolResponse, + ToolsToolType, + ToolsTool_Function, + UserDocsRouteListRequestDirection, + UserDocsRouteListRequestSortBy, + UserDocsRouteListResponse, + UserDocsSearchRouteSearchRequestDirection, + UserDocsSearchRouteSearchRequestSortBy, + UserDocsSearchRouteSearchResponse, + UsersRouteCreateOrUpdateResponse, + UsersRouteCreateResponse, + UsersRouteDeleteResponse, + UsersRouteListRequestDirection, + UsersRouteListRequestSortBy, + UsersRouteListResponse, + UsersRoutePatchResponse, + UsersRouteUpdateResponse, + UsersUser, ) from .environment import JulepApiEnvironment __all__ = [ - "Agent", - "AgentDefaultSettings", - "AgentDefaultSettingsPreset", - "AgentInstructions", - "CelObject", - "ChatInputData", - "ChatInputDataToolChoice", - "ChatMlImageContentPart", - "ChatMlImageContentPartImageUrl", - "ChatMlImageContentPartImageUrlDetail", - "ChatMlMessage", - "ChatMlMessageContent", - "ChatMlMessageContentItem", - "ChatMlMessageContentItem_ImageUrl", - "ChatMlMessageContentItem_Text", - "ChatMlMessageRole", - "ChatMlTextContentPart", - "ChatResponse", - "ChatResponseFinishReason", - "ChatSettings", - "ChatSettingsPreset", - "ChatSettingsResponseFormat", - "ChatSettingsResponseFormatSchema", - "ChatSettingsResponseFormatType", - "ChatSettingsStop", - "CompletionUsage", - "CreateAgentRequestInstructions", - "CreateDoc", - "CreateDocContent", - "CreateToolRequest", - "CreateToolRequestType", - "Doc", - "DocContent", - "DocIds", - "ErrorWorkflowStep", - "EvaluateWorkflowStep", - "Execution", - "ExecutionStatus", - "ExecutionTransition", - "FunctionCallOption", - "FunctionDef", - "FunctionParameters", - "GetAgentDocsRequestOrder", - "GetAgentDocsRequestSortBy", - "GetAgentDocsResponse", - "GetAgentMemoriesResponse", - "GetAgentToolsResponse", - "GetHistoryResponse", - "GetSuggestionsResponse", - "GetUserDocsRequestOrder", - "GetUserDocsRequestSortBy", - "GetUserDocsResponse", - "IfElseWorkflowStep", - "InputChatMlMessage", - "InputChatMlMessageContent", - "InputChatMlMessageContentItem", - "InputChatMlMessageContentItem_ImageUrl", - "InputChatMlMessageContentItem_Text", - "InputChatMlMessageRole", - "JobStatus", - "JobStatusState", + "AgentDocsRouteListRequestDirection", + "AgentDocsRouteListRequestSortBy", + "AgentDocsRouteListResponse", + "AgentToolsRouteCreateResponse", + "AgentToolsRouteListRequestDirection", + "AgentToolsRouteListRequestSortBy", + "AgentToolsRouteListResponse", + "AgentsAgent", + "AgentsAgentDefaultSettings", + "AgentsAgentInstructions", + "AgentsCreateAgentRequest", + "AgentsCreateAgentRequestDefaultSettings", + "AgentsCreateAgentRequestInstructions", + "AgentsCreateOrUpdateAgentRequestDefaultSettings", + "AgentsCreateOrUpdateAgentRequestInstructions", + "AgentsDocsSearchRouteSearchRequestDirection", + "AgentsDocsSearchRouteSearchRequestSortBy", + "AgentsDocsSearchRouteSearchResponse", + "AgentsPatchAgentRequestDefaultSettings", + "AgentsPatchAgentRequestInstructions", + "AgentsRouteCreateOrUpdateResponse", + "AgentsRouteCreateResponse", + "AgentsRouteDeleteResponse", + "AgentsRouteListRequestDirection", + "AgentsRouteListRequestSortBy", + "AgentsRouteListResponse", + "AgentsRoutePatchResponse", + "AgentsRouteUpdateResponse", + "AgentsUpdateAgentRequestDefaultSettings", + "AgentsUpdateAgentRequestInstructions", + "ChatCompletionResponseFormat", + "ChatCompletionResponseFormatType", + "ChatGenerationPreset", + "ChatGenerationPresetSettings", + "ChatOpenAiSettings", + "ChatVLlmSettings", + "CommonIdentifierSafeUnicode", + "CommonLimit", + "CommonLogitBias", + "CommonOffset", + "CommonToolRef", + "CommonUuid", + "CommonValidPythonIdentifier", + "DocsDoc", + "DocsDocContent", + "DocsDocOwner", + "DocsDocOwnerRole", + "DocsDocReference", + "DocsDocSearchRequest", + "DocsDocSearchRequestText", + "DocsDocSearchRequestVector", + "DocsDocSearchRequest_Hybrid", + "DocsDocSearchRequest_Text", + "DocsDocSearchRequest_Vector", + "DocsHybridDocSearchRequest", + "DocsHybridDocSearchRequestText", + "DocsHybridDocSearchRequestVector", + "DocsTextOnlyDocSearchRequest", + "DocsTextOnlyDocSearchRequestText", + "DocsVectorDocSearchRequest", + "DocsVectorDocSearchRequestVector", + "EntriesBaseChatMlContentPart", + "EntriesBaseChatMlContentPart_ImageUrl", + "EntriesChatMlImageContentPart", + "EntriesChatMlRole", + "EntriesChatMlTextContentPart", + "EntriesEntry", + "EntriesEntryContent", + "EntriesEntryContentItem", + "EntriesEntryContentItemItem", + "EntriesEntryContentItemItem_ImageUrl", + "EntriesEntryContentItemItem_Text", + "EntriesEntrySource", + "EntriesHistory", + "EntriesImageDetail", + "EntriesImageUrl", + "EntriesInputChatMlMessage", + "EntriesInputChatMlMessageContent", + "EntriesInputChatMlMessageContentItem", + "EntriesInputChatMlMessageContentItem_ImageUrl", + "EntriesInputChatMlMessageContentItem_Text", + "EntriesRelation", + "ExecutionTransitionsRouteListRequestDirection", + "ExecutionTransitionsRouteListRequestSortBy", + "ExecutionTransitionsRouteListResponse", + "ExecutionTransitionsRouteListResponseResultsItem", + "ExecutionsExecution", + "ExecutionsExecutionStatus", + "ExecutionsResumeExecutionRequest", + "ExecutionsRouteUpdateResponse", + "ExecutionsStopExecutionRequest", + "ExecutionsTransition", + "ExecutionsTransitionType", + "ExecutionsUpdateExecutionRequest", + "ExecutionsUpdateExecutionRequest_Cancelled", + "ExecutionsUpdateExecutionRequest_Running", + "HistoryRouteDeleteResponse", + "HistoryRouteListRequestDirection", + "HistoryRouteListRequestSortBy", + "HistoryRouteListResponse", + "IndividualDocsRouteDeleteResponse", + "JobsJobState", + "JobsJobStatus", "JulepApiEnvironment", - "ListAgentsRequestOrder", - "ListAgentsRequestSortBy", - "ListAgentsResponse", - "ListSessionsRequestOrder", - "ListSessionsRequestSortBy", - "ListSessionsResponse", - "ListUsersRequestOrder", - "ListUsersRequestSortBy", - "ListUsersResponse", - "Memory", - "MemoryAccessOptions", - "MemoryEntitiesItem", - "NamedToolChoice", - "NamedToolChoiceFunction", - "PartialFunctionDef", - "PatchAgentRequestInstructions", - "PromptWorkflowStep", - "ResourceCreatedResponse", - "ResourceDeletedResponse", - "ResourceUpdatedResponse", - "Session", - "Suggestion", - "SuggestionTarget", - "Task", - "Tool", - "ToolCallWorkflowStep", - "ToolChoiceOption", - "ToolResponse", - "ToolType", - "TransitionType", - "UpdateAgentRequestInstructions", - "User", - "WorkflowStep", - "YieldWorkflowStep", + "SessionsMultiAgentMultiUserSession", + "SessionsMultiAgentNoUserSession", + "SessionsMultiAgentSingleUserSession", + "SessionsRouteCreateOrUpdateResponse", + "SessionsRouteCreateResponse", + "SessionsRouteDeleteResponse", + "SessionsRouteListRequestDirection", + "SessionsRouteListRequestSortBy", + "SessionsRouteListResponse", + "SessionsRoutePatchResponse", + "SessionsRouteUpdateResponse", + "SessionsSession", + "SessionsSession_MultiAgentMultiUser", + "SessionsSession_MultiAgentNoUser", + "SessionsSession_MultiAgentSingleUser", + "SessionsSession_SingleAgentMultiUser", + "SessionsSession_SingleAgentNoUser", + "SessionsSession_SingleAgentSingleUser", + "SessionsSingleAgentMultiUserSession", + "SessionsSingleAgentNoUserSession", + "SessionsSingleAgentSingleUserSession", + "TaskExecutionsRouteCreateResponse", + "TaskExecutionsRouteListRequestDirection", + "TaskExecutionsRouteListRequestSortBy", + "TaskExecutionsRouteListResponse", + "TaskExecutionsRouteResumeWithTaskTokenResponse", + "TasksCel", + "TasksErrorWorkflowStep", + "TasksEvaluateStep", + "TasksIfElseWorkflowStep", + "TasksPromptStep", + "TasksPromptStepPrompt", + "TasksPromptStepSettings", + "TasksPromptStepSettingsFrequencyPenalty", + "TasksPromptStepSettingsLengthPenalty", + "TasksPromptStepSettingsPreset", + "TasksRouteCreateOrUpdateResponse", + "TasksRouteCreateResponse", + "TasksRouteDeleteResponse", + "TasksRouteListRequestDirection", + "TasksRouteListRequestSortBy", + "TasksRouteListResponse", + "TasksRoutePatchResponse", + "TasksRouteUpdateResponse", + "TasksTask", + "TasksToolCallStep", + "TasksWorkflowStep", + "TasksWorkflowStep_Error", + "TasksWorkflowStep_Evaluate", + "TasksWorkflowStep_IfElse", + "TasksWorkflowStep_Prompt", + "TasksWorkflowStep_ToolCall", + "TasksWorkflowStep_Yield", + "TasksYieldStep", + "ToolRouteDeleteResponse", + "ToolRoutePatchResponse", + "ToolRouteUpdateResponse", + "ToolsChosenFunctionCall", + "ToolsChosenToolCall", + "ToolsChosenToolCall_Function", + "ToolsCreateToolRequest", + "ToolsFunctionCallOption", + "ToolsFunctionDef", + "ToolsFunctionDefUpdate", + "ToolsFunctionTool", + "ToolsTool", + "ToolsToolResponse", + "ToolsToolType", + "ToolsTool_Function", + "UserDocsRouteListRequestDirection", + "UserDocsRouteListRequestSortBy", + "UserDocsRouteListResponse", + "UserDocsSearchRouteSearchRequestDirection", + "UserDocsSearchRouteSearchRequestSortBy", + "UserDocsSearchRouteSearchResponse", + "UsersRouteCreateOrUpdateResponse", + "UsersRouteCreateResponse", + "UsersRouteDeleteResponse", + "UsersRouteListRequestDirection", + "UsersRouteListRequestSortBy", + "UsersRouteListResponse", + "UsersRoutePatchResponse", + "UsersRouteUpdateResponse", + "UsersUser", ] diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index 4316526e0..bce26ce0b 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -11,52 +11,153 @@ from .core.jsonable_encoder import jsonable_encoder from .core.remove_none_from_dict import remove_none_from_dict from .environment import JulepApiEnvironment -from .types.agent import Agent -from .types.agent_default_settings import AgentDefaultSettings -from .types.chat_input_data_tool_choice import ChatInputDataToolChoice -from .types.chat_response import ChatResponse -from .types.chat_settings_preset import ChatSettingsPreset -from .types.chat_settings_response_format import ChatSettingsResponseFormat -from .types.chat_settings_stop import ChatSettingsStop -from .types.create_agent_request_instructions import CreateAgentRequestInstructions -from .types.create_doc import CreateDoc -from .types.create_tool_request import CreateToolRequest -from .types.execution import Execution -from .types.execution_status import ExecutionStatus -from .types.execution_transition import ExecutionTransition -from .types.function_def import FunctionDef -from .types.get_agent_docs_request_order import GetAgentDocsRequestOrder -from .types.get_agent_docs_request_sort_by import GetAgentDocsRequestSortBy -from .types.get_agent_docs_response import GetAgentDocsResponse -from .types.get_agent_memories_response import GetAgentMemoriesResponse -from .types.get_agent_tools_response import GetAgentToolsResponse -from .types.get_history_response import GetHistoryResponse -from .types.get_suggestions_response import GetSuggestionsResponse -from .types.get_user_docs_request_order import GetUserDocsRequestOrder -from .types.get_user_docs_request_sort_by import GetUserDocsRequestSortBy -from .types.get_user_docs_response import GetUserDocsResponse -from .types.input_chat_ml_message import InputChatMlMessage -from .types.job_status import JobStatus -from .types.list_agents_request_order import ListAgentsRequestOrder -from .types.list_agents_request_sort_by import ListAgentsRequestSortBy -from .types.list_agents_response import ListAgentsResponse -from .types.list_sessions_request_order import ListSessionsRequestOrder -from .types.list_sessions_request_sort_by import ListSessionsRequestSortBy -from .types.list_sessions_response import ListSessionsResponse -from .types.list_users_request_order import ListUsersRequestOrder -from .types.list_users_request_sort_by import ListUsersRequestSortBy -from .types.list_users_response import ListUsersResponse -from .types.partial_function_def import PartialFunctionDef -from .types.patch_agent_request_instructions import PatchAgentRequestInstructions -from .types.resource_created_response import ResourceCreatedResponse -from .types.resource_updated_response import ResourceUpdatedResponse -from .types.session import Session -from .types.task import Task -from .types.tool import Tool -from .types.tool_response import ToolResponse -from .types.update_agent_request_instructions import UpdateAgentRequestInstructions -from .types.user import User -from .types.workflow_step import WorkflowStep +from .types.agent_docs_route_list_request_direction import ( + AgentDocsRouteListRequestDirection, +) +from .types.agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy +from .types.agent_docs_route_list_response import AgentDocsRouteListResponse +from .types.agent_tools_route_create_response import AgentToolsRouteCreateResponse +from .types.agent_tools_route_list_request_direction import ( + AgentToolsRouteListRequestDirection, +) +from .types.agent_tools_route_list_request_sort_by import ( + AgentToolsRouteListRequestSortBy, +) +from .types.agent_tools_route_list_response import AgentToolsRouteListResponse +from .types.agents_agent import AgentsAgent +from .types.agents_create_agent_request import AgentsCreateAgentRequest +from .types.agents_create_or_update_agent_request_default_settings import ( + AgentsCreateOrUpdateAgentRequestDefaultSettings, +) +from .types.agents_create_or_update_agent_request_instructions import ( + AgentsCreateOrUpdateAgentRequestInstructions, +) +from .types.agents_docs_search_route_search_request_direction import ( + AgentsDocsSearchRouteSearchRequestDirection, +) +from .types.agents_docs_search_route_search_request_sort_by import ( + AgentsDocsSearchRouteSearchRequestSortBy, +) +from .types.agents_docs_search_route_search_response import ( + AgentsDocsSearchRouteSearchResponse, +) +from .types.agents_patch_agent_request_default_settings import ( + AgentsPatchAgentRequestDefaultSettings, +) +from .types.agents_patch_agent_request_instructions import ( + AgentsPatchAgentRequestInstructions, +) +from .types.agents_route_create_or_update_response import ( + AgentsRouteCreateOrUpdateResponse, +) +from .types.agents_route_create_response import AgentsRouteCreateResponse +from .types.agents_route_delete_response import AgentsRouteDeleteResponse +from .types.agents_route_list_request_direction import AgentsRouteListRequestDirection +from .types.agents_route_list_request_sort_by import AgentsRouteListRequestSortBy +from .types.agents_route_list_response import AgentsRouteListResponse +from .types.agents_route_patch_response import AgentsRoutePatchResponse +from .types.agents_route_update_response import AgentsRouteUpdateResponse +from .types.agents_update_agent_request_default_settings import ( + AgentsUpdateAgentRequestDefaultSettings, +) +from .types.agents_update_agent_request_instructions import ( + AgentsUpdateAgentRequestInstructions, +) +from .types.common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .types.common_limit import CommonLimit +from .types.common_offset import CommonOffset +from .types.common_uuid import CommonUuid +from .types.docs_doc import DocsDoc +from .types.docs_doc_search_request import DocsDocSearchRequest +from .types.execution_transitions_route_list_request_direction import ( + ExecutionTransitionsRouteListRequestDirection, +) +from .types.execution_transitions_route_list_request_sort_by import ( + ExecutionTransitionsRouteListRequestSortBy, +) +from .types.execution_transitions_route_list_response import ( + ExecutionTransitionsRouteListResponse, +) +from .types.executions_execution import ExecutionsExecution +from .types.executions_route_update_response import ExecutionsRouteUpdateResponse +from .types.executions_update_execution_request import ExecutionsUpdateExecutionRequest +from .types.history_route_delete_response import HistoryRouteDeleteResponse +from .types.history_route_list_request_direction import HistoryRouteListRequestDirection +from .types.history_route_list_request_sort_by import HistoryRouteListRequestSortBy +from .types.history_route_list_response import HistoryRouteListResponse +from .types.individual_docs_route_delete_response import ( + IndividualDocsRouteDeleteResponse, +) +from .types.jobs_job_status import JobsJobStatus +from .types.sessions_route_create_or_update_response import ( + SessionsRouteCreateOrUpdateResponse, +) +from .types.sessions_route_create_response import SessionsRouteCreateResponse +from .types.sessions_route_delete_response import SessionsRouteDeleteResponse +from .types.sessions_route_list_request_direction import ( + SessionsRouteListRequestDirection, +) +from .types.sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy +from .types.sessions_route_list_response import SessionsRouteListResponse +from .types.sessions_route_patch_response import SessionsRoutePatchResponse +from .types.sessions_route_update_response import SessionsRouteUpdateResponse +from .types.sessions_session import SessionsSession +from .types.task_executions_route_create_response import ( + TaskExecutionsRouteCreateResponse, +) +from .types.task_executions_route_list_request_direction import ( + TaskExecutionsRouteListRequestDirection, +) +from .types.task_executions_route_list_request_sort_by import ( + TaskExecutionsRouteListRequestSortBy, +) +from .types.task_executions_route_list_response import TaskExecutionsRouteListResponse +from .types.task_executions_route_resume_with_task_token_response import ( + TaskExecutionsRouteResumeWithTaskTokenResponse, +) +from .types.tasks_route_create_or_update_response import ( + TasksRouteCreateOrUpdateResponse, +) +from .types.tasks_route_create_response import TasksRouteCreateResponse +from .types.tasks_route_delete_response import TasksRouteDeleteResponse +from .types.tasks_route_list_request_direction import TasksRouteListRequestDirection +from .types.tasks_route_list_request_sort_by import TasksRouteListRequestSortBy +from .types.tasks_route_list_response import TasksRouteListResponse +from .types.tasks_route_patch_response import TasksRoutePatchResponse +from .types.tasks_route_update_response import TasksRouteUpdateResponse +from .types.tasks_workflow_step import TasksWorkflowStep +from .types.tool_route_delete_response import ToolRouteDeleteResponse +from .types.tool_route_patch_response import ToolRoutePatchResponse +from .types.tool_route_update_response import ToolRouteUpdateResponse +from .types.tools_create_tool_request import ToolsCreateToolRequest +from .types.tools_function_def import ToolsFunctionDef +from .types.tools_function_def_update import ToolsFunctionDefUpdate +from .types.tools_tool_type import ToolsToolType +from .types.user_docs_route_list_request_direction import ( + UserDocsRouteListRequestDirection, +) +from .types.user_docs_route_list_request_sort_by import UserDocsRouteListRequestSortBy +from .types.user_docs_route_list_response import UserDocsRouteListResponse +from .types.user_docs_search_route_search_request_direction import ( + UserDocsSearchRouteSearchRequestDirection, +) +from .types.user_docs_search_route_search_request_sort_by import ( + UserDocsSearchRouteSearchRequestSortBy, +) +from .types.user_docs_search_route_search_response import ( + UserDocsSearchRouteSearchResponse, +) +from .types.users_route_create_or_update_response import ( + UsersRouteCreateOrUpdateResponse, +) +from .types.users_route_create_response import UsersRouteCreateResponse +from .types.users_route_delete_response import UsersRouteDeleteResponse +from .types.users_route_list_request_direction import UsersRouteListRequestDirection +from .types.users_route_list_request_sort_by import UsersRouteListRequestSortBy +from .types.users_route_list_response import UsersRouteListResponse +from .types.users_route_patch_response import UsersRoutePatchResponse +from .types.users_route_update_response import UsersRouteUpdateResponse +from .types.users_user import UsersUser try: import pydantic.v1 as pydantic # type: ignore @@ -73,2101 +174,2568 @@ def __init__( *, base_url: typing.Optional[str] = None, environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, + auth_key: str, api_key: str, timeout: typing.Optional[float] = 300, httpx_client: typing.Optional[httpx.Client] = None, ): self._client_wrapper = SyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), + auth_key=auth_key, api_key=api_key, httpx_client=( httpx.Client(timeout=timeout) if httpx_client is None else httpx_client ), ) - def list_sessions( + def agents_route_list( self, *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[ListSessionsRequestSortBy] = None, - order: typing.Optional[ListSessionsRequestOrder] = None, - ) -> ListSessionsResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsRouteListRequestSortBy, + direction: AgentsRouteListRequestDirection, + metadata_filter: str, + ) -> AgentsRouteListResponse: """ - List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) + List undefined items Parameters: - - limit: typing.Optional[int]. Number of sessions to return + - limit: CommonLimit. Limit the number of undefined items returned - - offset: typing.Optional[int]. Number of sessions to skip (sorted created_at descending order) + - offset: CommonOffset. Offset the undefined items returned - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata + - sort_by: AgentsRouteListRequestSortBy. Sort by a field - - sort_by: typing.Optional[ListSessionsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` + - direction: AgentsRouteListRequestDirection. Sort direction - - order: typing.Optional[ListSessionsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import AgentsRouteListRequestDirection, AgentsRouteListRequestSortBy from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.list_sessions() + client.agents_route_list( + limit=1, + offset=1, + sort_by=AgentsRouteListRequestSortBy.CREATED_AT, + direction=AgentsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", + ) """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), params=remove_none_from_dict( { "limit": limit, "offset": offset, - "metadata_filter": metadata_filter, "sort_by": sort_by, - "order": order, + "direction": direction, + "metadata_filter": metadata_filter, } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ListSessionsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def agents_route_create( + self, *, request: AgentsCreateAgentRequest + ) -> AgentsRouteCreateResponse: + """ + Create new undefined + + Parameters: + - request: AgentsCreateAgentRequest. + --- + from julep import AgentsCreateAgentRequest + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.agents_route_create( + request=AgentsCreateAgentRequest( + name="name", + about="about", + model="model", + docs=[], + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), + json=jsonable_encoder(request), + headers=self._client_wrapper.get_headers(), + timeout=300, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_session( + def agents_route_create_or_update( self, *, - user_id: typing.Optional[str] = OMIT, - agent_id: str, - situation: typing.Optional[str] = OMIT, + id: CommonUuid, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - ) -> ResourceCreatedResponse: + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateOrUpdateAgentRequestInstructions, + default_settings: typing.Optional[ + AgentsCreateOrUpdateAgentRequestDefaultSettings + ] = OMIT, + ) -> AgentsRouteCreateOrUpdateResponse: """ - Create a session between an agent and a user + Create or update undefined (ID is required in payload; existing resource will be overwritten) Parameters: - - user_id: typing.Optional[str]. (Optional) User ID of user to associate with this session + - id: CommonUuid. - - agent_id: str. Agent ID of agent to associate with this session + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - - situation: typing.Optional[str]. A specific situation that sets the background for this session + - name: CommonIdentifierSafeUnicode. Name of the agent - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - about: str. About the agent - - render_templates: typing.Optional[bool]. Render system and assistant message content as jinja templates + - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + - instructions: AgentsCreateOrUpdateAgentRequestInstructions. Instructions for the agent - - context_overflow: typing.Optional[str]. Action to start on context window overflow + - default_settings: typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.create_session( - agent_id="agent_id", + client.agents_route_create_or_update( + id="id", + name="name", + about="about", + model="model", ) """ - _request: typing.Dict[str, typing.Any] = {"agent_id": agent_id} - if user_id is not OMIT: - _request["user_id"] = user_id - if situation is not OMIT: - _request["situation"] = situation + _request: typing.Dict[str, typing.Any] = { + "id": id, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + } if metadata is not OMIT: _request["metadata"] = metadata - if render_templates is not OMIT: - _request["render_templates"] = render_templates - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow + if default_settings is not OMIT: + _request["default_settings"] = default_settings _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list_users( - self, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[ListUsersRequestSortBy] = None, - order: typing.Optional[ListUsersRequestOrder] = None, - ) -> ListUsersResponse: + def agents_route_get(self, id: CommonUuid) -> AgentsAgent: """ - List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) + Get undefined by id Parameters: - - limit: typing.Optional[int]. Number of items to return - - - offset: typing.Optional[int]. Number of items to skip (sorted created_at descending order) - - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata - - - sort_by: typing.Optional[ListUsersRequestSortBy]. Which field to sort by: `created_at` or `updated_at` - - - order: typing.Optional[ListUsersRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.list_users() + client.agents_route_get( + id="id", + ) """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "metadata_filter": metadata_filter, - "sort_by": sort_by, - "order": order, - } + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ListUsersResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsAgent, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_user( + def agents_route_update( self, + id: CommonUuid, *, - name: typing.Optional[str] = OMIT, - about: typing.Optional[str] = OMIT, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - ) -> ResourceCreatedResponse: + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, + ) -> AgentsRouteUpdateResponse: """ - Create a new user + Update undefined by id (overwrite) Parameters: - - name: typing.Optional[str]. Name of the user + - id: CommonUuid. ID of the undefined - - about: typing.Optional[str]. About the user + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - name: CommonIdentifierSafeUnicode. Name of the agent + + - about: str. About the agent - - docs: typing.Optional[typing.List[CreateDoc]]. List of docs about user + - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. (Optional) metadata + - instructions: AgentsUpdateAgentRequestInstructions. Instructions for the agent + + - default_settings: typing.Optional[AgentsUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.create_user() + client.agents_route_update( + id="id", + name="name", + about="about", + model="model", + ) """ - _request: typing.Dict[str, typing.Any] = {} - if name is not OMIT: - _request["name"] = name - if about is not OMIT: - _request["about"] = about - if docs is not OMIT: - _request["docs"] = docs + _request: typing.Dict[str, typing.Any] = { + "name": name, + "about": about, + "model": model, + "instructions": instructions, + } if metadata is not OMIT: _request["metadata"] = metadata + if default_settings is not OMIT: + _request["default_settings"] = default_settings _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), + "PUT", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" + ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list_agents( - self, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[ListAgentsRequestSortBy] = None, - order: typing.Optional[ListAgentsRequestOrder] = None, - ) -> ListAgentsResponse: + def agents_route_delete(self, id: CommonUuid) -> AgentsRouteDeleteResponse: """ - List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) + Delete undefined by id Parameters: - - limit: typing.Optional[int]. Number of items to return - - - offset: typing.Optional[int]. Number of items to skip (sorted created_at descending order) - - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata - - - sort_by: typing.Optional[ListAgentsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` - - - order: typing.Optional[ListAgentsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.list_agents() + client.agents_route_delete( + id="id", + ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "metadata_filter": metadata_filter, - "sort_by": sort_by, - "order": order, - } + "DELETE", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ListAgentsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_agent( + def agents_route_patch( self, + id: CommonUuid, *, - name: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, about: typing.Optional[str] = OMIT, - tools: typing.Optional[typing.List[CreateToolRequest]] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, model: typing.Optional[str] = OMIT, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - instructions: typing.Optional[CreateAgentRequestInstructions] = OMIT, - ) -> ResourceCreatedResponse: + instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, + default_settings: typing.Optional[ + AgentsPatchAgentRequestDefaultSettings + ] = OMIT, + ) -> AgentsRoutePatchResponse: """ - Create a new agent + Patch undefined by id (merge changes) Parameters: - - name: str. Name of the agent - - - about: typing.Optional[str]. About the agent + - id: CommonUuid. ID of the undefined - - 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. + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - - default_settings: typing.Optional[AgentDefaultSettings]. Default model settings to start every session with + - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the agent - - model: typing.Optional[str]. Name of the model that the agent is supposed to use + - about: typing.Optional[str]. About the agent - - docs: typing.Optional[typing.List[CreateDoc]]. List of docs about agent + - model: typing.Optional[str]. Model name to use (gpt-4-turbo, gemini-nano etc) - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. (Optional) metadata + - instructions: typing.Optional[AgentsPatchAgentRequestInstructions]. Instructions for the agent - - instructions: typing.Optional[CreateAgentRequestInstructions]. Instructions for the agent + - default_settings: typing.Optional[AgentsPatchAgentRequestDefaultSettings]. Default settings for all sessions created by this agent --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.create_agent( - name="name", + client.agents_route_patch( + id="id", ) """ - _request: typing.Dict[str, typing.Any] = {"name": name} + _request: typing.Dict[str, typing.Any] = {} + if metadata is not OMIT: + _request["metadata"] = metadata + if name is not OMIT: + _request["name"] = name if about is not OMIT: _request["about"] = about - if tools is not OMIT: - _request["tools"] = tools - if default_settings is not OMIT: - _request["default_settings"] = default_settings if model is not OMIT: _request["model"] = model - if docs is not OMIT: - _request["docs"] = docs - if metadata is not OMIT: - _request["metadata"] = metadata if instructions is not OMIT: _request["instructions"] = instructions + if default_settings is not OMIT: + _request["default_settings"] = default_settings _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), + "PATCH", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" + ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_session(self, session_id: str) -> Session: + def agent_docs_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentDocsRouteListRequestSortBy, + direction: AgentDocsRouteListRequestDirection, + metadata_filter: str, + ) -> AgentDocsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - session_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: AgentDocsRouteListRequestSortBy. Sort by a field + + - direction: AgentDocsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + AgentDocsRouteListRequestDirection, + AgentDocsRouteListRequestSortBy, + ) from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_session( - session_id="session_id", + client.agent_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by=AgentDocsRouteListRequestSortBy.CREATED_AT, + direction=AgentDocsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/docs" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(Session, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update_session( + def agents_docs_search_route_search( self, - session_id: str, + id: CommonUuid, *, - situation: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - ) -> ResourceUpdatedResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsDocsSearchRouteSearchRequestSortBy, + direction: AgentsDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: DocsDocSearchRequest, + ) -> AgentsDocsSearchRouteSearchResponse: """ - + Search for documents owned by undefined Parameters: - - session_id: str. + - id: CommonUuid. ID of the undefined - - situation: str. Updated situation for this session + - limit: CommonLimit. Limit the number of undefined items returned - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - offset: CommonOffset. Offset the undefined items returned - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + - sort_by: AgentsDocsSearchRouteSearchRequestSortBy. Sort by a field - - context_overflow: typing.Optional[str]. Action to start on context window overflow - --- - from julep.client import JulepApi + - direction: AgentsDocsSearchRouteSearchRequestDirection. Sort direction - client = JulepApi( - api_key="YOUR_API_KEY", - ) - client.update_session( - session_id="session_id", - situation="situation", - ) + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata + + - body: DocsDocSearchRequest. """ - _request: typing.Dict[str, typing.Any] = {"situation": situation} - if metadata is not OMIT: - _request["metadata"] = metadata - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow _response = self._client_wrapper.httpx_client.request( - "PUT", + "POST", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/search" ), - json=jsonable_encoder(_request), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } + ), + json=jsonable_encoder({"body": body}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_session(self, session_id: str) -> None: + def agent_tools_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentToolsRouteListRequestSortBy, + direction: AgentToolsRouteListRequestDirection, + metadata_filter: str, + ) -> AgentToolsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - session_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: AgentToolsRouteListRequestSortBy. Sort by a field + + - direction: AgentToolsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + AgentToolsRouteListRequestDirection, + AgentToolsRouteListRequestSortBy, + ) from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_session( - session_id="session_id", + client.agent_tools_route_list( + id="id", + limit=1, + offset=1, + sort_by=AgentToolsRouteListRequestSortBy.CREATED_AT, + direction=AgentToolsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def patch_session( - self, - session_id: str, - *, - situation: typing.Optional[str] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - ) -> ResourceUpdatedResponse: + def agent_tools_route_create( + self, id: CommonUuid, *, request: AgentsCreateAgentRequest + ) -> AgentToolsRouteCreateResponse: """ - + Create new undefined Parameters: - - session_id: str. - - - situation: typing.Optional[str]. Updated situation for this session - - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - id: CommonUuid. ID of parent undefined - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality - - - context_overflow: typing.Optional[str]. Action to start on context window overflow + - request: AgentsCreateAgentRequest. --- + from julep import AgentsCreateAgentRequest from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.patch_session( - session_id="session_id", + client.agent_tools_route_create( + id="id", + request=AgentsCreateAgentRequest( + name="name", + about="about", + model="model", + docs=[], + ), ) """ - _request: typing.Dict[str, typing.Any] = {} - if situation is not OMIT: - _request["situation"] = situation - if metadata is not OMIT: - _request["metadata"] = metadata - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow _response = self._client_wrapper.httpx_client.request( - "PATCH", + "POST", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" ), - json=jsonable_encoder(_request), + json=jsonable_encoder(request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_suggestions( - self, - session_id: str, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetSuggestionsResponse: + def individual_docs_route_get(self, id: CommonUuid) -> DocsDoc: """ - Sorted (created_at descending) + Get undefined by id Parameters: - - session_id: str. - - - limit: typing.Optional[int]. - - - offset: typing.Optional[int]. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_suggestions( - session_id="session_id", + client.individual_docs_route_get( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"sessions/{session_id}/suggestions", + f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" ), - params=remove_none_from_dict({"limit": limit, "offset": offset}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetSuggestionsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(DocsDoc, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_history( - self, - session_id: str, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetHistoryResponse: + def individual_docs_route_delete( + self, id: CommonUuid + ) -> IndividualDocsRouteDeleteResponse: """ - Sorted (created_at ascending) + Delete undefined by id Parameters: - - session_id: str. - - - limit: typing.Optional[int]. - - - offset: typing.Optional[int]. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_history( - session_id="session_id", + client.individual_docs_route_delete( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", + "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"sessions/{session_id}/history", + f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" ), - params=remove_none_from_dict({"limit": limit, "offset": offset}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetHistoryResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_session_history(self, session_id: str) -> None: + def executions_route_get(self, id: CommonUuid) -> ExecutionsExecution: """ - + Get undefined by id Parameters: - - session_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_session_history( - session_id="session_id", + client.executions_route_get( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"sessions/{session_id}/history", + f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def chat( - self, - session_id: str, - *, - messages: typing.List[InputChatMlMessage], - tools: typing.Optional[typing.List[Tool]] = OMIT, - tool_choice: typing.Optional[ChatInputDataToolChoice] = 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, - min_p: typing.Optional[float] = OMIT, - preset: typing.Optional[ChatSettingsPreset] = OMIT, - model: typing.Optional[str] = OMIT, - recall: typing.Optional[bool] = OMIT, - record: typing.Optional[bool] = OMIT, - remember: typing.Optional[bool] = OMIT, - ) -> ChatResponse: + def executions_route_update( + self, id: CommonUuid, *, request: ExecutionsUpdateExecutionRequest + ) -> ExecutionsRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - 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 + - id: CommonUuid. ID of the undefined - - tool_choice: typing.Optional[ChatInputDataToolChoice]. 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. + - request: ExecutionsUpdateExecutionRequest. + """ + _response = self._client_wrapper.httpx_client.request( + "PUT", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" + ), + json=jsonable_encoder(request), + headers=self._client_wrapper.get_headers(), + timeout=300, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) - - 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. + def execution_transitions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, + metadata_filter: str, + ) -> ExecutionTransitionsRouteListResponse: + """ + List undefined items of parent undefined - - min_p: typing.Optional[float]. Minimum probability compared to leading token to be considered + Parameters: + - id: CommonUuid. ID of parent undefined - - preset: typing.Optional[ChatSettingsPreset]. Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) + - limit: CommonLimit. Limit the number of undefined items returned - - model: typing.Optional[str]. Model name + - offset: CommonOffset. Offset the undefined items returned - - recall: typing.Optional[bool]. Whether previous memories should be recalled or not + - sort_by: ExecutionTransitionsRouteListRequestSortBy. Sort by a field - - record: typing.Optional[bool]. Whether this interaction should be recorded in history or not + - direction: ExecutionTransitionsRouteListRequestDirection. Sort direction - - remember: typing.Optional[bool]. Whether this interaction should form memories or not + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- - from julep import InputChatMlMessage, InputChatMlMessageRole + from julep import ( + ExecutionTransitionsRouteListRequestDirection, + ExecutionTransitionsRouteListRequestSortBy, + ) from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.chat( - session_id="session_id", - messages=[ - InputChatMlMessage( - role=InputChatMlMessageRole.USER, - ) - ], + client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by=ExecutionTransitionsRouteListRequestSortBy.CREATED_AT, + direction=ExecutionTransitionsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ - _request: typing.Dict[str, typing.Any] = {"messages": messages} - if tools is not OMIT: - _request["tools"] = tools - if tool_choice is not OMIT: - _request["tool_choice"] = tool_choice - if frequency_penalty is not OMIT: - _request["frequency_penalty"] = frequency_penalty - if length_penalty is not OMIT: - _request["length_penalty"] = length_penalty - if logit_bias is not OMIT: - _request["logit_bias"] = logit_bias - if max_tokens is not OMIT: - _request["max_tokens"] = max_tokens - if presence_penalty is not OMIT: - _request["presence_penalty"] = presence_penalty - if repetition_penalty is not OMIT: - _request["repetition_penalty"] = repetition_penalty - if response_format is not OMIT: - _request["response_format"] = response_format - if seed is not OMIT: - _request["seed"] = seed - if stop is not OMIT: - _request["stop"] = stop - if stream is not OMIT: - _request["stream"] = stream - if temperature is not OMIT: - _request["temperature"] = temperature - if top_p is not OMIT: - _request["top_p"] = top_p - if min_p is not OMIT: - _request["min_p"] = min_p - if preset is not OMIT: - _request["preset"] = preset.value - if model is not OMIT: - _request["model"] = model - if recall is not OMIT: - _request["recall"] = recall - if record is not OMIT: - _request["record"] = record - if remember is not OMIT: - _request["remember"] = remember _response = self._client_wrapper.httpx_client.request( - "POST", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}/chat" + f"{self._client_wrapper.get_base_url()}/", + f"executions/{id}/transitions", ), - json=jsonable_encoder(_request), - headers=remove_none_from_dict( - {**self._client_wrapper.get_headers(), "Accept": "application/json"} + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), + headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ChatResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_agent_memories( - self, - agent_id: str, - *, - query: str, - user_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetAgentMemoriesResponse: + def job_route_get(self, id: CommonUuid) -> JobsJobStatus: """ - Sorted (created_at descending) + Get undefined by id Parameters: - - agent_id: str. - - - query: str. - - - user_id: typing.Optional[str]. - - - limit: typing.Optional[int]. - - - offset: typing.Optional[int]. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_agent_memories( - agent_id="agent_id", - query="query", + client.job_route_get( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/memories" - ), - params=remove_none_from_dict( - {"query": query, "user_id": user_id, "limit": limit, "offset": offset} + f"{self._client_wrapper.get_base_url()}/", f"jobs/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetAgentMemoriesResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_user(self, user_id: str) -> User: + def sessions_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: SessionsRouteListRequestSortBy, + direction: SessionsRouteListRequestDirection, + metadata_filter: str, + ) -> SessionsRouteListResponse: """ - + List undefined items Parameters: - - user_id: str. + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: SessionsRouteListRequestSortBy. Sort by a field + + - direction: SessionsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + SessionsRouteListRequestDirection, + SessionsRouteListRequestSortBy, + ) from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_user( - user_id="user_id", + client.sessions_route_list( + limit=1, + offset=1, + sort_by=SessionsRouteListRequestSortBy.CREATED_AT, + direction=SessionsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(User, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update_user( + def sessions_route_create( self, - user_id: str, *, - about: str, - name: str, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.List[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.List[CommonUuid]] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - ) -> ResourceUpdatedResponse: + ) -> SessionsRouteCreateResponse: """ - + Create new undefined Parameters: - - user_id: str. + - user: typing.Optional[CommonUuid]. User ID of user associated with this session - - about: str. About the user + - users: typing.Optional[typing.List[CommonUuid]]. + + - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + + - agents: typing.Optional[typing.List[CommonUuid]]. + + - situation: str. A specific situation that sets the background for this session - - name: str. Name of the user + - render_templates: bool. Render system and assistant message content as jinja templates + + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + + - context_overflow: typing.Optional[str]. Action to start on context window overflow - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.update_user( - user_id="user_id", - about="about", - name="name", - ) - """ - _request: typing.Dict[str, typing.Any] = {"about": about, "name": name} + client.sessions_route_create( + situation="situation", + render_templates=True, + ) + """ + _request: typing.Dict[str, typing.Any] = { + "situation": situation, + "render_templates": render_templates, + } + if user is not OMIT: + _request["user"] = user + if users is not OMIT: + _request["users"] = users + if agent is not OMIT: + _request["agent"] = agent + if agents is not OMIT: + _request["agents"] = agents + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow if metadata is not OMIT: _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" - ), + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_user(self, user_id: str) -> None: + def sessions_route_create_or_update( + self, + *, + id: CommonUuid, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.List[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.List[CommonUuid]] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + ) -> SessionsRouteCreateOrUpdateResponse: """ - + Create or update undefined (ID is required in payload; existing resource will be overwritten) Parameters: - - user_id: str. + - id: CommonUuid. + + - user: typing.Optional[CommonUuid]. User ID of user associated with this session + + - users: typing.Optional[typing.List[CommonUuid]]. + + - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + + - agents: typing.Optional[typing.List[CommonUuid]]. + + - situation: str. A specific situation that sets the background for this session + + - render_templates: bool. Render system and assistant message content as jinja templates + + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + + - context_overflow: typing.Optional[str]. Action to start on context window overflow + + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_user( - user_id="user_id", - ) - """ + client.sessions_route_create_or_update( + id="id", + situation="situation", + render_templates=True, + ) + """ + _request: typing.Dict[str, typing.Any] = { + "id": id, + "situation": situation, + "render_templates": render_templates, + } + if user is not OMIT: + _request["user"] = user + if users is not OMIT: + _request["users"] = users + if agent is not OMIT: + _request["agent"] = agent + if agents is not OMIT: + _request["agents"] = agents + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow + if metadata is not OMIT: + _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" - ), + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def patch_user( + def history_route_list( self, - user_id: str, + id: CommonUuid, *, - about: typing.Optional[str] = OMIT, - name: typing.Optional[str] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - ) -> ResourceUpdatedResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, + ) -> HistoryRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - user_id: str. + - id: CommonUuid. ID of parent undefined - - about: typing.Optional[str]. About the user + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned - - name: typing.Optional[str]. Name of the user + - sort_by: HistoryRouteListRequestSortBy. Sort by a field - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - direction: HistoryRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + HistoryRouteListRequestDirection, + HistoryRouteListRequestSortBy, + ) from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.patch_user( - user_id="user_id", + client.history_route_list( + id="id", + limit=1, + offset=1, + sort_by=HistoryRouteListRequestSortBy.CREATED_AT, + direction=HistoryRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ - _request: typing.Dict[str, typing.Any] = {} - if about is not OMIT: - _request["about"] = about - if name is not OMIT: - _request["name"] = name - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "PATCH", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), - json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_agent(self, agent_id: str) -> Agent: + def history_route_delete(self, id: CommonUuid) -> HistoryRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_agent( - agent_id="agent_id", + client.history_route_delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "DELETE", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" + ), + headers=self._client_wrapper.get_headers(), + timeout=300, ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_get(self, id: CommonUuid) -> SessionsSession: + """ + Get undefined by id + + Parameters: + - id: CommonUuid. ID of the undefined """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(Agent, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsSession, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update_agent( + def sessions_route_update( self, - agent_id: str, + id: CommonUuid, *, - about: str, - name: str, - model: typing.Optional[str] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - instructions: typing.Optional[UpdateAgentRequestInstructions] = OMIT, - ) -> ResourceUpdatedResponse: + ) -> SessionsRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - agent_id: str. - - - about: str. About the agent + - id: CommonUuid. ID of the undefined - - name: str. Name of the agent + - situation: str. A specific situation that sets the background for this session - - model: typing.Optional[str]. Name of the model that the agent is supposed to use + - render_templates: bool. Render system and assistant message content as jinja templates - - default_settings: typing.Optional[AgentDefaultSettings]. Default model settings to start every session with + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - context_overflow: typing.Optional[str]. Action to start on context window overflow - - instructions: typing.Optional[UpdateAgentRequestInstructions]. Instructions for the agent + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.update_agent( - agent_id="agent_id", - about="about", - name="name", + client.sessions_route_update( + id="id", + situation="situation", + render_templates=True, ) """ - _request: typing.Dict[str, typing.Any] = {"about": about, "name": name} - if model is not OMIT: - _request["model"] = model - if default_settings is not OMIT: - _request["default_settings"] = default_settings + _request: typing.Dict[str, typing.Any] = { + "situation": situation, + "render_templates": render_templates, + } + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow if metadata is not OMIT: _request["metadata"] = metadata - if instructions is not OMIT: - _request["instructions"] = instructions _response = self._client_wrapper.httpx_client.request( "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_agent(self, agent_id: str) -> None: + def sessions_route_delete(self, id: CommonUuid) -> SessionsRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_agent( - agent_id="agent_id", + client.sessions_route_delete( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def patch_agent( + def sessions_route_patch( self, - agent_id: str, + id: CommonUuid, *, - about: typing.Optional[str] = OMIT, - name: typing.Optional[str] = OMIT, - model: typing.Optional[str] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - instructions: typing.Optional[PatchAgentRequestInstructions] = OMIT, - ) -> ResourceUpdatedResponse: + ) -> SessionsRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - agent_id: str. - - - about: typing.Optional[str]. About the agent + - id: CommonUuid. ID of the undefined - - name: typing.Optional[str]. Name of the agent + - situation: typing.Optional[str]. A specific situation that sets the background for this session - - model: typing.Optional[str]. Name of the model that the agent is supposed to use + - render_templates: typing.Optional[bool]. Render system and assistant message content as jinja templates - - default_settings: typing.Optional[AgentDefaultSettings]. Default model settings to start every session with + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - context_overflow: typing.Optional[str]. Action to start on context window overflow - - instructions: typing.Optional[PatchAgentRequestInstructions]. Instructions for the agent + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.patch_agent( - agent_id="agent_id", + client.sessions_route_patch( + id="id", ) """ _request: typing.Dict[str, typing.Any] = {} - if about is not OMIT: - _request["about"] = about - if name is not OMIT: - _request["name"] = name - if model is not OMIT: - _request["model"] = model - if default_settings is not OMIT: - _request["default_settings"] = default_settings + if situation is not OMIT: + _request["situation"] = situation + if render_templates is not OMIT: + _request["render_templates"] = render_templates + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow if metadata is not OMIT: _request["metadata"] = metadata - if instructions is not OMIT: - _request["instructions"] = instructions _response = self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_agent_docs( + def tasks_route_list( self, - agent_id: str, *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[GetAgentDocsRequestSortBy] = None, - order: typing.Optional[GetAgentDocsRequestOrder] = None, - ) -> GetAgentDocsResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, + metadata_filter: str, + ) -> TasksRouteListResponse: """ - Sorted (created_at descending) + List undefined items Parameters: - - agent_id: str. - - - limit: typing.Optional[int]. + - limit: CommonLimit. Limit the number of undefined items returned - - offset: typing.Optional[int]. + - offset: CommonOffset. Offset the undefined items returned - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata + - sort_by: TasksRouteListRequestSortBy. Sort by a field - - sort_by: typing.Optional[GetAgentDocsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` + - direction: TasksRouteListRequestDirection. Sort direction - - order: typing.Optional[GetAgentDocsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import TasksRouteListRequestDirection, TasksRouteListRequestSortBy from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_agent_docs( - agent_id="agent_id", + client.tasks_route_list( + limit=1, + offset=1, + sort_by=TasksRouteListRequestSortBy.CREATED_AT, + direction=TasksRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/docs" - ), + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), params=remove_none_from_dict( { "limit": limit, "offset": offset, - "metadata_filter": metadata_filter, "sort_by": sort_by, - "order": order, + "direction": direction, + "metadata_filter": metadata_filter, } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetAgentDocsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_agent_doc( - self, agent_id: str, *, request: CreateDoc - ) -> ResourceCreatedResponse: + def tasks_route_create( + self, + *, + name: str, + description: str, + main: typing.List[TasksWorkflowStep], + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.List[ToolsCreateToolRequest], + inherit_tools: bool, + ) -> TasksRouteCreateResponse: """ - + Create new undefined Parameters: - - agent_id: str. + - name: str. + + - description: str. + + - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. - - request: CreateDoc. + - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + + - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. --- - from julep import CreateDoc + from julep import ToolsCreateToolRequest, ToolsToolType from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.create_agent_doc( - agent_id="agent_id", - request=CreateDoc( - title="title", - ), + client.tasks_route_create( + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + ], + inherit_tools=True, ) """ + _request: typing.Dict[str, typing.Any] = { + "name": name, + "description": description, + "main": main, + "tools": tools, + "inherit_tools": inherit_tools, + } + if input_schema is not OMIT: + _request["input_schema"] = input_schema _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/docs" - ), - json=jsonable_encoder(request), + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_user_docs( + def tasks_route_create_or_update( self, - user_id: str, *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[GetUserDocsRequestSortBy] = None, - order: typing.Optional[GetUserDocsRequestOrder] = None, - ) -> GetUserDocsResponse: + id: CommonUuid, + name: str, + description: str, + main: typing.List[TasksWorkflowStep], + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.List[ToolsCreateToolRequest], + inherit_tools: bool, + ) -> TasksRouteCreateOrUpdateResponse: """ - Sorted (created_at descending) + Create or update undefined (ID is required in payload; existing resource will be overwritten) Parameters: - - user_id: str. + - id: CommonUuid. - - limit: typing.Optional[int]. + - name: str. - - offset: typing.Optional[int]. + - description: str. - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata + - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. - - sort_by: typing.Optional[GetUserDocsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. - - order: typing.Optional[GetUserDocsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + + - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. --- + from julep import ToolsCreateToolRequest, ToolsToolType from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_user_docs( - user_id="user_id", + client.tasks_route_create_or_update( + id="id", + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + ], + inherit_tools=True, ) """ + _request: typing.Dict[str, typing.Any] = { + "id": id, + "name": name, + "description": description, + "main": main, + "tools": tools, + "inherit_tools": inherit_tools, + } + if input_schema is not OMIT: + _request["input_schema"] = input_schema _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}/docs" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "metadata_filter": metadata_filter, - "sort_by": sort_by, - "order": order, - } - ), + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetUserDocsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_user_doc( - self, user_id: str, *, request: CreateDoc - ) -> ResourceCreatedResponse: + def tasks_route_update( + self, + id: CommonUuid, + *, + description: str, + main: typing.List[TasksWorkflowStep], + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.List[ToolsCreateToolRequest], + inherit_tools: bool, + ) -> TasksRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - user_id: str. + - id: CommonUuid. ID of the undefined + + - description: str. + + - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. - - request: CreateDoc. + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + + - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + + - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. --- - from julep import CreateDoc + from julep import ToolsCreateToolRequest, ToolsToolType from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.create_user_doc( - user_id="user_id", - request=CreateDoc( - title="title", - ), + client.tasks_route_update( + id="id", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + ], + inherit_tools=True, ) """ + _request: typing.Dict[str, typing.Any] = { + "description": description, + "main": main, + "tools": tools, + "inherit_tools": inherit_tools, + } + if input_schema is not OMIT: + _request["input_schema"] = input_schema _response = self._client_wrapper.httpx_client.request( - "POST", + "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}/docs" + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" ), - json=jsonable_encoder(request), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_user_doc(self, user_id: str, doc_id: str) -> None: + def tasks_route_delete(self, id: CommonUuid) -> TasksRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - user_id: str. - - - doc_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_user_doc( - user_id="user_id", - doc_id="doc_id", + client.tasks_route_delete( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"users/{user_id}/docs/{doc_id}", + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_agent_doc(self, agent_id: str, doc_id: str) -> None: + def tasks_route_patch( + self, + id: CommonUuid, + *, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.List[TasksWorkflowStep]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.List[ToolsCreateToolRequest]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, + ) -> TasksRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined - - doc_id: str. + - description: typing.Optional[str]. + + - main: typing.Optional[typing.List[TasksWorkflowStep]]. The entrypoint of the task. + + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + + - tools: typing.Optional[typing.List[ToolsCreateToolRequest]]. Tools defined specifically for this task not included in the Agent itself. + + - inherit_tools: typing.Optional[bool]. Whether to inherit tools from the parent agent or not. Defaults to true. --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_agent_doc( - agent_id="agent_id", - doc_id="doc_id", + client.tasks_route_patch( + id="id", ) """ + _request: typing.Dict[str, typing.Any] = {} + if description is not OMIT: + _request["description"] = description + if main is not OMIT: + _request["main"] = main + if input_schema is not OMIT: + _request["input_schema"] = input_schema + if tools is not OMIT: + _request["tools"] = tools + if inherit_tools is not OMIT: + _request["inherit_tools"] = inherit_tools _response = self._client_wrapper.httpx_client.request( - "DELETE", + "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/docs/{doc_id}", + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" ), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_agent_memory(self, agent_id: str, memory_id: str) -> None: + def task_executions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TaskExecutionsRouteListRequestSortBy, + direction: TaskExecutionsRouteListRequestDirection, + metadata_filter: str, + ) -> TaskExecutionsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - agent_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned - - memory_id: str. + - sort_by: TaskExecutionsRouteListRequestSortBy. Sort by a field + + - direction: TaskExecutionsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + TaskExecutionsRouteListRequestDirection, + TaskExecutionsRouteListRequestSortBy, + ) from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_agent_memory( - agent_id="agent_id", - memory_id="memory_id", + client.task_executions_route_list( + id="id", + limit=1, + offset=1, + sort_by=TaskExecutionsRouteListRequestSortBy.CREATED_AT, + direction=TaskExecutionsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/memories/{memory_id}", + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_agent_tools( - self, - agent_id: str, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetAgentToolsResponse: + def task_executions_route_create( + self, id: CommonUuid, *, input: typing.Dict[str, typing.Any] + ) -> TaskExecutionsRouteCreateResponse: """ - Sorted (created_at descending) + Create new undefined Parameters: - - agent_id: str. - - - limit: typing.Optional[int]. + - id: CommonUuid. ID of parent undefined - - offset: typing.Optional[int]. + - input: typing.Dict[str, typing.Any]. The input to the execution --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_agent_tools( - agent_id="agent_id", + client.task_executions_route_create( + id="id", + input={}, ) """ _response = self._client_wrapper.httpx_client.request( - "GET", + "POST", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tools" + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" ), - params=remove_none_from_dict({"limit": limit, "offset": offset}), + json=jsonable_encoder({"input": input}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetAgentToolsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_agent_tool( - self, agent_id: str, *, request: CreateToolRequest - ) -> ResourceCreatedResponse: + def task_executions_route_resume_with_task_token( + self, + id: CommonUuid, + *, + task_token: str, + input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + ) -> TaskExecutionsRouteResumeWithTaskTokenResponse: """ - + Resume an execution with a task token Parameters: - - agent_id: str. + - id: CommonUuid. ID of parent Task + + - task_token: str. A Task Token is a unique identifier for a specific Task Execution. - - request: CreateToolRequest. + - input: typing.Optional[typing.Dict[str, typing.Any]]. The input to resume the execution with --- - from julep import CreateToolRequest, CreateToolRequestType, FunctionDef from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.create_agent_tool( - agent_id="agent_id", - request=CreateToolRequest( - type=CreateToolRequestType.FUNCTION, - function=FunctionDef( - name="name", - parameters={}, - ), - ), + client.task_executions_route_resume_with_task_token( + id="id", + status="running", + task_token="task_token", ) """ + _request: typing.Dict[str, typing.Any] = { + "status": status, + "task_token": task_token, + } + if input is not OMIT: + _request["input"] = input _response = self._client_wrapper.httpx_client.request( - "POST", + "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tools" + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" ), - json=jsonable_encoder(request), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update_agent_tool( - self, agent_id: str, tool_id: str, *, function: FunctionDef - ) -> ResourceUpdatedResponse: + def tool_route_update( + self, + id: CommonUuid, + *, + type: ToolsToolType, + background: bool, + interactive: bool, + function: typing.Optional[ToolsFunctionDef] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, + ) -> ToolRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined + + - type: ToolsToolType. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - tool_id: str. + - background: bool. The tool should be run in the background (not supported at the moment) - - function: FunctionDef. Function definition and parameters + - interactive: bool. Whether the tool that can be run interactively (response should contain "stop" boolean field) + + - function: typing.Optional[ToolsFunctionDef]. + + - integration: typing.Optional[typing.Any]. + + - system: typing.Optional[typing.Any]. + + - api_call: typing.Optional[typing.Any]. --- - from julep import FunctionDef + from julep import ToolsToolType from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.update_agent_tool( - agent_id="agent_id", - tool_id="tool_id", - function=FunctionDef( - name="name", - parameters={}, - ), - ) - """ + client.tool_route_update( + id="id", + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + """ + _request: typing.Dict[str, typing.Any] = { + "type": type.value, + "background": background, + "interactive": interactive, + } + if function is not OMIT: + _request["function"] = function + if integration is not OMIT: + _request["integration"] = integration + if system is not OMIT: + _request["system"] = system + if api_call is not OMIT: + _request["api_call"] = api_call _response = self._client_wrapper.httpx_client.request( "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tools/{tool_id}", + f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" ), - json=jsonable_encoder({"function": function}), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_agent_tool(self, agent_id: str, tool_id: str) -> None: + def tool_route_delete(self, id: CommonUuid) -> ToolRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - agent_id: str. - - - tool_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.delete_agent_tool( - agent_id="agent_id", - tool_id="tool_id", + client.tool_route_delete( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tools/{tool_id}", + f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def patch_agent_tool( - self, agent_id: str, tool_id: str, *, function: PartialFunctionDef - ) -> ResourceUpdatedResponse: + def tool_route_patch( + self, + id: CommonUuid, + *, + type: typing.Optional[ToolsToolType] = OMIT, + background: typing.Optional[bool] = OMIT, + interactive: typing.Optional[bool] = OMIT, + function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, + ) -> ToolRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined + + - type: typing.Optional[ToolsToolType]. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - tool_id: str. + - background: typing.Optional[bool]. The tool should be run in the background (not supported at the moment) - - function: PartialFunctionDef. Function definition and parameters + - interactive: typing.Optional[bool]. Whether the tool that can be run interactively (response should contain "stop" boolean field) + + - function: typing.Optional[ToolsFunctionDefUpdate]. + + - integration: typing.Optional[typing.Any]. + + - system: typing.Optional[typing.Any]. + + - api_call: typing.Optional[typing.Any]. --- - from julep import PartialFunctionDef from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.patch_agent_tool( - agent_id="agent_id", - tool_id="tool_id", - function=PartialFunctionDef(), + client.tool_route_patch( + id="id", ) """ + _request: typing.Dict[str, typing.Any] = {} + if type is not OMIT: + _request["type"] = type.value + if background is not OMIT: + _request["background"] = background + if interactive is not OMIT: + _request["interactive"] = interactive + if function is not OMIT: + _request["function"] = function + if integration is not OMIT: + _request["integration"] = integration + if system is not OMIT: + _request["system"] = system + if api_call is not OMIT: + _request["api_call"] = api_call _response = self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tools/{tool_id}", + f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" ), - json=jsonable_encoder({"function": function}), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_job_status(self, job_id: str) -> JobStatus: + def users_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UsersRouteListRequestSortBy, + direction: UsersRouteListRequestDirection, + metadata_filter: str, + ) -> UsersRouteListResponse: """ - + List undefined items Parameters: - - job_id: str. + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: UsersRouteListRequestSortBy. Sort by a field + + - direction: UsersRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import UsersRouteListRequestDirection, UsersRouteListRequestSortBy from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_job_status( - job_id="job_id", + client.users_route_list( + limit=1, + offset=1, + sort_by=UsersRouteListRequestSortBy.CREATED_AT, + direction=UsersRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"jobs/{job_id}" + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(JobStatus, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list_tasks(self, agent_id: str) -> typing.List[Task]: + def users_route_create( + self, + *, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + docs: typing.List[typing.Any], + ) -> UsersRouteCreateResponse: """ - + Create new undefined Parameters: - - agent_id: str. + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - name: CommonIdentifierSafeUnicode. Name of the user + + - about: str. About the user + + - docs: typing.List[typing.Any]. Documents to index for this user. (Max: 100 items) --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.list_tasks( - agent_id="agent_id", + client.users_route_create( + name="name", + about="about", + docs=[], ) """ + _request: typing.Dict[str, typing.Any] = { + "name": name, + "about": about, + "docs": docs, + } + if metadata is not OMIT: + _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tasks" - ), + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(typing.List[Task], _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_task( + def users_route_create_or_update( self, - agent_id: str, *, - name: str, - description: typing.Optional[str] = OMIT, - tools_available: typing.Optional[typing.List[str]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - main: typing.List[WorkflowStep], - ) -> ResourceCreatedResponse: + id: CommonUuid, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + ) -> UsersRouteCreateOrUpdateResponse: """ - + Create or update undefined (ID is required in payload; existing resource will be overwritten) Parameters: - - agent_id: str. - - - name: str. Name of the Task + - id: CommonUuid. - - description: typing.Optional[str]. Optional Description of the Task + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - - tools_available: typing.Optional[typing.List[str]]. Available Tools for the Task + - name: CommonIdentifierSafeUnicode. Name of the user - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. JSON Schema of parameters - - - main: typing.List[WorkflowStep]. Entrypoint Workflow for the Task + - about: str. About the user --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.create_task( - agent_id="agent_id", + client.users_route_create_or_update( + id="id", name="name", - main=[], + about="about", ) """ - _request: typing.Dict[str, typing.Any] = {"name": name, "main": main} - if description is not OMIT: - _request["description"] = description - if tools_available is not OMIT: - _request["tools_available"] = tools_available - if input_schema is not OMIT: - _request["input_schema"] = input_schema + _request: typing.Dict[str, typing.Any] = { + "id": id, + "name": name, + "about": about, + } + if metadata is not OMIT: + _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tasks" - ), + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_task_execution( - self, task_id: str, execution_id: str - ) -> typing.List[Execution]: + def users_route_get(self, id: CommonUuid) -> UsersUser: """ - + Get undefined by id Parameters: - - task_id: str. - - - execution_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_task_execution( - task_id="task_id", - execution_id="execution_id", + client.users_route_get( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"tasks/{task_id}/executions/{execution_id}", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(typing.List[Execution], _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersUser, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def start_task_execution( + def users_route_update( self, - agent_id: str, - task_id: str, + id: CommonUuid, *, - create_execution_task_id: str, - arguments: typing.Dict[str, typing.Any], - status: ExecutionStatus, - ) -> ResourceCreatedResponse: + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + ) -> UsersRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - agent_id: str. - - - task_id: str. + - id: CommonUuid. ID of the undefined - - create_execution_task_id: str. + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - - arguments: typing.Dict[str, typing.Any]. JSON Schema of parameters + - name: CommonIdentifierSafeUnicode. Name of the user - - status: ExecutionStatus. + - about: str. About the user --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.start_task_execution( - agent_id="agent_id", - task_id="task_id", - create_execution_task_id="task_id", - arguments={}, - status="status", + client.users_route_update( + id="id", + name="name", + about="about", ) """ + _request: typing.Dict[str, typing.Any] = {"name": name, "about": about} + if metadata is not OMIT: + _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "POST", + "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tasks/{task_id}/executions", - ), - json=jsonable_encoder( - { - "task_id": create_execution_task_id, - "arguments": arguments, - "status": status, - } + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_task(self, agent_id: str, task_id: str) -> Task: + def users_route_delete(self, id: CommonUuid) -> UsersRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - agent_id: str. - - - task_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_task( - agent_id="agent_id", - task_id="task_id", + client.users_route_delete( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", + "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tasks/{task_id}", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(Task, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_execution_transition( - self, execution_id: str - ) -> typing.List[ExecutionTransition]: + def users_route_patch( + self, + id: CommonUuid, + *, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, + ) -> UsersRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - execution_id: str. + - id: CommonUuid. ID of the undefined + + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the user + + - about: typing.Optional[str]. About the user --- from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.get_execution_transition( - execution_id="execution_id", + client.users_route_patch( + id="id", ) """ + _request: typing.Dict[str, typing.Any] = {} + if metadata is not OMIT: + _request["metadata"] = metadata + if name is not OMIT: + _request["name"] = name + if about is not OMIT: + _request["about"] = about _response = self._client_wrapper.httpx_client.request( - "GET", + "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"executions/{execution_id}/transitions/", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(typing.List[ExecutionTransition], _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def resume_tool_execution( + def user_docs_route_list( self, - execution_id: str, - transition_id: str, + id: CommonUuid, *, - responses: typing.List[ToolResponse], - ) -> ResourceUpdatedResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: UserDocsRouteListRequestSortBy, + direction: UserDocsRouteListRequestDirection, + metadata_filter: str, + ) -> UserDocsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - execution_id: str. + - id: CommonUuid. ID of parent undefined - - transition_id: str. + - limit: CommonLimit. Limit the number of undefined items returned - - responses: typing.List[ToolResponse]. + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: UserDocsRouteListRequestSortBy. Sort by a field + + - direction: UserDocsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- - from julep import ToolResponse + from julep import ( + UserDocsRouteListRequestDirection, + UserDocsRouteListRequestSortBy, + ) from julep.client import JulepApi client = JulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.resume_tool_execution( - execution_id="execution_id", - transition_id="transition_id", - responses=[ - ToolResponse( - id="id", - output={}, - ) - ], + client.user_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by=UserDocsRouteListRequestSortBy.CREATED_AT, + direction=UserDocsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "PUT", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"executions/{execution_id}/transitions/{transition_id}", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}/docs" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } + ), + headers=self._client_wrapper.get_headers(), + timeout=300, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def user_docs_search_route_search( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UserDocsSearchRouteSearchRequestSortBy, + direction: UserDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: DocsDocSearchRequest, + ) -> UserDocsSearchRouteSearchResponse: + """ + Search for documents owned by undefined + + Parameters: + - id: CommonUuid. ID of the undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: UserDocsSearchRouteSearchRequestSortBy. Sort by a field + + - direction: UserDocsSearchRouteSearchRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata + + - body: DocsDocSearchRequest. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"users/{id}/search" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), - json=jsonable_encoder({"responses": responses}), + json=jsonable_encoder({"body": body}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: @@ -2181,12 +2749,14 @@ def __init__( *, base_url: typing.Optional[str] = None, environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, + auth_key: str, api_key: str, timeout: typing.Optional[float] = 300, httpx_client: typing.Optional[httpx.AsyncClient] = None, ): self._client_wrapper = AsyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), + auth_key=auth_key, api_key=api_key, httpx_client=( httpx.AsyncClient(timeout=timeout) @@ -2195,2089 +2765,2556 @@ def __init__( ), ) - async def list_sessions( - self, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[ListSessionsRequestSortBy] = None, - order: typing.Optional[ListSessionsRequestOrder] = None, - ) -> ListSessionsResponse: + async def agents_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsRouteListRequestSortBy, + direction: AgentsRouteListRequestDirection, + metadata_filter: str, + ) -> AgentsRouteListResponse: + """ + List undefined items + + Parameters: + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: AgentsRouteListRequestSortBy. Sort by a field + + - direction: AgentsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata + --- + from julep import AgentsRouteListRequestDirection, AgentsRouteListRequestSortBy + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + await client.agents_route_list( + limit=1, + offset=1, + sort_by=AgentsRouteListRequestSortBy.CREATED_AT, + direction=AgentsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", + ) + """ + _response = await self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } + ), + headers=self._client_wrapper.get_headers(), + timeout=300, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_create( + self, *, request: AgentsCreateAgentRequest + ) -> AgentsRouteCreateResponse: + """ + Create new undefined + + Parameters: + - request: AgentsCreateAgentRequest. + --- + from julep import AgentsCreateAgentRequest + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + await client.agents_route_create( + request=AgentsCreateAgentRequest( + name="name", + about="about", + model="model", + docs=[], + ), + ) + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), + json=jsonable_encoder(request), + headers=self._client_wrapper.get_headers(), + timeout=300, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_create_or_update( + self, + *, + id: CommonUuid, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateOrUpdateAgentRequestInstructions, + default_settings: typing.Optional[ + AgentsCreateOrUpdateAgentRequestDefaultSettings + ] = OMIT, + ) -> AgentsRouteCreateOrUpdateResponse: + """ + Create or update undefined (ID is required in payload; existing resource will be overwritten) + + Parameters: + - id: CommonUuid. + + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - name: CommonIdentifierSafeUnicode. Name of the agent + + - about: str. About the agent + + - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) + + - instructions: AgentsCreateOrUpdateAgentRequestInstructions. Instructions for the agent + + - default_settings: typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent + --- + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + await client.agents_route_create_or_update( + id="id", + name="name", + about="about", + model="model", + ) + """ + _request: typing.Dict[str, typing.Any] = { + "id": id, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + } + if metadata is not OMIT: + _request["metadata"] = metadata + if default_settings is not OMIT: + _request["default_settings"] = default_settings + _response = await self._client_wrapper.httpx_client.request( + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), + json=jsonable_encoder(_request), + headers=self._client_wrapper.get_headers(), + timeout=300, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_get(self, id: CommonUuid) -> AgentsAgent: """ - List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) + Get undefined by id Parameters: - - limit: typing.Optional[int]. Number of sessions to return - - - offset: typing.Optional[int]. Number of sessions to skip (sorted created_at descending order) - - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata - - - sort_by: typing.Optional[ListSessionsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` - - - order: typing.Optional[ListSessionsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.list_sessions() + await client.agents_route_get( + id="id", + ) """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "metadata_filter": metadata_filter, - "sort_by": sort_by, - "order": order, - } + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ListSessionsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsAgent, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_session( + async def agents_route_update( self, + id: CommonUuid, *, - user_id: typing.Optional[str] = OMIT, - agent_id: str, - situation: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - ) -> ResourceCreatedResponse: + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, + ) -> AgentsRouteUpdateResponse: """ - Create a session between an agent and a user + Update undefined by id (overwrite) Parameters: - - user_id: typing.Optional[str]. (Optional) User ID of user to associate with this session + - id: CommonUuid. ID of the undefined - - agent_id: str. Agent ID of agent to associate with this session + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - - situation: typing.Optional[str]. A specific situation that sets the background for this session + - name: CommonIdentifierSafeUnicode. Name of the agent - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - about: str. About the agent - - render_templates: typing.Optional[bool]. Render system and assistant message content as jinja templates + - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + - instructions: AgentsUpdateAgentRequestInstructions. Instructions for the agent - - context_overflow: typing.Optional[str]. Action to start on context window overflow + - default_settings: typing.Optional[AgentsUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.create_session( - agent_id="agent_id", + await client.agents_route_update( + id="id", + name="name", + about="about", + model="model", ) """ - _request: typing.Dict[str, typing.Any] = {"agent_id": agent_id} - if user_id is not OMIT: - _request["user_id"] = user_id - if situation is not OMIT: - _request["situation"] = situation + _request: typing.Dict[str, typing.Any] = { + "name": name, + "about": about, + "model": model, + "instructions": instructions, + } if metadata is not OMIT: _request["metadata"] = metadata - if render_templates is not OMIT: - _request["render_templates"] = render_templates - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow + if default_settings is not OMIT: + _request["default_settings"] = default_settings _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), + "PUT", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" + ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list_users( - self, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[ListUsersRequestSortBy] = None, - order: typing.Optional[ListUsersRequestOrder] = None, - ) -> ListUsersResponse: + async def agents_route_delete(self, id: CommonUuid) -> AgentsRouteDeleteResponse: """ - List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) + Delete undefined by id Parameters: - - limit: typing.Optional[int]. Number of items to return - - - offset: typing.Optional[int]. Number of items to skip (sorted created_at descending order) - - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata - - - sort_by: typing.Optional[ListUsersRequestSortBy]. Which field to sort by: `created_at` or `updated_at` - - - order: typing.Optional[ListUsersRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.list_users() + await client.agents_route_delete( + id="id", + ) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "metadata_filter": metadata_filter, - "sort_by": sort_by, - "order": order, - } + "DELETE", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ListUsersResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_user( + async def agents_route_patch( self, + id: CommonUuid, *, - name: typing.Optional[str] = OMIT, - about: typing.Optional[str] = OMIT, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - ) -> ResourceCreatedResponse: + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, + model: typing.Optional[str] = OMIT, + instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, + default_settings: typing.Optional[ + AgentsPatchAgentRequestDefaultSettings + ] = OMIT, + ) -> AgentsRoutePatchResponse: """ - Create a new user + Patch undefined by id (merge changes) Parameters: - - name: typing.Optional[str]. Name of the user + - id: CommonUuid. ID of the undefined - - about: typing.Optional[str]. About the user + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the agent + + - about: typing.Optional[str]. About the agent - - docs: typing.Optional[typing.List[CreateDoc]]. List of docs about user + - model: typing.Optional[str]. Model name to use (gpt-4-turbo, gemini-nano etc) - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. (Optional) metadata + - instructions: typing.Optional[AgentsPatchAgentRequestInstructions]. Instructions for the agent + + - default_settings: typing.Optional[AgentsPatchAgentRequestDefaultSettings]. Default settings for all sessions created by this agent --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.create_user() + await client.agents_route_patch( + id="id", + ) """ _request: typing.Dict[str, typing.Any] = {} + if metadata is not OMIT: + _request["metadata"] = metadata if name is not OMIT: _request["name"] = name if about is not OMIT: _request["about"] = about - if docs is not OMIT: - _request["docs"] = docs - if metadata is not OMIT: - _request["metadata"] = metadata + if model is not OMIT: + _request["model"] = model + if instructions is not OMIT: + _request["instructions"] = instructions + if default_settings is not OMIT: + _request["default_settings"] = default_settings _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), + "PATCH", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" + ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list_agents( + async def agent_docs_route_list( self, + id: CommonUuid, *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[ListAgentsRequestSortBy] = None, - order: typing.Optional[ListAgentsRequestOrder] = None, - ) -> ListAgentsResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentDocsRouteListRequestSortBy, + direction: AgentDocsRouteListRequestDirection, + metadata_filter: str, + ) -> AgentDocsRouteListResponse: """ - List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) + List undefined items of parent undefined Parameters: - - limit: typing.Optional[int]. Number of items to return + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned - - offset: typing.Optional[int]. Number of items to skip (sorted created_at descending order) + - offset: CommonOffset. Offset the undefined items returned - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata + - sort_by: AgentDocsRouteListRequestSortBy. Sort by a field - - sort_by: typing.Optional[ListAgentsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` + - direction: AgentDocsRouteListRequestDirection. Sort direction - - order: typing.Optional[ListAgentsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + AgentDocsRouteListRequestDirection, + AgentDocsRouteListRequestSortBy, + ) from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.list_agents() + await client.agent_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by=AgentDocsRouteListRequestSortBy.CREATED_AT, + direction=AgentDocsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", + ) """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/docs" + ), params=remove_none_from_dict( { "limit": limit, "offset": offset, - "metadata_filter": metadata_filter, "sort_by": sort_by, - "order": order, + "direction": direction, + "metadata_filter": metadata_filter, } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ListAgentsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_agent( + async def agents_docs_search_route_search( self, + id: CommonUuid, *, - name: str, - about: typing.Optional[str] = OMIT, - tools: typing.Optional[typing.List[CreateToolRequest]] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, - model: typing.Optional[str] = OMIT, - docs: typing.Optional[typing.List[CreateDoc]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - instructions: typing.Optional[CreateAgentRequestInstructions] = OMIT, - ) -> ResourceCreatedResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsDocsSearchRouteSearchRequestSortBy, + direction: AgentsDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: DocsDocSearchRequest, + ) -> AgentsDocsSearchRouteSearchResponse: """ - Create a new agent + Search for documents owned by undefined Parameters: - - name: str. Name of the agent - - - about: typing.Optional[str]. About 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. + - id: CommonUuid. ID of the undefined - - default_settings: typing.Optional[AgentDefaultSettings]. Default model settings to start every session with + - limit: CommonLimit. Limit the number of undefined items returned - - model: typing.Optional[str]. Name of the model that the agent is supposed to use + - offset: CommonOffset. Offset the undefined items returned - - docs: typing.Optional[typing.List[CreateDoc]]. List of docs about agent + - sort_by: AgentsDocsSearchRouteSearchRequestSortBy. Sort by a field - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. (Optional) metadata + - direction: AgentsDocsSearchRouteSearchRequestDirection. Sort direction - - instructions: typing.Optional[CreateAgentRequestInstructions]. Instructions for the agent - --- - from julep.client import AsyncJulepApi + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - client = AsyncJulepApi( - api_key="YOUR_API_KEY", - ) - await client.create_agent( - name="name", - ) + - body: DocsDocSearchRequest. """ - _request: typing.Dict[str, typing.Any] = {"name": name} - if about is not OMIT: - _request["about"] = about - if tools is not OMIT: - _request["tools"] = tools - if default_settings is not OMIT: - _request["default_settings"] = default_settings - if model is not OMIT: - _request["model"] = model - if docs is not OMIT: - _request["docs"] = docs - if metadata is not OMIT: - _request["metadata"] = metadata - if instructions is not OMIT: - _request["instructions"] = instructions _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - json=jsonable_encoder(_request), + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/search" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } + ), + json=jsonable_encoder({"body": body}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_session(self, session_id: str) -> Session: + async def agent_tools_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentToolsRouteListRequestSortBy, + direction: AgentToolsRouteListRequestDirection, + metadata_filter: str, + ) -> AgentToolsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - session_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: AgentToolsRouteListRequestSortBy. Sort by a field + + - direction: AgentToolsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + AgentToolsRouteListRequestDirection, + AgentToolsRouteListRequestSortBy, + ) from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_session( - session_id="session_id", + await client.agent_tools_route_list( + id="id", + limit=1, + offset=1, + sort_by=AgentToolsRouteListRequestSortBy.CREATED_AT, + direction=AgentToolsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(Session, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update_session( - self, - session_id: str, - *, - situation: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - ) -> ResourceUpdatedResponse: + async def agent_tools_route_create( + self, id: CommonUuid, *, request: AgentsCreateAgentRequest + ) -> AgentToolsRouteCreateResponse: """ - + Create new undefined Parameters: - - session_id: str. - - - situation: str. Updated situation for this session + - id: CommonUuid. ID of parent undefined - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata - - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality - - - context_overflow: typing.Optional[str]. Action to start on context window overflow + - request: AgentsCreateAgentRequest. --- + from julep import AgentsCreateAgentRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.update_session( - session_id="session_id", - situation="situation", + await client.agent_tools_route_create( + id="id", + request=AgentsCreateAgentRequest( + name="name", + about="about", + model="model", + docs=[], + ), ) """ - _request: typing.Dict[str, typing.Any] = {"situation": situation} - if metadata is not OMIT: - _request["metadata"] = metadata - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow _response = await self._client_wrapper.httpx_client.request( - "PUT", + "POST", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" ), - json=jsonable_encoder(_request), + json=jsonable_encoder(request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_session(self, session_id: str) -> None: + async def individual_docs_route_get(self, id: CommonUuid) -> DocsDoc: """ - + Get undefined by id Parameters: - - session_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_session( - session_id="session_id", + await client.individual_docs_route_get( + id="id", ) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(DocsDoc, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def patch_session( - self, - session_id: str, - *, - situation: typing.Optional[str] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - ) -> ResourceUpdatedResponse: + async def individual_docs_route_delete( + self, id: CommonUuid + ) -> IndividualDocsRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - session_id: str. - - - situation: typing.Optional[str]. Updated situation for this session - - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata - - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality - - - context_overflow: typing.Optional[str]. Action to start on context window overflow + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.patch_session( - session_id="session_id", + await client.individual_docs_route_delete( + id="id", ) """ - _request: typing.Dict[str, typing.Any] = {} - if situation is not OMIT: - _request["situation"] = situation - if metadata is not OMIT: - _request["metadata"] = metadata - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow _response = await self._client_wrapper.httpx_client.request( - "PATCH", + "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}" + f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" ), - json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_suggestions( - self, - session_id: str, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetSuggestionsResponse: + async def executions_route_get(self, id: CommonUuid) -> ExecutionsExecution: """ - Sorted (created_at descending) + Get undefined by id Parameters: - - session_id: str. - - - limit: typing.Optional[int]. - - - offset: typing.Optional[int]. + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_suggestions( - session_id="session_id", + await client.executions_route_get( + id="id", ) """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"sessions/{session_id}/suggestions", + f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" ), - params=remove_none_from_dict({"limit": limit, "offset": offset}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetSuggestionsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_history( - self, - session_id: str, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetHistoryResponse: + async def executions_route_update( + self, id: CommonUuid, *, request: ExecutionsUpdateExecutionRequest + ) -> ExecutionsRouteUpdateResponse: """ - Sorted (created_at ascending) + Update undefined by id (overwrite) Parameters: - - session_id: str. - - - limit: typing.Optional[int]. - - - offset: typing.Optional[int]. - --- - from julep.client import AsyncJulepApi + - id: CommonUuid. ID of the undefined - client = AsyncJulepApi( - api_key="YOUR_API_KEY", - ) - await client.get_history( - session_id="session_id", - ) + - request: ExecutionsUpdateExecutionRequest. """ _response = await self._client_wrapper.httpx_client.request( - "GET", + "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"sessions/{session_id}/history", + f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" ), - params=remove_none_from_dict({"limit": limit, "offset": offset}), + json=jsonable_encoder(request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetHistoryResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_session_history(self, session_id: str) -> None: + async def execution_transitions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, + metadata_filter: str, + ) -> ExecutionTransitionsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - session_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: ExecutionTransitionsRouteListRequestSortBy. Sort by a field + + - direction: ExecutionTransitionsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + ExecutionTransitionsRouteListRequestDirection, + ExecutionTransitionsRouteListRequestSortBy, + ) from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_session_history( - session_id="session_id", + await client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by=ExecutionTransitionsRouteListRequestSortBy.CREATED_AT, + direction=ExecutionTransitionsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", + "GET", urllib.parse.urljoin( f"{self._client_wrapper.get_base_url()}/", - f"sessions/{session_id}/history", + f"executions/{id}/transitions", + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def chat( - self, - session_id: str, - *, - messages: typing.List[InputChatMlMessage], - tools: typing.Optional[typing.List[Tool]] = OMIT, - tool_choice: typing.Optional[ChatInputDataToolChoice] = 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, - min_p: typing.Optional[float] = OMIT, - preset: typing.Optional[ChatSettingsPreset] = OMIT, - model: typing.Optional[str] = OMIT, - recall: typing.Optional[bool] = OMIT, - record: typing.Optional[bool] = OMIT, - remember: typing.Optional[bool] = OMIT, - ) -> ChatResponse: + async def job_route_get(self, id: CommonUuid) -> JobsJobStatus: """ - + Get undefined by id Parameters: - - 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[ChatInputDataToolChoice]. 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. - - - min_p: typing.Optional[float]. Minimum probability compared to leading token to be considered - - - preset: typing.Optional[ChatSettingsPreset]. Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) - - - model: typing.Optional[str]. Model name - - - recall: typing.Optional[bool]. Whether previous memories should be recalled or not - - - record: typing.Optional[bool]. Whether this interaction should be recorded in history or not - - - remember: typing.Optional[bool]. Whether this interaction should form memories or not + - id: CommonUuid. ID of the undefined --- - from julep import InputChatMlMessage, InputChatMlMessageRole from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.chat( - session_id="session_id", - messages=[ - InputChatMlMessage( - role=InputChatMlMessageRole.USER, - ) - ], + await client.job_route_get( + id="id", ) """ - _request: typing.Dict[str, typing.Any] = {"messages": messages} - if tools is not OMIT: - _request["tools"] = tools - if tool_choice is not OMIT: - _request["tool_choice"] = tool_choice - if frequency_penalty is not OMIT: - _request["frequency_penalty"] = frequency_penalty - if length_penalty is not OMIT: - _request["length_penalty"] = length_penalty - if logit_bias is not OMIT: - _request["logit_bias"] = logit_bias - if max_tokens is not OMIT: - _request["max_tokens"] = max_tokens - if presence_penalty is not OMIT: - _request["presence_penalty"] = presence_penalty - if repetition_penalty is not OMIT: - _request["repetition_penalty"] = repetition_penalty - if response_format is not OMIT: - _request["response_format"] = response_format - if seed is not OMIT: - _request["seed"] = seed - if stop is not OMIT: - _request["stop"] = stop - if stream is not OMIT: - _request["stream"] = stream - if temperature is not OMIT: - _request["temperature"] = temperature - if top_p is not OMIT: - _request["top_p"] = top_p - if min_p is not OMIT: - _request["min_p"] = min_p - if preset is not OMIT: - _request["preset"] = preset.value - if model is not OMIT: - _request["model"] = model - if recall is not OMIT: - _request["recall"] = recall - if record is not OMIT: - _request["record"] = record - if remember is not OMIT: - _request["remember"] = remember _response = await self._client_wrapper.httpx_client.request( - "POST", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{session_id}/chat" - ), - json=jsonable_encoder(_request), - headers=remove_none_from_dict( - {**self._client_wrapper.get_headers(), "Accept": "application/json"} + f"{self._client_wrapper.get_base_url()}/", f"jobs/{id}" ), + headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ChatResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_agent_memories( + async def sessions_route_list( self, - agent_id: str, *, - query: str, - user_id: typing.Optional[str] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetAgentMemoriesResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: SessionsRouteListRequestSortBy, + direction: SessionsRouteListRequestDirection, + metadata_filter: str, + ) -> SessionsRouteListResponse: """ - Sorted (created_at descending) + List undefined items Parameters: - - agent_id: str. + - limit: CommonLimit. Limit the number of undefined items returned - - query: str. + - offset: CommonOffset. Offset the undefined items returned - - user_id: typing.Optional[str]. + - sort_by: SessionsRouteListRequestSortBy. Sort by a field - - limit: typing.Optional[int]. + - direction: SessionsRouteListRequestDirection. Sort direction - - offset: typing.Optional[int]. + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + SessionsRouteListRequestDirection, + SessionsRouteListRequestSortBy, + ) from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_agent_memories( - agent_id="agent_id", - query="query", + await client.sessions_route_list( + limit=1, + offset=1, + sort_by=SessionsRouteListRequestSortBy.CREATED_AT, + direction=SessionsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/memories" - ), + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), params=remove_none_from_dict( - {"query": query, "user_id": user_id, "limit": limit, "offset": offset} + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetAgentMemoriesResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_user(self, user_id: str) -> User: + async def sessions_route_create( + self, + *, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.List[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.List[CommonUuid]] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + ) -> SessionsRouteCreateResponse: """ - + Create new undefined Parameters: - - user_id: str. + - user: typing.Optional[CommonUuid]. User ID of user associated with this session + + - users: typing.Optional[typing.List[CommonUuid]]. + + - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + + - agents: typing.Optional[typing.List[CommonUuid]]. + + - situation: str. A specific situation that sets the background for this session + + - render_templates: bool. Render system and assistant message content as jinja templates + + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + + - context_overflow: typing.Optional[str]. Action to start on context window overflow + + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_user( - user_id="user_id", - ) - """ + await client.sessions_route_create( + situation="situation", + render_templates=True, + ) + """ + _request: typing.Dict[str, typing.Any] = { + "situation": situation, + "render_templates": render_templates, + } + if user is not OMIT: + _request["user"] = user + if users is not OMIT: + _request["users"] = users + if agent is not OMIT: + _request["agent"] = agent + if agents is not OMIT: + _request["agents"] = agents + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow + if metadata is not OMIT: + _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" - ), + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(User, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update_user( + async def sessions_route_create_or_update( self, - user_id: str, *, - about: str, - name: str, + id: CommonUuid, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.List[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.List[CommonUuid]] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - ) -> ResourceUpdatedResponse: + ) -> SessionsRouteCreateOrUpdateResponse: """ - + Create or update undefined (ID is required in payload; existing resource will be overwritten) Parameters: - - user_id: str. + - id: CommonUuid. - - about: str. About the user + - user: typing.Optional[CommonUuid]. User ID of user associated with this session - - name: str. Name of the user + - users: typing.Optional[typing.List[CommonUuid]]. + + - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + + - agents: typing.Optional[typing.List[CommonUuid]]. + + - situation: str. A specific situation that sets the background for this session + + - render_templates: bool. Render system and assistant message content as jinja templates + + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + + - context_overflow: typing.Optional[str]. Action to start on context window overflow - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.update_user( - user_id="user_id", - about="about", - name="name", - ) - """ - _request: typing.Dict[str, typing.Any] = {"about": about, "name": name} + await client.sessions_route_create_or_update( + id="id", + situation="situation", + render_templates=True, + ) + """ + _request: typing.Dict[str, typing.Any] = { + "id": id, + "situation": situation, + "render_templates": render_templates, + } + if user is not OMIT: + _request["user"] = user + if users is not OMIT: + _request["users"] = users + if agent is not OMIT: + _request["agent"] = agent + if agents is not OMIT: + _request["agents"] = agents + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow if metadata is not OMIT: _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" - ), + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_user(self, user_id: str) -> None: + async def history_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, + ) -> HistoryRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - user_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: HistoryRouteListRequestSortBy. Sort by a field + + - direction: HistoryRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + HistoryRouteListRequestDirection, + HistoryRouteListRequestSortBy, + ) from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_user( - user_id="user_id", + await client.history_route_list( + id="id", + limit=1, + offset=1, + sort_by=HistoryRouteListRequestSortBy.CREATED_AT, + direction=HistoryRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def patch_user( - self, - user_id: str, - *, - about: typing.Optional[str] = OMIT, - name: typing.Optional[str] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - ) -> ResourceUpdatedResponse: + async def history_route_delete(self, id: CommonUuid) -> HistoryRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - user_id: str. - - - about: typing.Optional[str]. About the user - - - name: typing.Optional[str]. Name of the user - - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.patch_user( - user_id="user_id", + await client.history_route_delete( + id="id", ) """ - _request: typing.Dict[str, typing.Any] = {} - if about is not OMIT: - _request["about"] = about - if name is not OMIT: - _request["name"] = name - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "PATCH", + "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" ), - json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_agent(self, agent_id: str) -> Agent: + async def sessions_route_get(self, id: CommonUuid) -> SessionsSession: """ - + Get undefined by id Parameters: - - agent_id: str. - --- - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - api_key="YOUR_API_KEY", - ) - await client.get_agent( - agent_id="agent_id", - ) + - id: CommonUuid. ID of the undefined """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(Agent, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsSession, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update_agent( + async def sessions_route_update( self, - agent_id: str, + id: CommonUuid, *, - about: str, - name: str, - model: typing.Optional[str] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - instructions: typing.Optional[UpdateAgentRequestInstructions] = OMIT, - ) -> ResourceUpdatedResponse: + ) -> SessionsRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - agent_id: str. - - - about: str. About the agent + - id: CommonUuid. ID of the undefined - - name: str. Name of the agent + - situation: str. A specific situation that sets the background for this session - - model: typing.Optional[str]. Name of the model that the agent is supposed to use + - render_templates: bool. Render system and assistant message content as jinja templates - - default_settings: typing.Optional[AgentDefaultSettings]. Default model settings to start every session with + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - context_overflow: typing.Optional[str]. Action to start on context window overflow - - instructions: typing.Optional[UpdateAgentRequestInstructions]. Instructions for the agent + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.update_agent( - agent_id="agent_id", - about="about", - name="name", + await client.sessions_route_update( + id="id", + situation="situation", + render_templates=True, ) """ - _request: typing.Dict[str, typing.Any] = {"about": about, "name": name} - if model is not OMIT: - _request["model"] = model - if default_settings is not OMIT: - _request["default_settings"] = default_settings + _request: typing.Dict[str, typing.Any] = { + "situation": situation, + "render_templates": render_templates, + } + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow if metadata is not OMIT: _request["metadata"] = metadata - if instructions is not OMIT: - _request["instructions"] = instructions _response = await self._client_wrapper.httpx_client.request( "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_agent(self, agent_id: str) -> None: + async def sessions_route_delete( + self, id: CommonUuid + ) -> SessionsRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_agent( - agent_id="agent_id", + await client.sessions_route_delete( + id="id", ) """ _response = await self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def patch_agent( + async def sessions_route_patch( self, - agent_id: str, + id: CommonUuid, *, - about: typing.Optional[str] = OMIT, - name: typing.Optional[str] = OMIT, - model: typing.Optional[str] = OMIT, - default_settings: typing.Optional[AgentDefaultSettings] = OMIT, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - instructions: typing.Optional[PatchAgentRequestInstructions] = OMIT, - ) -> ResourceUpdatedResponse: + ) -> SessionsRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - agent_id: str. - - - about: typing.Optional[str]. About the agent + - id: CommonUuid. ID of the undefined - - name: typing.Optional[str]. Name of the agent + - situation: typing.Optional[str]. A specific situation that sets the background for this session - - model: typing.Optional[str]. Name of the model that the agent is supposed to use + - render_templates: typing.Optional[bool]. Render system and assistant message content as jinja templates - - default_settings: typing.Optional[AgentDefaultSettings]. Default model settings to start every session with + - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. Optional metadata + - context_overflow: typing.Optional[str]. Action to start on context window overflow - - instructions: typing.Optional[PatchAgentRequestInstructions]. Instructions for the agent + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.patch_agent( - agent_id="agent_id", + await client.sessions_route_patch( + id="id", ) """ _request: typing.Dict[str, typing.Any] = {} - if about is not OMIT: - _request["about"] = about - if name is not OMIT: - _request["name"] = name - if model is not OMIT: - _request["model"] = model - if default_settings is not OMIT: - _request["default_settings"] = default_settings + if situation is not OMIT: + _request["situation"] = situation + if render_templates is not OMIT: + _request["render_templates"] = render_templates + if token_budget is not OMIT: + _request["token_budget"] = token_budget + if context_overflow is not OMIT: + _request["context_overflow"] = context_overflow if metadata is not OMIT: _request["metadata"] = metadata - if instructions is not OMIT: - _request["instructions"] = instructions _response = await self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}" + f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" ), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_agent_docs( + async def tasks_route_list( self, - agent_id: str, *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[GetAgentDocsRequestSortBy] = None, - order: typing.Optional[GetAgentDocsRequestOrder] = None, - ) -> GetAgentDocsResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, + metadata_filter: str, + ) -> TasksRouteListResponse: """ - Sorted (created_at descending) + List undefined items Parameters: - - agent_id: str. + - limit: CommonLimit. Limit the number of undefined items returned - - limit: typing.Optional[int]. + - offset: CommonOffset. Offset the undefined items returned - - offset: typing.Optional[int]. + - sort_by: TasksRouteListRequestSortBy. Sort by a field - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata + - direction: TasksRouteListRequestDirection. Sort direction - - sort_by: typing.Optional[GetAgentDocsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` - - - order: typing.Optional[GetAgentDocsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import TasksRouteListRequestDirection, TasksRouteListRequestSortBy from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_agent_docs( - agent_id="agent_id", + await client.tasks_route_list( + limit=1, + offset=1, + sort_by=TasksRouteListRequestSortBy.CREATED_AT, + direction=TasksRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/docs" - ), + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), params=remove_none_from_dict( { "limit": limit, "offset": offset, - "metadata_filter": metadata_filter, "sort_by": sort_by, - "order": order, + "direction": direction, + "metadata_filter": metadata_filter, } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetAgentDocsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_agent_doc( - self, agent_id: str, *, request: CreateDoc - ) -> ResourceCreatedResponse: + async def tasks_route_create( + self, + *, + name: str, + description: str, + main: typing.List[TasksWorkflowStep], + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.List[ToolsCreateToolRequest], + inherit_tools: bool, + ) -> TasksRouteCreateResponse: """ - + Create new undefined Parameters: - - agent_id: str. + - name: str. + + - description: str. + + - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + + - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. - - request: CreateDoc. + - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. --- - from julep import CreateDoc + from julep import ToolsCreateToolRequest, ToolsToolType from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.create_agent_doc( - agent_id="agent_id", - request=CreateDoc( - title="title", - ), + await client.tasks_route_create( + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + ], + inherit_tools=True, ) """ + _request: typing.Dict[str, typing.Any] = { + "name": name, + "description": description, + "main": main, + "tools": tools, + "inherit_tools": inherit_tools, + } + if input_schema is not OMIT: + _request["input_schema"] = input_schema _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/docs" - ), - json=jsonable_encoder(request), + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_user_docs( + async def tasks_route_create_or_update( self, - user_id: str, *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - metadata_filter: typing.Optional[str] = None, - sort_by: typing.Optional[GetUserDocsRequestSortBy] = None, - order: typing.Optional[GetUserDocsRequestOrder] = None, - ) -> GetUserDocsResponse: + id: CommonUuid, + name: str, + description: str, + main: typing.List[TasksWorkflowStep], + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.List[ToolsCreateToolRequest], + inherit_tools: bool, + ) -> TasksRouteCreateOrUpdateResponse: """ - Sorted (created_at descending) + Create or update undefined (ID is required in payload; existing resource will be overwritten) Parameters: - - user_id: str. + - id: CommonUuid. + + - name: str. - - limit: typing.Optional[int]. + - description: str. - - offset: typing.Optional[int]. + - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. - - metadata_filter: typing.Optional[str]. JSON object that should be used to filter objects by metadata + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. - - sort_by: typing.Optional[GetUserDocsRequestSortBy]. Which field to sort by: `created_at` or `updated_at` + - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. - - order: typing.Optional[GetUserDocsRequestOrder]. Which order should the sort be: `asc` (ascending) or `desc` (descending) + - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. --- + from julep import ToolsCreateToolRequest, ToolsToolType from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_user_docs( - user_id="user_id", + await client.tasks_route_create_or_update( + id="id", + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + ], + inherit_tools=True, ) """ + _request: typing.Dict[str, typing.Any] = { + "id": id, + "name": name, + "description": description, + "main": main, + "tools": tools, + "inherit_tools": inherit_tools, + } + if input_schema is not OMIT: + _request["input_schema"] = input_schema _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}/docs" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "metadata_filter": metadata_filter, - "sort_by": sort_by, - "order": order, - } - ), + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetUserDocsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_user_doc( - self, user_id: str, *, request: CreateDoc - ) -> ResourceCreatedResponse: + async def tasks_route_update( + self, + id: CommonUuid, + *, + description: str, + main: typing.List[TasksWorkflowStep], + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.List[ToolsCreateToolRequest], + inherit_tools: bool, + ) -> TasksRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - user_id: str. + - id: CommonUuid. ID of the undefined + + - description: str. + + - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. - - request: CreateDoc. + - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + + - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. --- - from julep import CreateDoc + from julep import ToolsCreateToolRequest, ToolsToolType from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.create_user_doc( - user_id="user_id", - request=CreateDoc( - title="title", - ), + await client.tasks_route_update( + id="id", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + ], + inherit_tools=True, ) """ + _request: typing.Dict[str, typing.Any] = { + "description": description, + "main": main, + "tools": tools, + "inherit_tools": inherit_tools, + } + if input_schema is not OMIT: + _request["input_schema"] = input_schema _response = await self._client_wrapper.httpx_client.request( - "POST", + "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{user_id}/docs" + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" ), - json=jsonable_encoder(request), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_user_doc(self, user_id: str, doc_id: str) -> None: + async def tasks_route_delete(self, id: CommonUuid) -> TasksRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - user_id: str. - - - doc_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_user_doc( - user_id="user_id", - doc_id="doc_id", + await client.tasks_route_delete( + id="id", ) """ _response = await self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"users/{user_id}/docs/{doc_id}", + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_agent_doc(self, agent_id: str, doc_id: str) -> None: + async def tasks_route_patch( + self, + id: CommonUuid, + *, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.List[TasksWorkflowStep]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.List[ToolsCreateToolRequest]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, + ) -> TasksRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined + + - description: typing.Optional[str]. - - doc_id: str. + - main: typing.Optional[typing.List[TasksWorkflowStep]]. The entrypoint of the task. + + - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + + - tools: typing.Optional[typing.List[ToolsCreateToolRequest]]. Tools defined specifically for this task not included in the Agent itself. + + - inherit_tools: typing.Optional[bool]. Whether to inherit tools from the parent agent or not. Defaults to true. --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_agent_doc( - agent_id="agent_id", - doc_id="doc_id", + await client.tasks_route_patch( + id="id", ) """ + _request: typing.Dict[str, typing.Any] = {} + if description is not OMIT: + _request["description"] = description + if main is not OMIT: + _request["main"] = main + if input_schema is not OMIT: + _request["input_schema"] = input_schema + if tools is not OMIT: + _request["tools"] = tools + if inherit_tools is not OMIT: + _request["inherit_tools"] = inherit_tools _response = await self._client_wrapper.httpx_client.request( - "DELETE", + "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/docs/{doc_id}", + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" ), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_agent_memory(self, agent_id: str, memory_id: str) -> None: + async def task_executions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TaskExecutionsRouteListRequestSortBy, + direction: TaskExecutionsRouteListRequestDirection, + metadata_filter: str, + ) -> TaskExecutionsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - agent_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: TaskExecutionsRouteListRequestSortBy. Sort by a field - - memory_id: str. + - direction: TaskExecutionsRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import ( + TaskExecutionsRouteListRequestDirection, + TaskExecutionsRouteListRequestSortBy, + ) from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_agent_memory( - agent_id="agent_id", - memory_id="memory_id", + await client.task_executions_route_list( + id="id", + limit=1, + offset=1, + sort_by=TaskExecutionsRouteListRequestSortBy.CREATED_AT, + direction=TaskExecutionsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/memories/{memory_id}", + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_agent_tools( - self, - agent_id: str, - *, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - ) -> GetAgentToolsResponse: + async def task_executions_route_create( + self, id: CommonUuid, *, input: typing.Dict[str, typing.Any] + ) -> TaskExecutionsRouteCreateResponse: """ - Sorted (created_at descending) + Create new undefined Parameters: - - agent_id: str. - - - limit: typing.Optional[int]. + - id: CommonUuid. ID of parent undefined - - offset: typing.Optional[int]. + - input: typing.Dict[str, typing.Any]. The input to the execution --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_agent_tools( - agent_id="agent_id", + await client.task_executions_route_create( + id="id", + input={}, ) """ _response = await self._client_wrapper.httpx_client.request( - "GET", + "POST", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tools" + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" ), - params=remove_none_from_dict({"limit": limit, "offset": offset}), + json=jsonable_encoder({"input": input}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(GetAgentToolsResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_agent_tool( - self, agent_id: str, *, request: CreateToolRequest - ) -> ResourceCreatedResponse: + async def task_executions_route_resume_with_task_token( + self, + id: CommonUuid, + *, + task_token: str, + input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + ) -> TaskExecutionsRouteResumeWithTaskTokenResponse: """ - + Resume an execution with a task token Parameters: - - agent_id: str. + - id: CommonUuid. ID of parent Task + + - task_token: str. A Task Token is a unique identifier for a specific Task Execution. - - request: CreateToolRequest. + - input: typing.Optional[typing.Dict[str, typing.Any]]. The input to resume the execution with --- - from julep import CreateToolRequest, CreateToolRequestType, FunctionDef from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.create_agent_tool( - agent_id="agent_id", - request=CreateToolRequest( - type=CreateToolRequestType.FUNCTION, - function=FunctionDef( - name="name", - parameters={}, - ), - ), + await client.task_executions_route_resume_with_task_token( + id="id", + status="running", + task_token="task_token", ) """ + _request: typing.Dict[str, typing.Any] = { + "status": status, + "task_token": task_token, + } + if input is not OMIT: + _request["input"] = input _response = await self._client_wrapper.httpx_client.request( - "POST", + "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tools" + f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" ), - json=jsonable_encoder(request), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update_agent_tool( - self, agent_id: str, tool_id: str, *, function: FunctionDef - ) -> ResourceUpdatedResponse: + async def tool_route_update( + self, + id: CommonUuid, + *, + type: ToolsToolType, + background: bool, + interactive: bool, + function: typing.Optional[ToolsFunctionDef] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, + ) -> ToolRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined + + - type: ToolsToolType. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + + - background: bool. The tool should be run in the background (not supported at the moment) - - tool_id: str. + - interactive: bool. Whether the tool that can be run interactively (response should contain "stop" boolean field) - - function: FunctionDef. Function definition and parameters + - function: typing.Optional[ToolsFunctionDef]. + + - integration: typing.Optional[typing.Any]. + + - system: typing.Optional[typing.Any]. + + - api_call: typing.Optional[typing.Any]. --- - from julep import FunctionDef + from julep import ToolsToolType from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.update_agent_tool( - agent_id="agent_id", - tool_id="tool_id", - function=FunctionDef( - name="name", - parameters={}, - ), - ) - """ + await client.tool_route_update( + id="id", + type=ToolsToolType.FUNCTION, + background=True, + interactive=True, + ) + """ + _request: typing.Dict[str, typing.Any] = { + "type": type.value, + "background": background, + "interactive": interactive, + } + if function is not OMIT: + _request["function"] = function + if integration is not OMIT: + _request["integration"] = integration + if system is not OMIT: + _request["system"] = system + if api_call is not OMIT: + _request["api_call"] = api_call _response = await self._client_wrapper.httpx_client.request( "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tools/{tool_id}", + f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" ), - json=jsonable_encoder({"function": function}), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_agent_tool(self, agent_id: str, tool_id: str) -> None: + async def tool_route_delete(self, id: CommonUuid) -> ToolRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - agent_id: str. - - - tool_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.delete_agent_tool( - agent_id="agent_id", - tool_id="tool_id", + await client.tool_route_delete( + id="id", ) """ _response = await self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tools/{tool_id}", + f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return + return pydantic.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def patch_agent_tool( - self, agent_id: str, tool_id: str, *, function: PartialFunctionDef - ) -> ResourceUpdatedResponse: + async def tool_route_patch( + self, + id: CommonUuid, + *, + type: typing.Optional[ToolsToolType] = OMIT, + background: typing.Optional[bool] = OMIT, + interactive: typing.Optional[bool] = OMIT, + function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, + ) -> ToolRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined + + - type: typing.Optional[ToolsToolType]. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - tool_id: str. + - background: typing.Optional[bool]. The tool should be run in the background (not supported at the moment) - - function: PartialFunctionDef. Function definition and parameters + - interactive: typing.Optional[bool]. Whether the tool that can be run interactively (response should contain "stop" boolean field) + + - function: typing.Optional[ToolsFunctionDefUpdate]. + + - integration: typing.Optional[typing.Any]. + + - system: typing.Optional[typing.Any]. + + - api_call: typing.Optional[typing.Any]. --- - from julep import PartialFunctionDef from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.patch_agent_tool( - agent_id="agent_id", - tool_id="tool_id", - function=PartialFunctionDef(), + await client.tool_route_patch( + id="id", ) """ + _request: typing.Dict[str, typing.Any] = {} + if type is not OMIT: + _request["type"] = type.value + if background is not OMIT: + _request["background"] = background + if interactive is not OMIT: + _request["interactive"] = interactive + if function is not OMIT: + _request["function"] = function + if integration is not OMIT: + _request["integration"] = integration + if system is not OMIT: + _request["system"] = system + if api_call is not OMIT: + _request["api_call"] = api_call _response = await self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tools/{tool_id}", + f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" ), - json=jsonable_encoder({"function": function}), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_job_status(self, job_id: str) -> JobStatus: + async def users_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UsersRouteListRequestSortBy, + direction: UsersRouteListRequestDirection, + metadata_filter: str, + ) -> UsersRouteListResponse: """ - + List undefined items Parameters: - - job_id: str. + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: UsersRouteListRequestSortBy. Sort by a field + + - direction: UsersRouteListRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- + from julep import UsersRouteListRequestDirection, UsersRouteListRequestSortBy from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_job_status( - job_id="job_id", + await client.users_route_list( + limit=1, + offset=1, + sort_by=UsersRouteListRequestSortBy.CREATED_AT, + direction=UsersRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"jobs/{job_id}" + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(JobStatus, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list_tasks(self, agent_id: str) -> typing.List[Task]: + async def users_route_create( + self, + *, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + docs: typing.List[typing.Any], + ) -> UsersRouteCreateResponse: """ - + Create new undefined Parameters: - - agent_id: str. + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - name: CommonIdentifierSafeUnicode. Name of the user + + - about: str. About the user + + - docs: typing.List[typing.Any]. Documents to index for this user. (Max: 100 items) --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.list_tasks( - agent_id="agent_id", + await client.users_route_create( + name="name", + about="about", + docs=[], ) """ + _request: typing.Dict[str, typing.Any] = { + "name": name, + "about": about, + "docs": docs, + } + if metadata is not OMIT: + _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tasks" - ), + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(typing.List[Task], _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_task( + async def users_route_create_or_update( self, - agent_id: str, *, - name: str, - description: typing.Optional[str] = OMIT, - tools_available: typing.Optional[typing.List[str]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - main: typing.List[WorkflowStep], - ) -> ResourceCreatedResponse: + id: CommonUuid, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + ) -> UsersRouteCreateOrUpdateResponse: """ - + Create or update undefined (ID is required in payload; existing resource will be overwritten) Parameters: - - agent_id: str. + - id: CommonUuid. - - name: str. Name of the Task + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - - description: typing.Optional[str]. Optional Description of the Task + - name: CommonIdentifierSafeUnicode. Name of the user - - tools_available: typing.Optional[typing.List[str]]. Available Tools for the Task - - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. JSON Schema of parameters - - - main: typing.List[WorkflowStep]. Entrypoint Workflow for the Task + - about: str. About the user --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.create_task( - agent_id="agent_id", + await client.users_route_create_or_update( + id="id", name="name", - main=[], + about="about", ) """ - _request: typing.Dict[str, typing.Any] = {"name": name, "main": main} - if description is not OMIT: - _request["description"] = description - if tools_available is not OMIT: - _request["tools_available"] = tools_available - if input_schema is not OMIT: - _request["input_schema"] = input_schema + _request: typing.Dict[str, typing.Any] = { + "id": id, + "name": name, + "about": about, + } + if metadata is not OMIT: + _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{agent_id}/tasks" - ), + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_task_execution( - self, task_id: str, execution_id: str - ) -> typing.List[Execution]: + async def users_route_get(self, id: CommonUuid) -> UsersUser: """ - + Get undefined by id Parameters: - - task_id: str. - - - execution_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_task_execution( - task_id="task_id", - execution_id="execution_id", + await client.users_route_get( + id="id", ) """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"tasks/{task_id}/executions/{execution_id}", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(typing.List[Execution], _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersUser, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def start_task_execution( + async def users_route_update( self, - agent_id: str, - task_id: str, + id: CommonUuid, *, - create_execution_task_id: str, - arguments: typing.Dict[str, typing.Any], - status: ExecutionStatus, - ) -> ResourceCreatedResponse: + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + ) -> UsersRouteUpdateResponse: """ - + Update undefined by id (overwrite) Parameters: - - agent_id: str. + - id: CommonUuid. ID of the undefined - - task_id: str. + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - - create_execution_task_id: str. + - name: CommonIdentifierSafeUnicode. Name of the user - - arguments: typing.Dict[str, typing.Any]. JSON Schema of parameters - - - status: ExecutionStatus. + - about: str. About the user --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.start_task_execution( - agent_id="agent_id", - task_id="task_id", - create_execution_task_id="task_id", - arguments={}, - status="status", + await client.users_route_update( + id="id", + name="name", + about="about", ) """ + _request: typing.Dict[str, typing.Any] = {"name": name, "about": about} + if metadata is not OMIT: + _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "POST", + "PUT", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tasks/{task_id}/executions", - ), - json=jsonable_encoder( - { - "task_id": create_execution_task_id, - "arguments": arguments, - "status": status, - } + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceCreatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_task(self, agent_id: str, task_id: str) -> Task: + async def users_route_delete(self, id: CommonUuid) -> UsersRouteDeleteResponse: """ - + Delete undefined by id Parameters: - - agent_id: str. - - - task_id: str. + - id: CommonUuid. ID of the undefined --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_task( - agent_id="agent_id", - task_id="task_id", + await client.users_route_delete( + id="id", ) """ _response = await self._client_wrapper.httpx_client.request( - "GET", + "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"agents/{agent_id}/tasks/{task_id}", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(Task, _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_execution_transition( - self, execution_id: str - ) -> typing.List[ExecutionTransition]: + async def users_route_patch( + self, + id: CommonUuid, + *, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, + ) -> UsersRoutePatchResponse: """ - + Patch undefined by id (merge changes) Parameters: - - execution_id: str. + - id: CommonUuid. ID of the undefined + + - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the user + + - about: typing.Optional[str]. About the user --- from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.get_execution_transition( - execution_id="execution_id", + await client.users_route_patch( + id="id", ) """ + _request: typing.Dict[str, typing.Any] = {} + if metadata is not OMIT: + _request["metadata"] = metadata + if name is not OMIT: + _request["name"] = name + if about is not OMIT: + _request["about"] = about _response = await self._client_wrapper.httpx_client.request( - "GET", + "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"executions/{execution_id}/transitions/", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}" ), + json=jsonable_encoder(_request), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(typing.List[ExecutionTransition], _response.json()) # type: ignore + return pydantic.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def resume_tool_execution( + async def user_docs_route_list( self, - execution_id: str, - transition_id: str, + id: CommonUuid, *, - responses: typing.List[ToolResponse], - ) -> ResourceUpdatedResponse: + limit: CommonLimit, + offset: CommonOffset, + sort_by: UserDocsRouteListRequestSortBy, + direction: UserDocsRouteListRequestDirection, + metadata_filter: str, + ) -> UserDocsRouteListResponse: """ - + List undefined items of parent undefined Parameters: - - execution_id: str. + - id: CommonUuid. ID of parent undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: UserDocsRouteListRequestSortBy. Sort by a field - - transition_id: str. + - direction: UserDocsRouteListRequestDirection. Sort direction - - responses: typing.List[ToolResponse]. + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata --- - from julep import ToolResponse + from julep import ( + UserDocsRouteListRequestDirection, + UserDocsRouteListRequestSortBy, + ) from julep.client import AsyncJulepApi client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.resume_tool_execution( - execution_id="execution_id", - transition_id="transition_id", - responses=[ - ToolResponse( - id="id", - output={}, - ) - ], + await client.user_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by=UserDocsRouteListRequestSortBy.CREATED_AT, + direction=UserDocsRouteListRequestDirection.ASC, + metadata_filter="metadata_filter", ) """ _response = await self._client_wrapper.httpx_client.request( - "PUT", + "GET", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"executions/{execution_id}/transitions/{transition_id}", + f"{self._client_wrapper.get_base_url()}/", f"users/{id}/docs" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } + ), + headers=self._client_wrapper.get_headers(), + timeout=300, + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def user_docs_search_route_search( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UserDocsSearchRouteSearchRequestSortBy, + direction: UserDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: DocsDocSearchRequest, + ) -> UserDocsSearchRouteSearchResponse: + """ + Search for documents owned by undefined + + Parameters: + - id: CommonUuid. ID of the undefined + + - limit: CommonLimit. Limit the number of undefined items returned + + - offset: CommonOffset. Offset the undefined items returned + + - sort_by: UserDocsSearchRouteSearchRequestSortBy. Sort by a field + + - direction: UserDocsSearchRouteSearchRequestDirection. Sort direction + + - metadata_filter: str. JSON string of object that should be used to filter objects by metadata + + - body: DocsDocSearchRequest. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"users/{id}/search" + ), + params=remove_none_from_dict( + { + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + } ), - json=jsonable_encoder({"responses": responses}), + json=jsonable_encoder({"body": body}), headers=self._client_wrapper.get_headers(), timeout=300, ) if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: _response_json = _response.json() except JSONDecodeError: diff --git a/sdks/python/julep/api/core/client_wrapper.py b/sdks/python/julep/api/core/client_wrapper.py index 56c1d13c7..4c9a0b2e4 100644 --- a/sdks/python/julep/api/core/client_wrapper.py +++ b/sdks/python/julep/api/core/client_wrapper.py @@ -6,12 +6,14 @@ class BaseClientWrapper: - def __init__(self, *, api_key: str, base_url: str): + def __init__(self, *, auth_key: str, api_key: str, base_url: str): + self._auth_key = auth_key self.api_key = api_key self._base_url = base_url def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = {"X-Fern-Language": "Python"} + headers["X-Auth-Key"] = self._auth_key headers["Authorization"] = self.api_key return headers @@ -20,12 +22,21 @@ def get_base_url(self) -> str: class SyncClientWrapper(BaseClientWrapper): - def __init__(self, *, api_key: str, base_url: str, httpx_client: httpx.Client): - super().__init__(api_key=api_key, base_url=base_url) + def __init__( + self, *, auth_key: str, api_key: str, base_url: str, httpx_client: httpx.Client + ): + super().__init__(auth_key=auth_key, api_key=api_key, base_url=base_url) self.httpx_client = httpx_client class AsyncClientWrapper(BaseClientWrapper): - def __init__(self, *, api_key: str, base_url: str, httpx_client: httpx.AsyncClient): - super().__init__(api_key=api_key, base_url=base_url) + def __init__( + self, + *, + auth_key: str, + api_key: str, + base_url: str, + httpx_client: httpx.AsyncClient + ): + super().__init__(auth_key=auth_key, api_key=api_key, base_url=base_url) self.httpx_client = httpx_client diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 35074987f..28c974209 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -1,201 +1,443 @@ # This file was auto-generated by Fern from our API Definition. -from .agent import Agent -from .agent_default_settings import AgentDefaultSettings -from .agent_default_settings_preset import AgentDefaultSettingsPreset -from .agent_instructions import AgentInstructions -from .cel_object import CelObject -from .chat_input_data import ChatInputData -from .chat_input_data_tool_choice import ChatInputDataToolChoice -from .chat_ml_image_content_part import ChatMlImageContentPart -from .chat_ml_image_content_part_image_url import ChatMlImageContentPartImageUrl -from .chat_ml_image_content_part_image_url_detail import ( - ChatMlImageContentPartImageUrlDetail, -) -from .chat_ml_message import ChatMlMessage -from .chat_ml_message_content import ChatMlMessageContent -from .chat_ml_message_content_item import ( - ChatMlMessageContentItem, - ChatMlMessageContentItem_ImageUrl, - ChatMlMessageContentItem_Text, -) -from .chat_ml_message_role import ChatMlMessageRole -from .chat_ml_text_content_part import ChatMlTextContentPart -from .chat_response import ChatResponse -from .chat_response_finish_reason import ChatResponseFinishReason -from .chat_settings import ChatSettings -from .chat_settings_preset import ChatSettingsPreset -from .chat_settings_response_format import ChatSettingsResponseFormat -from .chat_settings_response_format_schema import ChatSettingsResponseFormatSchema -from .chat_settings_response_format_type import ChatSettingsResponseFormatType -from .chat_settings_stop import ChatSettingsStop -from .completion_usage import CompletionUsage -from .create_agent_request_instructions import CreateAgentRequestInstructions -from .create_doc import CreateDoc -from .create_doc_content import CreateDocContent -from .create_tool_request import CreateToolRequest -from .create_tool_request_type import CreateToolRequestType -from .doc import Doc -from .doc_content import DocContent -from .doc_ids import DocIds -from .error_workflow_step import ErrorWorkflowStep -from .evaluate_workflow_step import EvaluateWorkflowStep -from .execution import Execution -from .execution_status import ExecutionStatus -from .execution_transition import ExecutionTransition -from .function_call_option import FunctionCallOption -from .function_def import FunctionDef -from .function_parameters import FunctionParameters -from .get_agent_docs_request_order import GetAgentDocsRequestOrder -from .get_agent_docs_request_sort_by import GetAgentDocsRequestSortBy -from .get_agent_docs_response import GetAgentDocsResponse -from .get_agent_memories_response import GetAgentMemoriesResponse -from .get_agent_tools_response import GetAgentToolsResponse -from .get_history_response import GetHistoryResponse -from .get_suggestions_response import GetSuggestionsResponse -from .get_user_docs_request_order import GetUserDocsRequestOrder -from .get_user_docs_request_sort_by import GetUserDocsRequestSortBy -from .get_user_docs_response import GetUserDocsResponse -from .if_else_workflow_step import IfElseWorkflowStep -from .input_chat_ml_message import InputChatMlMessage -from .input_chat_ml_message_content import InputChatMlMessageContent -from .input_chat_ml_message_content_item import ( - InputChatMlMessageContentItem, - InputChatMlMessageContentItem_ImageUrl, - InputChatMlMessageContentItem_Text, -) -from .input_chat_ml_message_role import InputChatMlMessageRole -from .job_status import JobStatus -from .job_status_state import JobStatusState -from .list_agents_request_order import ListAgentsRequestOrder -from .list_agents_request_sort_by import ListAgentsRequestSortBy -from .list_agents_response import ListAgentsResponse -from .list_sessions_request_order import ListSessionsRequestOrder -from .list_sessions_request_sort_by import ListSessionsRequestSortBy -from .list_sessions_response import ListSessionsResponse -from .list_users_request_order import ListUsersRequestOrder -from .list_users_request_sort_by import ListUsersRequestSortBy -from .list_users_response import ListUsersResponse -from .memory import Memory -from .memory_access_options import MemoryAccessOptions -from .memory_entities_item import MemoryEntitiesItem -from .named_tool_choice import NamedToolChoice -from .named_tool_choice_function import NamedToolChoiceFunction -from .partial_function_def import PartialFunctionDef -from .patch_agent_request_instructions import PatchAgentRequestInstructions -from .prompt_workflow_step import PromptWorkflowStep -from .resource_created_response import ResourceCreatedResponse -from .resource_deleted_response import ResourceDeletedResponse -from .resource_updated_response import ResourceUpdatedResponse -from .session import Session -from .suggestion import Suggestion -from .suggestion_target import SuggestionTarget -from .task import Task -from .tool import Tool -from .tool_call_workflow_step import ToolCallWorkflowStep -from .tool_choice_option import ToolChoiceOption -from .tool_response import ToolResponse -from .tool_type import ToolType -from .transition_type import TransitionType -from .update_agent_request_instructions import UpdateAgentRequestInstructions -from .user import User -from .workflow_step import WorkflowStep -from .yield_workflow_step import YieldWorkflowStep +from .agent_docs_route_list_request_direction import AgentDocsRouteListRequestDirection +from .agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy +from .agent_docs_route_list_response import AgentDocsRouteListResponse +from .agent_tools_route_create_response import AgentToolsRouteCreateResponse +from .agent_tools_route_list_request_direction import ( + AgentToolsRouteListRequestDirection, +) +from .agent_tools_route_list_request_sort_by import AgentToolsRouteListRequestSortBy +from .agent_tools_route_list_response import AgentToolsRouteListResponse +from .agents_agent import AgentsAgent +from .agents_agent_default_settings import AgentsAgentDefaultSettings +from .agents_agent_instructions import AgentsAgentInstructions +from .agents_create_agent_request import AgentsCreateAgentRequest +from .agents_create_agent_request_default_settings import ( + AgentsCreateAgentRequestDefaultSettings, +) +from .agents_create_agent_request_instructions import ( + AgentsCreateAgentRequestInstructions, +) +from .agents_create_or_update_agent_request_default_settings import ( + AgentsCreateOrUpdateAgentRequestDefaultSettings, +) +from .agents_create_or_update_agent_request_instructions import ( + AgentsCreateOrUpdateAgentRequestInstructions, +) +from .agents_docs_search_route_search_request_direction import ( + AgentsDocsSearchRouteSearchRequestDirection, +) +from .agents_docs_search_route_search_request_sort_by import ( + AgentsDocsSearchRouteSearchRequestSortBy, +) +from .agents_docs_search_route_search_response import ( + AgentsDocsSearchRouteSearchResponse, +) +from .agents_patch_agent_request_default_settings import ( + AgentsPatchAgentRequestDefaultSettings, +) +from .agents_patch_agent_request_instructions import AgentsPatchAgentRequestInstructions +from .agents_route_create_or_update_response import AgentsRouteCreateOrUpdateResponse +from .agents_route_create_response import AgentsRouteCreateResponse +from .agents_route_delete_response import AgentsRouteDeleteResponse +from .agents_route_list_request_direction import AgentsRouteListRequestDirection +from .agents_route_list_request_sort_by import AgentsRouteListRequestSortBy +from .agents_route_list_response import AgentsRouteListResponse +from .agents_route_patch_response import AgentsRoutePatchResponse +from .agents_route_update_response import AgentsRouteUpdateResponse +from .agents_update_agent_request_default_settings import ( + AgentsUpdateAgentRequestDefaultSettings, +) +from .agents_update_agent_request_instructions import ( + AgentsUpdateAgentRequestInstructions, +) +from .chat_completion_response_format import ChatCompletionResponseFormat +from .chat_completion_response_format_type import ChatCompletionResponseFormatType +from .chat_generation_preset import ChatGenerationPreset +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_limit import CommonLimit +from .common_logit_bias import CommonLogitBias +from .common_offset import CommonOffset +from .common_tool_ref import CommonToolRef +from .common_uuid import CommonUuid +from .common_valid_python_identifier import CommonValidPythonIdentifier +from .docs_doc import DocsDoc +from .docs_doc_content import DocsDocContent +from .docs_doc_owner import DocsDocOwner +from .docs_doc_owner_role import DocsDocOwnerRole +from .docs_doc_reference import DocsDocReference +from .docs_doc_search_request import ( + DocsDocSearchRequest, + DocsDocSearchRequest_Hybrid, + DocsDocSearchRequest_Text, + DocsDocSearchRequest_Vector, +) +from .docs_doc_search_request_text import DocsDocSearchRequestText +from .docs_doc_search_request_vector import DocsDocSearchRequestVector +from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest +from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText +from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector +from .docs_text_only_doc_search_request import DocsTextOnlyDocSearchRequest +from .docs_text_only_doc_search_request_text import DocsTextOnlyDocSearchRequestText +from .docs_vector_doc_search_request import DocsVectorDocSearchRequest +from .docs_vector_doc_search_request_vector import DocsVectorDocSearchRequestVector +from .entries_base_chat_ml_content_part import ( + EntriesBaseChatMlContentPart, + EntriesBaseChatMlContentPart_ImageUrl, +) +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_role import EntriesChatMlRole +from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart +from .entries_entry import EntriesEntry +from .entries_entry_content import EntriesEntryContent +from .entries_entry_content_item import EntriesEntryContentItem +from .entries_entry_content_item_item import ( + EntriesEntryContentItemItem, + EntriesEntryContentItemItem_ImageUrl, + EntriesEntryContentItemItem_Text, +) +from .entries_entry_source import EntriesEntrySource +from .entries_history import EntriesHistory +from .entries_image_detail import EntriesImageDetail +from .entries_image_url import EntriesImageUrl +from .entries_input_chat_ml_message import EntriesInputChatMlMessage +from .entries_input_chat_ml_message_content import EntriesInputChatMlMessageContent +from .entries_input_chat_ml_message_content_item import ( + EntriesInputChatMlMessageContentItem, + EntriesInputChatMlMessageContentItem_ImageUrl, + EntriesInputChatMlMessageContentItem_Text, +) +from .entries_relation import EntriesRelation +from .execution_transitions_route_list_request_direction import ( + ExecutionTransitionsRouteListRequestDirection, +) +from .execution_transitions_route_list_request_sort_by import ( + ExecutionTransitionsRouteListRequestSortBy, +) +from .execution_transitions_route_list_response import ( + ExecutionTransitionsRouteListResponse, +) +from .execution_transitions_route_list_response_results_item import ( + ExecutionTransitionsRouteListResponseResultsItem, +) +from .executions_execution import ExecutionsExecution +from .executions_execution_status import ExecutionsExecutionStatus +from .executions_resume_execution_request import ExecutionsResumeExecutionRequest +from .executions_route_update_response import ExecutionsRouteUpdateResponse +from .executions_stop_execution_request import ExecutionsStopExecutionRequest +from .executions_transition import ExecutionsTransition +from .executions_transition_type import ExecutionsTransitionType +from .executions_update_execution_request import ( + ExecutionsUpdateExecutionRequest, + ExecutionsUpdateExecutionRequest_Cancelled, + ExecutionsUpdateExecutionRequest_Running, +) +from .history_route_delete_response import HistoryRouteDeleteResponse +from .history_route_list_request_direction import HistoryRouteListRequestDirection +from .history_route_list_request_sort_by import HistoryRouteListRequestSortBy +from .history_route_list_response import HistoryRouteListResponse +from .individual_docs_route_delete_response import IndividualDocsRouteDeleteResponse +from .jobs_job_state import JobsJobState +from .jobs_job_status import JobsJobStatus +from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession +from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession +from .sessions_multi_agent_single_user_session import ( + SessionsMultiAgentSingleUserSession, +) +from .sessions_route_create_or_update_response import ( + SessionsRouteCreateOrUpdateResponse, +) +from .sessions_route_create_response import SessionsRouteCreateResponse +from .sessions_route_delete_response import SessionsRouteDeleteResponse +from .sessions_route_list_request_direction import SessionsRouteListRequestDirection +from .sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy +from .sessions_route_list_response import SessionsRouteListResponse +from .sessions_route_patch_response import SessionsRoutePatchResponse +from .sessions_route_update_response import SessionsRouteUpdateResponse +from .sessions_session import ( + SessionsSession, + SessionsSession_MultiAgentMultiUser, + SessionsSession_MultiAgentNoUser, + SessionsSession_MultiAgentSingleUser, + SessionsSession_SingleAgentMultiUser, + SessionsSession_SingleAgentNoUser, + SessionsSession_SingleAgentSingleUser, +) +from .sessions_single_agent_multi_user_session import ( + SessionsSingleAgentMultiUserSession, +) +from .sessions_single_agent_no_user_session import SessionsSingleAgentNoUserSession +from .sessions_single_agent_single_user_session import ( + SessionsSingleAgentSingleUserSession, +) +from .task_executions_route_create_response import TaskExecutionsRouteCreateResponse +from .task_executions_route_list_request_direction import ( + TaskExecutionsRouteListRequestDirection, +) +from .task_executions_route_list_request_sort_by import ( + TaskExecutionsRouteListRequestSortBy, +) +from .task_executions_route_list_response import TaskExecutionsRouteListResponse +from .task_executions_route_resume_with_task_token_response import ( + TaskExecutionsRouteResumeWithTaskTokenResponse, +) +from .tasks_cel import TasksCel +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_prompt_step_prompt import TasksPromptStepPrompt +from .tasks_prompt_step_settings import TasksPromptStepSettings +from .tasks_prompt_step_settings_frequency_penalty import ( + TasksPromptStepSettingsFrequencyPenalty, +) +from .tasks_prompt_step_settings_length_penalty import ( + TasksPromptStepSettingsLengthPenalty, +) +from .tasks_prompt_step_settings_preset import TasksPromptStepSettingsPreset +from .tasks_route_create_or_update_response import TasksRouteCreateOrUpdateResponse +from .tasks_route_create_response import TasksRouteCreateResponse +from .tasks_route_delete_response import TasksRouteDeleteResponse +from .tasks_route_list_request_direction import TasksRouteListRequestDirection +from .tasks_route_list_request_sort_by import TasksRouteListRequestSortBy +from .tasks_route_list_response import TasksRouteListResponse +from .tasks_route_patch_response import TasksRoutePatchResponse +from .tasks_route_update_response import TasksRouteUpdateResponse +from .tasks_task import TasksTask +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_workflow_step import ( + TasksWorkflowStep, + TasksWorkflowStep_Error, + TasksWorkflowStep_Evaluate, + TasksWorkflowStep_IfElse, + TasksWorkflowStep_Prompt, + TasksWorkflowStep_ToolCall, + TasksWorkflowStep_Yield, +) +from .tasks_yield_step import TasksYieldStep +from .tool_route_delete_response import ToolRouteDeleteResponse +from .tool_route_patch_response import ToolRoutePatchResponse +from .tool_route_update_response import ToolRouteUpdateResponse +from .tools_chosen_function_call import ToolsChosenFunctionCall +from .tools_chosen_tool_call import ToolsChosenToolCall, ToolsChosenToolCall_Function +from .tools_create_tool_request import ToolsCreateToolRequest +from .tools_function_call_option import ToolsFunctionCallOption +from .tools_function_def import ToolsFunctionDef +from .tools_function_def_update import ToolsFunctionDefUpdate +from .tools_function_tool import ToolsFunctionTool +from .tools_tool import ToolsTool, ToolsTool_Function +from .tools_tool_response import ToolsToolResponse +from .tools_tool_type import ToolsToolType +from .user_docs_route_list_request_direction import UserDocsRouteListRequestDirection +from .user_docs_route_list_request_sort_by import UserDocsRouteListRequestSortBy +from .user_docs_route_list_response import UserDocsRouteListResponse +from .user_docs_search_route_search_request_direction import ( + UserDocsSearchRouteSearchRequestDirection, +) +from .user_docs_search_route_search_request_sort_by import ( + UserDocsSearchRouteSearchRequestSortBy, +) +from .user_docs_search_route_search_response import UserDocsSearchRouteSearchResponse +from .users_route_create_or_update_response import UsersRouteCreateOrUpdateResponse +from .users_route_create_response import UsersRouteCreateResponse +from .users_route_delete_response import UsersRouteDeleteResponse +from .users_route_list_request_direction import UsersRouteListRequestDirection +from .users_route_list_request_sort_by import UsersRouteListRequestSortBy +from .users_route_list_response import UsersRouteListResponse +from .users_route_patch_response import UsersRoutePatchResponse +from .users_route_update_response import UsersRouteUpdateResponse +from .users_user import UsersUser __all__ = [ - "Agent", - "AgentDefaultSettings", - "AgentDefaultSettingsPreset", - "AgentInstructions", - "CelObject", - "ChatInputData", - "ChatInputDataToolChoice", - "ChatMlImageContentPart", - "ChatMlImageContentPartImageUrl", - "ChatMlImageContentPartImageUrlDetail", - "ChatMlMessage", - "ChatMlMessageContent", - "ChatMlMessageContentItem", - "ChatMlMessageContentItem_ImageUrl", - "ChatMlMessageContentItem_Text", - "ChatMlMessageRole", - "ChatMlTextContentPart", - "ChatResponse", - "ChatResponseFinishReason", - "ChatSettings", - "ChatSettingsPreset", - "ChatSettingsResponseFormat", - "ChatSettingsResponseFormatSchema", - "ChatSettingsResponseFormatType", - "ChatSettingsStop", - "CompletionUsage", - "CreateAgentRequestInstructions", - "CreateDoc", - "CreateDocContent", - "CreateToolRequest", - "CreateToolRequestType", - "Doc", - "DocContent", - "DocIds", - "ErrorWorkflowStep", - "EvaluateWorkflowStep", - "Execution", - "ExecutionStatus", - "ExecutionTransition", - "FunctionCallOption", - "FunctionDef", - "FunctionParameters", - "GetAgentDocsRequestOrder", - "GetAgentDocsRequestSortBy", - "GetAgentDocsResponse", - "GetAgentMemoriesResponse", - "GetAgentToolsResponse", - "GetHistoryResponse", - "GetSuggestionsResponse", - "GetUserDocsRequestOrder", - "GetUserDocsRequestSortBy", - "GetUserDocsResponse", - "IfElseWorkflowStep", - "InputChatMlMessage", - "InputChatMlMessageContent", - "InputChatMlMessageContentItem", - "InputChatMlMessageContentItem_ImageUrl", - "InputChatMlMessageContentItem_Text", - "InputChatMlMessageRole", - "JobStatus", - "JobStatusState", - "ListAgentsRequestOrder", - "ListAgentsRequestSortBy", - "ListAgentsResponse", - "ListSessionsRequestOrder", - "ListSessionsRequestSortBy", - "ListSessionsResponse", - "ListUsersRequestOrder", - "ListUsersRequestSortBy", - "ListUsersResponse", - "Memory", - "MemoryAccessOptions", - "MemoryEntitiesItem", - "NamedToolChoice", - "NamedToolChoiceFunction", - "PartialFunctionDef", - "PatchAgentRequestInstructions", - "PromptWorkflowStep", - "ResourceCreatedResponse", - "ResourceDeletedResponse", - "ResourceUpdatedResponse", - "Session", - "Suggestion", - "SuggestionTarget", - "Task", - "Tool", - "ToolCallWorkflowStep", - "ToolChoiceOption", - "ToolResponse", - "ToolType", - "TransitionType", - "UpdateAgentRequestInstructions", - "User", - "WorkflowStep", - "YieldWorkflowStep", + "AgentDocsRouteListRequestDirection", + "AgentDocsRouteListRequestSortBy", + "AgentDocsRouteListResponse", + "AgentToolsRouteCreateResponse", + "AgentToolsRouteListRequestDirection", + "AgentToolsRouteListRequestSortBy", + "AgentToolsRouteListResponse", + "AgentsAgent", + "AgentsAgentDefaultSettings", + "AgentsAgentInstructions", + "AgentsCreateAgentRequest", + "AgentsCreateAgentRequestDefaultSettings", + "AgentsCreateAgentRequestInstructions", + "AgentsCreateOrUpdateAgentRequestDefaultSettings", + "AgentsCreateOrUpdateAgentRequestInstructions", + "AgentsDocsSearchRouteSearchRequestDirection", + "AgentsDocsSearchRouteSearchRequestSortBy", + "AgentsDocsSearchRouteSearchResponse", + "AgentsPatchAgentRequestDefaultSettings", + "AgentsPatchAgentRequestInstructions", + "AgentsRouteCreateOrUpdateResponse", + "AgentsRouteCreateResponse", + "AgentsRouteDeleteResponse", + "AgentsRouteListRequestDirection", + "AgentsRouteListRequestSortBy", + "AgentsRouteListResponse", + "AgentsRoutePatchResponse", + "AgentsRouteUpdateResponse", + "AgentsUpdateAgentRequestDefaultSettings", + "AgentsUpdateAgentRequestInstructions", + "ChatCompletionResponseFormat", + "ChatCompletionResponseFormatType", + "ChatGenerationPreset", + "ChatGenerationPresetSettings", + "ChatOpenAiSettings", + "ChatVLlmSettings", + "CommonIdentifierSafeUnicode", + "CommonLimit", + "CommonLogitBias", + "CommonOffset", + "CommonToolRef", + "CommonUuid", + "CommonValidPythonIdentifier", + "DocsDoc", + "DocsDocContent", + "DocsDocOwner", + "DocsDocOwnerRole", + "DocsDocReference", + "DocsDocSearchRequest", + "DocsDocSearchRequestText", + "DocsDocSearchRequestVector", + "DocsDocSearchRequest_Hybrid", + "DocsDocSearchRequest_Text", + "DocsDocSearchRequest_Vector", + "DocsHybridDocSearchRequest", + "DocsHybridDocSearchRequestText", + "DocsHybridDocSearchRequestVector", + "DocsTextOnlyDocSearchRequest", + "DocsTextOnlyDocSearchRequestText", + "DocsVectorDocSearchRequest", + "DocsVectorDocSearchRequestVector", + "EntriesBaseChatMlContentPart", + "EntriesBaseChatMlContentPart_ImageUrl", + "EntriesChatMlImageContentPart", + "EntriesChatMlRole", + "EntriesChatMlTextContentPart", + "EntriesEntry", + "EntriesEntryContent", + "EntriesEntryContentItem", + "EntriesEntryContentItemItem", + "EntriesEntryContentItemItem_ImageUrl", + "EntriesEntryContentItemItem_Text", + "EntriesEntrySource", + "EntriesHistory", + "EntriesImageDetail", + "EntriesImageUrl", + "EntriesInputChatMlMessage", + "EntriesInputChatMlMessageContent", + "EntriesInputChatMlMessageContentItem", + "EntriesInputChatMlMessageContentItem_ImageUrl", + "EntriesInputChatMlMessageContentItem_Text", + "EntriesRelation", + "ExecutionTransitionsRouteListRequestDirection", + "ExecutionTransitionsRouteListRequestSortBy", + "ExecutionTransitionsRouteListResponse", + "ExecutionTransitionsRouteListResponseResultsItem", + "ExecutionsExecution", + "ExecutionsExecutionStatus", + "ExecutionsResumeExecutionRequest", + "ExecutionsRouteUpdateResponse", + "ExecutionsStopExecutionRequest", + "ExecutionsTransition", + "ExecutionsTransitionType", + "ExecutionsUpdateExecutionRequest", + "ExecutionsUpdateExecutionRequest_Cancelled", + "ExecutionsUpdateExecutionRequest_Running", + "HistoryRouteDeleteResponse", + "HistoryRouteListRequestDirection", + "HistoryRouteListRequestSortBy", + "HistoryRouteListResponse", + "IndividualDocsRouteDeleteResponse", + "JobsJobState", + "JobsJobStatus", + "SessionsMultiAgentMultiUserSession", + "SessionsMultiAgentNoUserSession", + "SessionsMultiAgentSingleUserSession", + "SessionsRouteCreateOrUpdateResponse", + "SessionsRouteCreateResponse", + "SessionsRouteDeleteResponse", + "SessionsRouteListRequestDirection", + "SessionsRouteListRequestSortBy", + "SessionsRouteListResponse", + "SessionsRoutePatchResponse", + "SessionsRouteUpdateResponse", + "SessionsSession", + "SessionsSession_MultiAgentMultiUser", + "SessionsSession_MultiAgentNoUser", + "SessionsSession_MultiAgentSingleUser", + "SessionsSession_SingleAgentMultiUser", + "SessionsSession_SingleAgentNoUser", + "SessionsSession_SingleAgentSingleUser", + "SessionsSingleAgentMultiUserSession", + "SessionsSingleAgentNoUserSession", + "SessionsSingleAgentSingleUserSession", + "TaskExecutionsRouteCreateResponse", + "TaskExecutionsRouteListRequestDirection", + "TaskExecutionsRouteListRequestSortBy", + "TaskExecutionsRouteListResponse", + "TaskExecutionsRouteResumeWithTaskTokenResponse", + "TasksCel", + "TasksErrorWorkflowStep", + "TasksEvaluateStep", + "TasksIfElseWorkflowStep", + "TasksPromptStep", + "TasksPromptStepPrompt", + "TasksPromptStepSettings", + "TasksPromptStepSettingsFrequencyPenalty", + "TasksPromptStepSettingsLengthPenalty", + "TasksPromptStepSettingsPreset", + "TasksRouteCreateOrUpdateResponse", + "TasksRouteCreateResponse", + "TasksRouteDeleteResponse", + "TasksRouteListRequestDirection", + "TasksRouteListRequestSortBy", + "TasksRouteListResponse", + "TasksRoutePatchResponse", + "TasksRouteUpdateResponse", + "TasksTask", + "TasksToolCallStep", + "TasksWorkflowStep", + "TasksWorkflowStep_Error", + "TasksWorkflowStep_Evaluate", + "TasksWorkflowStep_IfElse", + "TasksWorkflowStep_Prompt", + "TasksWorkflowStep_ToolCall", + "TasksWorkflowStep_Yield", + "TasksYieldStep", + "ToolRouteDeleteResponse", + "ToolRoutePatchResponse", + "ToolRouteUpdateResponse", + "ToolsChosenFunctionCall", + "ToolsChosenToolCall", + "ToolsChosenToolCall_Function", + "ToolsCreateToolRequest", + "ToolsFunctionCallOption", + "ToolsFunctionDef", + "ToolsFunctionDefUpdate", + "ToolsFunctionTool", + "ToolsTool", + "ToolsToolResponse", + "ToolsToolType", + "ToolsTool_Function", + "UserDocsRouteListRequestDirection", + "UserDocsRouteListRequestSortBy", + "UserDocsRouteListResponse", + "UserDocsSearchRouteSearchRequestDirection", + "UserDocsSearchRouteSearchRequestSortBy", + "UserDocsSearchRouteSearchResponse", + "UsersRouteCreateOrUpdateResponse", + "UsersRouteCreateResponse", + "UsersRouteDeleteResponse", + "UsersRouteListRequestDirection", + "UsersRouteListRequestSortBy", + "UsersRouteListResponse", + "UsersRoutePatchResponse", + "UsersRouteUpdateResponse", + "UsersUser", ] diff --git a/sdks/python/julep/api/types/agent_default_settings_preset.py b/sdks/python/julep/api/types/agent_default_settings_preset.py deleted file mode 100644 index ddd6fee1a..000000000 --- a/sdks/python/julep/api/types/agent_default_settings_preset.py +++ /dev/null @@ -1,53 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class AgentDefaultSettingsPreset(str, enum.Enum): - """ - Generation preset name (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - """ - - PROBLEM_SOLVING = "problem_solving" - CONVERSATIONAL = "conversational" - FUN = "fun" - PROSE = "prose" - CREATIVE = "creative" - BUSINESS = "business" - DETERMINISTIC = "deterministic" - CODE = "code" - MULTILINGUAL = "multilingual" - - def visit( - self, - problem_solving: typing.Callable[[], T_Result], - conversational: typing.Callable[[], T_Result], - fun: typing.Callable[[], T_Result], - prose: typing.Callable[[], T_Result], - creative: typing.Callable[[], T_Result], - business: typing.Callable[[], T_Result], - deterministic: typing.Callable[[], T_Result], - code: typing.Callable[[], T_Result], - multilingual: typing.Callable[[], T_Result], - ) -> T_Result: - if self is AgentDefaultSettingsPreset.PROBLEM_SOLVING: - return problem_solving() - if self is AgentDefaultSettingsPreset.CONVERSATIONAL: - return conversational() - if self is AgentDefaultSettingsPreset.FUN: - return fun() - if self is AgentDefaultSettingsPreset.PROSE: - return prose() - if self is AgentDefaultSettingsPreset.CREATIVE: - return creative() - if self is AgentDefaultSettingsPreset.BUSINESS: - return business() - if self is AgentDefaultSettingsPreset.DETERMINISTIC: - return deterministic() - if self is AgentDefaultSettingsPreset.CODE: - return code() - if self is AgentDefaultSettingsPreset.MULTILINGUAL: - return multilingual() diff --git a/sdks/python/julep/api/types/agent_docs_route_list_request_direction.py b/sdks/python/julep/api/types/agent_docs_route_list_request_direction.py new file mode 100644 index 000000000..33bb8e404 --- /dev/null +++ b/sdks/python/julep/api/types/agent_docs_route_list_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AgentDocsRouteListRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is AgentDocsRouteListRequestDirection.ASC: + return asc() + if self is AgentDocsRouteListRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py b/sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py new file mode 100644 index 000000000..f7c61ab5a --- /dev/null +++ b/sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AgentDocsRouteListRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is AgentDocsRouteListRequestSortBy.CREATED_AT: + return created_at() + if self is AgentDocsRouteListRequestSortBy.UPDATED_AT: + return updated_at() + if self is AgentDocsRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/doc_ids.py b/sdks/python/julep/api/types/agent_docs_route_list_response.py similarity index 88% rename from sdks/python/julep/api/types/doc_ids.py rename to sdks/python/julep/api/types/agent_docs_route_list_response.py index 19eea5473..13d9208cb 100644 --- a/sdks/python/julep/api/types/doc_ids.py +++ b/sdks/python/julep/api/types/agent_docs_route_list_response.py @@ -4,6 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime +from .docs_doc import DocsDoc try: import pydantic.v1 as pydantic # type: ignore @@ -11,9 +12,8 @@ import pydantic # type: ignore -class DocIds(pydantic.BaseModel): - agent_doc_ids: typing.List[str] - user_doc_ids: typing.List[str] +class AgentDocsRouteListResponse(pydantic.BaseModel): + results: typing.List[DocsDoc] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/agent_tools_route_create_response.py b/sdks/python/julep/api/types/agent_tools_route_create_response.py new file mode 100644 index 000000000..4c580bd0a --- /dev/null +++ b/sdks/python/julep/api/types/agent_tools_route_create_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentToolsRouteCreateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of created undefined") + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py b/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py new file mode 100644 index 000000000..69e7cdcd9 --- /dev/null +++ b/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AgentToolsRouteListRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is AgentToolsRouteListRequestDirection.ASC: + return asc() + if self is AgentToolsRouteListRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py b/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py new file mode 100644 index 000000000..d1321b821 --- /dev/null +++ b/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AgentToolsRouteListRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is AgentToolsRouteListRequestSortBy.CREATED_AT: + return created_at() + if self is AgentToolsRouteListRequestSortBy.UPDATED_AT: + return updated_at() + if self is AgentToolsRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/agent_tools_route_list_response.py b/sdks/python/julep/api/types/agent_tools_route_list_response.py new file mode 100644 index 000000000..ccc348710 --- /dev/null +++ b/sdks/python/julep/api/types/agent_tools_route_list_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .tools_tool import ToolsTool + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentToolsRouteListResponse(pydantic.BaseModel): + results: typing.List[ToolsTool] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agent.py b/sdks/python/julep/api/types/agents_agent.py similarity index 51% rename from sdks/python/julep/api/types/agent.py rename to sdks/python/julep/api/types/agents_agent.py index 4f6ca8cc2..554bc6766 100644 --- a/sdks/python/julep/api/types/agent.py +++ b/sdks/python/julep/api/types/agents_agent.py @@ -4,8 +4,10 @@ import typing from ..core.datetime_utils import serialize_datetime -from .agent_default_settings import AgentDefaultSettings -from .agent_instructions import AgentInstructions +from .agents_agent_default_settings import AgentsAgentDefaultSettings +from .agents_agent_instructions import AgentsAgentInstructions +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid try: import pydantic.v1 as pydantic # type: ignore @@ -13,26 +15,26 @@ import pydantic # type: ignore -class Agent(pydantic.BaseModel): - name: str = pydantic.Field(description="Name of the agent") - about: typing.Optional[str] = pydantic.Field(description="About the agent") - created_at: typing.Optional[dt.datetime] = pydantic.Field( - description="Agent created at (RFC-3339 format)" +class AgentsAgent(pydantic.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" ) - updated_at: typing.Optional[dt.datetime] = pydantic.Field( - description="Agent updated at (RFC-3339 format)" + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" ) - id: str = pydantic.Field(description="Agent id (UUID)") - default_settings: typing.Optional[AgentDefaultSettings] = pydantic.Field( - description="Default settings for all sessions created by this agent" - ) - model: str = pydantic.Field(description="The model to use with this agent") - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="Optional metadata" + name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the agent") + about: str = pydantic.Field(description="About the agent") + model: str = pydantic.Field( + description="Model name to use (gpt-4-turbo, gemini-nano etc)" ) - instructions: typing.Optional[AgentInstructions] = pydantic.Field( + instructions: AgentsAgentInstructions = pydantic.Field( description="Instructions for the agent" ) + default_settings: typing.Optional[AgentsAgentDefaultSettings] = pydantic.Field( + description="Default settings for all sessions created by this agent" + ) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/agents_agent_default_settings.py b/sdks/python/julep/api/types/agents_agent_default_settings.py new file mode 100644 index 000000000..a2b453aa2 --- /dev/null +++ b/sdks/python/julep/api/types/agents_agent_default_settings.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset import ChatGenerationPreset +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsAgentDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agent_instructions.py b/sdks/python/julep/api/types/agents_agent_instructions.py similarity index 56% rename from sdks/python/julep/api/types/agent_instructions.py rename to sdks/python/julep/api/types/agents_agent_instructions.py index d792498bd..b69d41f6f 100644 --- a/sdks/python/julep/api/types/agent_instructions.py +++ b/sdks/python/julep/api/types/agents_agent_instructions.py @@ -2,4 +2,4 @@ import typing -AgentInstructions = typing.Union[str, typing.List[str]] +AgentsAgentInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_create_agent_request.py b/sdks/python/julep/api/types/agents_create_agent_request.py new file mode 100644 index 000000000..c5d76306e --- /dev/null +++ b/sdks/python/julep/api/types/agents_create_agent_request.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .agents_create_agent_request_default_settings import ( + AgentsCreateAgentRequestDefaultSettings, +) +from .agents_create_agent_request_instructions import ( + AgentsCreateAgentRequestInstructions, +) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsCreateAgentRequest(pydantic.BaseModel): + """ + Payload for creating a agent (and associated documents) + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] + name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the agent") + about: str = pydantic.Field(description="About the agent") + model: str = pydantic.Field( + description="Model name to use (gpt-4-turbo, gemini-nano etc)" + ) + instructions: AgentsCreateAgentRequestInstructions = pydantic.Field( + description="Instructions for the agent" + ) + default_settings: typing.Optional[AgentsCreateAgentRequestDefaultSettings] = ( + pydantic.Field( + description="Default settings for all sessions created by this agent" + ) + ) + docs: typing.List[typing.Any] = pydantic.Field( + description="Documents to index for this agent. (Max: 100 items)" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py new file mode 100644 index 000000000..9e893905b --- /dev/null +++ b/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset import ChatGenerationPreset +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsCreateAgentRequestDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/create_agent_request_instructions.py b/sdks/python/julep/api/types/agents_create_agent_request_instructions.py similarity index 51% rename from sdks/python/julep/api/types/create_agent_request_instructions.py rename to sdks/python/julep/api/types/agents_create_agent_request_instructions.py index 366fb1159..70ec8cac1 100644 --- a/sdks/python/julep/api/types/create_agent_request_instructions.py +++ b/sdks/python/julep/api/types/agents_create_agent_request_instructions.py @@ -2,4 +2,4 @@ import typing -CreateAgentRequestInstructions = typing.Union[str, typing.List[str]] +AgentsCreateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py new file mode 100644 index 000000000..121add81e --- /dev/null +++ b/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset import ChatGenerationPreset +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsCreateOrUpdateAgentRequestDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py b/sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py new file mode 100644 index 000000000..4e69ede12 --- /dev/null +++ b/sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsCreateOrUpdateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py new file mode 100644 index 000000000..ac49ec44e --- /dev/null +++ b/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AgentsDocsSearchRouteSearchRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is AgentsDocsSearchRouteSearchRequestDirection.ASC: + return asc() + if self is AgentsDocsSearchRouteSearchRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py new file mode 100644 index 000000000..33953d12b --- /dev/null +++ b/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AgentsDocsSearchRouteSearchRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is AgentsDocsSearchRouteSearchRequestSortBy.CREATED_AT: + return created_at() + if self is AgentsDocsSearchRouteSearchRequestSortBy.UPDATED_AT: + return updated_at() + if self is AgentsDocsSearchRouteSearchRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_response.py b/sdks/python/julep/api/types/agents_docs_search_route_search_response.py new file mode 100644 index 000000000..c8ee082fa --- /dev/null +++ b/sdks/python/julep/api/types/agents_docs_search_route_search_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .docs_doc_reference import DocsDocReference + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsDocsSearchRouteSearchResponse(pydantic.BaseModel): + results: typing.List[DocsDocReference] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py new file mode 100644 index 000000000..457af4a38 --- /dev/null +++ b/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset import ChatGenerationPreset +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsPatchAgentRequestDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/chat_settings_stop.py b/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py similarity index 51% rename from sdks/python/julep/api/types/chat_settings_stop.py rename to sdks/python/julep/api/types/agents_patch_agent_request_instructions.py index d8d2311ad..9df431bc5 100644 --- a/sdks/python/julep/api/types/chat_settings_stop.py +++ b/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py @@ -2,4 +2,4 @@ import typing -ChatSettingsStop = typing.Union[typing.Optional[str], typing.List[str]] +AgentsPatchAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_route_create_or_update_response.py b/sdks/python/julep/api/types/agents_route_create_or_update_response.py new file mode 100644 index 000000000..c1d4bed53 --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_create_or_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsRouteCreateOrUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_create_response.py b/sdks/python/julep/api/types/agents_route_create_response.py new file mode 100644 index 000000000..0114ae2c1 --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_create_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsRouteCreateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of created undefined") + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_delete_response.py b/sdks/python/julep/api/types/agents_route_delete_response.py new file mode 100644 index 000000000..61b360a23 --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_delete_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsRouteDeleteResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of deleted undefined") + deleted_at: dt.datetime = pydantic.Field( + description="When this resource was deleted as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/list_sessions_request_order.py b/sdks/python/julep/api/types/agents_route_list_request_direction.py similarity index 66% rename from sdks/python/julep/api/types/list_sessions_request_order.py rename to sdks/python/julep/api/types/agents_route_list_request_direction.py index 61422a719..603bb8a82 100644 --- a/sdks/python/julep/api/types/list_sessions_request_order.py +++ b/sdks/python/julep/api/types/agents_route_list_request_direction.py @@ -6,14 +6,14 @@ T_Result = typing.TypeVar("T_Result") -class ListSessionsRequestOrder(str, enum.Enum): +class AgentsRouteListRequestDirection(str, enum.Enum): ASC = "asc" DESC = "desc" def visit( self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] ) -> T_Result: - if self is ListSessionsRequestOrder.ASC: + if self is AgentsRouteListRequestDirection.ASC: return asc() - if self is ListSessionsRequestOrder.DESC: + if self is AgentsRouteListRequestDirection.DESC: return desc() diff --git a/sdks/python/julep/api/types/list_sessions_request_sort_by.py b/sdks/python/julep/api/types/agents_route_list_request_sort_by.py similarity index 54% rename from sdks/python/julep/api/types/list_sessions_request_sort_by.py rename to sdks/python/julep/api/types/agents_route_list_request_sort_by.py index 518370a6a..80373a1cd 100644 --- a/sdks/python/julep/api/types/list_sessions_request_sort_by.py +++ b/sdks/python/julep/api/types/agents_route_list_request_sort_by.py @@ -6,16 +6,20 @@ T_Result = typing.TypeVar("T_Result") -class ListSessionsRequestSortBy(str, enum.Enum): +class AgentsRouteListRequestSortBy(str, enum.Enum): CREATED_AT = "created_at" UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" def visit( self, created_at: typing.Callable[[], T_Result], updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], ) -> T_Result: - if self is ListSessionsRequestSortBy.CREATED_AT: + if self is AgentsRouteListRequestSortBy.CREATED_AT: return created_at() - if self is ListSessionsRequestSortBy.UPDATED_AT: + if self is AgentsRouteListRequestSortBy.UPDATED_AT: return updated_at() + if self is AgentsRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/agents_route_list_response.py b/sdks/python/julep/api/types/agents_route_list_response.py new file mode 100644 index 000000000..1e008fd66 --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_list_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .agents_agent import AgentsAgent + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsRouteListResponse(pydantic.BaseModel): + results: typing.List[AgentsAgent] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_patch_response.py b/sdks/python/julep/api/types/agents_route_patch_response.py new file mode 100644 index 000000000..f67b8a7a0 --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_patch_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsRoutePatchResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_update_response.py b/sdks/python/julep/api/types/agents_route_update_response.py new file mode 100644 index 000000000..f110e1504 --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class AgentsRouteUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py new file mode 100644 index 000000000..25fb2d882 --- /dev/null +++ b/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset import ChatGenerationPreset +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsUpdateAgentRequestDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agents_update_agent_request_instructions.py b/sdks/python/julep/api/types/agents_update_agent_request_instructions.py new file mode 100644 index 000000000..aecd60481 --- /dev/null +++ b/sdks/python/julep/api/types/agents_update_agent_request_instructions.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsUpdateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/resource_created_response.py b/sdks/python/julep/api/types/chat_completion_response_format.py similarity index 78% rename from sdks/python/julep/api/types/resource_created_response.py rename to sdks/python/julep/api/types/chat_completion_response_format.py index b2deba09c..0143fa265 100644 --- a/sdks/python/julep/api/types/resource_created_response.py +++ b/sdks/python/julep/api/types/chat_completion_response_format.py @@ -4,6 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime +from .chat_completion_response_format_type import ChatCompletionResponseFormatType try: import pydantic.v1 as pydantic # type: ignore @@ -11,11 +12,9 @@ import pydantic # type: ignore -class ResourceCreatedResponse(pydantic.BaseModel): - id: str - created_at: dt.datetime - jobs: typing.Optional[typing.List[str]] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" +class ChatCompletionResponseFormat(pydantic.BaseModel): + type: ChatCompletionResponseFormatType = pydantic.Field( + description="The format of the response" ) def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/chat_settings_response_format_type.py b/sdks/python/julep/api/types/chat_completion_response_format_type.py similarity index 51% rename from sdks/python/julep/api/types/chat_settings_response_format_type.py rename to sdks/python/julep/api/types/chat_completion_response_format_type.py index 5e3e3d3fa..1c461620e 100644 --- a/sdks/python/julep/api/types/chat_settings_response_format_type.py +++ b/sdks/python/julep/api/types/chat_completion_response_format_type.py @@ -6,24 +6,20 @@ T_Result = typing.TypeVar("T_Result") -class ChatSettingsResponseFormatType(str, enum.Enum): +class ChatCompletionResponseFormatType(str, enum.Enum): """ - Must be one of `"text"`, `"regex"` or `"json_object"`. + The format of the response """ TEXT = "text" JSON_OBJECT = "json_object" - REGEX = "regex" def visit( self, text: typing.Callable[[], T_Result], json_object: typing.Callable[[], T_Result], - regex: typing.Callable[[], T_Result], ) -> T_Result: - if self is ChatSettingsResponseFormatType.TEXT: + if self is ChatCompletionResponseFormatType.TEXT: return text() - if self is ChatSettingsResponseFormatType.JSON_OBJECT: + if self is ChatCompletionResponseFormatType.JSON_OBJECT: return json_object() - if self is ChatSettingsResponseFormatType.REGEX: - return regex() diff --git a/sdks/python/julep/api/types/chat_settings_preset.py b/sdks/python/julep/api/types/chat_generation_preset.py similarity index 65% rename from sdks/python/julep/api/types/chat_settings_preset.py rename to sdks/python/julep/api/types/chat_generation_preset.py index 54ac0401c..7e644ee3c 100644 --- a/sdks/python/julep/api/types/chat_settings_preset.py +++ b/sdks/python/julep/api/types/chat_generation_preset.py @@ -6,9 +6,9 @@ T_Result = typing.TypeVar("T_Result") -class ChatSettingsPreset(str, enum.Enum): +class ChatGenerationPreset(str, enum.Enum): """ - Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) """ PROBLEM_SOLVING = "problem_solving" @@ -33,21 +33,21 @@ def visit( code: typing.Callable[[], T_Result], multilingual: typing.Callable[[], T_Result], ) -> T_Result: - if self is ChatSettingsPreset.PROBLEM_SOLVING: + if self is ChatGenerationPreset.PROBLEM_SOLVING: return problem_solving() - if self is ChatSettingsPreset.CONVERSATIONAL: + if self is ChatGenerationPreset.CONVERSATIONAL: return conversational() - if self is ChatSettingsPreset.FUN: + if self is ChatGenerationPreset.FUN: return fun() - if self is ChatSettingsPreset.PROSE: + if self is ChatGenerationPreset.PROSE: return prose() - if self is ChatSettingsPreset.CREATIVE: + if self is ChatGenerationPreset.CREATIVE: return creative() - if self is ChatSettingsPreset.BUSINESS: + if self is ChatGenerationPreset.BUSINESS: return business() - if self is ChatSettingsPreset.DETERMINISTIC: + if self is ChatGenerationPreset.DETERMINISTIC: return deterministic() - if self is ChatSettingsPreset.CODE: + if self is ChatGenerationPreset.CODE: return code() - if self is ChatSettingsPreset.MULTILINGUAL: + if self is ChatGenerationPreset.MULTILINGUAL: return multilingual() diff --git a/sdks/python/julep/api/types/chat_generation_preset_settings.py b/sdks/python/julep/api/types/chat_generation_preset_settings.py new file mode 100644 index 000000000..48cdadaba --- /dev/null +++ b/sdks/python/julep/api/types/chat_generation_preset_settings.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .chat_generation_preset import ChatGenerationPreset + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ChatGenerationPresetSettings(pydantic.BaseModel): + preset: typing.Optional[ChatGenerationPreset] = pydantic.Field( + description="Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_input_data.py b/sdks/python/julep/api/types/chat_input_data.py deleted file mode 100644 index 0b38a82e1..000000000 --- a/sdks/python/julep/api/types/chat_input_data.py +++ /dev/null @@ -1,47 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .chat_input_data_tool_choice import ChatInputDataToolChoice -from .input_chat_ml_message import InputChatMlMessage -from .tool import Tool - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ChatInputData(pydantic.BaseModel): - messages: typing.List[InputChatMlMessage] = pydantic.Field( - description="A list of new input messages comprising the conversation so far." - ) - tools: typing.Optional[typing.List[Tool]] = pydantic.Field( - description="(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[ChatInputDataToolChoice] = pydantic.Field( - description="Can be one of existing tools given to the agent earlier or the ones included in the request" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_input_data_tool_choice.py b/sdks/python/julep/api/types/chat_input_data_tool_choice.py deleted file mode 100644 index 2885d0693..000000000 --- a/sdks/python/julep/api/types/chat_input_data_tool_choice.py +++ /dev/null @@ -1,9 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .named_tool_choice import NamedToolChoice -from .named_tool_choice_function import NamedToolChoiceFunction -from .tool_choice_option import ToolChoiceOption - -ChatInputDataToolChoice = typing.Union[ToolChoiceOption, NamedToolChoice] diff --git a/sdks/python/julep/api/types/chat_ml_message_content.py b/sdks/python/julep/api/types/chat_ml_message_content.py deleted file mode 100644 index 96006aafb..000000000 --- a/sdks/python/julep/api/types/chat_ml_message_content.py +++ /dev/null @@ -1,13 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_ml_image_content_part import ChatMlImageContentPart -from .chat_ml_image_content_part_image_url import ChatMlImageContentPartImageUrl -from .chat_ml_image_content_part_image_url_detail import ( - ChatMlImageContentPartImageUrlDetail, -) -from .chat_ml_message_content_item import ChatMlMessageContentItem -from .chat_ml_text_content_part import ChatMlTextContentPart - -ChatMlMessageContent = typing.Union[str, typing.List[ChatMlMessageContentItem]] diff --git a/sdks/python/julep/api/types/chat_ml_message_role.py b/sdks/python/julep/api/types/chat_ml_message_role.py deleted file mode 100644 index 5a572390e..000000000 --- a/sdks/python/julep/api/types/chat_ml_message_role.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class ChatMlMessageRole(str, enum.Enum): - """ - ChatML role (system|assistant|user|function_call|function) - """ - - USER = "user" - ASSISTANT = "assistant" - SYSTEM = "system" - FUNCTION_CALL = "function_call" - FUNCTION = "function" - - def visit( - self, - user: typing.Callable[[], T_Result], - assistant: typing.Callable[[], T_Result], - system: typing.Callable[[], T_Result], - function_call: typing.Callable[[], T_Result], - function: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ChatMlMessageRole.USER: - return user() - if self is ChatMlMessageRole.ASSISTANT: - return assistant() - if self is ChatMlMessageRole.SYSTEM: - return system() - if self is ChatMlMessageRole.FUNCTION_CALL: - return function_call() - if self is ChatMlMessageRole.FUNCTION: - return function() diff --git a/sdks/python/julep/api/types/chat_open_ai_settings.py b/sdks/python/julep/api/types/chat_open_ai_settings.py new file mode 100644 index 000000000..ff9fe786e --- /dev/null +++ b/sdks/python/julep/api/types/chat_open_ai_settings.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ChatOpenAiSettings(pydantic.BaseModel): + frequency_penalty: typing.Optional[float] = pydantic.Field( + description="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." + ) + presence_penalty: typing.Optional[float] = pydantic.Field( + description="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." + ) + temperature: typing.Optional[float] = pydantic.Field( + description="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] = pydantic.Field( + description="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." + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_response.py b/sdks/python/julep/api/types/chat_response.py deleted file mode 100644 index c24284f61..000000000 --- a/sdks/python/julep/api/types/chat_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .chat_ml_message import ChatMlMessage -from .chat_response_finish_reason import ChatResponseFinishReason -from .completion_usage import CompletionUsage -from .doc_ids import DocIds - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ChatResponse(pydantic.BaseModel): - """ - Represents a chat completion response returned by model, based on the provided input. - """ - - id: str = pydantic.Field(description="A unique identifier for the chat completion.") - finish_reason: ChatResponseFinishReason = pydantic.Field( - description="The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function." - ) - response: typing.List[typing.List[ChatMlMessage]] = pydantic.Field( - description="A list of chat completion messages produced as a response." - ) - usage: CompletionUsage - jobs: typing.Optional[typing.List[str]] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) - doc_ids: DocIds - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_response_finish_reason.py b/sdks/python/julep/api/types/chat_response_finish_reason.py deleted file mode 100644 index 67d9d9aa8..000000000 --- a/sdks/python/julep/api/types/chat_response_finish_reason.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class ChatResponseFinishReason(str, enum.Enum): - """ - The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. - """ - - STOP = "stop" - LENGTH = "length" - TOOL_CALLS = "tool_calls" - CONTENT_FILTER = "content_filter" - FUNCTION_CALL = "function_call" - - def visit( - self, - stop: typing.Callable[[], T_Result], - length: typing.Callable[[], T_Result], - tool_calls: typing.Callable[[], T_Result], - content_filter: typing.Callable[[], T_Result], - function_call: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ChatResponseFinishReason.STOP: - return stop() - if self is ChatResponseFinishReason.LENGTH: - return length() - if self is ChatResponseFinishReason.TOOL_CALLS: - return tool_calls() - if self is ChatResponseFinishReason.CONTENT_FILTER: - return content_filter() - if self is ChatResponseFinishReason.FUNCTION_CALL: - return function_call() diff --git a/sdks/python/julep/api/types/chat_settings.py b/sdks/python/julep/api/types/chat_settings.py deleted file mode 100644 index 11659754d..000000000 --- a/sdks/python/julep/api/types/chat_settings.py +++ /dev/null @@ -1,111 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .chat_settings_preset import ChatSettingsPreset -from .chat_settings_response_format import ChatSettingsResponseFormat -from .chat_settings_stop import ChatSettingsStop - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ChatSettings(pydantic.BaseModel): - frequency_penalty: typing.Optional[float] = pydantic.Field( - description="(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] = pydantic.Field( - description="(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]]] = ( - pydantic.Field( - description=( - "Modify the likelihood of specified tokens appearing in the completion.\n" - "\n" - "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.\n" - ) - ) - ) - max_tokens: typing.Optional[int] = pydantic.Field( - description=( - "The maximum number of tokens to generate in the chat completion.\n" - "\n" - "The total length of input tokens and generated tokens is limited by the model's context length.\n" - ) - ) - presence_penalty: typing.Optional[float] = pydantic.Field( - description="(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] = pydantic.Field( - description="(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] = pydantic.Field( - description=( - "An object specifying the format that the model must output.\n" - "\n" - 'Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.\n' - "\n" - '**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.\n' - ) - ) - seed: typing.Optional[int] = pydantic.Field( - description=( - "This feature is in Beta.\n" - "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.\n" - "Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.\n" - ) - ) - stop: typing.Optional[ChatSettingsStop] = pydantic.Field( - description="Up to 4 sequences where the API will stop generating further tokens." - ) - stream: typing.Optional[bool] = pydantic.Field( - description="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] = pydantic.Field( - description="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] = pydantic.Field( - description="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." - ) - min_p: typing.Optional[float] = pydantic.Field( - description="Minimum probability compared to leading token to be considered" - ) - preset: typing.Optional[ChatSettingsPreset] = pydantic.Field( - description=( - "Generation preset name (problem_solving\n" - "conversational\n" - "fun\n" - "prose\n" - "creative\n" - "business\n" - "deterministic\n" - "code\n" - "multilingual)\n" - ) - ) - model: typing.Optional[str] = pydantic.Field(description="Model name") - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_settings_response_format.py b/sdks/python/julep/api/types/chat_settings_response_format.py deleted file mode 100644 index cb0730271..000000000 --- a/sdks/python/julep/api/types/chat_settings_response_format.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .chat_settings_response_format_schema import ChatSettingsResponseFormatSchema -from .chat_settings_response_format_type import ChatSettingsResponseFormatType - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ChatSettingsResponseFormat(pydantic.BaseModel): - """ - 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. - """ - - type: typing.Optional[ChatSettingsResponseFormatType] = pydantic.Field( - description='Must be one of `"text"`, `"regex"` or `"json_object"`.' - ) - pattern: typing.Optional[str] = pydantic.Field( - description='Regular expression pattern to use if `type` is `"regex"`' - ) - schema_: typing.Optional[ChatSettingsResponseFormatSchema] = pydantic.Field( - alias="schema", description='JSON Schema to use if `type` is `"json_object"`' - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agent_default_settings.py b/sdks/python/julep/api/types/chat_v_llm_settings.py similarity index 58% rename from sdks/python/julep/api/types/agent_default_settings.py rename to sdks/python/julep/api/types/chat_v_llm_settings.py index be2355cb8..bf984695f 100644 --- a/sdks/python/julep/api/types/agent_default_settings.py +++ b/sdks/python/julep/api/types/chat_v_llm_settings.py @@ -4,7 +4,6 @@ import typing from ..core.datetime_utils import serialize_datetime -from .agent_default_settings_preset import AgentDefaultSettingsPreset try: import pydantic.v1 as pydantic # type: ignore @@ -12,18 +11,12 @@ import pydantic # type: ignore -class AgentDefaultSettings(pydantic.BaseModel): - frequency_penalty: typing.Optional[float] = pydantic.Field( - description="(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." +class ChatVLlmSettings(pydantic.BaseModel): + repetition_penalty: typing.Optional[float] = pydantic.Field( + description="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." ) length_penalty: typing.Optional[float] = pydantic.Field( - description="(Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated." - ) - presence_penalty: typing.Optional[float] = pydantic.Field( - description="(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] = pydantic.Field( - description="(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." + description="Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated." ) temperature: typing.Optional[float] = pydantic.Field( description="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." @@ -34,9 +27,6 @@ class AgentDefaultSettings(pydantic.BaseModel): min_p: typing.Optional[float] = pydantic.Field( description="Minimum probability compared to leading token to be considered" ) - preset: typing.Optional[AgentDefaultSettingsPreset] = pydantic.Field( - description="Generation preset name (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)" - ) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/common_identifier_safe_unicode.py b/sdks/python/julep/api/types/common_identifier_safe_unicode.py new file mode 100644 index 000000000..0cbe24387 --- /dev/null +++ b/sdks/python/julep/api/types/common_identifier_safe_unicode.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +CommonIdentifierSafeUnicode = str diff --git a/sdks/python/julep/api/types/transition_type.py b/sdks/python/julep/api/types/common_limit.py similarity index 75% rename from sdks/python/julep/api/types/transition_type.py rename to sdks/python/julep/api/types/common_limit.py index 47dbe0111..fa246cc15 100644 --- a/sdks/python/julep/api/types/transition_type.py +++ b/sdks/python/julep/api/types/common_limit.py @@ -1,3 +1,3 @@ # This file was auto-generated by Fern from our API Definition. -TransitionType = str +CommonLimit = int diff --git a/sdks/python/julep/api/types/common_logit_bias.py b/sdks/python/julep/api/types/common_logit_bias.py new file mode 100644 index 000000000..43c8e7673 --- /dev/null +++ b/sdks/python/julep/api/types/common_logit_bias.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +CommonLogitBias = float diff --git a/sdks/python/julep/api/types/execution_status.py b/sdks/python/julep/api/types/common_offset.py similarity index 74% rename from sdks/python/julep/api/types/execution_status.py rename to sdks/python/julep/api/types/common_offset.py index e3782b8b5..dd19b6ef3 100644 --- a/sdks/python/julep/api/types/execution_status.py +++ b/sdks/python/julep/api/types/common_offset.py @@ -1,3 +1,3 @@ # This file was auto-generated by Fern from our API Definition. -ExecutionStatus = str +CommonOffset = int diff --git a/sdks/python/julep/api/types/tool_choice_option.py b/sdks/python/julep/api/types/common_tool_ref.py similarity index 73% rename from sdks/python/julep/api/types/tool_choice_option.py rename to sdks/python/julep/api/types/common_tool_ref.py index 8b7d3a210..60dd3f74b 100644 --- a/sdks/python/julep/api/types/tool_choice_option.py +++ b/sdks/python/julep/api/types/common_tool_ref.py @@ -1,3 +1,3 @@ # This file was auto-generated by Fern from our API Definition. -ToolChoiceOption = str +CommonToolRef = str diff --git a/sdks/python/julep/api/types/common_uuid.py b/sdks/python/julep/api/types/common_uuid.py new file mode 100644 index 000000000..ed515c4be --- /dev/null +++ b/sdks/python/julep/api/types/common_uuid.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +CommonUuid = str diff --git a/sdks/python/julep/api/types/common_valid_python_identifier.py b/sdks/python/julep/api/types/common_valid_python_identifier.py new file mode 100644 index 000000000..b25c1fc30 --- /dev/null +++ b/sdks/python/julep/api/types/common_valid_python_identifier.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +CommonValidPythonIdentifier = str diff --git a/sdks/python/julep/api/types/create_tool_request_type.py b/sdks/python/julep/api/types/create_tool_request_type.py deleted file mode 100644 index 46d62a2c7..000000000 --- a/sdks/python/julep/api/types/create_tool_request_type.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class CreateToolRequestType(str, enum.Enum): - """ - Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now) - """ - - FUNCTION = "function" - WEBHOOK = "webhook" - - def visit( - self, - function: typing.Callable[[], T_Result], - webhook: typing.Callable[[], T_Result], - ) -> T_Result: - if self is CreateToolRequestType.FUNCTION: - return function() - if self is CreateToolRequestType.WEBHOOK: - return webhook() diff --git a/sdks/python/julep/api/types/doc.py b/sdks/python/julep/api/types/doc.py deleted file mode 100644 index a7cdcdb44..000000000 --- a/sdks/python/julep/api/types/doc.py +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .doc_content import DocContent - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Doc(pydantic.BaseModel): - title: str = pydantic.Field( - description="Title describing what this bit of information contains" - ) - content: DocContent = pydantic.Field(description="Information content") - id: str = pydantic.Field(description="ID of doc") - created_at: dt.datetime = pydantic.Field(description="Doc created at") - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="optional metadata" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/doc_content.py b/sdks/python/julep/api/types/doc_content.py deleted file mode 100644 index 8b27a9501..000000000 --- a/sdks/python/julep/api/types/doc_content.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DocContent = typing.Union[typing.List[str], str] diff --git a/sdks/python/julep/api/types/chat_ml_image_content_part_image_url.py b/sdks/python/julep/api/types/docs_doc.py similarity index 60% rename from sdks/python/julep/api/types/chat_ml_image_content_part_image_url.py rename to sdks/python/julep/api/types/docs_doc.py index 5d2d07897..a66bba71f 100644 --- a/sdks/python/julep/api/types/chat_ml_image_content_part_image_url.py +++ b/sdks/python/julep/api/types/docs_doc.py @@ -4,9 +4,9 @@ import typing from ..core.datetime_utils import serialize_datetime -from .chat_ml_image_content_part_image_url_detail import ( - ChatMlImageContentPartImageUrlDetail, -) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid +from .docs_doc_content import DocsDocContent try: import pydantic.v1 as pydantic # type: ignore @@ -14,19 +14,16 @@ import pydantic # type: ignore -class ChatMlImageContentPartImageUrl(pydantic.BaseModel): - """ - Image content part, can be a URL or a base64-encoded image - """ - - url: str = pydantic.Field( - description="URL or base64 data url (e.g. `data:image/jpeg;base64,`)" +class DocsDoc(pydantic.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" ) - detail: typing.Optional[ChatMlImageContentPartImageUrlDetail] = pydantic.Field( - description=( - "image detail to feed into the model can be low \n" " high \n" " auto\n" - ) + title: CommonIdentifierSafeUnicode = pydantic.Field( + description="Title describing what this document contains" ) + content: DocsDocContent = pydantic.Field(description="Contents of the document") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/function_parameters.py b/sdks/python/julep/api/types/docs_doc_content.py similarity index 60% rename from sdks/python/julep/api/types/function_parameters.py rename to sdks/python/julep/api/types/docs_doc_content.py index 4623a72ca..e2a56e578 100644 --- a/sdks/python/julep/api/types/function_parameters.py +++ b/sdks/python/julep/api/types/docs_doc_content.py @@ -2,4 +2,4 @@ import typing -FunctionParameters = typing.Dict[str, typing.Any] +DocsDocContent = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/docs_doc_owner.py b/sdks/python/julep/api/types/docs_doc_owner.py new file mode 100644 index 000000000..a8766900f --- /dev/null +++ b/sdks/python/julep/api/types/docs_doc_owner.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid +from .docs_doc_owner_role import DocsDocOwnerRole + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class DocsDocOwner(pydantic.BaseModel): + id: CommonUuid + role: DocsDocOwnerRole + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/suggestion_target.py b/sdks/python/julep/api/types/docs_doc_owner_role.py similarity index 63% rename from sdks/python/julep/api/types/suggestion_target.py rename to sdks/python/julep/api/types/docs_doc_owner_role.py index 1049db3ee..f9c6b55c6 100644 --- a/sdks/python/julep/api/types/suggestion_target.py +++ b/sdks/python/julep/api/types/docs_doc_owner_role.py @@ -6,18 +6,14 @@ T_Result = typing.TypeVar("T_Result") -class SuggestionTarget(str, enum.Enum): - """ - Whether the suggestion is for the `agent` or a `user` - """ - +class DocsDocOwnerRole(str, enum.Enum): USER = "user" AGENT = "agent" def visit( self, user: typing.Callable[[], T_Result], agent: typing.Callable[[], T_Result] ) -> T_Result: - if self is SuggestionTarget.USER: + if self is DocsDocOwnerRole.USER: return user() - if self is SuggestionTarget.AGENT: + if self is DocsDocOwnerRole.AGENT: return agent() diff --git a/sdks/python/julep/api/types/completion_usage.py b/sdks/python/julep/api/types/docs_doc_reference.py similarity index 66% rename from sdks/python/julep/api/types/completion_usage.py rename to sdks/python/julep/api/types/docs_doc_reference.py index 89130e85c..3ea189cd5 100644 --- a/sdks/python/julep/api/types/completion_usage.py +++ b/sdks/python/julep/api/types/docs_doc_reference.py @@ -4,6 +4,8 @@ import typing from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid +from .docs_doc_owner import DocsDocOwner try: import pydantic.v1 as pydantic # type: ignore @@ -11,18 +13,14 @@ import pydantic # type: ignore -class CompletionUsage(pydantic.BaseModel): - """ - Usage statistics for the completion request. - """ - - completion_tokens: int = pydantic.Field( - description="Number of tokens in the generated completion." - ) - prompt_tokens: int = pydantic.Field(description="Number of tokens in the prompt.") - total_tokens: int = pydantic.Field( - description="Total number of tokens used in the request (prompt + completion)." +class DocsDocReference(pydantic.BaseModel): + owner: DocsDocOwner = pydantic.Field(description="The owner of this document.") + id: CommonUuid = pydantic.Field(description="ID of the document") + snippet_index: typing.List[int] = pydantic.Field( + description="Snippets referred to of the document" ) + title: typing.Optional[str] + snippet: typing.Optional[str] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/docs_doc_search_request.py b/sdks/python/julep/api/types/docs_doc_search_request.py new file mode 100644 index 000000000..72ae36c4c --- /dev/null +++ b/sdks/python/julep/api/types/docs_doc_search_request.py @@ -0,0 +1,88 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import typing_extensions + +from ..core.datetime_utils import serialize_datetime +from .docs_doc_search_request_text import DocsDocSearchRequestText +from .docs_doc_search_request_vector import DocsDocSearchRequestVector +from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest +from .docs_text_only_doc_search_request import DocsTextOnlyDocSearchRequest +from .docs_vector_doc_search_request import DocsVectorDocSearchRequest + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class Base(pydantic.BaseModel): + text: typing.Optional[DocsDocSearchRequestText] + vector: typing.Optional[DocsDocSearchRequestVector] + confidence: float = pydantic.Field(description="The confidence cutoff level") + alpha: float = pydantic.Field( + description="The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;" + ) + mmr: bool = pydantic.Field( + description="Whether to include the MMR algorithm in the search. Optimizes for diversity in search results." + ) + lang: typing_extensions.Literal["en-US"] = pydantic.Field( + description="The language to be used for text-only search. Support for other languages coming soon." + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + +class DocsDocSearchRequest_Vector(DocsVectorDocSearchRequest, Base): + mode: typing_extensions.Literal["vector"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class DocsDocSearchRequest_Text(DocsTextOnlyDocSearchRequest, Base): + mode: typing_extensions.Literal["text"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class DocsDocSearchRequest_Hybrid(DocsHybridDocSearchRequest, Base): + mode: typing_extensions.Literal["hybrid"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +DocsDocSearchRequest = typing.Union[ + DocsDocSearchRequest_Vector, DocsDocSearchRequest_Text, DocsDocSearchRequest_Hybrid +] diff --git a/sdks/python/julep/api/types/cel_object.py b/sdks/python/julep/api/types/docs_doc_search_request_text.py similarity index 55% rename from sdks/python/julep/api/types/cel_object.py rename to sdks/python/julep/api/types/docs_doc_search_request_text.py index 2fefc34ef..9eeaec434 100644 --- a/sdks/python/julep/api/types/cel_object.py +++ b/sdks/python/julep/api/types/docs_doc_search_request_text.py @@ -2,4 +2,4 @@ import typing -CelObject = typing.Dict[str, typing.Any] +DocsDocSearchRequestText = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/docs_doc_search_request_vector.py b/sdks/python/julep/api/types/docs_doc_search_request_vector.py new file mode 100644 index 000000000..fc8a55e86 --- /dev/null +++ b/sdks/python/julep/api/types/docs_doc_search_request_vector.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocsDocSearchRequestVector = typing.Union[ + typing.List[float], typing.List[typing.List[float]] +] diff --git a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py new file mode 100644 index 000000000..e5ef4d895 --- /dev/null +++ b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText +from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class DocsHybridDocSearchRequest(pydantic.BaseModel): + text: typing.Optional[DocsHybridDocSearchRequestText] = pydantic.Field( + description="Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required." + ) + vector: typing.Optional[DocsHybridDocSearchRequestVector] = pydantic.Field( + description="Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown." + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/update_agent_request_instructions.py b/sdks/python/julep/api/types/docs_hybrid_doc_search_request_text.py similarity index 57% rename from sdks/python/julep/api/types/update_agent_request_instructions.py rename to sdks/python/julep/api/types/docs_hybrid_doc_search_request_text.py index e34e3c8be..b3cfcf16a 100644 --- a/sdks/python/julep/api/types/update_agent_request_instructions.py +++ b/sdks/python/julep/api/types/docs_hybrid_doc_search_request_text.py @@ -2,4 +2,4 @@ import typing -UpdateAgentRequestInstructions = typing.Union[str, typing.List[str]] +DocsHybridDocSearchRequestText = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/docs_hybrid_doc_search_request_vector.py b/sdks/python/julep/api/types/docs_hybrid_doc_search_request_vector.py new file mode 100644 index 000000000..64624e57e --- /dev/null +++ b/sdks/python/julep/api/types/docs_hybrid_doc_search_request_vector.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocsHybridDocSearchRequestVector = typing.Union[ + typing.List[float], typing.List[typing.List[float]] +] diff --git a/sdks/python/julep/api/types/prompt_workflow_step.py b/sdks/python/julep/api/types/docs_text_only_doc_search_request.py similarity index 75% rename from sdks/python/julep/api/types/prompt_workflow_step.py rename to sdks/python/julep/api/types/docs_text_only_doc_search_request.py index b5cde87bf..2b881449f 100644 --- a/sdks/python/julep/api/types/prompt_workflow_step.py +++ b/sdks/python/julep/api/types/docs_text_only_doc_search_request.py @@ -4,8 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime -from .chat_settings import ChatSettings -from .input_chat_ml_message import InputChatMlMessage +from .docs_text_only_doc_search_request_text import DocsTextOnlyDocSearchRequestText try: import pydantic.v1 as pydantic # type: ignore @@ -13,11 +12,10 @@ import pydantic # type: ignore -class PromptWorkflowStep(pydantic.BaseModel): - prompt: typing.List[InputChatMlMessage] = pydantic.Field( - description="List of ChatML Messages in Jinja Templates" +class DocsTextOnlyDocSearchRequest(pydantic.BaseModel): + text: DocsTextOnlyDocSearchRequestText = pydantic.Field( + description="Text or texts to use in the search. In `text` search mode, only BM25 is used." ) - settings: ChatSettings def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/create_doc_content.py b/sdks/python/julep/api/types/docs_text_only_doc_search_request_text.py similarity index 52% rename from sdks/python/julep/api/types/create_doc_content.py rename to sdks/python/julep/api/types/docs_text_only_doc_search_request_text.py index e186d7fa0..5f957995e 100644 --- a/sdks/python/julep/api/types/create_doc_content.py +++ b/sdks/python/julep/api/types/docs_text_only_doc_search_request_text.py @@ -2,4 +2,4 @@ import typing -CreateDocContent = typing.Union[typing.List[str], str] +DocsTextOnlyDocSearchRequestText = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/docs_vector_doc_search_request.py b/sdks/python/julep/api/types/docs_vector_doc_search_request.py new file mode 100644 index 000000000..9a05db11f --- /dev/null +++ b/sdks/python/julep/api/types/docs_vector_doc_search_request.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .docs_vector_doc_search_request_vector import DocsVectorDocSearchRequestVector + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class DocsVectorDocSearchRequest(pydantic.BaseModel): + vector: DocsVectorDocSearchRequestVector = pydantic.Field( + description="Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown." + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_vector_doc_search_request_vector.py b/sdks/python/julep/api/types/docs_vector_doc_search_request_vector.py new file mode 100644 index 000000000..e64b2da82 --- /dev/null +++ b/sdks/python/julep/api/types/docs_vector_doc_search_request_vector.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocsVectorDocSearchRequestVector = typing.Union[ + typing.List[float], typing.List[typing.List[float]] +] diff --git a/sdks/python/julep/api/types/if_else_workflow_step.py b/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py similarity index 59% rename from sdks/python/julep/api/types/if_else_workflow_step.py rename to sdks/python/julep/api/types/entries_base_chat_ml_content_part.py index 3acfe67ee..d6d025200 100644 --- a/sdks/python/julep/api/types/if_else_workflow_step.py +++ b/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py @@ -1,10 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing +import typing_extensions + from ..core.datetime_utils import serialize_datetime -from .yield_workflow_step import YieldWorkflowStep +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_image_detail import EntriesImageDetail +from .entries_image_url import EntriesImageUrl try: import pydantic.v1 as pydantic # type: ignore @@ -12,10 +18,9 @@ import pydantic # type: ignore -class IfElseWorkflowStep(pydantic.BaseModel): - if_: str = pydantic.Field(alias="if") - then: YieldWorkflowStep - else_: YieldWorkflowStep = pydantic.Field(alias="else") +class Base(pydantic.BaseModel): + text: typing.Optional[str] + image_url: typing.Optional[EntriesImageUrl] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -36,5 +41,16 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True - allow_population_by_field_name = True json_encoders = {dt.datetime: serialize_datetime} + + +class EntriesBaseChatMlContentPart_ImageUrl(EntriesChatMlImageContentPart, Base): + type: typing_extensions.Literal["image_url"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +EntriesBaseChatMlContentPart = typing.Union[EntriesBaseChatMlContentPart_ImageUrl] diff --git a/sdks/python/julep/api/types/entries_chat_ml_image_content_part.py b/sdks/python/julep/api/types/entries_chat_ml_image_content_part.py new file mode 100644 index 000000000..e12d1a534 --- /dev/null +++ b/sdks/python/julep/api/types/entries_chat_ml_image_content_part.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .entries_image_url import EntriesImageUrl + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class EntriesChatMlImageContentPart(pydantic.BaseModel): + image_url: EntriesImageUrl = pydantic.Field(description="The image URL") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/input_chat_ml_message_role.py b/sdks/python/julep/api/types/entries_chat_ml_role.py similarity index 50% rename from sdks/python/julep/api/types/input_chat_ml_message_role.py rename to sdks/python/julep/api/types/entries_chat_ml_role.py index b172e4209..215fc8ddd 100644 --- a/sdks/python/julep/api/types/input_chat_ml_message_role.py +++ b/sdks/python/julep/api/types/entries_chat_ml_role.py @@ -6,36 +6,40 @@ T_Result = typing.TypeVar("T_Result") -class InputChatMlMessageRole(str, enum.Enum): +class EntriesChatMlRole(str, enum.Enum): """ - ChatML role (system|assistant|user|function_call|function|auto) + ChatML role (system|assistant|user|function_call|function|function_response|auto) """ USER = "user" - ASSISTANT = "assistant" + AGENT = "agent" SYSTEM = "system" - FUNCTION_CALL = "function_call" FUNCTION = "function" + FUNCTION_RESPONSE = "function_response" + FUNCTION_CALL = "function_call" AUTO = "auto" def visit( self, user: typing.Callable[[], T_Result], - assistant: typing.Callable[[], T_Result], + agent: typing.Callable[[], T_Result], system: typing.Callable[[], T_Result], - function_call: typing.Callable[[], T_Result], function: typing.Callable[[], T_Result], + function_response: typing.Callable[[], T_Result], + function_call: typing.Callable[[], T_Result], auto: typing.Callable[[], T_Result], ) -> T_Result: - if self is InputChatMlMessageRole.USER: + if self is EntriesChatMlRole.USER: return user() - if self is InputChatMlMessageRole.ASSISTANT: - return assistant() - if self is InputChatMlMessageRole.SYSTEM: + if self is EntriesChatMlRole.AGENT: + return agent() + if self is EntriesChatMlRole.SYSTEM: return system() - if self is InputChatMlMessageRole.FUNCTION_CALL: - return function_call() - if self is InputChatMlMessageRole.FUNCTION: + if self is EntriesChatMlRole.FUNCTION: return function() - if self is InputChatMlMessageRole.AUTO: + if self is EntriesChatMlRole.FUNCTION_RESPONSE: + return function_response() + if self is EntriesChatMlRole.FUNCTION_CALL: + return function_call() + if self is EntriesChatMlRole.AUTO: return auto() diff --git a/sdks/python/julep/api/types/error_workflow_step.py b/sdks/python/julep/api/types/entries_chat_ml_text_content_part.py similarity index 92% rename from sdks/python/julep/api/types/error_workflow_step.py rename to sdks/python/julep/api/types/entries_chat_ml_text_content_part.py index 3e936a63d..fc0ef695b 100644 --- a/sdks/python/julep/api/types/error_workflow_step.py +++ b/sdks/python/julep/api/types/entries_chat_ml_text_content_part.py @@ -11,8 +11,8 @@ import pydantic # type: ignore -class ErrorWorkflowStep(pydantic.BaseModel): - error: str +class EntriesChatMlTextContentPart(pydantic.BaseModel): + text: str def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/entries_entry.py b/sdks/python/julep/api/types/entries_entry.py new file mode 100644 index 000000000..f30ee9c2b --- /dev/null +++ b/sdks/python/julep/api/types/entries_entry.py @@ -0,0 +1,50 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid +from .entries_chat_ml_role import EntriesChatMlRole +from .entries_entry_content import EntriesEntryContent +from .entries_entry_source import EntriesEntrySource + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class EntriesEntry(pydantic.BaseModel): + role: EntriesChatMlRole + name: typing.Optional[str] + content: EntriesEntryContent + source: EntriesEntrySource + timestamp: int = pydantic.Field( + description="This is the time that this event refers to." + ) + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + id: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_entry_content.py b/sdks/python/julep/api/types/entries_entry_content.py new file mode 100644 index 000000000..318a0fff6 --- /dev/null +++ b/sdks/python/julep/api/types/entries_entry_content.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid +from .common_valid_python_identifier import CommonValidPythonIdentifier +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart +from .entries_entry_content_item import EntriesEntryContentItem +from .entries_entry_content_item_item import EntriesEntryContentItemItem +from .entries_image_detail import EntriesImageDetail +from .entries_image_url import EntriesImageUrl +from .tools_chosen_function_call import ToolsChosenFunctionCall +from .tools_chosen_tool_call import ToolsChosenToolCall +from .tools_function_call_option import ToolsFunctionCallOption +from .tools_function_def import ToolsFunctionDef +from .tools_function_tool import ToolsFunctionTool +from .tools_tool import ToolsTool +from .tools_tool_response import ToolsToolResponse + +EntriesEntryContent = typing.Union[ + typing.List[EntriesEntryContentItem], + ToolsTool, + ToolsChosenToolCall, + str, + ToolsToolResponse, + typing.List[EntriesEntryContentItem], +] diff --git a/sdks/python/julep/api/types/entries_entry_content_item.py b/sdks/python/julep/api/types/entries_entry_content_item.py new file mode 100644 index 000000000..91aed2fca --- /dev/null +++ b/sdks/python/julep/api/types/entries_entry_content_item.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid +from .common_valid_python_identifier import CommonValidPythonIdentifier +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart +from .entries_entry_content_item_item import EntriesEntryContentItemItem +from .entries_image_detail import EntriesImageDetail +from .entries_image_url import EntriesImageUrl +from .tools_chosen_function_call import ToolsChosenFunctionCall +from .tools_chosen_tool_call import ToolsChosenToolCall +from .tools_function_call_option import ToolsFunctionCallOption +from .tools_function_def import ToolsFunctionDef +from .tools_function_tool import ToolsFunctionTool +from .tools_tool import ToolsTool +from .tools_tool_response import ToolsToolResponse + +EntriesEntryContentItem = typing.Union[ + typing.List[EntriesEntryContentItemItem], + ToolsTool, + ToolsChosenToolCall, + str, + ToolsToolResponse, +] diff --git a/sdks/python/julep/api/types/input_chat_ml_message_content_item.py b/sdks/python/julep/api/types/entries_entry_content_item_item.py similarity index 53% rename from sdks/python/julep/api/types/input_chat_ml_message_content_item.py rename to sdks/python/julep/api/types/entries_entry_content_item_item.py index 661654569..8318dc29c 100644 --- a/sdks/python/julep/api/types/input_chat_ml_message_content_item.py +++ b/sdks/python/julep/api/types/entries_entry_content_item_item.py @@ -6,11 +6,11 @@ import typing_extensions -from .chat_ml_image_content_part import ChatMlImageContentPart -from .chat_ml_text_content_part import ChatMlTextContentPart +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart -class InputChatMlMessageContentItem_Text(ChatMlTextContentPart): +class EntriesEntryContentItemItem_Text(EntriesChatMlTextContentPart): type: typing_extensions.Literal["text"] class Config: @@ -19,7 +19,7 @@ class Config: allow_population_by_field_name = True -class InputChatMlMessageContentItem_ImageUrl(ChatMlImageContentPart): +class EntriesEntryContentItemItem_ImageUrl(EntriesChatMlImageContentPart): type: typing_extensions.Literal["image_url"] class Config: @@ -28,6 +28,6 @@ class Config: allow_population_by_field_name = True -InputChatMlMessageContentItem = typing.Union[ - InputChatMlMessageContentItem_Text, InputChatMlMessageContentItem_ImageUrl +EntriesEntryContentItemItem = typing.Union[ + EntriesEntryContentItemItem_Text, EntriesEntryContentItemItem_ImageUrl ] diff --git a/sdks/python/julep/api/types/entries_entry_source.py b/sdks/python/julep/api/types/entries_entry_source.py new file mode 100644 index 000000000..c1af48448 --- /dev/null +++ b/sdks/python/julep/api/types/entries_entry_source.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class EntriesEntrySource(str, enum.Enum): + API_REQUEST = "api_request" + API_RESPONSE = "api_response" + TOOL_RESPONSE = "tool_response" + INTERNAL = "internal" + SUMMARIZER = "summarizer" + META = "meta" + + def visit( + self, + api_request: typing.Callable[[], T_Result], + api_response: typing.Callable[[], T_Result], + tool_response: typing.Callable[[], T_Result], + internal: typing.Callable[[], T_Result], + summarizer: typing.Callable[[], T_Result], + meta: typing.Callable[[], T_Result], + ) -> T_Result: + if self is EntriesEntrySource.API_REQUEST: + return api_request() + if self is EntriesEntrySource.API_RESPONSE: + return api_response() + if self is EntriesEntrySource.TOOL_RESPONSE: + return tool_response() + if self is EntriesEntrySource.INTERNAL: + return internal() + if self is EntriesEntrySource.SUMMARIZER: + return summarizer() + if self is EntriesEntrySource.META: + return meta() diff --git a/sdks/python/julep/api/types/execution.py b/sdks/python/julep/api/types/entries_history.py similarity index 70% rename from sdks/python/julep/api/types/execution.py rename to sdks/python/julep/api/types/entries_history.py index 10f595417..b67c572f7 100644 --- a/sdks/python/julep/api/types/execution.py +++ b/sdks/python/julep/api/types/entries_history.py @@ -4,7 +4,9 @@ import typing from ..core.datetime_utils import serialize_datetime -from .execution_status import ExecutionStatus +from .common_uuid import CommonUuid +from .entries_entry import EntriesEntry +from .entries_relation import EntriesRelation try: import pydantic.v1 as pydantic # type: ignore @@ -12,17 +14,13 @@ import pydantic # type: ignore -class Execution(pydantic.BaseModel): - id: str - task_id: str - status: ExecutionStatus - arguments: typing.Dict[str, typing.Any] = pydantic.Field( - description="JSON of parameters" +class EntriesHistory(pydantic.BaseModel): + entries: typing.List[EntriesEntry] + relations: typing.List[EntriesRelation] + session_id: CommonUuid + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" ) - user_id: typing.Optional[str] - session_id: typing.Optional[str] - created_at: dt.datetime - updated_at: dt.datetime def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/chat_ml_image_content_part_image_url_detail.py b/sdks/python/julep/api/types/entries_image_detail.py similarity index 59% rename from sdks/python/julep/api/types/chat_ml_image_content_part_image_url_detail.py rename to sdks/python/julep/api/types/entries_image_detail.py index c1786e479..3ebc73cb7 100644 --- a/sdks/python/julep/api/types/chat_ml_image_content_part_image_url_detail.py +++ b/sdks/python/julep/api/types/entries_image_detail.py @@ -6,9 +6,9 @@ T_Result = typing.TypeVar("T_Result") -class ChatMlImageContentPartImageUrlDetail(str, enum.Enum): +class EntriesImageDetail(str, enum.Enum): """ - image detail to feed into the model can be low | high | auto + Image detail level """ LOW = "low" @@ -21,9 +21,9 @@ def visit( high: typing.Callable[[], T_Result], auto: typing.Callable[[], T_Result], ) -> T_Result: - if self is ChatMlImageContentPartImageUrlDetail.LOW: + if self is EntriesImageDetail.LOW: return low() - if self is ChatMlImageContentPartImageUrlDetail.HIGH: + if self is EntriesImageDetail.HIGH: return high() - if self is ChatMlImageContentPartImageUrlDetail.AUTO: + if self is EntriesImageDetail.AUTO: return auto() diff --git a/sdks/python/julep/api/types/entries_image_url.py b/sdks/python/julep/api/types/entries_image_url.py new file mode 100644 index 000000000..bbc1b26fe --- /dev/null +++ b/sdks/python/julep/api/types/entries_image_url.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .entries_image_detail import EntriesImageDetail + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class EntriesImageUrl(pydantic.BaseModel): + url: str = pydantic.Field( + description="Image URL or base64 data url (e.g. `data:image/jpeg;base64,`)" + ) + detail: EntriesImageDetail = pydantic.Field( + description="The detail level of the image" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/input_chat_ml_message.py b/sdks/python/julep/api/types/entries_input_chat_ml_message.py similarity index 65% rename from sdks/python/julep/api/types/input_chat_ml_message.py rename to sdks/python/julep/api/types/entries_input_chat_ml_message.py index 3e2a85ad9..de6c7edb9 100644 --- a/sdks/python/julep/api/types/input_chat_ml_message.py +++ b/sdks/python/julep/api/types/entries_input_chat_ml_message.py @@ -4,8 +4,8 @@ import typing from ..core.datetime_utils import serialize_datetime -from .input_chat_ml_message_content import InputChatMlMessageContent -from .input_chat_ml_message_role import InputChatMlMessageRole +from .entries_chat_ml_role import EntriesChatMlRole +from .entries_input_chat_ml_message_content import EntriesInputChatMlMessageContent try: import pydantic.v1 as pydantic # type: ignore @@ -13,19 +13,12 @@ import pydantic # type: ignore -class InputChatMlMessage(pydantic.BaseModel): - role: InputChatMlMessageRole = pydantic.Field( - description=( - "ChatML role (system\n" - "assistant\n" - "user\n" - "function_call\n" - "function\n" - "auto)\n" - ) +class EntriesInputChatMlMessage(pydantic.BaseModel): + role: EntriesChatMlRole = pydantic.Field(description="The role of the message") + content: EntriesInputChatMlMessageContent = pydantic.Field( + description="The content parts of the message" ) - content: InputChatMlMessageContent = pydantic.Field(description="ChatML content") - name: typing.Optional[str] = pydantic.Field(description="ChatML name") + name: typing.Optional[str] = pydantic.Field(description="Name") continue_: typing.Optional[bool] = pydantic.Field( alias="continue", description="Whether to continue this message or return a new one", diff --git a/sdks/python/julep/api/types/entries_input_chat_ml_message_content.py b/sdks/python/julep/api/types/entries_input_chat_ml_message_content.py new file mode 100644 index 000000000..bdc8aa0e8 --- /dev/null +++ b/sdks/python/julep/api/types/entries_input_chat_ml_message_content.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart +from .entries_image_detail import EntriesImageDetail +from .entries_image_url import EntriesImageUrl +from .entries_input_chat_ml_message_content_item import ( + EntriesInputChatMlMessageContentItem, +) + +EntriesInputChatMlMessageContent = typing.Union[ + str, typing.List[str], typing.List[EntriesInputChatMlMessageContentItem] +] diff --git a/sdks/python/julep/api/types/chat_ml_message_content_item.py b/sdks/python/julep/api/types/entries_input_chat_ml_message_content_item.py similarity index 50% rename from sdks/python/julep/api/types/chat_ml_message_content_item.py rename to sdks/python/julep/api/types/entries_input_chat_ml_message_content_item.py index b21f7eabf..f7c1db687 100644 --- a/sdks/python/julep/api/types/chat_ml_message_content_item.py +++ b/sdks/python/julep/api/types/entries_input_chat_ml_message_content_item.py @@ -6,11 +6,11 @@ import typing_extensions -from .chat_ml_image_content_part import ChatMlImageContentPart -from .chat_ml_text_content_part import ChatMlTextContentPart +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart -class ChatMlMessageContentItem_Text(ChatMlTextContentPart): +class EntriesInputChatMlMessageContentItem_Text(EntriesChatMlTextContentPart): type: typing_extensions.Literal["text"] class Config: @@ -19,7 +19,7 @@ class Config: allow_population_by_field_name = True -class ChatMlMessageContentItem_ImageUrl(ChatMlImageContentPart): +class EntriesInputChatMlMessageContentItem_ImageUrl(EntriesChatMlImageContentPart): type: typing_extensions.Literal["image_url"] class Config: @@ -28,6 +28,7 @@ class Config: allow_population_by_field_name = True -ChatMlMessageContentItem = typing.Union[ - ChatMlMessageContentItem_Text, ChatMlMessageContentItem_ImageUrl +EntriesInputChatMlMessageContentItem = typing.Union[ + EntriesInputChatMlMessageContentItem_Text, + EntriesInputChatMlMessageContentItem_ImageUrl, ] diff --git a/sdks/python/julep/api/types/entries_relation.py b/sdks/python/julep/api/types/entries_relation.py new file mode 100644 index 000000000..ea520eb6e --- /dev/null +++ b/sdks/python/julep/api/types/entries_relation.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class EntriesRelation(pydantic.BaseModel): + head: CommonUuid + relation: str + tail: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py b/sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py new file mode 100644 index 000000000..0ae70bf0a --- /dev/null +++ b/sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExecutionTransitionsRouteListRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is ExecutionTransitionsRouteListRequestDirection.ASC: + return asc() + if self is ExecutionTransitionsRouteListRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py b/sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py new file mode 100644 index 000000000..a4f0227dc --- /dev/null +++ b/sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExecutionTransitionsRouteListRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ExecutionTransitionsRouteListRequestSortBy.CREATED_AT: + return created_at() + if self is ExecutionTransitionsRouteListRequestSortBy.UPDATED_AT: + return updated_at() + if self is ExecutionTransitionsRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/function_call_option.py b/sdks/python/julep/api/types/execution_transitions_route_list_response.py similarity index 77% rename from sdks/python/julep/api/types/function_call_option.py rename to sdks/python/julep/api/types/execution_transitions_route_list_response.py index fec071814..16b314ed0 100644 --- a/sdks/python/julep/api/types/function_call_option.py +++ b/sdks/python/julep/api/types/execution_transitions_route_list_response.py @@ -4,6 +4,9 @@ import typing from ..core.datetime_utils import serialize_datetime +from .execution_transitions_route_list_response_results_item import ( + ExecutionTransitionsRouteListResponseResultsItem, +) try: import pydantic.v1 as pydantic # type: ignore @@ -11,12 +14,8 @@ import pydantic # type: ignore -class FunctionCallOption(pydantic.BaseModel): - """ - Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. - """ - - name: str = pydantic.Field(description="The name of the function to call.") +class ExecutionTransitionsRouteListResponse(pydantic.BaseModel): + results: typing.List[ExecutionTransitionsRouteListResponseResultsItem] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py b/sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py new file mode 100644 index 000000000..14a06247d --- /dev/null +++ b/sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .executions_transition import ExecutionsTransition + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ExecutionTransitionsRouteListResponseResultsItem(pydantic.BaseModel): + transitions: typing.List[ExecutionsTransition] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_ml_message.py b/sdks/python/julep/api/types/executions_execution.py similarity index 58% rename from sdks/python/julep/api/types/chat_ml_message.py rename to sdks/python/julep/api/types/executions_execution.py index 2e6ea9ef0..5ec778e2a 100644 --- a/sdks/python/julep/api/types/chat_ml_message.py +++ b/sdks/python/julep/api/types/executions_execution.py @@ -4,8 +4,8 @@ import typing from ..core.datetime_utils import serialize_datetime -from .chat_ml_message_content import ChatMlMessageContent -from .chat_ml_message_role import ChatMlMessageRole +from .common_uuid import CommonUuid +from .executions_execution_status import ExecutionsExecutionStatus try: import pydantic.v1 as pydantic # type: ignore @@ -13,22 +13,23 @@ import pydantic # type: ignore -class ChatMlMessage(pydantic.BaseModel): - role: ChatMlMessageRole = pydantic.Field( - description=( - "ChatML role (system\n" - "assistant\n" - "user\n" - "function_call\n" - "function)\n" - ) +class ExecutionsExecution(pydantic.BaseModel): + task_id: CommonUuid = pydantic.Field( + description="The ID of the task that the execution is running" + ) + status: ExecutionsExecutionStatus = pydantic.Field( + description="The status of the execution" + ) + input: typing.Dict[str, typing.Any] = pydantic.Field( + description="The input to the execution" ) - content: ChatMlMessageContent = pydantic.Field(description="ChatML content") - name: typing.Optional[str] = pydantic.Field(description="ChatML name") created_at: dt.datetime = pydantic.Field( - description="Message created at (RFC-3339 format)" + description="When this resource was created as UTC date-time" + ) + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" ) - id: str = pydantic.Field(description="Message ID") + id: CommonUuid def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/executions_execution_status.py b/sdks/python/julep/api/types/executions_execution_status.py new file mode 100644 index 000000000..841464f6c --- /dev/null +++ b/sdks/python/julep/api/types/executions_execution_status.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExecutionsExecutionStatus(str, enum.Enum): + """ + The status of the execution + """ + + QUEUED = "queued" + STARTING = "starting" + RUNNING = "running" + AWAITING_INPUT = "awaiting_input" + SUCCEEDED = "succeeded" + FAILED = "failed" + CANCELLED = "cancelled" + + def visit( + self, + queued: typing.Callable[[], T_Result], + starting: typing.Callable[[], T_Result], + running: typing.Callable[[], T_Result], + awaiting_input: typing.Callable[[], T_Result], + succeeded: typing.Callable[[], T_Result], + failed: typing.Callable[[], T_Result], + cancelled: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ExecutionsExecutionStatus.QUEUED: + return queued() + if self is ExecutionsExecutionStatus.STARTING: + return starting() + if self is ExecutionsExecutionStatus.RUNNING: + return running() + if self is ExecutionsExecutionStatus.AWAITING_INPUT: + return awaiting_input() + if self is ExecutionsExecutionStatus.SUCCEEDED: + return succeeded() + if self is ExecutionsExecutionStatus.FAILED: + return failed() + if self is ExecutionsExecutionStatus.CANCELLED: + return cancelled() diff --git a/sdks/python/julep/api/types/executions_resume_execution_request.py b/sdks/python/julep/api/types/executions_resume_execution_request.py new file mode 100644 index 000000000..3fe258b34 --- /dev/null +++ b/sdks/python/julep/api/types/executions_resume_execution_request.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ExecutionsResumeExecutionRequest(pydantic.BaseModel): + input: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( + description="The input to resume the execution with" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_route_update_response.py b/sdks/python/julep/api/types/executions_route_update_response.py new file mode 100644 index 000000000..9dd6369c4 --- /dev/null +++ b/sdks/python/julep/api/types/executions_route_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ExecutionsRouteUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_stop_execution_request.py b/sdks/python/julep/api/types/executions_stop_execution_request.py new file mode 100644 index 000000000..15a954901 --- /dev/null +++ b/sdks/python/julep/api/types/executions_stop_execution_request.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ExecutionsStopExecutionRequest(pydantic.BaseModel): + reason: typing.Optional[str] = pydantic.Field( + description="The reason for stopping the execution" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_transition.py b/sdks/python/julep/api/types/executions_transition.py new file mode 100644 index 000000000..ef40ec138 --- /dev/null +++ b/sdks/python/julep/api/types/executions_transition.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid +from .executions_transition_type import ExecutionsTransitionType + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ExecutionsTransition(pydantic.BaseModel): + type: ExecutionsTransitionType + execution_id: CommonUuid + outputs: typing.Dict[str, typing.Any] + current: typing.List[typing.Any] + next: typing.Optional[typing.List[typing.Any]] + id: CommonUuid + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_transition_type.py b/sdks/python/julep/api/types/executions_transition_type.py new file mode 100644 index 000000000..e5b59ecc0 --- /dev/null +++ b/sdks/python/julep/api/types/executions_transition_type.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExecutionsTransitionType(str, enum.Enum): + FINISH = "finish" + WAIT = "wait" + ERROR = "error" + STEP = "step" + CANCELLED = "cancelled" + + def visit( + self, + finish: typing.Callable[[], T_Result], + wait: typing.Callable[[], T_Result], + error: typing.Callable[[], T_Result], + step: typing.Callable[[], T_Result], + cancelled: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ExecutionsTransitionType.FINISH: + return finish() + if self is ExecutionsTransitionType.WAIT: + return wait() + if self is ExecutionsTransitionType.ERROR: + return error() + if self is ExecutionsTransitionType.STEP: + return step() + if self is ExecutionsTransitionType.CANCELLED: + return cancelled() diff --git a/sdks/python/julep/api/types/executions_update_execution_request.py b/sdks/python/julep/api/types/executions_update_execution_request.py new file mode 100644 index 000000000..424b74405 --- /dev/null +++ b/sdks/python/julep/api/types/executions_update_execution_request.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import typing_extensions + +from .executions_resume_execution_request import ExecutionsResumeExecutionRequest +from .executions_stop_execution_request import ExecutionsStopExecutionRequest + + +class ExecutionsUpdateExecutionRequest_Cancelled(ExecutionsStopExecutionRequest): + status: typing_extensions.Literal["cancelled"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class ExecutionsUpdateExecutionRequest_Running(ExecutionsResumeExecutionRequest): + status: typing_extensions.Literal["running"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +ExecutionsUpdateExecutionRequest = typing.Union[ + ExecutionsUpdateExecutionRequest_Cancelled, ExecutionsUpdateExecutionRequest_Running +] diff --git a/sdks/python/julep/api/types/function_def.py b/sdks/python/julep/api/types/function_def.py deleted file mode 100644 index 44d922e39..000000000 --- a/sdks/python/julep/api/types/function_def.py +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .function_parameters import FunctionParameters - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class FunctionDef(pydantic.BaseModel): - description: typing.Optional[str] = pydantic.Field( - description="A description of what the function does, used by the model to choose when and how to call the function." - ) - name: str = pydantic.Field( - description="The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." - ) - parameters: FunctionParameters = pydantic.Field( - description="Parameters accepeted by this function" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_agent_docs_response.py b/sdks/python/julep/api/types/get_agent_docs_response.py deleted file mode 100644 index 85a82e97e..000000000 --- a/sdks/python/julep/api/types/get_agent_docs_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .doc import Doc - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class GetAgentDocsResponse(pydantic.BaseModel): - items: typing.Optional[typing.List[Doc]] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_agent_memories_response.py b/sdks/python/julep/api/types/get_agent_memories_response.py deleted file mode 100644 index f64fab71a..000000000 --- a/sdks/python/julep/api/types/get_agent_memories_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .memory import Memory - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class GetAgentMemoriesResponse(pydantic.BaseModel): - items: typing.Optional[typing.List[Memory]] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_agent_tools_response.py b/sdks/python/julep/api/types/get_agent_tools_response.py deleted file mode 100644 index 4be91fc7c..000000000 --- a/sdks/python/julep/api/types/get_agent_tools_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .tool import Tool - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class GetAgentToolsResponse(pydantic.BaseModel): - items: typing.Optional[typing.List[Tool]] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_history_response.py b/sdks/python/julep/api/types/get_history_response.py deleted file mode 100644 index 83c02e026..000000000 --- a/sdks/python/julep/api/types/get_history_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .chat_ml_message import ChatMlMessage - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class GetHistoryResponse(pydantic.BaseModel): - items: typing.Optional[typing.List[ChatMlMessage]] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_suggestions_response.py b/sdks/python/julep/api/types/get_suggestions_response.py deleted file mode 100644 index d26088747..000000000 --- a/sdks/python/julep/api/types/get_suggestions_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .suggestion import Suggestion - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class GetSuggestionsResponse(pydantic.BaseModel): - items: typing.Optional[typing.List[Suggestion]] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_user_docs_response.py b/sdks/python/julep/api/types/get_user_docs_response.py deleted file mode 100644 index 3c5232c55..000000000 --- a/sdks/python/julep/api/types/get_user_docs_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .doc import Doc - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class GetUserDocsResponse(pydantic.BaseModel): - items: typing.Optional[typing.List[Doc]] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/history_route_delete_response.py b/sdks/python/julep/api/types/history_route_delete_response.py new file mode 100644 index 000000000..34cec6434 --- /dev/null +++ b/sdks/python/julep/api/types/history_route_delete_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class HistoryRouteDeleteResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of deleted undefined") + deleted_at: dt.datetime = pydantic.Field( + description="When this resource was deleted as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/list_agents_request_order.py b/sdks/python/julep/api/types/history_route_list_request_direction.py similarity index 66% rename from sdks/python/julep/api/types/list_agents_request_order.py rename to sdks/python/julep/api/types/history_route_list_request_direction.py index f541ea4a1..6795d5657 100644 --- a/sdks/python/julep/api/types/list_agents_request_order.py +++ b/sdks/python/julep/api/types/history_route_list_request_direction.py @@ -6,14 +6,14 @@ T_Result = typing.TypeVar("T_Result") -class ListAgentsRequestOrder(str, enum.Enum): +class HistoryRouteListRequestDirection(str, enum.Enum): ASC = "asc" DESC = "desc" def visit( self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] ) -> T_Result: - if self is ListAgentsRequestOrder.ASC: + if self is HistoryRouteListRequestDirection.ASC: return asc() - if self is ListAgentsRequestOrder.DESC: + if self is HistoryRouteListRequestDirection.DESC: return desc() diff --git a/sdks/python/julep/api/types/get_user_docs_request_sort_by.py b/sdks/python/julep/api/types/history_route_list_request_sort_by.py similarity index 53% rename from sdks/python/julep/api/types/get_user_docs_request_sort_by.py rename to sdks/python/julep/api/types/history_route_list_request_sort_by.py index b911f6e82..2fde6f7a0 100644 --- a/sdks/python/julep/api/types/get_user_docs_request_sort_by.py +++ b/sdks/python/julep/api/types/history_route_list_request_sort_by.py @@ -6,16 +6,20 @@ T_Result = typing.TypeVar("T_Result") -class GetUserDocsRequestSortBy(str, enum.Enum): +class HistoryRouteListRequestSortBy(str, enum.Enum): CREATED_AT = "created_at" UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" def visit( self, created_at: typing.Callable[[], T_Result], updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], ) -> T_Result: - if self is GetUserDocsRequestSortBy.CREATED_AT: + if self is HistoryRouteListRequestSortBy.CREATED_AT: return created_at() - if self is GetUserDocsRequestSortBy.UPDATED_AT: + if self is HistoryRouteListRequestSortBy.UPDATED_AT: return updated_at() + if self is HistoryRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/history_route_list_response.py b/sdks/python/julep/api/types/history_route_list_response.py new file mode 100644 index 000000000..97ed6088b --- /dev/null +++ b/sdks/python/julep/api/types/history_route_list_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .entries_history import EntriesHistory + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class HistoryRouteListResponse(pydantic.BaseModel): + results: typing.List[EntriesHistory] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/individual_docs_route_delete_response.py b/sdks/python/julep/api/types/individual_docs_route_delete_response.py new file mode 100644 index 000000000..0b09a5d95 --- /dev/null +++ b/sdks/python/julep/api/types/individual_docs_route_delete_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class IndividualDocsRouteDeleteResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of deleted undefined") + deleted_at: dt.datetime = pydantic.Field( + description="When this resource was deleted as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/input_chat_ml_message_content.py b/sdks/python/julep/api/types/input_chat_ml_message_content.py deleted file mode 100644 index 4b8bd1c53..000000000 --- a/sdks/python/julep/api/types/input_chat_ml_message_content.py +++ /dev/null @@ -1,15 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_ml_image_content_part import ChatMlImageContentPart -from .chat_ml_image_content_part_image_url import ChatMlImageContentPartImageUrl -from .chat_ml_image_content_part_image_url_detail import ( - ChatMlImageContentPartImageUrlDetail, -) -from .chat_ml_text_content_part import ChatMlTextContentPart -from .input_chat_ml_message_content_item import InputChatMlMessageContentItem - -InputChatMlMessageContent = typing.Union[ - str, typing.List[InputChatMlMessageContentItem] -] diff --git a/sdks/python/julep/api/types/job_status_state.py b/sdks/python/julep/api/types/jobs_job_state.py similarity index 74% rename from sdks/python/julep/api/types/job_status_state.py rename to sdks/python/julep/api/types/jobs_job_state.py index 0c94644fe..efacd8154 100644 --- a/sdks/python/julep/api/types/job_status_state.py +++ b/sdks/python/julep/api/types/jobs_job_state.py @@ -6,7 +6,7 @@ T_Result = typing.TypeVar("T_Result") -class JobStatusState(str, enum.Enum): +class JobsJobState(str, enum.Enum): """ Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) """ @@ -29,17 +29,17 @@ def visit( failed: typing.Callable[[], T_Result], unknown: typing.Callable[[], T_Result], ) -> T_Result: - if self is JobStatusState.PENDING: + if self is JobsJobState.PENDING: return pending() - if self is JobStatusState.IN_PROGRESS: + if self is JobsJobState.IN_PROGRESS: return in_progress() - if self is JobStatusState.RETRYING: + if self is JobsJobState.RETRYING: return retrying() - if self is JobStatusState.SUCCEEDED: + if self is JobsJobState.SUCCEEDED: return succeeded() - if self is JobStatusState.ABORTED: + if self is JobsJobState.ABORTED: return aborted() - if self is JobStatusState.FAILED: + if self is JobsJobState.FAILED: return failed() - if self is JobStatusState.UNKNOWN: + if self is JobsJobState.UNKNOWN: return unknown() diff --git a/sdks/python/julep/api/types/job_status.py b/sdks/python/julep/api/types/jobs_job_status.py similarity index 57% rename from sdks/python/julep/api/types/job_status.py rename to sdks/python/julep/api/types/jobs_job_status.py index 94855181b..cc6061efb 100644 --- a/sdks/python/julep/api/types/job_status.py +++ b/sdks/python/julep/api/types/jobs_job_status.py @@ -4,7 +4,9 @@ import typing from ..core.datetime_utils import serialize_datetime -from .job_status_state import JobStatusState +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid +from .jobs_job_state import JobsJobState try: import pydantic.v1 as pydantic # type: ignore @@ -12,25 +14,21 @@ import pydantic # type: ignore -class JobStatus(pydantic.BaseModel): - name: str = pydantic.Field(description="Name of the job") - reason: typing.Optional[str] = pydantic.Field( - description="Reason for current state" - ) +class JobsJobStatus(pydantic.BaseModel): + id: CommonUuid created_at: dt.datetime = pydantic.Field( - description="Job created at (RFC-3339 format)" + description="When this resource was created as UTC date-time" ) - updated_at: typing.Optional[dt.datetime] = pydantic.Field( - description="Job updated at (RFC-3339 format)" + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" ) - id: str = pydantic.Field(description="Job id (UUID)") - has_progress: typing.Optional[bool] = pydantic.Field( + name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the job") + reason: str = pydantic.Field(description="Reason for the current state of the job") + has_progress: bool = pydantic.Field( description="Whether this Job supports progress updates" ) - progress: typing.Optional[float] = pydantic.Field(description="Progress percentage") - state: JobStatusState = pydantic.Field( - description="Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed)" - ) + progress: float = pydantic.Field(description="Progress percentage") + state: JobsJobState = pydantic.Field(description="Current state of the job") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/list_agents_response.py b/sdks/python/julep/api/types/list_agents_response.py deleted file mode 100644 index 8b5f9c25a..000000000 --- a/sdks/python/julep/api/types/list_agents_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .agent import Agent - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ListAgentsResponse(pydantic.BaseModel): - items: typing.List[Agent] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/list_sessions_response.py b/sdks/python/julep/api/types/list_sessions_response.py deleted file mode 100644 index 332410fcf..000000000 --- a/sdks/python/julep/api/types/list_sessions_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .session import Session - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ListSessionsResponse(pydantic.BaseModel): - items: typing.List[Session] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/list_users_request_order.py b/sdks/python/julep/api/types/list_users_request_order.py deleted file mode 100644 index 08dd63e6e..000000000 --- a/sdks/python/julep/api/types/list_users_request_order.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class ListUsersRequestOrder(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is ListUsersRequestOrder.ASC: - return asc() - if self is ListUsersRequestOrder.DESC: - return desc() diff --git a/sdks/python/julep/api/types/list_users_request_sort_by.py b/sdks/python/julep/api/types/list_users_request_sort_by.py deleted file mode 100644 index 809fd92a1..000000000 --- a/sdks/python/julep/api/types/list_users_request_sort_by.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class ListUsersRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ListUsersRequestSortBy.CREATED_AT: - return created_at() - if self is ListUsersRequestSortBy.UPDATED_AT: - return updated_at() diff --git a/sdks/python/julep/api/types/list_users_response.py b/sdks/python/julep/api/types/list_users_response.py deleted file mode 100644 index a22ab7951..000000000 --- a/sdks/python/julep/api/types/list_users_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .user import User - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ListUsersResponse(pydantic.BaseModel): - items: typing.List[User] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/memory.py b/sdks/python/julep/api/types/memory.py deleted file mode 100644 index 671d397b0..000000000 --- a/sdks/python/julep/api/types/memory.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .memory_entities_item import MemoryEntitiesItem - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Memory(pydantic.BaseModel): - agent_id: str = pydantic.Field(description="ID of the agent") - user_id: str = pydantic.Field(description="ID of the user") - content: str = pydantic.Field(description="Content of the memory") - created_at: dt.datetime = pydantic.Field( - description="Memory created at (RFC-3339 format)" - ) - last_accessed_at: typing.Optional[dt.datetime] = pydantic.Field( - description="Memory last accessed at (RFC-3339 format)" - ) - timestamp: typing.Optional[dt.datetime] = pydantic.Field( - description="Memory happened at (RFC-3339 format)" - ) - sentiment: typing.Optional[float] = pydantic.Field( - description="Sentiment (valence) of the memory on a scale of -1 to 1" - ) - id: str = pydantic.Field(description="Memory id (UUID)") - entities: typing.List[MemoryEntitiesItem] = pydantic.Field( - description="List of entities mentioned in the memory" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/memory_access_options.py b/sdks/python/julep/api/types/memory_access_options.py deleted file mode 100644 index 29c7bc659..000000000 --- a/sdks/python/julep/api/types/memory_access_options.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class MemoryAccessOptions(pydantic.BaseModel): - recall: typing.Optional[bool] = pydantic.Field( - description="Whether previous memories should be recalled or not" - ) - record: typing.Optional[bool] = pydantic.Field( - description="Whether this interaction should be recorded in history or not" - ) - remember: typing.Optional[bool] = pydantic.Field( - description="Whether this interaction should form memories or not" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/memory_entities_item.py b/sdks/python/julep/api/types/memory_entities_item.py deleted file mode 100644 index 64aa8c5b7..000000000 --- a/sdks/python/julep/api/types/memory_entities_item.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class MemoryEntitiesItem(pydantic.BaseModel): - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/partial_function_def.py b/sdks/python/julep/api/types/partial_function_def.py deleted file mode 100644 index 31418e3ab..000000000 --- a/sdks/python/julep/api/types/partial_function_def.py +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .function_parameters import FunctionParameters - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class PartialFunctionDef(pydantic.BaseModel): - description: typing.Optional[str] = pydantic.Field( - description="A description of what the function does, used by the model to choose when and how to call the function." - ) - name: typing.Optional[str] = pydantic.Field( - description="The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." - ) - parameters: typing.Optional[FunctionParameters] = pydantic.Field( - description="Parameters accepeted by this function" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/patch_agent_request_instructions.py b/sdks/python/julep/api/types/patch_agent_request_instructions.py deleted file mode 100644 index 34dadc486..000000000 --- a/sdks/python/julep/api/types/patch_agent_request_instructions.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -PatchAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/session.py b/sdks/python/julep/api/types/session.py deleted file mode 100644 index 22081c5e2..000000000 --- a/sdks/python/julep/api/types/session.py +++ /dev/null @@ -1,66 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Session(pydantic.BaseModel): - id: str = pydantic.Field(description="Session id (UUID)") - user_id: typing.Optional[str] = pydantic.Field( - description="User ID of user associated with this session" - ) - agent_id: str = pydantic.Field( - description="Agent ID of agent associated with this session" - ) - situation: typing.Optional[str] = pydantic.Field( - description="A specific situation that sets the background for this session" - ) - summary: typing.Optional[str] = pydantic.Field( - description="(null at the beginning) - generated automatically after every interaction" - ) - created_at: typing.Optional[dt.datetime] = pydantic.Field( - description="Session created at (RFC-3339 format)" - ) - updated_at: typing.Optional[dt.datetime] = pydantic.Field( - description="Session updated at (RFC-3339 format)" - ) - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="Optional metadata" - ) - render_templates: typing.Optional[bool] = pydantic.Field( - description="Render system and assistant message content as jinja templates" - ) - token_budget: typing.Optional[int] = pydantic.Field( - description="Threshold value for the adaptive context functionality" - ) - context_overflow: typing.Optional[str] = pydantic.Field( - description="Action to start on context window overflow" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py new file mode 100644 index 000000000..0277daa62 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsMultiAgentMultiUserSession(pydantic.BaseModel): + agents: typing.List[CommonUuid] + users: typing.List[CommonUuid] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_settings_response_format_schema.py b/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py similarity index 87% rename from sdks/python/julep/api/types/chat_settings_response_format_schema.py rename to sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py index 395c4f7c8..8cbf56316 100644 --- a/sdks/python/julep/api/types/chat_settings_response_format_schema.py +++ b/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py @@ -4,6 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid try: import pydantic.v1 as pydantic # type: ignore @@ -11,10 +12,8 @@ import pydantic # type: ignore -class ChatSettingsResponseFormatSchema(pydantic.BaseModel): - """ - JSON Schema to use if `type` is `"json_object"` - """ +class SessionsMultiAgentNoUserSession(pydantic.BaseModel): + agents: typing.List[CommonUuid] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py new file mode 100644 index 000000000..88b6d3006 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsMultiAgentSingleUserSession(pydantic.BaseModel): + agents: typing.List[CommonUuid] + user: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_create_or_update_response.py b/sdks/python/julep/api/types/sessions_route_create_or_update_response.py new file mode 100644 index 000000000..1bed8fd79 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_create_or_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsRouteCreateOrUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_create_response.py b/sdks/python/julep/api/types/sessions_route_create_response.py new file mode 100644 index 000000000..7f13b6d47 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_create_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsRouteCreateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of created undefined") + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_delete_response.py b/sdks/python/julep/api/types/sessions_route_delete_response.py new file mode 100644 index 000000000..fa753c106 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_delete_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsRouteDeleteResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of deleted undefined") + deleted_at: dt.datetime = pydantic.Field( + description="When this resource was deleted as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_list_request_direction.py b/sdks/python/julep/api/types/sessions_route_list_request_direction.py new file mode 100644 index 000000000..870b3e7eb --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_list_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class SessionsRouteListRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is SessionsRouteListRequestDirection.ASC: + return asc() + if self is SessionsRouteListRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py b/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py new file mode 100644 index 000000000..5b4ca464e --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class SessionsRouteListRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is SessionsRouteListRequestSortBy.CREATED_AT: + return created_at() + if self is SessionsRouteListRequestSortBy.UPDATED_AT: + return updated_at() + if self is SessionsRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/sessions_route_list_response.py b/sdks/python/julep/api/types/sessions_route_list_response.py new file mode 100644 index 000000000..bd7a35361 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_list_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .sessions_session import SessionsSession + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsRouteListResponse(pydantic.BaseModel): + results: typing.List[SessionsSession] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_patch_response.py b/sdks/python/julep/api/types/sessions_route_patch_response.py new file mode 100644 index 000000000..04a74bd4d --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_patch_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsRoutePatchResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_update_response.py b/sdks/python/julep/api/types/sessions_route_update_response.py new file mode 100644 index 000000000..c1dc79fc2 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsRouteUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_session.py b/sdks/python/julep/api/types/sessions_session.py new file mode 100644 index 000000000..5a84ac490 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_session.py @@ -0,0 +1,139 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import typing_extensions + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid +from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession +from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession +from .sessions_multi_agent_single_user_session import ( + SessionsMultiAgentSingleUserSession, +) +from .sessions_single_agent_multi_user_session import ( + SessionsSingleAgentMultiUserSession, +) +from .sessions_single_agent_no_user_session import SessionsSingleAgentNoUserSession +from .sessions_single_agent_single_user_session import ( + SessionsSingleAgentSingleUserSession, +) + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class Base(pydantic.BaseModel): + situation: str = pydantic.Field( + description="A specific situation that sets the background for this session" + ) + summary: typing.Optional[str] = pydantic.Field( + description="Summary (null at the beginning) - generated automatically after every interaction" + ) + render_templates: bool = pydantic.Field( + description="Render system and assistant message content as jinja templates" + ) + token_budget: typing.Optional[int] = pydantic.Field( + description="Threshold value for the adaptive context functionality" + ) + context_overflow: typing.Optional[str] = pydantic.Field( + description="Action to start on context window overflow" + ) + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_SingleAgentNoUser(SessionsSingleAgentNoUserSession, Base): + kind: typing_extensions.Literal["single_agent_no_user"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class SessionsSession_SingleAgentSingleUser(SessionsSingleAgentSingleUserSession, Base): + kind: typing_extensions.Literal["single_agent_single_user"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class SessionsSession_SingleAgentMultiUser(SessionsSingleAgentMultiUserSession, Base): + kind: typing_extensions.Literal["single_agent_multi_user"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class SessionsSession_MultiAgentNoUser(SessionsMultiAgentNoUserSession, Base): + kind: typing_extensions.Literal["multi_agent_no_user"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class SessionsSession_MultiAgentSingleUser(SessionsMultiAgentSingleUserSession, Base): + kind: typing_extensions.Literal["multi_agent_single_user"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class SessionsSession_MultiAgentMultiUser(SessionsMultiAgentMultiUserSession, Base): + kind: typing_extensions.Literal["multi_agent_multi_user"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +SessionsSession = typing.Union[ + SessionsSession_SingleAgentNoUser, + SessionsSession_SingleAgentSingleUser, + SessionsSession_SingleAgentMultiUser, + SessionsSession_MultiAgentNoUser, + SessionsSession_MultiAgentSingleUser, + SessionsSession_MultiAgentMultiUser, +] diff --git a/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py new file mode 100644 index 000000000..10c6d7e97 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsSingleAgentMultiUserSession(pydantic.BaseModel): + agent: CommonUuid + users: typing.List[CommonUuid] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py new file mode 100644 index 000000000..3076ed67b --- /dev/null +++ b/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsSingleAgentNoUserSession(pydantic.BaseModel): + agent: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py new file mode 100644 index 000000000..415c84bfc --- /dev/null +++ b/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class SessionsSingleAgentSingleUserSession(pydantic.BaseModel): + agent: CommonUuid + user: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/suggestion.py b/sdks/python/julep/api/types/suggestion.py deleted file mode 100644 index db3218089..000000000 --- a/sdks/python/julep/api/types/suggestion.py +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .suggestion_target import SuggestionTarget - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Suggestion(pydantic.BaseModel): - created_at: typing.Optional[dt.datetime] = pydantic.Field( - description="Suggestion created at (RFC-3339 format)" - ) - target: SuggestionTarget = pydantic.Field( - description="Whether the suggestion is for the `agent` or a `user`" - ) - content: str = pydantic.Field(description="The content of the suggestion") - message_id: str = pydantic.Field(description="The message that produced it") - session_id: str = pydantic.Field(description="Session this suggestion belongs to") - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task_executions_route_create_response.py b/sdks/python/julep/api/types/task_executions_route_create_response.py new file mode 100644 index 000000000..800c2f79b --- /dev/null +++ b/sdks/python/julep/api/types/task_executions_route_create_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TaskExecutionsRouteCreateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of created undefined") + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task_executions_route_list_request_direction.py b/sdks/python/julep/api/types/task_executions_route_list_request_direction.py new file mode 100644 index 000000000..9a184e984 --- /dev/null +++ b/sdks/python/julep/api/types/task_executions_route_list_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class TaskExecutionsRouteListRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is TaskExecutionsRouteListRequestDirection.ASC: + return asc() + if self is TaskExecutionsRouteListRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py b/sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py new file mode 100644 index 000000000..ead7f15eb --- /dev/null +++ b/sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class TaskExecutionsRouteListRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is TaskExecutionsRouteListRequestSortBy.CREATED_AT: + return created_at() + if self is TaskExecutionsRouteListRequestSortBy.UPDATED_AT: + return updated_at() + if self is TaskExecutionsRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/task_executions_route_list_response.py b/sdks/python/julep/api/types/task_executions_route_list_response.py new file mode 100644 index 000000000..5000bf531 --- /dev/null +++ b/sdks/python/julep/api/types/task_executions_route_list_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .executions_execution import ExecutionsExecution + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TaskExecutionsRouteListResponse(pydantic.BaseModel): + results: typing.List[ExecutionsExecution] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/create_tool_request.py b/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py similarity index 68% rename from sdks/python/julep/api/types/create_tool_request.py rename to sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py index d20cdc518..2c7a35030 100644 --- a/sdks/python/julep/api/types/create_tool_request.py +++ b/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py @@ -4,8 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime -from .create_tool_request_type import CreateToolRequestType -from .function_def import FunctionDef +from .common_uuid import CommonUuid try: import pydantic.v1 as pydantic # type: ignore @@ -13,12 +12,13 @@ import pydantic # type: ignore -class CreateToolRequest(pydantic.BaseModel): - type: CreateToolRequestType = pydantic.Field( - description="Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now)" +class TaskExecutionsRouteResumeWithTaskTokenResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" ) - function: FunctionDef = pydantic.Field( - description="Function definition and parameters" + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" ) def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/tasks_cel.py b/sdks/python/julep/api/types/tasks_cel.py new file mode 100644 index 000000000..acf516d8c --- /dev/null +++ b/sdks/python/julep/api/types/tasks_cel.py @@ -0,0 +1,3 @@ +# This file was auto-generated by Fern from our API Definition. + +TasksCel = str diff --git a/sdks/python/julep/api/types/chat_ml_text_content_part.py b/sdks/python/julep/api/types/tasks_error_workflow_step.py similarity index 88% rename from sdks/python/julep/api/types/chat_ml_text_content_part.py rename to sdks/python/julep/api/types/tasks_error_workflow_step.py index 377b6adf0..34c1aa47b 100644 --- a/sdks/python/julep/api/types/chat_ml_text_content_part.py +++ b/sdks/python/julep/api/types/tasks_error_workflow_step.py @@ -11,8 +11,8 @@ import pydantic # type: ignore -class ChatMlTextContentPart(pydantic.BaseModel): - text: str = pydantic.Field(description="Text content part") +class TasksErrorWorkflowStep(pydantic.BaseModel): + error: str = pydantic.Field(description="The error message") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/tasks_evaluate_step.py b/sdks/python/julep/api/types/tasks_evaluate_step.py new file mode 100644 index 000000000..b660b2265 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_evaluate_step.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .tasks_cel import TasksCel + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksEvaluateStep(pydantic.BaseModel): + evaluate: typing.Dict[str, TasksCel] = pydantic.Field( + description="The expression to evaluate" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/execution_transition.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py similarity index 61% rename from sdks/python/julep/api/types/execution_transition.py rename to sdks/python/julep/api/types/tasks_if_else_workflow_step.py index 59167277f..f834f3db5 100644 --- a/sdks/python/julep/api/types/execution_transition.py +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing from ..core.datetime_utils import serialize_datetime -from .transition_type import TransitionType +from .tasks_cel import TasksCel try: import pydantic.v1 as pydantic # type: ignore @@ -12,21 +14,14 @@ import pydantic # type: ignore -class ExecutionTransition(pydantic.BaseModel): - id: str - execution_id: str - type: TransitionType - from_: typing.List[typing.Any] = pydantic.Field(alias="from") - to: typing.Optional[typing.List[typing.Any]] - task_token: typing.Optional[str] - outputs: typing.Dict[str, typing.Any] = pydantic.Field( - description="Outputs from an Execution Transition" +class TasksIfElseWorkflowStep(pydantic.BaseModel): + if_: TasksCel = pydantic.Field(alias="if", description="The condition to evaluate") + then: "TasksWorkflowStep" = pydantic.Field( + description="The steps to run if the condition is true" ) - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="(Optional) metadata" + else_: "TasksWorkflowStep" = pydantic.Field( + alias="else", description="The steps to run if the condition is false" ) - created_at: dt.datetime - updated_at: typing.Optional[dt.datetime] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -49,3 +44,8 @@ class Config: smart_union = True allow_population_by_field_name = True json_encoders = {dt.datetime: serialize_datetime} + + +from .tasks_workflow_step import TasksWorkflowStep # noqa: E402 + +TasksIfElseWorkflowStep.update_forward_refs(TasksWorkflowStep=TasksWorkflowStep) diff --git a/sdks/python/julep/api/types/tasks_prompt_step.py b/sdks/python/julep/api/types/tasks_prompt_step.py new file mode 100644 index 000000000..a7a99b08f --- /dev/null +++ b/sdks/python/julep/api/types/tasks_prompt_step.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .tasks_prompt_step_prompt import TasksPromptStepPrompt +from .tasks_prompt_step_settings import TasksPromptStepSettings + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksPromptStep(pydantic.BaseModel): + prompt: TasksPromptStepPrompt = pydantic.Field(description="The prompt to run") + settings: TasksPromptStepSettings = pydantic.Field( + description="Settings for the prompt" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_prompt_step_prompt.py b/sdks/python/julep/api/types/tasks_prompt_step_prompt.py new file mode 100644 index 000000000..bf293072c --- /dev/null +++ b/sdks/python/julep/api/types/tasks_prompt_step_prompt.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_role import EntriesChatMlRole +from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart +from .entries_image_detail import EntriesImageDetail +from .entries_image_url import EntriesImageUrl +from .entries_input_chat_ml_message import EntriesInputChatMlMessage +from .entries_input_chat_ml_message_content import EntriesInputChatMlMessageContent +from .entries_input_chat_ml_message_content_item import ( + EntriesInputChatMlMessageContentItem, +) + +TasksPromptStepPrompt = typing.Union[str, typing.List[EntriesInputChatMlMessage]] diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings.py b/sdks/python/julep/api/types/tasks_prompt_step_settings.py new file mode 100644 index 000000000..a0c882a18 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_completion_response_format import ChatCompletionResponseFormat +from .chat_completion_response_format_type import ChatCompletionResponseFormatType +from .chat_generation_preset import ChatGenerationPreset +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_logit_bias import CommonLogitBias +from .tasks_prompt_step_settings_frequency_penalty import ( + TasksPromptStepSettingsFrequencyPenalty, +) +from .tasks_prompt_step_settings_length_penalty import ( + TasksPromptStepSettingsLengthPenalty, +) +from .tasks_prompt_step_settings_preset import TasksPromptStepSettingsPreset + +TasksPromptStepSettings = typing.Union[ + TasksPromptStepSettingsPreset, + TasksPromptStepSettingsFrequencyPenalty, + TasksPromptStepSettingsLengthPenalty, +] diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py new file mode 100644 index 000000000..ba14f18b3 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .chat_completion_response_format import ChatCompletionResponseFormat +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_logit_bias import CommonLogitBias + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksPromptStepSettingsFrequencyPenalty(pydantic.BaseModel): + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( + description="Identifier of the model to be used" + ) + stream: bool = pydantic.Field( + description="Indicates if the server should stream the response as it's generated" + ) + stop: typing.Optional[typing.List[str]] = pydantic.Field( + description="Up to 4 sequences where the API will stop generating further tokens." + ) + seed: typing.Optional[int] = pydantic.Field( + description="If specified, the system will make a best effort to sample deterministically for that particular seed value" + ) + max_tokens: typing.Optional[int] = pydantic.Field( + description="The maximum number of tokens to generate in the chat completion" + ) + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic.Field( + description="Modify the likelihood of specified tokens appearing in the completion" + ) + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic.Field( + description="Response format (set to `json_object` to restrict output to JSON)" + ) + frequency_penalty: typing.Optional[float] = pydantic.Field( + description="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." + ) + presence_penalty: typing.Optional[float] = pydantic.Field( + description="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." + ) + temperature: typing.Optional[float] = pydantic.Field( + description="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] = pydantic.Field( + description="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." + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py new file mode 100644 index 000000000..9f9e67428 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py @@ -0,0 +1,74 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .chat_completion_response_format import ChatCompletionResponseFormat +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_logit_bias import CommonLogitBias + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksPromptStepSettingsLengthPenalty(pydantic.BaseModel): + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( + description="Identifier of the model to be used" + ) + stream: bool = pydantic.Field( + description="Indicates if the server should stream the response as it's generated" + ) + stop: typing.Optional[typing.List[str]] = pydantic.Field( + description="Up to 4 sequences where the API will stop generating further tokens." + ) + seed: typing.Optional[int] = pydantic.Field( + description="If specified, the system will make a best effort to sample deterministically for that particular seed value" + ) + max_tokens: typing.Optional[int] = pydantic.Field( + description="The maximum number of tokens to generate in the chat completion" + ) + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic.Field( + description="Modify the likelihood of specified tokens appearing in the completion" + ) + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic.Field( + description="Response format (set to `json_object` to restrict output to JSON)" + ) + repetition_penalty: typing.Optional[float] = pydantic.Field( + description="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." + ) + length_penalty: typing.Optional[float] = pydantic.Field( + description="Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated." + ) + temperature: typing.Optional[float] = pydantic.Field( + description="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] = pydantic.Field( + description="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." + ) + min_p: typing.Optional[float] = pydantic.Field( + description="Minimum probability compared to leading token to be considered" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py new file mode 100644 index 000000000..325d26a0e --- /dev/null +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .chat_completion_response_format import ChatCompletionResponseFormat +from .chat_generation_preset import ChatGenerationPreset +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_logit_bias import CommonLogitBias + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksPromptStepSettingsPreset(pydantic.BaseModel): + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( + description="Identifier of the model to be used" + ) + stream: bool = pydantic.Field( + description="Indicates if the server should stream the response as it's generated" + ) + stop: typing.Optional[typing.List[str]] = pydantic.Field( + description="Up to 4 sequences where the API will stop generating further tokens." + ) + seed: typing.Optional[int] = pydantic.Field( + description="If specified, the system will make a best effort to sample deterministically for that particular seed value" + ) + max_tokens: typing.Optional[int] = pydantic.Field( + description="The maximum number of tokens to generate in the chat completion" + ) + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic.Field( + description="Modify the likelihood of specified tokens appearing in the completion" + ) + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic.Field( + description="Response format (set to `json_object` to restrict output to JSON)" + ) + preset: typing.Optional[ChatGenerationPreset] = pydantic.Field( + description="Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_create_or_update_response.py b/sdks/python/julep/api/types/tasks_route_create_or_update_response.py new file mode 100644 index 000000000..d197303a9 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_route_create_or_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksRouteCreateOrUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_create_response.py b/sdks/python/julep/api/types/tasks_route_create_response.py new file mode 100644 index 000000000..5ab4617c6 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_route_create_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksRouteCreateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of created undefined") + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_delete_response.py b/sdks/python/julep/api/types/tasks_route_delete_response.py new file mode 100644 index 000000000..6d6a273ec --- /dev/null +++ b/sdks/python/julep/api/types/tasks_route_delete_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksRouteDeleteResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of deleted undefined") + deleted_at: dt.datetime = pydantic.Field( + description="When this resource was deleted as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_agent_docs_request_order.py b/sdks/python/julep/api/types/tasks_route_list_request_direction.py similarity index 67% rename from sdks/python/julep/api/types/get_agent_docs_request_order.py rename to sdks/python/julep/api/types/tasks_route_list_request_direction.py index a2bcfe194..2ed0763c6 100644 --- a/sdks/python/julep/api/types/get_agent_docs_request_order.py +++ b/sdks/python/julep/api/types/tasks_route_list_request_direction.py @@ -6,14 +6,14 @@ T_Result = typing.TypeVar("T_Result") -class GetAgentDocsRequestOrder(str, enum.Enum): +class TasksRouteListRequestDirection(str, enum.Enum): ASC = "asc" DESC = "desc" def visit( self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] ) -> T_Result: - if self is GetAgentDocsRequestOrder.ASC: + if self is TasksRouteListRequestDirection.ASC: return asc() - if self is GetAgentDocsRequestOrder.DESC: + if self is TasksRouteListRequestDirection.DESC: return desc() diff --git a/sdks/python/julep/api/types/get_agent_docs_request_sort_by.py b/sdks/python/julep/api/types/tasks_route_list_request_sort_by.py similarity index 54% rename from sdks/python/julep/api/types/get_agent_docs_request_sort_by.py rename to sdks/python/julep/api/types/tasks_route_list_request_sort_by.py index 9ca1c7c83..c80bbefaa 100644 --- a/sdks/python/julep/api/types/get_agent_docs_request_sort_by.py +++ b/sdks/python/julep/api/types/tasks_route_list_request_sort_by.py @@ -6,16 +6,20 @@ T_Result = typing.TypeVar("T_Result") -class GetAgentDocsRequestSortBy(str, enum.Enum): +class TasksRouteListRequestSortBy(str, enum.Enum): CREATED_AT = "created_at" UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" def visit( self, created_at: typing.Callable[[], T_Result], updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], ) -> T_Result: - if self is GetAgentDocsRequestSortBy.CREATED_AT: + if self is TasksRouteListRequestSortBy.CREATED_AT: return created_at() - if self is GetAgentDocsRequestSortBy.UPDATED_AT: + if self is TasksRouteListRequestSortBy.UPDATED_AT: return updated_at() + if self is TasksRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/tasks_route_list_response.py b/sdks/python/julep/api/types/tasks_route_list_response.py new file mode 100644 index 000000000..f687a3763 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_route_list_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .tasks_task import TasksTask + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksRouteListResponse(pydantic.BaseModel): + results: typing.List[TasksTask] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/create_doc.py b/sdks/python/julep/api/types/tasks_route_patch_response.py similarity index 69% rename from sdks/python/julep/api/types/create_doc.py rename to sdks/python/julep/api/types/tasks_route_patch_response.py index 3411254d8..a6b8208eb 100644 --- a/sdks/python/julep/api/types/create_doc.py +++ b/sdks/python/julep/api/types/tasks_route_patch_response.py @@ -4,7 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime -from .create_doc_content import CreateDocContent +from .common_uuid import CommonUuid try: import pydantic.v1 as pydantic # type: ignore @@ -12,13 +12,13 @@ import pydantic # type: ignore -class CreateDoc(pydantic.BaseModel): - title: str = pydantic.Field( - description="Title describing what this bit of information contains" +class TasksRoutePatchResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" ) - content: CreateDocContent = pydantic.Field(description="Information content") - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="Optional metadata" + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" ) def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/tasks_route_update_response.py b/sdks/python/julep/api/types/tasks_route_update_response.py new file mode 100644 index 000000000..597685dd4 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_route_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksRouteUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_task.py b/sdks/python/julep/api/types/tasks_task.py new file mode 100644 index 000000000..67706ce9e --- /dev/null +++ b/sdks/python/julep/api/types/tasks_task.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid +from .tasks_workflow_step import TasksWorkflowStep +from .tools_create_tool_request import ToolsCreateToolRequest + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class TasksTask(pydantic.BaseModel): + """ + Object describing a Task + """ + + name: str + description: str + main: typing.List[TasksWorkflowStep] = pydantic.Field( + description="The entrypoint of the task." + ) + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( + description="The schema for the input to the task. `null` means all inputs are valid." + ) + tools: typing.List[ToolsCreateToolRequest] = pydantic.Field( + description="Tools defined specifically for this task not included in the Agent itself." + ) + inherit_tools: bool = pydantic.Field( + description="Whether to inherit tools from the parent agent or not. Defaults to true." + ) + agent_id: CommonUuid + id: CommonUuid + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_ml_image_content_part.py b/sdks/python/julep/api/types/tasks_tool_call_step.py similarity index 76% rename from sdks/python/julep/api/types/chat_ml_image_content_part.py rename to sdks/python/julep/api/types/tasks_tool_call_step.py index a9da11135..b861d623a 100644 --- a/sdks/python/julep/api/types/chat_ml_image_content_part.py +++ b/sdks/python/julep/api/types/tasks_tool_call_step.py @@ -4,7 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime -from .chat_ml_image_content_part_image_url import ChatMlImageContentPartImageUrl +from .common_tool_ref import CommonToolRef try: import pydantic.v1 as pydantic # type: ignore @@ -12,9 +12,10 @@ import pydantic # type: ignore -class ChatMlImageContentPart(pydantic.BaseModel): - image_url: ChatMlImageContentPartImageUrl = pydantic.Field( - description="Image content part, can be a URL or a base64-encoded image" +class TasksToolCallStep(pydantic.BaseModel): + tool: CommonToolRef = pydantic.Field(description="The tool to run") + arguments: typing.Dict[str, typing.Any] = pydantic.Field( + description="The input parameters for the tool" ) def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/tasks_workflow_step.py b/sdks/python/julep/api/types/tasks_workflow_step.py new file mode 100644 index 000000000..e03804d82 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_workflow_step.py @@ -0,0 +1,82 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import typing_extensions + +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_yield_step import TasksYieldStep + + +class TasksWorkflowStep_ToolCall(TasksToolCallStep): + kind: typing_extensions.Literal["tool_call"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class TasksWorkflowStep_Yield(TasksYieldStep): + kind: typing_extensions.Literal["yield"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class TasksWorkflowStep_Prompt(TasksPromptStep): + kind: typing_extensions.Literal["prompt"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class TasksWorkflowStep_Evaluate(TasksEvaluateStep): + kind: typing_extensions.Literal["evaluate"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class TasksWorkflowStep_IfElse(TasksIfElseWorkflowStep): + kind: typing_extensions.Literal["if_else"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class TasksWorkflowStep_Error(TasksErrorWorkflowStep): + kind: typing_extensions.Literal["error"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +TasksWorkflowStep = typing.Union[ + TasksWorkflowStep_ToolCall, + TasksWorkflowStep_Yield, + TasksWorkflowStep_Prompt, + TasksWorkflowStep_Evaluate, + TasksWorkflowStep_IfElse, + TasksWorkflowStep_Error, +] +from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep # noqa: E402 + +TasksWorkflowStep_IfElse.update_forward_refs( + TasksIfElseWorkflowStep=TasksIfElseWorkflowStep, TasksWorkflowStep=TasksWorkflowStep +) diff --git a/sdks/python/julep/api/types/resource_deleted_response.py b/sdks/python/julep/api/types/tasks_yield_step.py similarity index 77% rename from sdks/python/julep/api/types/resource_deleted_response.py rename to sdks/python/julep/api/types/tasks_yield_step.py index 39bd87a01..5cdc89a69 100644 --- a/sdks/python/julep/api/types/resource_deleted_response.py +++ b/sdks/python/julep/api/types/tasks_yield_step.py @@ -4,6 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime +from .tasks_cel import TasksCel try: import pydantic.v1 as pydantic # type: ignore @@ -11,11 +12,10 @@ import pydantic # type: ignore -class ResourceDeletedResponse(pydantic.BaseModel): - id: str - deleted_at: dt.datetime - jobs: typing.Optional[typing.List[str]] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" +class TasksYieldStep(pydantic.BaseModel): + workflow: str = pydantic.Field(description="The subworkflow to run") + arguments: typing.Dict[str, TasksCel] = pydantic.Field( + description="The input parameters for the subworkflow" ) def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/tool.py b/sdks/python/julep/api/types/tool.py deleted file mode 100644 index 1ffadb9b0..000000000 --- a/sdks/python/julep/api/types/tool.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .function_def import FunctionDef -from .tool_type import ToolType - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Tool(pydantic.BaseModel): - type: ToolType = pydantic.Field( - description="Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now)" - ) - function: FunctionDef = pydantic.Field( - description="Function definition and parameters" - ) - id: str = pydantic.Field(description="Tool ID") - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_call_workflow_step.py b/sdks/python/julep/api/types/tool_call_workflow_step.py deleted file mode 100644 index 0578eb454..000000000 --- a/sdks/python/julep/api/types/tool_call_workflow_step.py +++ /dev/null @@ -1,38 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .cel_object import CelObject - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ToolCallWorkflowStep(pydantic.BaseModel): - tool_id: str - arguments: CelObject - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_response.py b/sdks/python/julep/api/types/tool_response.py deleted file mode 100644 index a8f082397..000000000 --- a/sdks/python/julep/api/types/tool_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ToolResponse(pydantic.BaseModel): - id: str = pydantic.Field(description="Optional Tool ID") - output: typing.Dict[str, typing.Any] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_route_delete_response.py b/sdks/python/julep/api/types/tool_route_delete_response.py new file mode 100644 index 000000000..23ff6a7f1 --- /dev/null +++ b/sdks/python/julep/api/types/tool_route_delete_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ToolRouteDeleteResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of deleted undefined") + deleted_at: dt.datetime = pydantic.Field( + description="When this resource was deleted as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/resource_updated_response.py b/sdks/python/julep/api/types/tool_route_patch_response.py similarity index 74% rename from sdks/python/julep/api/types/resource_updated_response.py rename to sdks/python/julep/api/types/tool_route_patch_response.py index 1bee40d11..7f9b62834 100644 --- a/sdks/python/julep/api/types/resource_updated_response.py +++ b/sdks/python/julep/api/types/tool_route_patch_response.py @@ -4,6 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid try: import pydantic.v1 as pydantic # type: ignore @@ -11,10 +12,12 @@ import pydantic # type: ignore -class ResourceUpdatedResponse(pydantic.BaseModel): - id: str - updated_at: dt.datetime - jobs: typing.Optional[typing.List[str]] = pydantic.Field( +class ToolRoutePatchResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( description="IDs (if any) of jobs created as part of this request" ) diff --git a/sdks/python/julep/api/types/tool_route_update_response.py b/sdks/python/julep/api/types/tool_route_update_response.py new file mode 100644 index 000000000..476b756ba --- /dev/null +++ b/sdks/python/julep/api/types/tool_route_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ToolRouteUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_type.py b/sdks/python/julep/api/types/tool_type.py deleted file mode 100644 index 55a87c7c5..000000000 --- a/sdks/python/julep/api/types/tool_type.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class ToolType(str, enum.Enum): - """ - Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now) - """ - - FUNCTION = "function" - WEBHOOK = "webhook" - - def visit( - self, - function: typing.Callable[[], T_Result], - webhook: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ToolType.FUNCTION: - return function() - if self is ToolType.WEBHOOK: - return webhook() diff --git a/sdks/python/julep/api/types/tools_chosen_function_call.py b/sdks/python/julep/api/types/tools_chosen_function_call.py new file mode 100644 index 000000000..6f79ae527 --- /dev/null +++ b/sdks/python/julep/api/types/tools_chosen_function_call.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .tools_function_call_option import ToolsFunctionCallOption + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ToolsChosenFunctionCall(pydantic.BaseModel): + function: ToolsFunctionCallOption = pydantic.Field( + description="The function to call" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_chosen_tool_call.py b/sdks/python/julep/api/types/tools_chosen_tool_call.py new file mode 100644 index 000000000..d15cc12e4 --- /dev/null +++ b/sdks/python/julep/api/types/tools_chosen_tool_call.py @@ -0,0 +1,59 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import typing_extensions + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid +from .tools_chosen_function_call import ToolsChosenFunctionCall +from .tools_function_call_option import ToolsFunctionCallOption + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class Base(pydantic.BaseModel): + function: typing.Optional[ToolsFunctionCallOption] + integration: typing.Any + system: typing.Any + api_call: typing.Any + id: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + +class ToolsChosenToolCall_Function(ToolsChosenFunctionCall, Base): + type: typing_extensions.Literal["function"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +ToolsChosenToolCall = typing.Union[ToolsChosenToolCall_Function] diff --git a/sdks/python/julep/api/types/tools_create_tool_request.py b/sdks/python/julep/api/types/tools_create_tool_request.py new file mode 100644 index 000000000..c6e8fc2f4 --- /dev/null +++ b/sdks/python/julep/api/types/tools_create_tool_request.py @@ -0,0 +1,54 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .tools_function_def import ToolsFunctionDef +from .tools_tool_type import ToolsToolType + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ToolsCreateToolRequest(pydantic.BaseModel): + """ + Payload for creating a tool + """ + + type: ToolsToolType = pydantic.Field( + description="Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)" + ) + background: bool = pydantic.Field( + description="The tool should be run in the background (not supported at the moment)" + ) + interactive: bool = pydantic.Field( + description='Whether the tool that can be run interactively (response should contain "stop" boolean field)' + ) + function: typing.Optional[ToolsFunctionDef] + integration: typing.Optional[typing.Any] + system: typing.Optional[typing.Any] + api_call: typing.Optional[typing.Any] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/named_tool_choice_function.py b/sdks/python/julep/api/types/tools_function_call_option.py similarity index 93% rename from sdks/python/julep/api/types/named_tool_choice_function.py rename to sdks/python/julep/api/types/tools_function_call_option.py index 604446ce9..7944fa8c2 100644 --- a/sdks/python/julep/api/types/named_tool_choice_function.py +++ b/sdks/python/julep/api/types/tools_function_call_option.py @@ -11,8 +11,8 @@ import pydantic # type: ignore -class NamedToolChoiceFunction(pydantic.BaseModel): - name: str = pydantic.Field(description="The name of the function to call.") +class ToolsFunctionCallOption(pydantic.BaseModel): + name: str = pydantic.Field(description="The name of the function") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/named_tool_choice.py b/sdks/python/julep/api/types/tools_function_def.py similarity index 58% rename from sdks/python/julep/api/types/named_tool_choice.py rename to sdks/python/julep/api/types/tools_function_def.py index 3c0d8481b..8b6ac24c9 100644 --- a/sdks/python/julep/api/types/named_tool_choice.py +++ b/sdks/python/julep/api/types/tools_function_def.py @@ -3,10 +3,9 @@ import datetime as dt import typing -import typing_extensions - from ..core.datetime_utils import serialize_datetime -from .named_tool_choice_function import NamedToolChoiceFunction +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_valid_python_identifier import CommonValidPythonIdentifier try: import pydantic.v1 as pydantic # type: ignore @@ -14,15 +13,20 @@ import pydantic # type: ignore -class NamedToolChoice(pydantic.BaseModel): +class ToolsFunctionDef(pydantic.BaseModel): """ - Specifies a tool the model should use. Use to force the model to call a specific function. + Function definition """ - type: typing_extensions.Literal["function"] = pydantic.Field( - description="The type of the tool. Currently, only `function` is supported." + name: typing.Optional[CommonValidPythonIdentifier] = pydantic.Field( + description="DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons." + ) + parameters: typing.Dict[str, typing.Any] = pydantic.Field( + description="The parameters the function accepts" + ) + description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( + description="Description of the function" ) - function: NamedToolChoiceFunction def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/task.py b/sdks/python/julep/api/types/tools_function_def_update.py similarity index 57% rename from sdks/python/julep/api/types/task.py rename to sdks/python/julep/api/types/tools_function_def_update.py index 61dead763..770bafa04 100644 --- a/sdks/python/julep/api/types/task.py +++ b/sdks/python/julep/api/types/tools_function_def_update.py @@ -4,7 +4,8 @@ import typing from ..core.datetime_utils import serialize_datetime -from .workflow_step import WorkflowStep +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_valid_python_identifier import CommonValidPythonIdentifier try: import pydantic.v1 as pydantic # type: ignore @@ -12,28 +13,20 @@ import pydantic # type: ignore -class Task(pydantic.BaseModel): +class ToolsFunctionDefUpdate(pydantic.BaseModel): """ - Describes a Task + Function definition """ - name: str = pydantic.Field(description="Name of the Task") - description: typing.Optional[str] = pydantic.Field( - description="Optional Description of the Task" + name: typing.Optional[CommonValidPythonIdentifier] = pydantic.Field( + description="DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons." ) - tools_available: typing.Optional[typing.List[str]] = pydantic.Field( - description="Available Tools for the Task" + parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( + description="The parameters the function accepts" ) - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="JSON Schema of parameters" + description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( + description="Description of the function" ) - main: typing.List[WorkflowStep] = pydantic.Field( - description="Entrypoint Workflow for the Task" - ) - id: str = pydantic.Field(description="ID of the Task") - created_at: dt.datetime - updated_at: typing.Optional[dt.datetime] - agent_id: str def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/tools_function_tool.py b/sdks/python/julep/api/types/tools_function_tool.py new file mode 100644 index 000000000..93a4e2331 --- /dev/null +++ b/sdks/python/julep/api/types/tools_function_tool.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .tools_function_def import ToolsFunctionDef + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ToolsFunctionTool(pydantic.BaseModel): + background: bool + interactive: bool + function: ToolsFunctionDef = pydantic.Field(description="The function to call") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_tool.py b/sdks/python/julep/api/types/tools_tool.py new file mode 100644 index 000000000..3f90bf959 --- /dev/null +++ b/sdks/python/julep/api/types/tools_tool.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import typing_extensions + +from ..core.datetime_utils import serialize_datetime +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid +from .common_valid_python_identifier import CommonValidPythonIdentifier +from .tools_function_def import ToolsFunctionDef +from .tools_function_tool import ToolsFunctionTool + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class Base(pydantic.BaseModel): + background: bool = pydantic.Field( + description="The tool should be run in the background (not supported at the moment)" + ) + interactive: bool = pydantic.Field( + description='Whether the tool that can be run interactively (response should contain "stop" boolean field)' + ) + function: typing.Optional[ToolsFunctionDef] + integration: typing.Any + system: typing.Any + api_call: typing.Any + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + id: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + +class ToolsTool_Function(ToolsFunctionTool, Base): + type: typing_extensions.Literal["function"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +ToolsTool = typing.Union[ToolsTool_Function] diff --git a/sdks/python/julep/api/types/tools_tool_response.py b/sdks/python/julep/api/types/tools_tool_response.py new file mode 100644 index 000000000..2870953ae --- /dev/null +++ b/sdks/python/julep/api/types/tools_tool_response.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ToolsToolResponse(pydantic.BaseModel): + id: CommonUuid + output: typing.Dict[str, typing.Any] = pydantic.Field( + description="The output of the tool" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_tool_type.py b/sdks/python/julep/api/types/tools_tool_type.py new file mode 100644 index 000000000..639cb1775 --- /dev/null +++ b/sdks/python/julep/api/types/tools_tool_type.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ToolsToolType(str, enum.Enum): + FUNCTION = "function" + INTEGRATION = "integration" + SYSTEM = "system" + API_CALL = "api_call" + + def visit( + self, + function: typing.Callable[[], T_Result], + integration: typing.Callable[[], T_Result], + system: typing.Callable[[], T_Result], + api_call: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ToolsToolType.FUNCTION: + return function() + if self is ToolsToolType.INTEGRATION: + return integration() + if self is ToolsToolType.SYSTEM: + return system() + if self is ToolsToolType.API_CALL: + return api_call() diff --git a/sdks/python/julep/api/types/user.py b/sdks/python/julep/api/types/user.py deleted file mode 100644 index 0dd901d13..000000000 --- a/sdks/python/julep/api/types/user.py +++ /dev/null @@ -1,47 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class User(pydantic.BaseModel): - name: typing.Optional[str] = pydantic.Field(description="Name of the user") - about: typing.Optional[str] = pydantic.Field(description="About the user") - created_at: typing.Optional[dt.datetime] = pydantic.Field( - description="User created at (RFC-3339 format)" - ) - updated_at: typing.Optional[dt.datetime] = pydantic.Field( - description="User updated at (RFC-3339 format)" - ) - id: str = pydantic.Field(description="User id (UUID)") - metadata: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="(Optional) metadata" - ) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/user_docs_route_list_request_direction.py b/sdks/python/julep/api/types/user_docs_route_list_request_direction.py new file mode 100644 index 000000000..3c4fa8ae2 --- /dev/null +++ b/sdks/python/julep/api/types/user_docs_route_list_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class UserDocsRouteListRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is UserDocsRouteListRequestDirection.ASC: + return asc() + if self is UserDocsRouteListRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py b/sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py new file mode 100644 index 000000000..18f659d71 --- /dev/null +++ b/sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class UserDocsRouteListRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is UserDocsRouteListRequestSortBy.CREATED_AT: + return created_at() + if self is UserDocsRouteListRequestSortBy.UPDATED_AT: + return updated_at() + if self is UserDocsRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/evaluate_workflow_step.py b/sdks/python/julep/api/types/user_docs_route_list_response.py similarity index 88% rename from sdks/python/julep/api/types/evaluate_workflow_step.py rename to sdks/python/julep/api/types/user_docs_route_list_response.py index ae354bd06..3760ad130 100644 --- a/sdks/python/julep/api/types/evaluate_workflow_step.py +++ b/sdks/python/julep/api/types/user_docs_route_list_response.py @@ -4,7 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime -from .cel_object import CelObject +from .docs_doc import DocsDoc try: import pydantic.v1 as pydantic # type: ignore @@ -12,8 +12,8 @@ import pydantic # type: ignore -class EvaluateWorkflowStep(pydantic.BaseModel): - evaluate: CelObject +class UserDocsRouteListResponse(pydantic.BaseModel): + results: typing.List[DocsDoc] def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py new file mode 100644 index 000000000..414bb3d0f --- /dev/null +++ b/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class UserDocsSearchRouteSearchRequestDirection(str, enum.Enum): + ASC = "asc" + DESC = "desc" + + def visit( + self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] + ) -> T_Result: + if self is UserDocsSearchRouteSearchRequestDirection.ASC: + return asc() + if self is UserDocsSearchRouteSearchRequestDirection.DESC: + return desc() diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py new file mode 100644 index 000000000..2d42b02bd --- /dev/null +++ b/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class UserDocsSearchRouteSearchRequestSortBy(str, enum.Enum): + CREATED_AT = "created_at" + UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" + + def visit( + self, + created_at: typing.Callable[[], T_Result], + updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], + ) -> T_Result: + if self is UserDocsSearchRouteSearchRequestSortBy.CREATED_AT: + return created_at() + if self is UserDocsSearchRouteSearchRequestSortBy.UPDATED_AT: + return updated_at() + if self is UserDocsSearchRouteSearchRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_response.py b/sdks/python/julep/api/types/user_docs_search_route_search_response.py new file mode 100644 index 000000000..bc43c1139 --- /dev/null +++ b/sdks/python/julep/api/types/user_docs_search_route_search_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .docs_doc_reference import DocsDocReference + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UserDocsSearchRouteSearchResponse(pydantic.BaseModel): + results: typing.List[DocsDocReference] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_create_or_update_response.py b/sdks/python/julep/api/types/users_route_create_or_update_response.py new file mode 100644 index 000000000..4cde96361 --- /dev/null +++ b/sdks/python/julep/api/types/users_route_create_or_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UsersRouteCreateOrUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_create_response.py b/sdks/python/julep/api/types/users_route_create_response.py new file mode 100644 index 000000000..5d569b66a --- /dev/null +++ b/sdks/python/julep/api/types/users_route_create_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UsersRouteCreateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of created undefined") + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_delete_response.py b/sdks/python/julep/api/types/users_route_delete_response.py new file mode 100644 index 000000000..f1a06fe55 --- /dev/null +++ b/sdks/python/julep/api/types/users_route_delete_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UsersRouteDeleteResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of deleted undefined") + deleted_at: dt.datetime = pydantic.Field( + description="When this resource was deleted as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/get_user_docs_request_order.py b/sdks/python/julep/api/types/users_route_list_request_direction.py similarity index 67% rename from sdks/python/julep/api/types/get_user_docs_request_order.py rename to sdks/python/julep/api/types/users_route_list_request_direction.py index 4c2f19bec..876e3e297 100644 --- a/sdks/python/julep/api/types/get_user_docs_request_order.py +++ b/sdks/python/julep/api/types/users_route_list_request_direction.py @@ -6,14 +6,14 @@ T_Result = typing.TypeVar("T_Result") -class GetUserDocsRequestOrder(str, enum.Enum): +class UsersRouteListRequestDirection(str, enum.Enum): ASC = "asc" DESC = "desc" def visit( self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] ) -> T_Result: - if self is GetUserDocsRequestOrder.ASC: + if self is UsersRouteListRequestDirection.ASC: return asc() - if self is GetUserDocsRequestOrder.DESC: + if self is UsersRouteListRequestDirection.DESC: return desc() diff --git a/sdks/python/julep/api/types/list_agents_request_sort_by.py b/sdks/python/julep/api/types/users_route_list_request_sort_by.py similarity index 54% rename from sdks/python/julep/api/types/list_agents_request_sort_by.py rename to sdks/python/julep/api/types/users_route_list_request_sort_by.py index d781f81f6..bfab3f205 100644 --- a/sdks/python/julep/api/types/list_agents_request_sort_by.py +++ b/sdks/python/julep/api/types/users_route_list_request_sort_by.py @@ -6,16 +6,20 @@ T_Result = typing.TypeVar("T_Result") -class ListAgentsRequestSortBy(str, enum.Enum): +class UsersRouteListRequestSortBy(str, enum.Enum): CREATED_AT = "created_at" UPDATED_AT = "updated_at" + DELETED_AT = "deleted_at" def visit( self, created_at: typing.Callable[[], T_Result], updated_at: typing.Callable[[], T_Result], + deleted_at: typing.Callable[[], T_Result], ) -> T_Result: - if self is ListAgentsRequestSortBy.CREATED_AT: + if self is UsersRouteListRequestSortBy.CREATED_AT: return created_at() - if self is ListAgentsRequestSortBy.UPDATED_AT: + if self is UsersRouteListRequestSortBy.UPDATED_AT: return updated_at() + if self is UsersRouteListRequestSortBy.DELETED_AT: + return deleted_at() diff --git a/sdks/python/julep/api/types/users_route_list_response.py b/sdks/python/julep/api/types/users_route_list_response.py new file mode 100644 index 000000000..d2d358a2a --- /dev/null +++ b/sdks/python/julep/api/types/users_route_list_response.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .users_user import UsersUser + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UsersRouteListResponse(pydantic.BaseModel): + results: typing.List[UsersUser] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_patch_response.py b/sdks/python/julep/api/types/users_route_patch_response.py new file mode 100644 index 000000000..05a16bb93 --- /dev/null +++ b/sdks/python/julep/api/types/users_route_patch_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UsersRoutePatchResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_update_response.py b/sdks/python/julep/api/types/users_route_update_response.py new file mode 100644 index 000000000..eab11cc37 --- /dev/null +++ b/sdks/python/julep/api/types/users_route_update_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UsersRouteUpdateResponse(pydantic.BaseModel): + id: CommonUuid = pydantic.Field(description="ID of updated undefined") + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + jobs: typing.List[CommonUuid] = pydantic.Field( + description="IDs (if any) of jobs created as part of this request" + ) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_user.py b/sdks/python/julep/api/types/users_user.py new file mode 100644 index 000000000..0d4513399 --- /dev/null +++ b/sdks/python/julep/api/types/users_user.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class UsersUser(pydantic.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] + created_at: dt.datetime = pydantic.Field( + description="When this resource was created as UTC date-time" + ) + updated_at: dt.datetime = pydantic.Field( + description="When this resource was updated as UTC date-time" + ) + name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the user") + about: str = pydantic.Field(description="About the user") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/workflow_step.py b/sdks/python/julep/api/types/workflow_step.py deleted file mode 100644 index d5a5c3a92..000000000 --- a/sdks/python/julep/api/types/workflow_step.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .cel_object import CelObject -from .chat_ml_image_content_part import ChatMlImageContentPart -from .chat_ml_image_content_part_image_url import ChatMlImageContentPartImageUrl -from .chat_ml_image_content_part_image_url_detail import ( - ChatMlImageContentPartImageUrlDetail, -) -from .chat_ml_text_content_part import ChatMlTextContentPart -from .chat_settings import ChatSettings -from .chat_settings_preset import ChatSettingsPreset -from .chat_settings_response_format import ChatSettingsResponseFormat -from .chat_settings_response_format_schema import ChatSettingsResponseFormatSchema -from .chat_settings_response_format_type import ChatSettingsResponseFormatType -from .chat_settings_stop import ChatSettingsStop -from .error_workflow_step import ErrorWorkflowStep -from .evaluate_workflow_step import EvaluateWorkflowStep -from .if_else_workflow_step import IfElseWorkflowStep -from .input_chat_ml_message import InputChatMlMessage -from .input_chat_ml_message_content import InputChatMlMessageContent -from .input_chat_ml_message_content_item import InputChatMlMessageContentItem -from .input_chat_ml_message_role import InputChatMlMessageRole -from .prompt_workflow_step import PromptWorkflowStep -from .tool_call_workflow_step import ToolCallWorkflowStep -from .yield_workflow_step import YieldWorkflowStep - -WorkflowStep = typing.Union[ - PromptWorkflowStep, - EvaluateWorkflowStep, - YieldWorkflowStep, - ToolCallWorkflowStep, - ErrorWorkflowStep, - IfElseWorkflowStep, -] diff --git a/sdks/python/julep/api/types/yield_workflow_step.py b/sdks/python/julep/api/types/yield_workflow_step.py deleted file mode 100644 index 08debe097..000000000 --- a/sdks/python/julep/api/types/yield_workflow_step.py +++ /dev/null @@ -1,38 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from .cel_object import CelObject - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class YieldWorkflowStep(pydantic.BaseModel): - workflow: str - arguments: CelObject - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().dict(**kwargs_with_defaults) - - class Config: - frozen = True - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index 3dfa8a344..d87067268 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -301,13 +301,13 @@ css = ["tinycss2 (>=1.1.0,<1.3)"] [[package]] name = "certifi" -version = "2024.6.2" +version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, - {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, + {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, + {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, ] [[package]] @@ -577,33 +577,33 @@ develop = ["coverage", "invoke", "path.py", "pylint", "pytest (>=3.2)", "pytest- [[package]] name = "debugpy" -version = "1.8.1" +version = "1.8.2" description = "An implementation of the Debug Adapter Protocol for Python" optional = false python-versions = ">=3.8" files = [ - {file = "debugpy-1.8.1-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:3bda0f1e943d386cc7a0e71bfa59f4137909e2ed947fb3946c506e113000f741"}, - {file = "debugpy-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dda73bf69ea479c8577a0448f8c707691152e6c4de7f0c4dec5a4bc11dee516e"}, - {file = "debugpy-1.8.1-cp310-cp310-win32.whl", hash = "sha256:3a79c6f62adef994b2dbe9fc2cc9cc3864a23575b6e387339ab739873bea53d0"}, - {file = "debugpy-1.8.1-cp310-cp310-win_amd64.whl", hash = "sha256:7eb7bd2b56ea3bedb009616d9e2f64aab8fc7000d481faec3cd26c98a964bcdd"}, - {file = "debugpy-1.8.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:016a9fcfc2c6b57f939673c874310d8581d51a0fe0858e7fac4e240c5eb743cb"}, - {file = "debugpy-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd97ed11a4c7f6d042d320ce03d83b20c3fb40da892f994bc041bbc415d7a099"}, - {file = "debugpy-1.8.1-cp311-cp311-win32.whl", hash = "sha256:0de56aba8249c28a300bdb0672a9b94785074eb82eb672db66c8144fff673146"}, - {file = "debugpy-1.8.1-cp311-cp311-win_amd64.whl", hash = "sha256:1a9fe0829c2b854757b4fd0a338d93bc17249a3bf69ecf765c61d4c522bb92a8"}, - {file = "debugpy-1.8.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3ebb70ba1a6524d19fa7bb122f44b74170c447d5746a503e36adc244a20ac539"}, - {file = "debugpy-1.8.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a2e658a9630f27534e63922ebf655a6ab60c370f4d2fc5c02a5b19baf4410ace"}, - {file = "debugpy-1.8.1-cp312-cp312-win32.whl", hash = "sha256:caad2846e21188797a1f17fc09c31b84c7c3c23baf2516fed5b40b378515bbf0"}, - {file = "debugpy-1.8.1-cp312-cp312-win_amd64.whl", hash = "sha256:edcc9f58ec0fd121a25bc950d4578df47428d72e1a0d66c07403b04eb93bcf98"}, - {file = "debugpy-1.8.1-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:7a3afa222f6fd3d9dfecd52729bc2e12c93e22a7491405a0ecbf9e1d32d45b39"}, - {file = "debugpy-1.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d915a18f0597ef685e88bb35e5d7ab968964b7befefe1aaea1eb5b2640b586c7"}, - {file = "debugpy-1.8.1-cp38-cp38-win32.whl", hash = "sha256:92116039b5500633cc8d44ecc187abe2dfa9b90f7a82bbf81d079fcdd506bae9"}, - {file = "debugpy-1.8.1-cp38-cp38-win_amd64.whl", hash = "sha256:e38beb7992b5afd9d5244e96ad5fa9135e94993b0c551ceebf3fe1a5d9beb234"}, - {file = "debugpy-1.8.1-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:bfb20cb57486c8e4793d41996652e5a6a885b4d9175dd369045dad59eaacea42"}, - {file = "debugpy-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efd3fdd3f67a7e576dd869c184c5dd71d9aaa36ded271939da352880c012e703"}, - {file = "debugpy-1.8.1-cp39-cp39-win32.whl", hash = "sha256:58911e8521ca0c785ac7a0539f1e77e0ce2df753f786188f382229278b4cdf23"}, - {file = "debugpy-1.8.1-cp39-cp39-win_amd64.whl", hash = "sha256:6df9aa9599eb05ca179fb0b810282255202a66835c6efb1d112d21ecb830ddd3"}, - {file = "debugpy-1.8.1-py2.py3-none-any.whl", hash = "sha256:28acbe2241222b87e255260c76741e1fbf04fdc3b6d094fcf57b6c6f75ce1242"}, - {file = "debugpy-1.8.1.zip", hash = "sha256:f696d6be15be87aef621917585f9bb94b1dc9e8aced570db1b8a6fc14e8f9b42"}, + {file = "debugpy-1.8.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:7ee2e1afbf44b138c005e4380097d92532e1001580853a7cb40ed84e0ef1c3d2"}, + {file = "debugpy-1.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f8c3f7c53130a070f0fc845a0f2cee8ed88d220d6b04595897b66605df1edd6"}, + {file = "debugpy-1.8.2-cp310-cp310-win32.whl", hash = "sha256:f179af1e1bd4c88b0b9f0fa153569b24f6b6f3de33f94703336363ae62f4bf47"}, + {file = "debugpy-1.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:0600faef1d0b8d0e85c816b8bb0cb90ed94fc611f308d5fde28cb8b3d2ff0fe3"}, + {file = "debugpy-1.8.2-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:8a13417ccd5978a642e91fb79b871baded925d4fadd4dfafec1928196292aa0a"}, + {file = "debugpy-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acdf39855f65c48ac9667b2801234fc64d46778021efac2de7e50907ab90c634"}, + {file = "debugpy-1.8.2-cp311-cp311-win32.whl", hash = "sha256:2cbd4d9a2fc5e7f583ff9bf11f3b7d78dfda8401e8bb6856ad1ed190be4281ad"}, + {file = "debugpy-1.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:d3408fddd76414034c02880e891ea434e9a9cf3a69842098ef92f6e809d09afa"}, + {file = "debugpy-1.8.2-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:5d3ccd39e4021f2eb86b8d748a96c766058b39443c1f18b2dc52c10ac2757835"}, + {file = "debugpy-1.8.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62658aefe289598680193ff655ff3940e2a601765259b123dc7f89c0239b8cd3"}, + {file = "debugpy-1.8.2-cp312-cp312-win32.whl", hash = "sha256:bd11fe35d6fd3431f1546d94121322c0ac572e1bfb1f6be0e9b8655fb4ea941e"}, + {file = "debugpy-1.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:15bc2f4b0f5e99bf86c162c91a74c0631dbd9cef3c6a1d1329c946586255e859"}, + {file = "debugpy-1.8.2-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:5a019d4574afedc6ead1daa22736c530712465c0c4cd44f820d803d937531b2d"}, + {file = "debugpy-1.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40f062d6877d2e45b112c0bbade9a17aac507445fd638922b1a5434df34aed02"}, + {file = "debugpy-1.8.2-cp38-cp38-win32.whl", hash = "sha256:c78ba1680f1015c0ca7115671fe347b28b446081dada3fedf54138f44e4ba031"}, + {file = "debugpy-1.8.2-cp38-cp38-win_amd64.whl", hash = "sha256:cf327316ae0c0e7dd81eb92d24ba8b5e88bb4d1b585b5c0d32929274a66a5210"}, + {file = "debugpy-1.8.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:1523bc551e28e15147815d1397afc150ac99dbd3a8e64641d53425dba57b0ff9"}, + {file = "debugpy-1.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e24ccb0cd6f8bfaec68d577cb49e9c680621c336f347479b3fce060ba7c09ec1"}, + {file = "debugpy-1.8.2-cp39-cp39-win32.whl", hash = "sha256:7f8d57a98c5a486c5c7824bc0b9f2f11189d08d73635c326abef268f83950326"}, + {file = "debugpy-1.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:16c8dcab02617b75697a0a925a62943e26a0330da076e2a10437edd9f0bf3755"}, + {file = "debugpy-1.8.2-py2.py3-none-any.whl", hash = "sha256:16e16df3a98a35c63c3ab1e4d19be4cbc7fdda92d9ddc059294f18910928e0ca"}, + {file = "debugpy-1.8.2.zip", hash = "sha256:95378ed08ed2089221896b9b3a8d021e642c24edc8fef20e5d4342ca8be65c00"}, ] [[package]] @@ -662,13 +662,13 @@ tests = ["environs[django]", "pytest"] [[package]] name = "exceptiongroup" -version = "1.2.1" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, - {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -814,13 +814,13 @@ networkx = ">=2" [[package]] name = "importlib-metadata" -version = "7.2.0" +version = "8.0.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-7.2.0-py3-none-any.whl", hash = "sha256:04e4aad329b8b948a5711d394fa8759cb80f009225441b4f2a02bd4d8e5f426c"}, - {file = "importlib_metadata-7.2.0.tar.gz", hash = "sha256:3ff4519071ed42740522d494d04819b666541b9752c43012f85afb2cc220fcc6"}, + {file = "importlib_metadata-8.0.0-py3-none-any.whl", hash = "sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f"}, + {file = "importlib_metadata-8.0.0.tar.gz", hash = "sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812"}, ] [package.dependencies] @@ -851,13 +851,13 @@ testing = ["jaraco.test (>=5.4)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "p [[package]] name = "ipykernel" -version = "6.29.4" +version = "6.29.5" description = "IPython Kernel for Jupyter" optional = false python-versions = ">=3.8" files = [ - {file = "ipykernel-6.29.4-py3-none-any.whl", hash = "sha256:1181e653d95c6808039c509ef8e67c4126b3b3af7781496c7cbfb5ed938a27da"}, - {file = "ipykernel-6.29.4.tar.gz", hash = "sha256:3d44070060f9475ac2092b760123fadf105d2e2493c24848b6691a7c4f42af5c"}, + {file = "ipykernel-6.29.5-py3-none-any.whl", hash = "sha256:afdb66ba5aa354b09b91379bac28ae4afebbb30e8b39510c9690afb7a10421b5"}, + {file = "ipykernel-6.29.5.tar.gz", hash = "sha256:f093a22c4a40f8828f8e330a9c297cb93dcab13bd9678ded6de8e5cf81c56215"}, ] [package.dependencies] @@ -995,13 +995,13 @@ files = [ [[package]] name = "jsonschema" -version = "4.22.0" +version = "4.23.0" description = "An implementation of JSON Schema validation for Python" optional = false python-versions = ">=3.8" files = [ - {file = "jsonschema-4.22.0-py3-none-any.whl", hash = "sha256:ff4cfd6b1367a40e7bc6411caec72effadd3db0bbe5017de188f2d6108335802"}, - {file = "jsonschema-4.22.0.tar.gz", hash = "sha256:5b22d434a45935119af990552c862e5d6d564e8f6601206b305a61fdf661a2b7"}, + {file = "jsonschema-4.23.0-py3-none-any.whl", hash = "sha256:fbadb6f8b144a8f8cf9f0b89ba94501d143e50411a1278633f56a7acf7fd5566"}, + {file = "jsonschema-4.23.0.tar.gz", hash = "sha256:d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4"}, ] [package.dependencies] @@ -1016,11 +1016,11 @@ rfc3339-validator = {version = "*", optional = true, markers = "extra == \"forma rfc3986-validator = {version = ">0.1.0", optional = true, markers = "extra == \"format-nongpl\""} rpds-py = ">=0.7.1" uri-template = {version = "*", optional = true, markers = "extra == \"format-nongpl\""} -webcolors = {version = ">=1.11", optional = true, markers = "extra == \"format-nongpl\""} +webcolors = {version = ">=24.6.0", optional = true, markers = "extra == \"format-nongpl\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] -format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] +format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=24.6.0)"] [[package]] name = "jsonschema-specifications" @@ -1121,13 +1121,13 @@ jupyter-server = ">=1.1.2" [[package]] name = "jupyter-server" -version = "2.14.1" +version = "2.14.2" description = "The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications." optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_server-2.14.1-py3-none-any.whl", hash = "sha256:16f7177c3a4ea8fe37784e2d31271981a812f0b2874af17339031dc3510cc2a5"}, - {file = "jupyter_server-2.14.1.tar.gz", hash = "sha256:12558d158ec7a0653bf96cc272bc7ad79e0127d503b982ed144399346694f726"}, + {file = "jupyter_server-2.14.2-py3-none-any.whl", hash = "sha256:47ff506127c2f7851a17bf4713434208fc490955d0e8632e95014a9a9afbeefd"}, + {file = "jupyter_server-2.14.2.tar.gz", hash = "sha256:66095021aa9638ced276c248b1d81862e4c50f292d575920bbe960de1c56b12b"}, ] [package.dependencies] @@ -1176,13 +1176,13 @@ test = ["jupyter-server (>=2.0.0)", "pytest (>=7.0)", "pytest-jupyter[server] (> [[package]] name = "jupyterlab" -version = "4.2.2" +version = "4.2.3" description = "JupyterLab computational environment" optional = false python-versions = ">=3.8" files = [ - {file = "jupyterlab-4.2.2-py3-none-any.whl", hash = "sha256:59ee9b839f43308c3dfd55d72d1f1a299ed42a7f91f2d1afe9c12a783f9e525f"}, - {file = "jupyterlab-4.2.2.tar.gz", hash = "sha256:a534b6a25719a92a40d514fb133a9fe8f0d9981b0bbce5d8a5fcaa33344a3038"}, + {file = "jupyterlab-4.2.3-py3-none-any.whl", hash = "sha256:0b59d11808e84bb84105c73364edfa867dd475492429ab34ea388a52f2e2e596"}, + {file = "jupyterlab-4.2.3.tar.gz", hash = "sha256:df6e46969ea51d66815167f23d92f105423b7f1f06fa604d4f44aeb018c82c7b"}, ] [package.dependencies] @@ -1666,13 +1666,13 @@ files = [ [[package]] name = "openai" -version = "1.35.3" +version = "1.35.13" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.35.3-py3-none-any.whl", hash = "sha256:7b26544cef80f125431c073ffab3811d2421fbb9e30d3bd5c2436aba00b042d5"}, - {file = "openai-1.35.3.tar.gz", hash = "sha256:d6177087f150b381d49499be782d764213fdf638d391b29ca692b84dd675a389"}, + {file = "openai-1.35.13-py3-none-any.whl", hash = "sha256:36ec3e93e0d1f243f69be85c89b9221a471c3e450dfd9df16c9829e3cdf63e60"}, + {file = "openai-1.35.13.tar.gz", hash = "sha256:c684f3945608baf7d2dcc0ef3ee6f3e27e4c66f21076df0b47be45d57e6ae6e4"}, ] [package.dependencies] @@ -1749,9 +1749,9 @@ files = [ [package.dependencies] numpy = [ + {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, {version = ">=1.22.4", markers = "python_version < \"3.11\""}, {version = ">=1.23.2", markers = "python_version == \"3.11\""}, - {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" @@ -1857,13 +1857,13 @@ files = [ [[package]] name = "pip" -version = "24.1" +version = "24.1.2" description = "The PyPA recommended tool for installing Python packages." optional = false python-versions = ">=3.8" files = [ - {file = "pip-24.1-py3-none-any.whl", hash = "sha256:a775837439bf5da2c1a0c2fa43d5744854497c689ddbd9344cf3ea6d00598540"}, - {file = "pip-24.1.tar.gz", hash = "sha256:bdae551038c0ce6a83030b4aedef27fc95f0daa683593fea22fa05e55ed8e317"}, + {file = "pip-24.1.2-py3-none-any.whl", hash = "sha256:7cd207eed4c60b0f411b444cd1464198fe186671c323b6cd6d433ed80fc9d247"}, + {file = "pip-24.1.2.tar.gz", hash = "sha256:e5458a0b89f2755e0ee8c0c77613fe5273e05f337907874d64f13171a898a7ff"}, ] [[package]] @@ -2010,13 +2010,13 @@ tests = ["pytest"] [[package]] name = "pycnite" -version = "2024.6.13" +version = "2024.7.9" description = "Python bytecode utilities" optional = false python-versions = ">=3.8" files = [ - {file = "pycnite-2024.6.13-py3-none-any.whl", hash = "sha256:7346099b2313894db65ffca177f9e6eb3251fdfedb019eb6da02822c2ff8c1e1"}, - {file = "pycnite-2024.6.13.tar.gz", hash = "sha256:301c5d7e2e2f61e5535d0af7c4486f3ea4f5083c4808a7645a55ddb45cb25027"}, + {file = "pycnite-2024.7.9-py3-none-any.whl", hash = "sha256:aece401e70e8b6bf369b3b33867c79a1b8bf584e68da9790de2f821503cebcf8"}, + {file = "pycnite-2024.7.9.tar.gz", hash = "sha256:f07bea393ee4d5820013fae66db6cc091e8dc01fd3f6b367595108752f264872"}, ] [[package]] @@ -2053,109 +2053,122 @@ files = [ [[package]] name = "pydantic" -version = "2.7.4" +version = "2.8.2" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.7.4-py3-none-any.whl", hash = "sha256:ee8538d41ccb9c0a9ad3e0e5f07bf15ed8015b481ced539a1759d8cc89ae90d0"}, - {file = "pydantic-2.7.4.tar.gz", hash = "sha256:0c84efd9548d545f63ac0060c1e4d39bb9b14db8b3c0652338aecc07b5adec52"}, + {file = "pydantic-2.8.2-py3-none-any.whl", hash = "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8"}, + {file = "pydantic-2.8.2.tar.gz", hash = "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.18.4" -typing-extensions = ">=4.6.1" +pydantic-core = "2.20.1" +typing-extensions = [ + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, +] [package.extras] email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.18.4" +version = "2.20.1" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.18.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:f76d0ad001edd426b92233d45c746fd08f467d56100fd8f30e9ace4b005266e4"}, - {file = "pydantic_core-2.18.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:59ff3e89f4eaf14050c8022011862df275b552caef8082e37b542b066ce1ff26"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a55b5b16c839df1070bc113c1f7f94a0af4433fcfa1b41799ce7606e5c79ce0a"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4d0dcc59664fcb8974b356fe0a18a672d6d7cf9f54746c05f43275fc48636851"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8951eee36c57cd128f779e641e21eb40bc5073eb28b2d23f33eb0ef14ffb3f5d"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4701b19f7e3a06ea655513f7938de6f108123bf7c86bbebb1196eb9bd35cf724"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e00a3f196329e08e43d99b79b286d60ce46bed10f2280d25a1718399457e06be"}, - {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:97736815b9cc893b2b7f663628e63f436018b75f44854c8027040e05230eeddb"}, - {file = "pydantic_core-2.18.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6891a2ae0e8692679c07728819b6e2b822fb30ca7445f67bbf6509b25a96332c"}, - {file = "pydantic_core-2.18.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bc4ff9805858bd54d1a20efff925ccd89c9d2e7cf4986144b30802bf78091c3e"}, - {file = "pydantic_core-2.18.4-cp310-none-win32.whl", hash = "sha256:1b4de2e51bbcb61fdebd0ab86ef28062704f62c82bbf4addc4e37fa4b00b7cbc"}, - {file = "pydantic_core-2.18.4-cp310-none-win_amd64.whl", hash = "sha256:6a750aec7bf431517a9fd78cb93c97b9b0c496090fee84a47a0d23668976b4b0"}, - {file = "pydantic_core-2.18.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:942ba11e7dfb66dc70f9ae66b33452f51ac7bb90676da39a7345e99ffb55402d"}, - {file = "pydantic_core-2.18.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b2ebef0e0b4454320274f5e83a41844c63438fdc874ea40a8b5b4ecb7693f1c4"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a642295cd0c8df1b86fc3dced1d067874c353a188dc8e0f744626d49e9aa51c4"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f09baa656c904807e832cf9cce799c6460c450c4ad80803517032da0cd062e2"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:98906207f29bc2c459ff64fa007afd10a8c8ac080f7e4d5beff4c97086a3dabd"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:19894b95aacfa98e7cb093cd7881a0c76f55731efad31073db4521e2b6ff5b7d"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fbbdc827fe5e42e4d196c746b890b3d72876bdbf160b0eafe9f0334525119c8"}, - {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f85d05aa0918283cf29a30b547b4df2fbb56b45b135f9e35b6807cb28bc47951"}, - {file = "pydantic_core-2.18.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e85637bc8fe81ddb73fda9e56bab24560bdddfa98aa64f87aaa4e4b6730c23d2"}, - {file = "pydantic_core-2.18.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2f5966897e5461f818e136b8451d0551a2e77259eb0f73a837027b47dc95dab9"}, - {file = "pydantic_core-2.18.4-cp311-none-win32.whl", hash = "sha256:44c7486a4228413c317952e9d89598bcdfb06399735e49e0f8df643e1ccd0558"}, - {file = "pydantic_core-2.18.4-cp311-none-win_amd64.whl", hash = "sha256:8a7164fe2005d03c64fd3b85649891cd4953a8de53107940bf272500ba8a788b"}, - {file = "pydantic_core-2.18.4-cp311-none-win_arm64.whl", hash = "sha256:4e99bc050fe65c450344421017f98298a97cefc18c53bb2f7b3531eb39bc7805"}, - {file = "pydantic_core-2.18.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6f5c4d41b2771c730ea1c34e458e781b18cc668d194958e0112455fff4e402b2"}, - {file = "pydantic_core-2.18.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2fdf2156aa3d017fddf8aea5adfba9f777db1d6022d392b682d2a8329e087cef"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4748321b5078216070b151d5271ef3e7cc905ab170bbfd27d5c83ee3ec436695"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:847a35c4d58721c5dc3dba599878ebbdfd96784f3fb8bb2c356e123bdcd73f34"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c40d4eaad41f78e3bbda31b89edc46a3f3dc6e171bf0ecf097ff7a0ffff7cb1"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:21a5e440dbe315ab9825fcd459b8814bb92b27c974cbc23c3e8baa2b76890077"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01dd777215e2aa86dfd664daed5957704b769e726626393438f9c87690ce78c3"}, - {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4b06beb3b3f1479d32befd1f3079cc47b34fa2da62457cdf6c963393340b56e9"}, - {file = "pydantic_core-2.18.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:564d7922e4b13a16b98772441879fcdcbe82ff50daa622d681dd682175ea918c"}, - {file = "pydantic_core-2.18.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0eb2a4f660fcd8e2b1c90ad566db2b98d7f3f4717c64fe0a83e0adb39766d5b8"}, - {file = "pydantic_core-2.18.4-cp312-none-win32.whl", hash = "sha256:8b8bab4c97248095ae0c4455b5a1cd1cdd96e4e4769306ab19dda135ea4cdb07"}, - {file = "pydantic_core-2.18.4-cp312-none-win_amd64.whl", hash = "sha256:14601cdb733d741b8958224030e2bfe21a4a881fb3dd6fbb21f071cabd48fa0a"}, - {file = "pydantic_core-2.18.4-cp312-none-win_arm64.whl", hash = "sha256:c1322d7dd74713dcc157a2b7898a564ab091ca6c58302d5c7b4c07296e3fd00f"}, - {file = "pydantic_core-2.18.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:823be1deb01793da05ecb0484d6c9e20baebb39bd42b5d72636ae9cf8350dbd2"}, - {file = "pydantic_core-2.18.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ebef0dd9bf9b812bf75bda96743f2a6c5734a02092ae7f721c048d156d5fabae"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ae1d6df168efb88d7d522664693607b80b4080be6750c913eefb77e34c12c71a"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f9899c94762343f2cc2fc64c13e7cae4c3cc65cdfc87dd810a31654c9b7358cc"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99457f184ad90235cfe8461c4d70ab7dd2680e28821c29eca00252ba90308c78"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18f469a3d2a2fdafe99296a87e8a4c37748b5080a26b806a707f25a902c040a8"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b7cdf28938ac6b8b49ae5e92f2735056a7ba99c9b110a474473fd71185c1af5d"}, - {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:938cb21650855054dc54dfd9120a851c974f95450f00683399006aa6e8abb057"}, - {file = "pydantic_core-2.18.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:44cd83ab6a51da80fb5adbd9560e26018e2ac7826f9626bc06ca3dc074cd198b"}, - {file = "pydantic_core-2.18.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:972658f4a72d02b8abfa2581d92d59f59897d2e9f7e708fdabe922f9087773af"}, - {file = "pydantic_core-2.18.4-cp38-none-win32.whl", hash = "sha256:1d886dc848e60cb7666f771e406acae54ab279b9f1e4143babc9c2258213daa2"}, - {file = "pydantic_core-2.18.4-cp38-none-win_amd64.whl", hash = "sha256:bb4462bd43c2460774914b8525f79b00f8f407c945d50881568f294c1d9b4443"}, - {file = "pydantic_core-2.18.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:44a688331d4a4e2129140a8118479443bd6f1905231138971372fcde37e43528"}, - {file = "pydantic_core-2.18.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a2fdd81edd64342c85ac7cf2753ccae0b79bf2dfa063785503cb85a7d3593223"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:86110d7e1907ab36691f80b33eb2da87d780f4739ae773e5fc83fb272f88825f"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:46387e38bd641b3ee5ce247563b60c5ca098da9c56c75c157a05eaa0933ed154"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:123c3cec203e3f5ac7b000bd82235f1a3eced8665b63d18be751f115588fea30"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dc1803ac5c32ec324c5261c7209e8f8ce88e83254c4e1aebdc8b0a39f9ddb443"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53db086f9f6ab2b4061958d9c276d1dbe3690e8dd727d6abf2321d6cce37fa94"}, - {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:abc267fa9837245cc28ea6929f19fa335f3dc330a35d2e45509b6566dc18be23"}, - {file = "pydantic_core-2.18.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a0d829524aaefdebccb869eed855e2d04c21d2d7479b6cada7ace5448416597b"}, - {file = "pydantic_core-2.18.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:509daade3b8649f80d4e5ff21aa5673e4ebe58590b25fe42fac5f0f52c6f034a"}, - {file = "pydantic_core-2.18.4-cp39-none-win32.whl", hash = "sha256:ca26a1e73c48cfc54c4a76ff78df3727b9d9f4ccc8dbee4ae3f73306a591676d"}, - {file = "pydantic_core-2.18.4-cp39-none-win_amd64.whl", hash = "sha256:c67598100338d5d985db1b3d21f3619ef392e185e71b8d52bceacc4a7771ea7e"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:574d92eac874f7f4db0ca653514d823a0d22e2354359d0759e3f6a406db5d55d"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1f4d26ceb5eb9eed4af91bebeae4b06c3fb28966ca3a8fb765208cf6b51102ab"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77450e6d20016ec41f43ca4a6c63e9fdde03f0ae3fe90e7c27bdbeaece8b1ed4"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d323a01da91851a4f17bf592faf46149c9169d68430b3146dcba2bb5e5719abc"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:43d447dd2ae072a0065389092a231283f62d960030ecd27565672bd40746c507"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:578e24f761f3b425834f297b9935e1ce2e30f51400964ce4801002435a1b41ef"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:81b5efb2f126454586d0f40c4d834010979cb80785173d1586df845a632e4e6d"}, - {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ab86ce7c8f9bea87b9d12c7f0af71102acbf5ecbc66c17796cff45dae54ef9a5"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:90afc12421df2b1b4dcc975f814e21bc1754640d502a2fbcc6d41e77af5ec312"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:51991a89639a912c17bef4b45c87bd83593aee0437d8102556af4885811d59f5"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:293afe532740370aba8c060882f7d26cfd00c94cae32fd2e212a3a6e3b7bc15e"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b48ece5bde2e768197a2d0f6e925f9d7e3e826f0ad2271120f8144a9db18d5c8"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:eae237477a873ab46e8dd748e515c72c0c804fb380fbe6c85533c7de51f23a8f"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:834b5230b5dfc0c1ec37b2fda433b271cbbc0e507560b5d1588e2cc1148cf1ce"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e858ac0a25074ba4bce653f9b5d0a85b7456eaddadc0ce82d3878c22489fa4ee"}, - {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2fd41f6eff4c20778d717af1cc50eca52f5afe7805ee530a4fbd0bae284f16e9"}, - {file = "pydantic_core-2.18.4.tar.gz", hash = "sha256:ec3beeada09ff865c344ff3bc2f427f5e6c26401cc6113d77e372c3fdac73864"}, + {file = "pydantic_core-2.20.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3"}, + {file = "pydantic_core-2.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f239eb799a2081495ea659d8d4a43a8f42cd1fe9ff2e7e436295c38a10c286a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53e431da3fc53360db73eedf6f7124d1076e1b4ee4276b36fb25514544ceb4a3"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1f62b2413c3a0e846c3b838b2ecd6c7a19ec6793b2a522745b0869e37ab5bc1"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5d41e6daee2813ecceea8eda38062d69e280b39df793f5a942fa515b8ed67953"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d482efec8b7dc6bfaedc0f166b2ce349df0011f5d2f1f25537ced4cfc34fd98"}, + {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e93e1a4b4b33daed65d781a57a522ff153dcf748dee70b40c7258c5861e1768a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e7c4ea22b6739b162c9ecaaa41d718dfad48a244909fe7ef4b54c0b530effc5a"}, + {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4f2790949cf385d985a31984907fecb3896999329103df4e4983a4a41e13e840"}, + {file = "pydantic_core-2.20.1-cp310-none-win32.whl", hash = "sha256:5e999ba8dd90e93d57410c5e67ebb67ffcaadcea0ad973240fdfd3a135506250"}, + {file = "pydantic_core-2.20.1-cp310-none-win_amd64.whl", hash = "sha256:512ecfbefef6dac7bc5eaaf46177b2de58cdf7acac8793fe033b24ece0b9566c"}, + {file = "pydantic_core-2.20.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:d2a8fa9d6d6f891f3deec72f5cc668e6f66b188ab14bb1ab52422fe8e644f312"}, + {file = "pydantic_core-2.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:175873691124f3d0da55aeea1d90660a6ea7a3cfea137c38afa0a5ffabe37b88"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37eee5b638f0e0dcd18d21f59b679686bbd18917b87db0193ae36f9c23c355fc"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25e9185e2d06c16ee438ed39bf62935ec436474a6ac4f9358524220f1b236e43"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:150906b40ff188a3260cbee25380e7494ee85048584998c1e66df0c7a11c17a6"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ad4aeb3e9a97286573c03df758fc7627aecdd02f1da04516a86dc159bf70121"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3f3ed29cd9f978c604708511a1f9c2fdcb6c38b9aae36a51905b8811ee5cbf1"}, + {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b0dae11d8f5ded51699c74d9548dcc5938e0804cc8298ec0aa0da95c21fff57b"}, + {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27"}, + {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9dc1b507c12eb0481d071f3c1808f0529ad41dc415d0ca11f7ebfc666e66a18b"}, + {file = "pydantic_core-2.20.1-cp311-none-win32.whl", hash = "sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a"}, + {file = "pydantic_core-2.20.1-cp311-none-win_amd64.whl", hash = "sha256:40a783fb7ee353c50bd3853e626f15677ea527ae556429453685ae32280c19c2"}, + {file = "pydantic_core-2.20.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:595ba5be69b35777474fa07f80fc260ea71255656191adb22a8c53aba4479231"}, + {file = "pydantic_core-2.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a4f55095ad087474999ee28d3398bae183a66be4823f753cd7d67dd0153427c9"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e97fdf088d4b31ff4ba35db26d9cc472ac7ef4a2ff2badeabf8d727b3377fc52"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc633a9fe1eb87e250b5c57d389cf28998e4292336926b0b6cdaee353f89a237"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d573faf8eb7e6b1cbbcb4f5b247c60ca8be39fe2c674495df0eb4318303137fe"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26dc97754b57d2fd00ac2b24dfa341abffc380b823211994c4efac7f13b9e90e"}, + {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:33499e85e739a4b60c9dac710c20a08dc73cb3240c9a0e22325e671b27b70d24"}, + {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bebb4d6715c814597f85297c332297c6ce81e29436125ca59d1159b07f423eb1"}, + {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:516d9227919612425c8ef1c9b869bbbee249bc91912c8aaffb66116c0b447ebd"}, + {file = "pydantic_core-2.20.1-cp312-none-win32.whl", hash = "sha256:469f29f9093c9d834432034d33f5fe45699e664f12a13bf38c04967ce233d688"}, + {file = "pydantic_core-2.20.1-cp312-none-win_amd64.whl", hash = "sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d"}, + {file = "pydantic_core-2.20.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686"}, + {file = "pydantic_core-2.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19c0fa39fa154e7e0b7f82f88ef85faa2a4c23cc65aae2f5aea625e3c13c735a"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa223cd1e36b642092c326d694d8bf59b71ddddc94cdb752bbbb1c5c91d833b"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c336a6d235522a62fef872c6295a42ecb0c4e1d0f1a3e500fe949415761b8a19"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7eb6a0587eded33aeefea9f916899d42b1799b7b14b8f8ff2753c0ac1741edac"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:70c8daf4faca8da5a6d655f9af86faf6ec2e1768f4b8b9d0226c02f3d6209703"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9fa4c9bf273ca41f940bceb86922a7667cd5bf90e95dbb157cbb8441008482c"}, + {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11b71d67b4725e7e2a9f6e9c0ac1239bbc0c48cce3dc59f98635efc57d6dac83"}, + {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:270755f15174fb983890c49881e93f8f1b80f0b5e3a3cc1394a255706cabd203"}, + {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c81131869240e3e568916ef4c307f8b99583efaa60a8112ef27a366eefba8ef0"}, + {file = "pydantic_core-2.20.1-cp313-none-win32.whl", hash = "sha256:b91ced227c41aa29c672814f50dbb05ec93536abf8f43cd14ec9521ea09afe4e"}, + {file = "pydantic_core-2.20.1-cp313-none-win_amd64.whl", hash = "sha256:65db0f2eefcaad1a3950f498aabb4875c8890438bc80b19362cf633b87a8ab20"}, + {file = "pydantic_core-2.20.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:4745f4ac52cc6686390c40eaa01d48b18997cb130833154801a442323cc78f91"}, + {file = "pydantic_core-2.20.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a8ad4c766d3f33ba8fd692f9aa297c9058970530a32c728a2c4bfd2616d3358b"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41e81317dd6a0127cabce83c0c9c3fbecceae981c8391e6f1dec88a77c8a569a"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:04024d270cf63f586ad41fff13fde4311c4fc13ea74676962c876d9577bcc78f"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eaad4ff2de1c3823fddf82f41121bdf453d922e9a238642b1dedb33c4e4f98ad"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26ab812fa0c845df815e506be30337e2df27e88399b985d0bb4e3ecfe72df31c"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c5ebac750d9d5f2706654c638c041635c385596caf68f81342011ddfa1e5598"}, + {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2aafc5a503855ea5885559eae883978c9b6d8c8993d67766ee73d82e841300dd"}, + {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:4868f6bd7c9d98904b748a2653031fc9c2f85b6237009d475b1008bfaeb0a5aa"}, + {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa2f457b4af386254372dfa78a2eda2563680d982422641a85f271c859df1987"}, + {file = "pydantic_core-2.20.1-cp38-none-win32.whl", hash = "sha256:225b67a1f6d602de0ce7f6c1c3ae89a4aa25d3de9be857999e9124f15dab486a"}, + {file = "pydantic_core-2.20.1-cp38-none-win_amd64.whl", hash = "sha256:6b507132dcfc0dea440cce23ee2182c0ce7aba7054576efc65634f080dbe9434"}, + {file = "pydantic_core-2.20.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:b03f7941783b4c4a26051846dea594628b38f6940a2fdc0df00b221aed39314c"}, + {file = "pydantic_core-2.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1eedfeb6089ed3fad42e81a67755846ad4dcc14d73698c120a82e4ccf0f1f9f6"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:635fee4e041ab9c479e31edda27fcf966ea9614fff1317e280d99eb3e5ab6fe2"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:77bf3ac639c1ff567ae3b47f8d4cc3dc20f9966a2a6dd2311dcc055d3d04fb8a"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ed1b0132f24beeec5a78b67d9388656d03e6a7c837394f99257e2d55b461611"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c6514f963b023aeee506678a1cf821fe31159b925c4b76fe2afa94cc70b3222b"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10d4204d8ca33146e761c79f83cc861df20e7ae9f6487ca290a97702daf56006"}, + {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2d036c7187b9422ae5b262badb87a20a49eb6c5238b2004e96d4da1231badef1"}, + {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9ebfef07dbe1d93efb94b4700f2d278494e9162565a54f124c404a5656d7ff09"}, + {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6b9d9bb600328a1ce523ab4f454859e9d439150abb0906c5a1983c146580ebab"}, + {file = "pydantic_core-2.20.1-cp39-none-win32.whl", hash = "sha256:784c1214cb6dd1e3b15dd8b91b9a53852aed16671cc3fbe4786f4f1db07089e2"}, + {file = "pydantic_core-2.20.1-cp39-none-win_amd64.whl", hash = "sha256:d2fe69c5434391727efa54b47a1e7986bb0186e72a41b203df8f5b0a19a4f669"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a45f84b09ac9c3d35dfcf6a27fd0634d30d183205230a0ebe8373a0e8cfa0906"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d02a72df14dfdbaf228424573a07af10637bd490f0901cee872c4f434a735b94"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2b27e6af28f07e2f195552b37d7d66b150adbaa39a6d327766ffd695799780f"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:242b8feb3c493ab78be289c034a1f659e8826e2233786e36f2893a950a719bb6"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:38cf1c40a921d05c5edc61a785c0ddb4bed67827069f535d794ce6bcded919fc"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e0bbdd76ce9aa5d4209d65f2b27fc6e5ef1312ae6c5333c26db3f5ade53a1e99"}, + {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:254ec27fdb5b1ee60684f91683be95e5133c994cc54e86a0b0963afa25c8f8a6"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:407653af5617f0757261ae249d3fba09504d7a71ab36ac057c938572d1bc9331"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:c693e916709c2465b02ca0ad7b387c4f8423d1db7b4649c551f27a529181c5ad"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b5ff4911aea936a47d9376fd3ab17e970cc543d1b68921886e7f64bd28308d1"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177f55a886d74f1808763976ac4efd29b7ed15c69f4d838bbd74d9d09cf6fa86"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:964faa8a861d2664f0c7ab0c181af0bea66098b1919439815ca8803ef136fc4e"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:4dd484681c15e6b9a977c785a345d3e378d72678fd5f1f3c0509608da24f2ac0"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f6d6cff3538391e8486a431569b77921adfcdef14eb18fbf19b7c0a5294d4e6a"}, + {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a6d511cc297ff0883bc3708b465ff82d7560193169a8b93260f74ecb0a5e08a7"}, + {file = "pydantic_core-2.20.1.tar.gz", hash = "sha256:26ca695eeee5f9f1aeeb211ffc12f10bcb6f71e2989988fda61dabd65db878d4"}, ] [package.dependencies] @@ -2210,13 +2223,13 @@ diagrams = ["jinja2", "railroad-diagrams"] [[package]] name = "pyright" -version = "1.1.368" +version = "1.1.371" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.368-py3-none-any.whl", hash = "sha256:4a86e34b61c755b43b367af7fbf927fc6466fff6b81a9dcea07d42416c640af3"}, - {file = "pyright-1.1.368.tar.gz", hash = "sha256:9b2aa48142d9d9fc9a6aedff743c76873cc4e615f3297cdbf893d5793f75b306"}, + {file = "pyright-1.1.371-py3-none-any.whl", hash = "sha256:cce52e42ff73943243e7e5e24f2a59dee81b97d99f4e3cf97370b27e8a1858cd"}, + {file = "pyright-1.1.371.tar.gz", hash = "sha256:777b508b92dda2db476214c400ce043aad8d8f3dd0e10d284c96e79f298308b5"}, ] [package.dependencies] @@ -2373,7 +2386,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -2589,110 +2601,110 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "rpds-py" -version = "0.18.1" +version = "0.19.0" description = "Python bindings to Rust's persistent data structures (rpds)" optional = false python-versions = ">=3.8" files = [ - {file = "rpds_py-0.18.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:d31dea506d718693b6b2cffc0648a8929bdc51c70a311b2770f09611caa10d53"}, - {file = "rpds_py-0.18.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:732672fbc449bab754e0b15356c077cc31566df874964d4801ab14f71951ea80"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a98a1f0552b5f227a3d6422dbd61bc6f30db170939bd87ed14f3c339aa6c7c9"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7f1944ce16401aad1e3f7d312247b3d5de7981f634dc9dfe90da72b87d37887d"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:38e14fb4e370885c4ecd734f093a2225ee52dc384b86fa55fe3f74638b2cfb09"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:08d74b184f9ab6289b87b19fe6a6d1a97fbfea84b8a3e745e87a5de3029bf944"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d70129cef4a8d979caa37e7fe957202e7eee8ea02c5e16455bc9808a59c6b2f0"}, - {file = "rpds_py-0.18.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ce0bb20e3a11bd04461324a6a798af34d503f8d6f1aa3d2aa8901ceaf039176d"}, - {file = "rpds_py-0.18.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:81c5196a790032e0fc2464c0b4ab95f8610f96f1f2fa3d4deacce6a79852da60"}, - {file = "rpds_py-0.18.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:f3027be483868c99b4985fda802a57a67fdf30c5d9a50338d9db646d590198da"}, - {file = "rpds_py-0.18.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d44607f98caa2961bab4fa3c4309724b185b464cdc3ba6f3d7340bac3ec97cc1"}, - {file = "rpds_py-0.18.1-cp310-none-win32.whl", hash = "sha256:c273e795e7a0f1fddd46e1e3cb8be15634c29ae8ff31c196debb620e1edb9333"}, - {file = "rpds_py-0.18.1-cp310-none-win_amd64.whl", hash = "sha256:8352f48d511de5f973e4f2f9412736d7dea76c69faa6d36bcf885b50c758ab9a"}, - {file = "rpds_py-0.18.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6b5ff7e1d63a8281654b5e2896d7f08799378e594f09cf3674e832ecaf396ce8"}, - {file = "rpds_py-0.18.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8927638a4d4137a289e41d0fd631551e89fa346d6dbcfc31ad627557d03ceb6d"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:154bf5c93d79558b44e5b50cc354aa0459e518e83677791e6adb0b039b7aa6a7"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:07f2139741e5deb2c5154a7b9629bc5aa48c766b643c1a6750d16f865a82c5fc"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8c7672e9fba7425f79019db9945b16e308ed8bc89348c23d955c8c0540da0a07"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:489bdfe1abd0406eba6b3bb4fdc87c7fa40f1031de073d0cfb744634cc8fa261"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c20f05e8e3d4fc76875fc9cb8cf24b90a63f5a1b4c5b9273f0e8225e169b100"}, - {file = "rpds_py-0.18.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:967342e045564cef76dfcf1edb700b1e20838d83b1aa02ab313e6a497cf923b8"}, - {file = "rpds_py-0.18.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2cc7c1a47f3a63282ab0f422d90ddac4aa3034e39fc66a559ab93041e6505da7"}, - {file = "rpds_py-0.18.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f7afbfee1157e0f9376c00bb232e80a60e59ed716e3211a80cb8506550671e6e"}, - {file = "rpds_py-0.18.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9e6934d70dc50f9f8ea47081ceafdec09245fd9f6032669c3b45705dea096b88"}, - {file = "rpds_py-0.18.1-cp311-none-win32.whl", hash = "sha256:c69882964516dc143083d3795cb508e806b09fc3800fd0d4cddc1df6c36e76bb"}, - {file = "rpds_py-0.18.1-cp311-none-win_amd64.whl", hash = "sha256:70a838f7754483bcdc830444952fd89645569e7452e3226de4a613a4c1793fb2"}, - {file = "rpds_py-0.18.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3dd3cd86e1db5aadd334e011eba4e29d37a104b403e8ca24dcd6703c68ca55b3"}, - {file = "rpds_py-0.18.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:05f3d615099bd9b13ecf2fc9cf2d839ad3f20239c678f461c753e93755d629ee"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35b2b771b13eee8729a5049c976197ff58a27a3829c018a04341bcf1ae409b2b"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ee17cd26b97d537af8f33635ef38be873073d516fd425e80559f4585a7b90c43"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b646bf655b135ccf4522ed43d6902af37d3f5dbcf0da66c769a2b3938b9d8184"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:19ba472b9606c36716062c023afa2484d1e4220548751bda14f725a7de17b4f6"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e30ac5e329098903262dc5bdd7e2086e0256aa762cc8b744f9e7bf2a427d3f8"}, - {file = "rpds_py-0.18.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d58ad6317d188c43750cb76e9deacf6051d0f884d87dc6518e0280438648a9ac"}, - {file = "rpds_py-0.18.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e1735502458621921cee039c47318cb90b51d532c2766593be6207eec53e5c4c"}, - {file = "rpds_py-0.18.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:f5bab211605d91db0e2995a17b5c6ee5edec1270e46223e513eaa20da20076ac"}, - {file = "rpds_py-0.18.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2fc24a329a717f9e2448f8cd1f960f9dac4e45b6224d60734edeb67499bab03a"}, - {file = "rpds_py-0.18.1-cp312-none-win32.whl", hash = "sha256:1805d5901779662d599d0e2e4159d8a82c0b05faa86ef9222bf974572286b2b6"}, - {file = "rpds_py-0.18.1-cp312-none-win_amd64.whl", hash = "sha256:720edcb916df872d80f80a1cc5ea9058300b97721efda8651efcd938a9c70a72"}, - {file = "rpds_py-0.18.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:c827576e2fa017a081346dce87d532a5310241648eb3700af9a571a6e9fc7e74"}, - {file = "rpds_py-0.18.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:aa3679e751408d75a0b4d8d26d6647b6d9326f5e35c00a7ccd82b78ef64f65f8"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0abeee75434e2ee2d142d650d1e54ac1f8b01e6e6abdde8ffd6eeac6e9c38e20"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed402d6153c5d519a0faf1bb69898e97fb31613b49da27a84a13935ea9164dfc"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:338dee44b0cef8b70fd2ef54b4e09bb1b97fc6c3a58fea5db6cc083fd9fc2724"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7750569d9526199c5b97e5a9f8d96a13300950d910cf04a861d96f4273d5b104"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:607345bd5912aacc0c5a63d45a1f73fef29e697884f7e861094e443187c02be5"}, - {file = "rpds_py-0.18.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:207c82978115baa1fd8d706d720b4a4d2b0913df1c78c85ba73fe6c5804505f0"}, - {file = "rpds_py-0.18.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6d1e42d2735d437e7e80bab4d78eb2e459af48c0a46e686ea35f690b93db792d"}, - {file = "rpds_py-0.18.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:5463c47c08630007dc0fe99fb480ea4f34a89712410592380425a9b4e1611d8e"}, - {file = "rpds_py-0.18.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:06d218939e1bf2ca50e6b0ec700ffe755e5216a8230ab3e87c059ebb4ea06afc"}, - {file = "rpds_py-0.18.1-cp38-none-win32.whl", hash = "sha256:312fe69b4fe1ffbe76520a7676b1e5ac06ddf7826d764cc10265c3b53f96dbe9"}, - {file = "rpds_py-0.18.1-cp38-none-win_amd64.whl", hash = "sha256:9437ca26784120a279f3137ee080b0e717012c42921eb07861b412340f85bae2"}, - {file = "rpds_py-0.18.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:19e515b78c3fc1039dd7da0a33c28c3154458f947f4dc198d3c72db2b6b5dc93"}, - {file = "rpds_py-0.18.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a7b28c5b066bca9a4eb4e2f2663012debe680f097979d880657f00e1c30875a0"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:673fdbbf668dd958eff750e500495ef3f611e2ecc209464f661bc82e9838991e"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d960de62227635d2e61068f42a6cb6aae91a7fe00fca0e3aeed17667c8a34611"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:352a88dc7892f1da66b6027af06a2e7e5d53fe05924cc2cfc56495b586a10b72"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4e0ee01ad8260184db21468a6e1c37afa0529acc12c3a697ee498d3c2c4dcaf3"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4c39ad2f512b4041343ea3c7894339e4ca7839ac38ca83d68a832fc8b3748ab"}, - {file = "rpds_py-0.18.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:aaa71ee43a703c321906813bb252f69524f02aa05bf4eec85f0c41d5d62d0f4c"}, - {file = "rpds_py-0.18.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:6cd8098517c64a85e790657e7b1e509b9fe07487fd358e19431cb120f7d96338"}, - {file = "rpds_py-0.18.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4adec039b8e2928983f885c53b7cc4cda8965b62b6596501a0308d2703f8af1b"}, - {file = "rpds_py-0.18.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:32b7daaa3e9389db3695964ce8e566e3413b0c43e3394c05e4b243a4cd7bef26"}, - {file = "rpds_py-0.18.1-cp39-none-win32.whl", hash = "sha256:2625f03b105328729f9450c8badda34d5243231eef6535f80064d57035738360"}, - {file = "rpds_py-0.18.1-cp39-none-win_amd64.whl", hash = "sha256:bf18932d0003c8c4d51a39f244231986ab23ee057d235a12b2684ea26a353590"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:cbfbea39ba64f5e53ae2915de36f130588bba71245b418060ec3330ebf85678e"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:a3d456ff2a6a4d2adcdf3c1c960a36f4fd2fec6e3b4902a42a384d17cf4e7a65"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7700936ef9d006b7ef605dc53aa364da2de5a3aa65516a1f3ce73bf82ecfc7ae"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:51584acc5916212e1bf45edd17f3a6b05fe0cbb40482d25e619f824dccb679de"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:942695a206a58d2575033ff1e42b12b2aece98d6003c6bc739fbf33d1773b12f"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b906b5f58892813e5ba5c6056d6a5ad08f358ba49f046d910ad992196ea61397"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6f8e3fecca256fefc91bb6765a693d96692459d7d4c644660a9fff32e517843"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7732770412bab81c5a9f6d20aeb60ae943a9b36dcd990d876a773526468e7163"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:bd1105b50ede37461c1d51b9698c4f4be6e13e69a908ab7751e3807985fc0346"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:618916f5535784960f3ecf8111581f4ad31d347c3de66d02e728de460a46303c"}, - {file = "rpds_py-0.18.1-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:17c6d2155e2423f7e79e3bb18151c686d40db42d8645e7977442170c360194d4"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:6c4c4c3f878df21faf5fac86eda32671c27889e13570645a9eea0a1abdd50922"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:fab6ce90574645a0d6c58890e9bcaac8d94dff54fb51c69e5522a7358b80ab64"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:531796fb842b53f2695e94dc338929e9f9dbf473b64710c28af5a160b2a8927d"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:740884bc62a5e2bbb31e584f5d23b32320fd75d79f916f15a788d527a5e83644"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:998125738de0158f088aef3cb264a34251908dd2e5d9966774fdab7402edfab7"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e2be6e9dd4111d5b31ba3b74d17da54a8319d8168890fbaea4b9e5c3de630ae5"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0cee71bc618cd93716f3c1bf56653740d2d13ddbd47673efa8bf41435a60daa"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2c3caec4ec5cd1d18e5dd6ae5194d24ed12785212a90b37f5f7f06b8bedd7139"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:27bba383e8c5231cd559affe169ca0b96ec78d39909ffd817f28b166d7ddd4d8"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:a888e8bdb45916234b99da2d859566f1e8a1d2275a801bb8e4a9644e3c7e7909"}, - {file = "rpds_py-0.18.1-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6031b25fb1b06327b43d841f33842b383beba399884f8228a6bb3df3088485ff"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:48c2faaa8adfacefcbfdb5f2e2e7bdad081e5ace8d182e5f4ade971f128e6bb3"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:d85164315bd68c0806768dc6bb0429c6f95c354f87485ee3593c4f6b14def2bd"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6afd80f6c79893cfc0574956f78a0add8c76e3696f2d6a15bca2c66c415cf2d4"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa242ac1ff583e4ec7771141606aafc92b361cd90a05c30d93e343a0c2d82a89"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21be4770ff4e08698e1e8e0bce06edb6ea0626e7c8f560bc08222880aca6a6f"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c45a639e93a0c5d4b788b2613bd637468edd62f8f95ebc6fcc303d58ab3f0a8"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:910e71711d1055b2768181efa0a17537b2622afeb0424116619817007f8a2b10"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b9bb1f182a97880f6078283b3505a707057c42bf55d8fca604f70dedfdc0772a"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:1d54f74f40b1f7aaa595a02ff42ef38ca654b1469bef7d52867da474243cc633"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:8d2e182c9ee01135e11e9676e9a62dfad791a7a467738f06726872374a83db49"}, - {file = "rpds_py-0.18.1-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:636a15acc588f70fda1661234761f9ed9ad79ebed3f2125d44be0862708b666e"}, - {file = "rpds_py-0.18.1.tar.gz", hash = "sha256:dc48b479d540770c811fbd1eb9ba2bb66951863e448efec2e2c102625328e92f"}, + {file = "rpds_py-0.19.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:fb37bd599f031f1a6fb9e58ec62864ccf3ad549cf14bac527dbfa97123edcca4"}, + {file = "rpds_py-0.19.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3384d278df99ec2c6acf701d067147320b864ef6727405d6470838476e44d9e8"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e54548e0be3ac117595408fd4ca0ac9278fde89829b0b518be92863b17ff67a2"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8eb488ef928cdbc05a27245e52de73c0d7c72a34240ef4d9893fdf65a8c1a955"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a5da93debdfe27b2bfc69eefb592e1831d957b9535e0943a0ee8b97996de21b5"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:79e205c70afddd41f6ee79a8656aec738492a550247a7af697d5bd1aee14f766"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:959179efb3e4a27610e8d54d667c02a9feaa86bbabaf63efa7faa4dfa780d4f1"}, + {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a6e605bb9edcf010f54f8b6a590dd23a4b40a8cb141255eec2a03db249bc915b"}, + {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9133d75dc119a61d1a0ded38fb9ba40a00ef41697cc07adb6ae098c875195a3f"}, + {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dd36b712d35e757e28bf2f40a71e8f8a2d43c8b026d881aa0c617b450d6865c9"}, + {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:354f3a91718489912f2e0fc331c24eaaf6a4565c080e00fbedb6015857c00582"}, + {file = "rpds_py-0.19.0-cp310-none-win32.whl", hash = "sha256:ebcbf356bf5c51afc3290e491d3722b26aaf5b6af3c1c7f6a1b757828a46e336"}, + {file = "rpds_py-0.19.0-cp310-none-win_amd64.whl", hash = "sha256:75a6076289b2df6c8ecb9d13ff79ae0cad1d5fb40af377a5021016d58cd691ec"}, + {file = "rpds_py-0.19.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6d45080095e585f8c5097897313def60caa2046da202cdb17a01f147fb263b81"}, + {file = "rpds_py-0.19.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5c9581019c96f865483d031691a5ff1cc455feb4d84fc6920a5ffc48a794d8a"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1540d807364c84516417115c38f0119dfec5ea5c0dd9a25332dea60b1d26fc4d"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9e65489222b410f79711dc3d2d5003d2757e30874096b2008d50329ea4d0f88c"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9da6f400eeb8c36f72ef6646ea530d6d175a4f77ff2ed8dfd6352842274c1d8b"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37f46bb11858717e0efa7893c0f7055c43b44c103e40e69442db5061cb26ed34"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:071d4adc734de562bd11d43bd134330fb6249769b2f66b9310dab7460f4bf714"}, + {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9625367c8955e4319049113ea4f8fee0c6c1145192d57946c6ffcd8fe8bf48dd"}, + {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e19509145275d46bc4d1e16af0b57a12d227c8253655a46bbd5ec317e941279d"}, + {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d438e4c020d8c39961deaf58f6913b1bf8832d9b6f62ec35bd93e97807e9cbc"}, + {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:90bf55d9d139e5d127193170f38c584ed3c79e16638890d2e36f23aa1630b952"}, + {file = "rpds_py-0.19.0-cp311-none-win32.whl", hash = "sha256:8d6ad132b1bc13d05ffe5b85e7a01a3998bf3a6302ba594b28d61b8c2cf13aaf"}, + {file = "rpds_py-0.19.0-cp311-none-win_amd64.whl", hash = "sha256:7ec72df7354e6b7f6eb2a17fa6901350018c3a9ad78e48d7b2b54d0412539a67"}, + {file = "rpds_py-0.19.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:5095a7c838a8647c32aa37c3a460d2c48debff7fc26e1136aee60100a8cd8f68"}, + {file = "rpds_py-0.19.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f2f78ef14077e08856e788fa482107aa602636c16c25bdf59c22ea525a785e9"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7cc6cb44f8636fbf4a934ca72f3e786ba3c9f9ba4f4d74611e7da80684e48d2"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cf902878b4af334a09de7a45badbff0389e7cf8dc2e4dcf5f07125d0b7c2656d"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:688aa6b8aa724db1596514751ffb767766e02e5c4a87486ab36b8e1ebc1aedac"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57dbc9167d48e355e2569346b5aa4077f29bf86389c924df25c0a8b9124461fb"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b4cf5a9497874822341c2ebe0d5850fed392034caadc0bad134ab6822c0925b"}, + {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8a790d235b9d39c70a466200d506bb33a98e2ee374a9b4eec7a8ac64c2c261fa"}, + {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1d16089dfa58719c98a1c06f2daceba6d8e3fb9b5d7931af4a990a3c486241cb"}, + {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:bc9128e74fe94650367fe23f37074f121b9f796cabbd2f928f13e9661837296d"}, + {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c8f77e661ffd96ff104bebf7d0f3255b02aa5d5b28326f5408d6284c4a8b3248"}, + {file = "rpds_py-0.19.0-cp312-none-win32.whl", hash = "sha256:5f83689a38e76969327e9b682be5521d87a0c9e5a2e187d2bc6be4765f0d4600"}, + {file = "rpds_py-0.19.0-cp312-none-win_amd64.whl", hash = "sha256:06925c50f86da0596b9c3c64c3837b2481337b83ef3519e5db2701df695453a4"}, + {file = "rpds_py-0.19.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:52e466bea6f8f3a44b1234570244b1cff45150f59a4acae3fcc5fd700c2993ca"}, + {file = "rpds_py-0.19.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e21cc693045fda7f745c790cb687958161ce172ffe3c5719ca1764e752237d16"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b31f059878eb1f5da8b2fd82480cc18bed8dcd7fb8fe68370e2e6285fa86da6"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1dd46f309e953927dd018567d6a9e2fb84783963650171f6c5fe7e5c41fd5666"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34a01a4490e170376cd79258b7f755fa13b1a6c3667e872c8e35051ae857a92b"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bcf426a8c38eb57f7bf28932e68425ba86def6e756a5b8cb4731d8e62e4e0223"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68eea5df6347d3f1378ce992d86b2af16ad7ff4dcb4a19ccdc23dea901b87fb"}, + {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dab8d921b55a28287733263c0e4c7db11b3ee22aee158a4de09f13c93283c62d"}, + {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6fe87efd7f47266dfc42fe76dae89060038f1d9cb911f89ae7e5084148d1cc08"}, + {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:535d4b52524a961d220875688159277f0e9eeeda0ac45e766092bfb54437543f"}, + {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:8b1a94b8afc154fbe36978a511a1f155f9bd97664e4f1f7a374d72e180ceb0ae"}, + {file = "rpds_py-0.19.0-cp38-none-win32.whl", hash = "sha256:7c98298a15d6b90c8f6e3caa6457f4f022423caa5fa1a1ca7a5e9e512bdb77a4"}, + {file = "rpds_py-0.19.0-cp38-none-win_amd64.whl", hash = "sha256:b0da31853ab6e58a11db3205729133ce0df26e6804e93079dee095be3d681dc1"}, + {file = "rpds_py-0.19.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:5039e3cef7b3e7a060de468a4a60a60a1f31786da94c6cb054e7a3c75906111c"}, + {file = "rpds_py-0.19.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab1932ca6cb8c7499a4d87cb21ccc0d3326f172cfb6a64021a889b591bb3045c"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2afd2164a1e85226fcb6a1da77a5c8896c18bfe08e82e8ceced5181c42d2179"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b1c30841f5040de47a0046c243fc1b44ddc87d1b12435a43b8edff7e7cb1e0d0"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f757f359f30ec7dcebca662a6bd46d1098f8b9fb1fcd661a9e13f2e8ce343ba1"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15e65395a59d2e0e96caf8ee5389ffb4604e980479c32742936ddd7ade914b22"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb0f6eb3a320f24b94d177e62f4074ff438f2ad9d27e75a46221904ef21a7b05"}, + {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b228e693a2559888790936e20f5f88b6e9f8162c681830eda303bad7517b4d5a"}, + {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2575efaa5d949c9f4e2cdbe7d805d02122c16065bfb8d95c129372d65a291a0b"}, + {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5c872814b77a4e84afa293a1bee08c14daed1068b2bb1cc312edbf020bbbca2b"}, + {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:850720e1b383df199b8433a20e02b25b72f0fded28bc03c5bd79e2ce7ef050be"}, + {file = "rpds_py-0.19.0-cp39-none-win32.whl", hash = "sha256:ce84a7efa5af9f54c0aa7692c45861c1667080814286cacb9958c07fc50294fb"}, + {file = "rpds_py-0.19.0-cp39-none-win_amd64.whl", hash = "sha256:1c26da90b8d06227d7769f34915913911222d24ce08c0ab2d60b354e2d9c7aff"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:75969cf900d7be665ccb1622a9aba225cf386bbc9c3bcfeeab9f62b5048f4a07"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:8445f23f13339da640d1be8e44e5baf4af97e396882ebbf1692aecd67f67c479"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5a7c1062ef8aea3eda149f08120f10795835fc1c8bc6ad948fb9652a113ca55"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:462b0c18fbb48fdbf980914a02ee38c423a25fcc4cf40f66bacc95a2d2d73bc8"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3208f9aea18991ac7f2b39721e947bbd752a1abbe79ad90d9b6a84a74d44409b"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3444fe52b82f122d8a99bf66777aed6b858d392b12f4c317da19f8234db4533"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88cb4bac7185a9f0168d38c01d7a00addece9822a52870eee26b8d5b61409213"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6b130bd4163c93798a6b9bb96be64a7c43e1cec81126ffa7ffaa106e1fc5cef5"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:a707b158b4410aefb6b054715545bbb21aaa5d5d0080217290131c49c2124a6e"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:dc9ac4659456bde7c567107556ab065801622396b435a3ff213daef27b495388"}, + {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:81ea573aa46d3b6b3d890cd3c0ad82105985e6058a4baed03cf92518081eec8c"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3f148c3f47f7f29a79c38cc5d020edcb5ca780020fab94dbc21f9af95c463581"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0906357f90784a66e89ae3eadc2654f36c580a7d65cf63e6a616e4aec3a81be"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f629ecc2db6a4736b5ba95a8347b0089240d69ad14ac364f557d52ad68cf94b0"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6feacd1d178c30e5bc37184526e56740342fd2aa6371a28367bad7908d454fc"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae8b6068ee374fdfab63689be0963333aa83b0815ead5d8648389a8ded593378"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78d57546bad81e0da13263e4c9ce30e96dcbe720dbff5ada08d2600a3502e526"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8b6683a37338818646af718c9ca2a07f89787551057fae57c4ec0446dc6224b"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e8481b946792415adc07410420d6fc65a352b45d347b78fec45d8f8f0d7496f0"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:bec35eb20792ea64c3c57891bc3ca0bedb2884fbac2c8249d9b731447ecde4fa"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:aa5476c3e3a402c37779e95f7b4048db2cb5b0ed0b9d006983965e93f40fe05a"}, + {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:19d02c45f2507b489fd4df7b827940f1420480b3e2e471e952af4d44a1ea8e34"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a3e2fd14c5d49ee1da322672375963f19f32b3d5953f0615b175ff7b9d38daed"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:93a91c2640645303e874eada51f4f33351b84b351a689d470f8108d0e0694210"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5b9fc03bf76a94065299d4a2ecd8dfbae4ae8e2e8098bbfa6ab6413ca267709"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5a4b07cdf3f84310c08c1de2c12ddadbb7a77568bcb16e95489f9c81074322ed"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba0ed0dc6763d8bd6e5de5cf0d746d28e706a10b615ea382ac0ab17bb7388633"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:474bc83233abdcf2124ed3f66230a1c8435896046caa4b0b5ab6013c640803cc"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329c719d31362355a96b435f4653e3b4b061fcc9eba9f91dd40804ca637d914e"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ef9101f3f7b59043a34f1dccbb385ca760467590951952d6701df0da9893ca0c"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:0121803b0f424ee2109d6e1f27db45b166ebaa4b32ff47d6aa225642636cd834"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:8344127403dea42f5970adccf6c5957a71a47f522171fafaf4c6ddb41b61703a"}, + {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:443cec402ddd650bb2b885113e1dcedb22b1175c6be223b14246a714b61cd521"}, + {file = "rpds_py-0.19.0.tar.gz", hash = "sha256:4fdc9afadbeb393b4bbbad75481e0ea78e4469f2e1d713a90811700830b553a9"}, ] [[package]] @@ -2739,18 +2751,18 @@ win32 = ["pywin32"] [[package]] name = "setuptools" -version = "70.1.0" +version = "70.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.1.0-py3-none-any.whl", hash = "sha256:d9b8b771455a97c8a9f3ab3448ebe0b29b5e105f1228bba41028be116985a267"}, - {file = "setuptools-70.1.0.tar.gz", hash = "sha256:01a1e793faa5bd89abc851fa15d0a0db26f160890c7102cd8dce643e886b47f5"}, + {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, + {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shellingham" diff --git a/sdks/ts/src/api/JulepApiClient.ts b/sdks/ts/src/api/JulepApiClient.ts index 7f4116113..03bf1cc0d 100644 --- a/sdks/ts/src/api/JulepApiClient.ts +++ b/sdks/ts/src/api/JulepApiClient.ts @@ -16,7 +16,7 @@ export class JulepApiClient { ) { this.request = new HttpRequest({ BASE: config?.BASE ?? "https://api-alpha.julep.ai/api", - VERSION: config?.VERSION ?? "1.0.0", + VERSION: config?.VERSION ?? "0.4.0", WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, CREDENTIALS: config?.CREDENTIALS ?? "include", TOKEN: config?.TOKEN, diff --git a/sdks/ts/src/api/core/OpenAPI.ts b/sdks/ts/src/api/core/OpenAPI.ts index 12cf962fb..9ffb201ab 100644 --- a/sdks/ts/src/api/core/OpenAPI.ts +++ b/sdks/ts/src/api/core/OpenAPI.ts @@ -21,7 +21,7 @@ export type OpenAPIConfig = { export const OpenAPI: OpenAPIConfig = { BASE: "https://api-alpha.julep.ai/api", - VERSION: "1.0.0", + VERSION: "0.4.0", WITH_CREDENTIALS: false, CREDENTIALS: "include", TOKEN: undefined, diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index fe1fea973..6b45b0053 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -10,144 +10,174 @@ export { CancelablePromise, CancelError } from "./core/CancelablePromise"; export { OpenAPI } from "./core/OpenAPI"; export type { OpenAPIConfig } from "./core/OpenAPI"; -export type { Agent } from "./models/Agent"; -export type { agent_id } from "./models/agent_id"; -export type { AgentDefaultSettings } from "./models/AgentDefaultSettings"; -export type { CELObject } from "./models/CELObject"; -export type { ChatInput } from "./models/ChatInput"; -export type { ChatInputData } from "./models/ChatInputData"; -export type { ChatMLImageContentPart } from "./models/ChatMLImageContentPart"; -export type { ChatMLMessage } from "./models/ChatMLMessage"; -export type { ChatMLTextContentPart } from "./models/ChatMLTextContentPart"; -export type { ChatResponse } from "./models/ChatResponse"; -export type { ChatSettings } from "./models/ChatSettings"; -export type { CompletionUsage } from "./models/CompletionUsage"; -export type { CreateAgentRequest } from "./models/CreateAgentRequest"; -export type { CreateDoc } from "./models/CreateDoc"; -export type { CreateExecution } from "./models/CreateExecution"; -export type { CreateSessionRequest } from "./models/CreateSessionRequest"; -export type { CreateTask } from "./models/CreateTask"; -export type { CreateToolRequest } from "./models/CreateToolRequest"; -export type { CreateUserRequest } from "./models/CreateUserRequest"; -export type { Doc } from "./models/Doc"; -export type { doc_id } from "./models/doc_id"; -export type { DocIds } from "./models/DocIds"; -export type { ErrorWorkflowStep } from "./models/ErrorWorkflowStep"; -export type { EvaluateWorkflowStep } from "./models/EvaluateWorkflowStep"; -export type { Execution } from "./models/Execution"; -export type { execution_id } from "./models/execution_id"; -export type { ExecutionStatus } from "./models/ExecutionStatus"; -export type { ExecutionTransition } from "./models/ExecutionTransition"; -export type { FunctionCallOption } from "./models/FunctionCallOption"; -export type { FunctionDef } from "./models/FunctionDef"; -export type { FunctionParameters } from "./models/FunctionParameters"; -export type { IfElseWorkflowStep } from "./models/IfElseWorkflowStep"; -export type { InputChatMLMessage } from "./models/InputChatMLMessage"; -export type { job_id } from "./models/job_id"; -export type { JobStatus } from "./models/JobStatus"; -export type { Memory } from "./models/Memory"; -export type { memory_id } from "./models/memory_id"; -export type { MemoryAccessOptions } from "./models/MemoryAccessOptions"; -export type { message_id } from "./models/message_id"; -export type { NamedToolChoice } from "./models/NamedToolChoice"; -export type { PartialFunctionDef } from "./models/PartialFunctionDef"; -export type { PatchAgentRequest } from "./models/PatchAgentRequest"; -export type { PatchSessionRequest } from "./models/PatchSessionRequest"; -export type { PatchToolRequest } from "./models/PatchToolRequest"; -export type { PatchUserRequest } from "./models/PatchUserRequest"; -export type { PromptWorkflowStep } from "./models/PromptWorkflowStep"; -export type { ResourceCreatedResponse } from "./models/ResourceCreatedResponse"; -export type { ResourceDeletedResponse } from "./models/ResourceDeletedResponse"; -export type { ResourceUpdatedResponse } from "./models/ResourceUpdatedResponse"; -export type { Session } from "./models/Session"; -export type { session_id } from "./models/session_id"; -export type { Suggestion } from "./models/Suggestion"; -export type { Task } from "./models/Task"; -export type { task_id } from "./models/task_id"; -export type { Tool } from "./models/Tool"; -export type { tool_id } from "./models/tool_id"; -export type { ToolCallWorkflowStep } from "./models/ToolCallWorkflowStep"; -export type { ToolChoiceOption } from "./models/ToolChoiceOption"; -export type { ToolResponse } from "./models/ToolResponse"; -export type { transition_id } from "./models/transition_id"; -export type { TransitionType } from "./models/TransitionType"; -export type { UpdateAgentRequest } from "./models/UpdateAgentRequest"; -export type { UpdateSessionRequest } from "./models/UpdateSessionRequest"; -export type { UpdateToolRequest } from "./models/UpdateToolRequest"; -export type { UpdateUserRequest } from "./models/UpdateUserRequest"; -export type { User } from "./models/User"; -export type { user_id } from "./models/user_id"; -export type { WorkflowStep } from "./models/WorkflowStep"; -export type { YieldWorkflowStep } from "./models/YieldWorkflowStep"; +export type { Agents_Agent } from "./models/Agents_Agent"; +export type { Agents_CreateAgentRequest } from "./models/Agents_CreateAgentRequest"; +export type { Agents_CreateOrUpdateAgentRequest } from "./models/Agents_CreateOrUpdateAgentRequest"; +export type { Agents_PatchAgentRequest } from "./models/Agents_PatchAgentRequest"; +export type { Agents_UpdateAgentRequest } from "./models/Agents_UpdateAgentRequest"; +export type { Chat_CompletionResponseFormat } from "./models/Chat_CompletionResponseFormat"; +export type { Chat_GenerationPreset } from "./models/Chat_GenerationPreset"; +export type { Chat_GenerationPresetSettings } from "./models/Chat_GenerationPresetSettings"; +export type { Chat_OpenAISettings } from "./models/Chat_OpenAISettings"; +export type { Chat_vLLMSettings } from "./models/Chat_vLLMSettings"; +export type { Common_identifierSafeUnicode } from "./models/Common_identifierSafeUnicode"; +export type { Common_limit } from "./models/Common_limit"; +export type { Common_logit_bias } from "./models/Common_logit_bias"; +export type { Common_offset } from "./models/Common_offset"; +export type { Common_toolRef } from "./models/Common_toolRef"; +export type { Common_uuid } from "./models/Common_uuid"; +export type { Common_validPythonIdentifier } from "./models/Common_validPythonIdentifier"; +export type { Docs_Doc } from "./models/Docs_Doc"; +export type { Docs_DocOwner } from "./models/Docs_DocOwner"; +export type { Docs_DocReference } from "./models/Docs_DocReference"; +export type { Docs_DocSearchRequest } from "./models/Docs_DocSearchRequest"; +export type { Docs_HybridDocSearchRequest } from "./models/Docs_HybridDocSearchRequest"; +export type { Docs_TextOnlyDocSearchRequest } from "./models/Docs_TextOnlyDocSearchRequest"; +export type { Docs_VectorDocSearchRequest } from "./models/Docs_VectorDocSearchRequest"; +export type { Entries_BaseChatMLContentPart } from "./models/Entries_BaseChatMLContentPart"; +export type { Entries_ChatMLImageContentPart } from "./models/Entries_ChatMLImageContentPart"; +export type { Entries_ChatMLRole } from "./models/Entries_ChatMLRole"; +export type { Entries_ChatMLTextContentPart } from "./models/Entries_ChatMLTextContentPart"; +export type { Entries_Entry } from "./models/Entries_Entry"; +export type { Entries_History } from "./models/Entries_History"; +export type { Entries_ImageDetail } from "./models/Entries_ImageDetail"; +export type { Entries_ImageURL } from "./models/Entries_ImageURL"; +export type { Entries_InputChatMLMessage } from "./models/Entries_InputChatMLMessage"; +export type { Entries_Relation } from "./models/Entries_Relation"; +export type { Executions_CreateExecutionRequest } from "./models/Executions_CreateExecutionRequest"; +export type { Executions_Execution } from "./models/Executions_Execution"; +export type { Executions_ResumeExecutionRequest } from "./models/Executions_ResumeExecutionRequest"; +export type { Executions_StopExecutionRequest } from "./models/Executions_StopExecutionRequest"; +export type { Executions_TaskTokenResumeExecutionRequest } from "./models/Executions_TaskTokenResumeExecutionRequest"; +export type { Executions_Transition } from "./models/Executions_Transition"; +export type { Executions_UpdateExecutionRequest } from "./models/Executions_UpdateExecutionRequest"; +export type { Jobs_JobState } from "./models/Jobs_JobState"; +export type { Jobs_JobStatus } from "./models/Jobs_JobStatus"; +export type { Sessions_CreateOrUpdateSessionRequest } from "./models/Sessions_CreateOrUpdateSessionRequest"; +export type { Sessions_CreateSessionRequest } from "./models/Sessions_CreateSessionRequest"; +export type { Sessions_MultiAgentMultiUserSession } from "./models/Sessions_MultiAgentMultiUserSession"; +export type { Sessions_MultiAgentNoUserSession } from "./models/Sessions_MultiAgentNoUserSession"; +export type { Sessions_MultiAgentSingleUserSession } from "./models/Sessions_MultiAgentSingleUserSession"; +export type { Sessions_PatchSessionRequest } from "./models/Sessions_PatchSessionRequest"; +export type { Sessions_Session } from "./models/Sessions_Session"; +export type { Sessions_SingleAgentMultiUserSession } from "./models/Sessions_SingleAgentMultiUserSession"; +export type { Sessions_SingleAgentNoUserSession } from "./models/Sessions_SingleAgentNoUserSession"; +export type { Sessions_SingleAgentSingleUserSession } from "./models/Sessions_SingleAgentSingleUserSession"; +export type { Sessions_UpdateSessionRequest } from "./models/Sessions_UpdateSessionRequest"; +export type { Tasks_CEL } from "./models/Tasks_CEL"; +export type { Tasks_CreateOrUpdateTaskRequest } from "./models/Tasks_CreateOrUpdateTaskRequest"; +export type { Tasks_CreateTaskRequest } from "./models/Tasks_CreateTaskRequest"; +export type { Tasks_ErrorWorkflowStep } from "./models/Tasks_ErrorWorkflowStep"; +export type { Tasks_EvaluateStep } from "./models/Tasks_EvaluateStep"; +export type { Tasks_IfElseWorkflowStep } from "./models/Tasks_IfElseWorkflowStep"; +export type { Tasks_PatchTaskRequest } from "./models/Tasks_PatchTaskRequest"; +export type { Tasks_PromptStep } from "./models/Tasks_PromptStep"; +export type { Tasks_Task } from "./models/Tasks_Task"; +export type { Tasks_ToolCallStep } from "./models/Tasks_ToolCallStep"; +export type { Tasks_UpdateTaskRequest } from "./models/Tasks_UpdateTaskRequest"; +export type { Tasks_WorkflowStep } from "./models/Tasks_WorkflowStep"; +export type { Tasks_YieldStep } from "./models/Tasks_YieldStep"; +export type { Tools_ChosenFunctionCall } from "./models/Tools_ChosenFunctionCall"; +export type { Tools_ChosenToolCall } from "./models/Tools_ChosenToolCall"; +export type { Tools_CreateToolRequest } from "./models/Tools_CreateToolRequest"; +export type { Tools_FunctionCallOption } from "./models/Tools_FunctionCallOption"; +export type { Tools_FunctionDef } from "./models/Tools_FunctionDef"; +export type { Tools_FunctionDefUpdate } from "./models/Tools_FunctionDefUpdate"; +export type { Tools_FunctionTool } from "./models/Tools_FunctionTool"; +export type { Tools_PatchToolRequest } from "./models/Tools_PatchToolRequest"; +export type { Tools_Tool } from "./models/Tools_Tool"; +export type { Tools_ToolResponse } from "./models/Tools_ToolResponse"; +export type { Tools_ToolType } from "./models/Tools_ToolType"; +export type { Tools_UpdateToolRequest } from "./models/Tools_UpdateToolRequest"; +export type { Users_CreateOrUpdateUserRequest } from "./models/Users_CreateOrUpdateUserRequest"; +export type { Users_CreateUserRequest } from "./models/Users_CreateUserRequest"; +export type { Users_PatchUserRequest } from "./models/Users_PatchUserRequest"; +export type { Users_UpdateUserRequest } from "./models/Users_UpdateUserRequest"; +export type { Users_User } from "./models/Users_User"; -export { $Agent } from "./schemas/$Agent"; -export { $agent_id } from "./schemas/$agent_id"; -export { $AgentDefaultSettings } from "./schemas/$AgentDefaultSettings"; -export { $CELObject } from "./schemas/$CELObject"; -export { $ChatInput } from "./schemas/$ChatInput"; -export { $ChatInputData } from "./schemas/$ChatInputData"; -export { $ChatMLImageContentPart } from "./schemas/$ChatMLImageContentPart"; -export { $ChatMLMessage } from "./schemas/$ChatMLMessage"; -export { $ChatMLTextContentPart } from "./schemas/$ChatMLTextContentPart"; -export { $ChatResponse } from "./schemas/$ChatResponse"; -export { $ChatSettings } from "./schemas/$ChatSettings"; -export { $CompletionUsage } from "./schemas/$CompletionUsage"; -export { $CreateAgentRequest } from "./schemas/$CreateAgentRequest"; -export { $CreateDoc } from "./schemas/$CreateDoc"; -export { $CreateExecution } from "./schemas/$CreateExecution"; -export { $CreateSessionRequest } from "./schemas/$CreateSessionRequest"; -export { $CreateTask } from "./schemas/$CreateTask"; -export { $CreateToolRequest } from "./schemas/$CreateToolRequest"; -export { $CreateUserRequest } from "./schemas/$CreateUserRequest"; -export { $Doc } from "./schemas/$Doc"; -export { $doc_id } from "./schemas/$doc_id"; -export { $DocIds } from "./schemas/$DocIds"; -export { $ErrorWorkflowStep } from "./schemas/$ErrorWorkflowStep"; -export { $EvaluateWorkflowStep } from "./schemas/$EvaluateWorkflowStep"; -export { $Execution } from "./schemas/$Execution"; -export { $execution_id } from "./schemas/$execution_id"; -export { $ExecutionStatus } from "./schemas/$ExecutionStatus"; -export { $ExecutionTransition } from "./schemas/$ExecutionTransition"; -export { $FunctionCallOption } from "./schemas/$FunctionCallOption"; -export { $FunctionDef } from "./schemas/$FunctionDef"; -export { $FunctionParameters } from "./schemas/$FunctionParameters"; -export { $IfElseWorkflowStep } from "./schemas/$IfElseWorkflowStep"; -export { $InputChatMLMessage } from "./schemas/$InputChatMLMessage"; -export { $job_id } from "./schemas/$job_id"; -export { $JobStatus } from "./schemas/$JobStatus"; -export { $Memory } from "./schemas/$Memory"; -export { $memory_id } from "./schemas/$memory_id"; -export { $MemoryAccessOptions } from "./schemas/$MemoryAccessOptions"; -export { $message_id } from "./schemas/$message_id"; -export { $NamedToolChoice } from "./schemas/$NamedToolChoice"; -export { $PartialFunctionDef } from "./schemas/$PartialFunctionDef"; -export { $PatchAgentRequest } from "./schemas/$PatchAgentRequest"; -export { $PatchSessionRequest } from "./schemas/$PatchSessionRequest"; -export { $PatchToolRequest } from "./schemas/$PatchToolRequest"; -export { $PatchUserRequest } from "./schemas/$PatchUserRequest"; -export { $PromptWorkflowStep } from "./schemas/$PromptWorkflowStep"; -export { $ResourceCreatedResponse } from "./schemas/$ResourceCreatedResponse"; -export { $ResourceDeletedResponse } from "./schemas/$ResourceDeletedResponse"; -export { $ResourceUpdatedResponse } from "./schemas/$ResourceUpdatedResponse"; -export { $Session } from "./schemas/$Session"; -export { $session_id } from "./schemas/$session_id"; -export { $Suggestion } from "./schemas/$Suggestion"; -export { $Task } from "./schemas/$Task"; -export { $task_id } from "./schemas/$task_id"; -export { $Tool } from "./schemas/$Tool"; -export { $tool_id } from "./schemas/$tool_id"; -export { $ToolCallWorkflowStep } from "./schemas/$ToolCallWorkflowStep"; -export { $ToolChoiceOption } from "./schemas/$ToolChoiceOption"; -export { $ToolResponse } from "./schemas/$ToolResponse"; -export { $transition_id } from "./schemas/$transition_id"; -export { $TransitionType } from "./schemas/$TransitionType"; -export { $UpdateAgentRequest } from "./schemas/$UpdateAgentRequest"; -export { $UpdateSessionRequest } from "./schemas/$UpdateSessionRequest"; -export { $UpdateToolRequest } from "./schemas/$UpdateToolRequest"; -export { $UpdateUserRequest } from "./schemas/$UpdateUserRequest"; -export { $User } from "./schemas/$User"; -export { $user_id } from "./schemas/$user_id"; -export { $WorkflowStep } from "./schemas/$WorkflowStep"; -export { $YieldWorkflowStep } from "./schemas/$YieldWorkflowStep"; +export { $Agents_Agent } from "./schemas/$Agents_Agent"; +export { $Agents_CreateAgentRequest } from "./schemas/$Agents_CreateAgentRequest"; +export { $Agents_CreateOrUpdateAgentRequest } from "./schemas/$Agents_CreateOrUpdateAgentRequest"; +export { $Agents_PatchAgentRequest } from "./schemas/$Agents_PatchAgentRequest"; +export { $Agents_UpdateAgentRequest } from "./schemas/$Agents_UpdateAgentRequest"; +export { $Chat_CompletionResponseFormat } from "./schemas/$Chat_CompletionResponseFormat"; +export { $Chat_GenerationPreset } from "./schemas/$Chat_GenerationPreset"; +export { $Chat_GenerationPresetSettings } from "./schemas/$Chat_GenerationPresetSettings"; +export { $Chat_OpenAISettings } from "./schemas/$Chat_OpenAISettings"; +export { $Chat_vLLMSettings } from "./schemas/$Chat_vLLMSettings"; +export { $Common_identifierSafeUnicode } from "./schemas/$Common_identifierSafeUnicode"; +export { $Common_limit } from "./schemas/$Common_limit"; +export { $Common_logit_bias } from "./schemas/$Common_logit_bias"; +export { $Common_offset } from "./schemas/$Common_offset"; +export { $Common_toolRef } from "./schemas/$Common_toolRef"; +export { $Common_uuid } from "./schemas/$Common_uuid"; +export { $Common_validPythonIdentifier } from "./schemas/$Common_validPythonIdentifier"; +export { $Docs_Doc } from "./schemas/$Docs_Doc"; +export { $Docs_DocOwner } from "./schemas/$Docs_DocOwner"; +export { $Docs_DocReference } from "./schemas/$Docs_DocReference"; +export { $Docs_DocSearchRequest } from "./schemas/$Docs_DocSearchRequest"; +export { $Docs_HybridDocSearchRequest } from "./schemas/$Docs_HybridDocSearchRequest"; +export { $Docs_TextOnlyDocSearchRequest } from "./schemas/$Docs_TextOnlyDocSearchRequest"; +export { $Docs_VectorDocSearchRequest } from "./schemas/$Docs_VectorDocSearchRequest"; +export { $Entries_BaseChatMLContentPart } from "./schemas/$Entries_BaseChatMLContentPart"; +export { $Entries_ChatMLImageContentPart } from "./schemas/$Entries_ChatMLImageContentPart"; +export { $Entries_ChatMLRole } from "./schemas/$Entries_ChatMLRole"; +export { $Entries_ChatMLTextContentPart } from "./schemas/$Entries_ChatMLTextContentPart"; +export { $Entries_Entry } from "./schemas/$Entries_Entry"; +export { $Entries_History } from "./schemas/$Entries_History"; +export { $Entries_ImageDetail } from "./schemas/$Entries_ImageDetail"; +export { $Entries_ImageURL } from "./schemas/$Entries_ImageURL"; +export { $Entries_InputChatMLMessage } from "./schemas/$Entries_InputChatMLMessage"; +export { $Entries_Relation } from "./schemas/$Entries_Relation"; +export { $Executions_CreateExecutionRequest } from "./schemas/$Executions_CreateExecutionRequest"; +export { $Executions_Execution } from "./schemas/$Executions_Execution"; +export { $Executions_ResumeExecutionRequest } from "./schemas/$Executions_ResumeExecutionRequest"; +export { $Executions_StopExecutionRequest } from "./schemas/$Executions_StopExecutionRequest"; +export { $Executions_TaskTokenResumeExecutionRequest } from "./schemas/$Executions_TaskTokenResumeExecutionRequest"; +export { $Executions_Transition } from "./schemas/$Executions_Transition"; +export { $Executions_UpdateExecutionRequest } from "./schemas/$Executions_UpdateExecutionRequest"; +export { $Jobs_JobState } from "./schemas/$Jobs_JobState"; +export { $Jobs_JobStatus } from "./schemas/$Jobs_JobStatus"; +export { $Sessions_CreateOrUpdateSessionRequest } from "./schemas/$Sessions_CreateOrUpdateSessionRequest"; +export { $Sessions_CreateSessionRequest } from "./schemas/$Sessions_CreateSessionRequest"; +export { $Sessions_MultiAgentMultiUserSession } from "./schemas/$Sessions_MultiAgentMultiUserSession"; +export { $Sessions_MultiAgentNoUserSession } from "./schemas/$Sessions_MultiAgentNoUserSession"; +export { $Sessions_MultiAgentSingleUserSession } from "./schemas/$Sessions_MultiAgentSingleUserSession"; +export { $Sessions_PatchSessionRequest } from "./schemas/$Sessions_PatchSessionRequest"; +export { $Sessions_Session } from "./schemas/$Sessions_Session"; +export { $Sessions_SingleAgentMultiUserSession } from "./schemas/$Sessions_SingleAgentMultiUserSession"; +export { $Sessions_SingleAgentNoUserSession } from "./schemas/$Sessions_SingleAgentNoUserSession"; +export { $Sessions_SingleAgentSingleUserSession } from "./schemas/$Sessions_SingleAgentSingleUserSession"; +export { $Sessions_UpdateSessionRequest } from "./schemas/$Sessions_UpdateSessionRequest"; +export { $Tasks_CEL } from "./schemas/$Tasks_CEL"; +export { $Tasks_CreateOrUpdateTaskRequest } from "./schemas/$Tasks_CreateOrUpdateTaskRequest"; +export { $Tasks_CreateTaskRequest } from "./schemas/$Tasks_CreateTaskRequest"; +export { $Tasks_ErrorWorkflowStep } from "./schemas/$Tasks_ErrorWorkflowStep"; +export { $Tasks_EvaluateStep } from "./schemas/$Tasks_EvaluateStep"; +export { $Tasks_IfElseWorkflowStep } from "./schemas/$Tasks_IfElseWorkflowStep"; +export { $Tasks_PatchTaskRequest } from "./schemas/$Tasks_PatchTaskRequest"; +export { $Tasks_PromptStep } from "./schemas/$Tasks_PromptStep"; +export { $Tasks_Task } from "./schemas/$Tasks_Task"; +export { $Tasks_ToolCallStep } from "./schemas/$Tasks_ToolCallStep"; +export { $Tasks_UpdateTaskRequest } from "./schemas/$Tasks_UpdateTaskRequest"; +export { $Tasks_WorkflowStep } from "./schemas/$Tasks_WorkflowStep"; +export { $Tasks_YieldStep } from "./schemas/$Tasks_YieldStep"; +export { $Tools_ChosenFunctionCall } from "./schemas/$Tools_ChosenFunctionCall"; +export { $Tools_ChosenToolCall } from "./schemas/$Tools_ChosenToolCall"; +export { $Tools_CreateToolRequest } from "./schemas/$Tools_CreateToolRequest"; +export { $Tools_FunctionCallOption } from "./schemas/$Tools_FunctionCallOption"; +export { $Tools_FunctionDef } from "./schemas/$Tools_FunctionDef"; +export { $Tools_FunctionDefUpdate } from "./schemas/$Tools_FunctionDefUpdate"; +export { $Tools_FunctionTool } from "./schemas/$Tools_FunctionTool"; +export { $Tools_PatchToolRequest } from "./schemas/$Tools_PatchToolRequest"; +export { $Tools_Tool } from "./schemas/$Tools_Tool"; +export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse"; +export { $Tools_ToolType } from "./schemas/$Tools_ToolType"; +export { $Tools_UpdateToolRequest } from "./schemas/$Tools_UpdateToolRequest"; +export { $Users_CreateOrUpdateUserRequest } from "./schemas/$Users_CreateOrUpdateUserRequest"; +export { $Users_CreateUserRequest } from "./schemas/$Users_CreateUserRequest"; +export { $Users_PatchUserRequest } from "./schemas/$Users_PatchUserRequest"; +export { $Users_UpdateUserRequest } from "./schemas/$Users_UpdateUserRequest"; +export { $Users_User } from "./schemas/$Users_User"; export { DefaultService } from "./services/DefaultService"; diff --git a/sdks/ts/src/api/models/Agent.ts b/sdks/ts/src/api/models/Agent.ts deleted file mode 100644 index e02e429e6..000000000 --- a/sdks/ts/src/api/models/Agent.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AgentDefaultSettings } from "./AgentDefaultSettings"; -export type Agent = { - /** - * Name of the agent - */ - name: string; - /** - * About the agent - */ - about?: string; - /** - * Agent created at (RFC-3339 format) - */ - created_at?: string; - /** - * Agent updated at (RFC-3339 format) - */ - updated_at?: string; - /** - * Agent id (UUID) - */ - id: string; - /** - * Default settings for all sessions created by this agent - */ - default_settings?: AgentDefaultSettings; - /** - * The model to use with this agent - */ - model: string; - /** - * Optional metadata - */ - metadata?: Record; - /** - * Instructions for the agent - */ - instructions?: string | Array; -}; diff --git a/sdks/ts/src/api/models/AgentDefaultSettings.ts b/sdks/ts/src/api/models/AgentDefaultSettings.ts deleted file mode 100644 index e34795ff6..000000000 --- a/sdks/ts/src/api/models/AgentDefaultSettings.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type AgentDefaultSettings = { - /** - * (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. - */ - frequency_penalty?: number | null; - /** - * (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - */ - length_penalty?: number | null; - /** - * (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. - */ - presence_penalty?: number | null; - /** - * (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. - */ - repetition_penalty?: number | null; - /** - * 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. - */ - temperature?: number | null; - /** - * 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. - */ - top_p?: number | null; - /** - * Minimum probability compared to leading token to be considered - */ - min_p?: number; - /** - * Generation preset name (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - */ - preset?: - | "problem_solving" - | "conversational" - | "fun" - | "prose" - | "creative" - | "business" - | "deterministic" - | "code" - | "multilingual"; -}; diff --git a/sdks/ts/src/api/models/Agents_Agent.ts b/sdks/ts/src/api/models/Agents_Agent.ts new file mode 100644 index 000000000..c92c84c33 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_Agent.ts @@ -0,0 +1,44 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Agents_Agent = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts b/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts new file mode 100644 index 000000000..56d5ff6c5 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts @@ -0,0 +1,41 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for creating a agent (and associated documents) + */ +export type Agents_CreateAgentRequest = { + metadata?: Record; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; + /** + * Documents to index for this agent. (Max: 100 items) + */ + docs: Array; +}; diff --git a/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts new file mode 100644 index 000000000..282bdb28b --- /dev/null +++ b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts @@ -0,0 +1,36 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Agents_CreateOrUpdateAgentRequest = { + id: Common_uuid; + metadata?: Record; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts b/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts new file mode 100644 index 000000000..52f60bb04 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for patching a agent + */ +export type Agents_PatchAgentRequest = { + metadata?: Record; + /** + * Name of the agent + */ + name?: Common_identifierSafeUnicode; + /** + * About the agent + */ + about?: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model?: string; + /** + * Instructions for the agent + */ + instructions?: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts b/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts new file mode 100644 index 000000000..1b5aa4c23 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for updating a agent + */ +export type Agents_UpdateAgentRequest = { + metadata?: Record; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/ChatInput.ts b/sdks/ts/src/api/models/ChatInput.ts deleted file mode 100644 index 866fe2718..000000000 --- a/sdks/ts/src/api/models/ChatInput.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ChatInputData } from "./ChatInputData"; -import type { ChatSettings } from "./ChatSettings"; -import type { MemoryAccessOptions } from "./MemoryAccessOptions"; -export type ChatInput = ChatInputData & ChatSettings & MemoryAccessOptions; diff --git a/sdks/ts/src/api/models/ChatInputData.ts b/sdks/ts/src/api/models/ChatInputData.ts deleted file mode 100644 index 5255c50e8..000000000 --- a/sdks/ts/src/api/models/ChatInputData.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { InputChatMLMessage } from "./InputChatMLMessage"; -import type { NamedToolChoice } from "./NamedToolChoice"; -import type { Tool } from "./Tool"; -import type { ToolChoiceOption } from "./ToolChoiceOption"; -export type ChatInputData = { - /** - * A list of new input messages comprising the conversation so far. - */ - messages: Array; - /** - * (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 - */ - tools?: Array | null; - /** - * Can be one of existing tools given to the agent earlier or the ones included in the request - */ - tool_choice?: (ToolChoiceOption | NamedToolChoice) | null; -}; diff --git a/sdks/ts/src/api/models/ChatMLImageContentPart.ts b/sdks/ts/src/api/models/ChatMLImageContentPart.ts deleted file mode 100644 index 3d41fe77a..000000000 --- a/sdks/ts/src/api/models/ChatMLImageContentPart.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ChatMLImageContentPart = { - /** - * Fixed to 'image_url' - */ - type: "image_url"; - /** - * Image content part, can be a URL or a base64-encoded image - */ - image_url: { - /** - * URL or base64 data url (e.g. `data:image/jpeg;base64,`) - */ - url: string; - /** - * image detail to feed into the model can be low | high | auto - */ - detail?: "low" | "high" | "auto"; - }; -}; diff --git a/sdks/ts/src/api/models/ChatMLMessage.ts b/sdks/ts/src/api/models/ChatMLMessage.ts deleted file mode 100644 index 8c9418125..000000000 --- a/sdks/ts/src/api/models/ChatMLMessage.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ChatMLMessage = { - /** - * ChatML role (system|assistant|user|function_call|function) - */ - role: "user" | "assistant" | "system" | "function_call" | "function"; - /** - * ChatML content - */ - content: string; - /** - * ChatML name - */ - name?: string; - /** - * Message created at (RFC-3339 format) - */ - created_at: string; - /** - * Message ID - */ - id: string; -}; diff --git a/sdks/ts/src/api/models/ChatResponse.ts b/sdks/ts/src/api/models/ChatResponse.ts deleted file mode 100644 index 6614069fe..000000000 --- a/sdks/ts/src/api/models/ChatResponse.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ChatMLMessage } from "./ChatMLMessage"; -import type { CompletionUsage } from "./CompletionUsage"; -import type { DocIds } from "./DocIds"; -/** - * Represents a chat completion response returned by model, based on the provided input. - */ -export type ChatResponse = { - /** - * A unique identifier for the chat completion. - */ - id: string; - /** - * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. - */ - finish_reason: - | "stop" - | "length" - | "tool_calls" - | "content_filter" - | "function_call"; - /** - * A list of chat completion messages produced as a response. - */ - response: Array>; - usage: CompletionUsage; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs?: Array; - doc_ids: DocIds; -}; diff --git a/sdks/ts/src/api/models/ChatSettings.ts b/sdks/ts/src/api/models/ChatSettings.ts deleted file mode 100644 index c6c899ef3..000000000 --- a/sdks/ts/src/api/models/ChatSettings.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ChatSettings = { - /** - * (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. - */ - frequency_penalty?: number | null; - /** - * (Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - */ - length_penalty?: number | null; - /** - * 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. - * - */ - logit_bias?: Record | null; - /** - * 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. - * - */ - max_tokens?: number | null; - /** - * (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. - */ - presence_penalty?: number | null; - /** - * (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. - */ - repetition_penalty?: number | null; - /** - * 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. - * - */ - response_format?: { - /** - * Must be one of `"text"`, `"regex"` or `"json_object"`. - */ - type?: "text" | "json_object" | "regex"; - /** - * Regular expression pattern to use if `type` is `"regex"` - */ - pattern?: string; - /** - * JSON Schema to use if `type` is `"json_object"` - */ - schema?: any; - }; - /** - * 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. - * - */ - seed?: number | null; - /** - * Up to 4 sequences where the API will stop generating further tokens. - * - */ - stop?: string | null | Array; - /** - * 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). - * - */ - stream?: boolean | null; - /** - * 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. - */ - temperature?: number | null; - /** - * 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. - */ - top_p?: number | null; - /** - * Minimum probability compared to leading token to be considered - */ - min_p?: number; - /** - * Generation preset name (problem_solving|conversational|fun|prose|creative|business|deterministic|code|multilingual) - */ - preset?: - | "problem_solving" - | "conversational" - | "fun" - | "prose" - | "creative" - | "business" - | "deterministic" - | "code" - | "multilingual"; - /** - * Model name - */ - model?: string; -}; diff --git a/sdks/ts/src/api/models/ChatMLTextContentPart.ts b/sdks/ts/src/api/models/Chat_CompletionResponseFormat.ts similarity index 53% rename from sdks/ts/src/api/models/ChatMLTextContentPart.ts rename to sdks/ts/src/api/models/Chat_CompletionResponseFormat.ts index 549c4f98c..94d94ac5a 100644 --- a/sdks/ts/src/api/models/ChatMLTextContentPart.ts +++ b/sdks/ts/src/api/models/Chat_CompletionResponseFormat.ts @@ -2,13 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type ChatMLTextContentPart = { +export type Chat_CompletionResponseFormat = { /** - * Fixed to 'text' + * The format of the response */ - type: "text"; - /** - * Text content part - */ - text: string; + type: "text" | "json_object"; }; diff --git a/sdks/ts/src/api/models/Chat_GenerationPreset.ts b/sdks/ts/src/api/models/Chat_GenerationPreset.ts new file mode 100644 index 000000000..1083d3294 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_GenerationPreset.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + */ +export type Chat_GenerationPreset = + | "problem_solving" + | "conversational" + | "fun" + | "prose" + | "creative" + | "business" + | "deterministic" + | "code" + | "multilingual"; diff --git a/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts b/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts new file mode 100644 index 000000000..230124c0a --- /dev/null +++ b/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPreset } from "./Chat_GenerationPreset"; +export type Chat_GenerationPresetSettings = { + /** + * Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + */ + preset?: Chat_GenerationPreset; +}; diff --git a/sdks/ts/src/api/models/Chat_OpenAISettings.ts b/sdks/ts/src/api/models/Chat_OpenAISettings.ts new file mode 100644 index 000000000..2ab230a6f --- /dev/null +++ b/sdks/ts/src/api/models/Chat_OpenAISettings.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Chat_OpenAISettings = { + /** + * 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. + */ + frequency_penalty?: number; + /** + * 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. + */ + presence_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; +}; diff --git a/sdks/ts/src/api/models/Chat_vLLMSettings.ts b/sdks/ts/src/api/models/Chat_vLLMSettings.ts new file mode 100644 index 000000000..8973da946 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_vLLMSettings.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Chat_vLLMSettings = { + /** + * 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. + */ + repetition_penalty?: number; + /** + * Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + */ + length_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; + /** + * Minimum probability compared to leading token to be considered + */ + min_p?: number; +}; diff --git a/sdks/ts/src/api/models/Common_identifierSafeUnicode.ts b/sdks/ts/src/api/models/Common_identifierSafeUnicode.ts new file mode 100644 index 000000000..42b41faad --- /dev/null +++ b/sdks/ts/src/api/models/Common_identifierSafeUnicode.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * For Unicode character safety + * See: https://unicode.org/reports/tr31/ + * See: https://www.unicode.org/reports/tr39/#Identifier_Characters + */ +export type Common_identifierSafeUnicode = string; diff --git a/sdks/ts/src/api/models/Task.ts b/sdks/ts/src/api/models/Common_limit.ts similarity index 67% rename from sdks/ts/src/api/models/Task.ts rename to sdks/ts/src/api/models/Common_limit.ts index c873c994c..d29076ef3 100644 --- a/sdks/ts/src/api/models/Task.ts +++ b/sdks/ts/src/api/models/Common_limit.ts @@ -3,6 +3,6 @@ /* tslint:disable */ /* eslint-disable */ /** - * Describes a Task + * Limit the number of results */ -export type Task = Record; +export type Common_limit = number; diff --git a/sdks/ts/src/api/models/execution_id.ts b/sdks/ts/src/api/models/Common_logit_bias.ts similarity index 76% rename from sdks/ts/src/api/models/execution_id.ts rename to sdks/ts/src/api/models/Common_logit_bias.ts index ab861633b..3df5e7b43 100644 --- a/sdks/ts/src/api/models/execution_id.ts +++ b/sdks/ts/src/api/models/Common_logit_bias.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type execution_id = string; +export type Common_logit_bias = number; diff --git a/sdks/ts/src/api/models/CreateTask.ts b/sdks/ts/src/api/models/Common_offset.ts similarity index 66% rename from sdks/ts/src/api/models/CreateTask.ts rename to sdks/ts/src/api/models/Common_offset.ts index bad05898e..742987b41 100644 --- a/sdks/ts/src/api/models/CreateTask.ts +++ b/sdks/ts/src/api/models/Common_offset.ts @@ -3,6 +3,6 @@ /* tslint:disable */ /* eslint-disable */ /** - * Describes a Task + * Offset to apply to the results */ -export type CreateTask = Record; +export type Common_offset = number; diff --git a/sdks/ts/src/api/models/Common_toolRef.ts b/sdks/ts/src/api/models/Common_toolRef.ts new file mode 100644 index 000000000..76f396892 --- /dev/null +++ b/sdks/ts/src/api/models/Common_toolRef.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Naming convention for tool references. Tools are resolved in order: `step-settings` -> `task` -> `agent` + */ +export type Common_toolRef = string; diff --git a/sdks/ts/src/api/models/job_id.ts b/sdks/ts/src/api/models/Common_uuid.ts similarity index 79% rename from sdks/ts/src/api/models/job_id.ts rename to sdks/ts/src/api/models/Common_uuid.ts index 88811cb8c..b8bf0d880 100644 --- a/sdks/ts/src/api/models/job_id.ts +++ b/sdks/ts/src/api/models/Common_uuid.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type job_id = string; +export type Common_uuid = string; diff --git a/sdks/ts/src/api/models/TransitionType.ts b/sdks/ts/src/api/models/Common_validPythonIdentifier.ts similarity index 62% rename from sdks/ts/src/api/models/TransitionType.ts rename to sdks/ts/src/api/models/Common_validPythonIdentifier.ts index 19192515d..0ddcc9440 100644 --- a/sdks/ts/src/api/models/TransitionType.ts +++ b/sdks/ts/src/api/models/Common_validPythonIdentifier.ts @@ -3,6 +3,6 @@ /* tslint:disable */ /* eslint-disable */ /** - * Execution Status + * Valid python identifier names */ -export type TransitionType = string; +export type Common_validPythonIdentifier = string; diff --git a/sdks/ts/src/api/models/CompletionUsage.ts b/sdks/ts/src/api/models/CompletionUsage.ts deleted file mode 100644 index 303f9027e..000000000 --- a/sdks/ts/src/api/models/CompletionUsage.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * Usage statistics for the completion request. - */ -export type CompletionUsage = { - /** - * Number of tokens in the generated completion. - */ - completion_tokens: number; - /** - * Number of tokens in the prompt. - */ - prompt_tokens: number; - /** - * Total number of tokens used in the request (prompt + completion). - */ - total_tokens: number; -}; diff --git a/sdks/ts/src/api/models/CreateAgentRequest.ts b/sdks/ts/src/api/models/CreateAgentRequest.ts deleted file mode 100644 index 8eac6089d..000000000 --- a/sdks/ts/src/api/models/CreateAgentRequest.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AgentDefaultSettings } from "./AgentDefaultSettings"; -import type { CreateDoc } from "./CreateDoc"; -import type { CreateToolRequest } from "./CreateToolRequest"; -/** - * A valid request payload for creating an agent - */ -export type CreateAgentRequest = { - /** - * Name of the agent - */ - name: string; - /** - * About the agent - */ - about?: string; - /** - * 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. - */ - tools?: Array; - /** - * Default model settings to start every session with - */ - default_settings?: AgentDefaultSettings; - /** - * Name of the model that the agent is supposed to use - */ - model?: string; - /** - * List of docs about agent - */ - docs?: Array; - /** - * (Optional) metadata - */ - metadata?: Record; - /** - * Instructions for the agent - */ - instructions?: string | Array; -}; diff --git a/sdks/ts/src/api/models/CreateDoc.ts b/sdks/ts/src/api/models/CreateDoc.ts deleted file mode 100644 index c897a0abc..000000000 --- a/sdks/ts/src/api/models/CreateDoc.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type CreateDoc = { - /** - * Title describing what this bit of information contains - */ - title: string; - /** - * Information content - */ - content: Array | string; - /** - * Optional metadata - */ - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/CreateExecution.ts b/sdks/ts/src/api/models/CreateExecution.ts deleted file mode 100644 index fe777c0b4..000000000 --- a/sdks/ts/src/api/models/CreateExecution.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ExecutionStatus } from "./ExecutionStatus"; -export type CreateExecution = { - task_id: string; - /** - * JSON Schema of parameters - */ - arguments: Record; - status: ExecutionStatus; -}; diff --git a/sdks/ts/src/api/models/CreateToolRequest.ts b/sdks/ts/src/api/models/CreateToolRequest.ts deleted file mode 100644 index ba1c9196d..000000000 --- a/sdks/ts/src/api/models/CreateToolRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FunctionDef } from "./FunctionDef"; -export type CreateToolRequest = { - /** - * Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now) - */ - type: "function" | "webhook"; - /** - * Function definition and parameters - */ - function: FunctionDef; -}; diff --git a/sdks/ts/src/api/models/CreateUserRequest.ts b/sdks/ts/src/api/models/CreateUserRequest.ts deleted file mode 100644 index 753117f26..000000000 --- a/sdks/ts/src/api/models/CreateUserRequest.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CreateDoc } from "./CreateDoc"; -/** - * A valid request payload for creating a user - */ -export type CreateUserRequest = { - /** - * Name of the user - */ - name?: string; - /** - * About the user - */ - about?: string; - /** - * List of docs about user - */ - docs?: Array; - /** - * (Optional) metadata - */ - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/Doc.ts b/sdks/ts/src/api/models/Doc.ts deleted file mode 100644 index 329cd4bdc..000000000 --- a/sdks/ts/src/api/models/Doc.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Doc = { - /** - * Title describing what this bit of information contains - */ - title: string; - /** - * Information content - */ - content: Array | string; - /** - * ID of doc - */ - id: string; - /** - * Doc created at - */ - created_at: string; - /** - * optional metadata - */ - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/DocIds.ts b/sdks/ts/src/api/models/DocIds.ts deleted file mode 100644 index c33bb4948..000000000 --- a/sdks/ts/src/api/models/DocIds.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DocIds = { - agent_doc_ids: Array; - user_doc_ids: Array; -}; diff --git a/sdks/ts/src/api/models/Docs_Doc.ts b/sdks/ts/src/api/models/Docs_Doc.ts new file mode 100644 index 000000000..3a4c7681d --- /dev/null +++ b/sdks/ts/src/api/models/Docs_Doc.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Docs_Doc = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * Title describing what this document contains + */ + title: Common_identifierSafeUnicode; + /** + * Contents of the document + */ + content: string | Array; +}; diff --git a/sdks/ts/src/api/models/ErrorWorkflowStep.ts b/sdks/ts/src/api/models/Docs_DocOwner.ts similarity index 51% rename from sdks/ts/src/api/models/ErrorWorkflowStep.ts rename to sdks/ts/src/api/models/Docs_DocOwner.ts index 6fe456615..5f22e918e 100644 --- a/sdks/ts/src/api/models/ErrorWorkflowStep.ts +++ b/sdks/ts/src/api/models/Docs_DocOwner.ts @@ -2,6 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type ErrorWorkflowStep = { - error: string; +import type { Common_uuid } from "./Common_uuid"; +export type Docs_DocOwner = { + id: Common_uuid; + role: "user" | "agent"; }; diff --git a/sdks/ts/src/api/models/Docs_DocReference.ts b/sdks/ts/src/api/models/Docs_DocReference.ts new file mode 100644 index 000000000..9848f4079 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_DocReference.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Docs_DocOwner } from "./Docs_DocOwner"; +export type Docs_DocReference = { + /** + * The owner of this document. + */ + owner: Docs_DocOwner; + /** + * ID of the document + */ + readonly id: Common_uuid; + /** + * Snippets referred to of the document + */ + snippet_index: Array; + title?: string; + snippet?: string; +}; diff --git a/sdks/ts/src/api/models/Docs_DocSearchRequest.ts b/sdks/ts/src/api/models/Docs_DocSearchRequest.ts new file mode 100644 index 000000000..a5be8f355 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_DocSearchRequest.ts @@ -0,0 +1,28 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Docs_DocSearchRequest = { + text?: string | Array; + vector?: Array | Array>; + /** + * The search mode + */ + mode: "vector" | "text" | "hybrid"; + /** + * The confidence cutoff level + */ + confidence: number; + /** + * The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + */ + alpha: number; + /** + * Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. + */ + mmr: boolean; + /** + * The language to be used for text-only search. Support for other languages coming soon. + */ + lang: "en-US"; +}; diff --git a/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts new file mode 100644 index 000000000..578ef02c7 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Docs_DocSearchRequest } from "./Docs_DocSearchRequest"; +export type Docs_HybridDocSearchRequest = Docs_DocSearchRequest & { + /** + * Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. + */ + text?: string | Array; + /** + * Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + */ + vector?: Array | Array>; + mode: "hybrid"; +}; diff --git a/sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts new file mode 100644 index 000000000..dc6a24b85 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Docs_DocSearchRequest } from "./Docs_DocSearchRequest"; +export type Docs_TextOnlyDocSearchRequest = Docs_DocSearchRequest & { + text: string | Array; + /** + * Text or texts to use in the search. In `text` search mode, only BM25 is used. + */ + text: string | Array; + mode: "text"; +}; diff --git a/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts new file mode 100644 index 000000000..9d63ba1c6 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Docs_DocSearchRequest } from "./Docs_DocSearchRequest"; +export type Docs_VectorDocSearchRequest = Docs_DocSearchRequest & { + vector: Array | Array>; + /** + * Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + */ + vector: Array | Array>; + mode: "vector"; +}; diff --git a/sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts b/sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts new file mode 100644 index 000000000..477a3b93c --- /dev/null +++ b/sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Entries_ImageURL } from "./Entries_ImageURL"; +export type Entries_BaseChatMLContentPart = { + /** + * The type of content part + */ + type: string; + text?: string; + image_url?: Entries_ImageURL; +}; diff --git a/sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts b/sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts new file mode 100644 index 000000000..6d871a960 --- /dev/null +++ b/sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Entries_BaseChatMLContentPart } from "./Entries_BaseChatMLContentPart"; +import type { Entries_ImageURL } from "./Entries_ImageURL"; +export type Entries_ChatMLImageContentPart = Entries_BaseChatMLContentPart & { + image_url: Entries_ImageURL; + /** + * The image URL + */ + image_url: Entries_ImageURL; + /** + * The type (fixed to 'image_url') + */ + type: "image_url"; +}; diff --git a/sdks/ts/src/api/models/Entries_ChatMLRole.ts b/sdks/ts/src/api/models/Entries_ChatMLRole.ts new file mode 100644 index 000000000..0a4789cde --- /dev/null +++ b/sdks/ts/src/api/models/Entries_ChatMLRole.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * ChatML role (system|assistant|user|function_call|function|function_response|auto) + */ +export type Entries_ChatMLRole = + | "user" + | "agent" + | "system" + | "function" + | "function_response" + | "function_call" + | "auto"; diff --git a/sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts b/sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts new file mode 100644 index 000000000..1b48ec707 --- /dev/null +++ b/sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Entries_BaseChatMLContentPart } from "./Entries_BaseChatMLContentPart"; +export type Entries_ChatMLTextContentPart = Entries_BaseChatMLContentPart & { + text: string; + text: string; + /** + * The type (fixed to 'text') + */ + type: "text"; +}; diff --git a/sdks/ts/src/api/models/Entries_Entry.ts b/sdks/ts/src/api/models/Entries_Entry.ts new file mode 100644 index 000000000..f3e40ce03 --- /dev/null +++ b/sdks/ts/src/api/models/Entries_Entry.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Entries_ChatMLRole } from "./Entries_ChatMLRole"; +import type { Tools_ChosenToolCall } from "./Tools_ChosenToolCall"; +import type { Tools_Tool } from "./Tools_Tool"; +import type { Tools_ToolResponse } from "./Tools_ToolResponse"; +export type Entries_Entry = { + role: Entries_ChatMLRole; + name: string | null; + content: Tools_Tool | Tools_ChosenToolCall | string | Tools_ToolResponse; + source: + | "api_request" + | "api_response" + | "tool_response" + | "internal" + | "summarizer" + | "meta"; + /** + * This is the time that this event refers to. + */ + timestamp: number; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Entries_History.ts b/sdks/ts/src/api/models/Entries_History.ts new file mode 100644 index 000000000..784972435 --- /dev/null +++ b/sdks/ts/src/api/models/Entries_History.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Entries_Entry } from "./Entries_Entry"; +import type { Entries_Relation } from "./Entries_Relation"; +export type Entries_History = { + entries: Array; + relations: Array; + readonly session_id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; +}; diff --git a/sdks/ts/src/api/models/ExecutionStatus.ts b/sdks/ts/src/api/models/Entries_ImageDetail.ts similarity index 63% rename from sdks/ts/src/api/models/ExecutionStatus.ts rename to sdks/ts/src/api/models/Entries_ImageDetail.ts index 47af8d064..5d4d49347 100644 --- a/sdks/ts/src/api/models/ExecutionStatus.ts +++ b/sdks/ts/src/api/models/Entries_ImageDetail.ts @@ -3,6 +3,6 @@ /* tslint:disable */ /* eslint-disable */ /** - * Execution Status + * Image detail level */ -export type ExecutionStatus = string; +export type Entries_ImageDetail = "low" | "high" | "auto"; diff --git a/sdks/ts/src/api/models/Entries_ImageURL.ts b/sdks/ts/src/api/models/Entries_ImageURL.ts new file mode 100644 index 000000000..0fe36804d --- /dev/null +++ b/sdks/ts/src/api/models/Entries_ImageURL.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Entries_ImageDetail } from "./Entries_ImageDetail"; +export type Entries_ImageURL = { + /** + * Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + */ + url: string; + /** + * The detail level of the image + */ + detail: Entries_ImageDetail; +}; diff --git a/sdks/ts/src/api/models/InputChatMLMessage.ts b/sdks/ts/src/api/models/Entries_InputChatMLMessage.ts similarity index 53% rename from sdks/ts/src/api/models/InputChatMLMessage.ts rename to sdks/ts/src/api/models/Entries_InputChatMLMessage.ts index fb3f391d7..e735b8bd1 100644 --- a/sdks/ts/src/api/models/InputChatMLMessage.ts +++ b/sdks/ts/src/api/models/Entries_InputChatMLMessage.ts @@ -2,17 +2,18 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type InputChatMLMessage = { +import type { Entries_ChatMLRole } from "./Entries_ChatMLRole"; +export type Entries_InputChatMLMessage = { /** - * ChatML role (system|assistant|user|function_call|function|auto) + * The role of the message */ - role: "user" | "assistant" | "system" | "function_call" | "function" | "auto"; + role: Entries_ChatMLRole; /** - * ChatML content + * The content parts of the message */ - content: string; + content: string | Array; /** - * ChatML name + * Name */ name?: string; /** diff --git a/sdks/ts/src/api/models/Entries_Relation.ts b/sdks/ts/src/api/models/Entries_Relation.ts new file mode 100644 index 000000000..2f7b7383c --- /dev/null +++ b/sdks/ts/src/api/models/Entries_Relation.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Entries_Relation = { + head: Common_uuid; + relation: string; + tail: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Execution.ts b/sdks/ts/src/api/models/Execution.ts deleted file mode 100644 index 4bcbd3762..000000000 --- a/sdks/ts/src/api/models/Execution.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ExecutionStatus } from "./ExecutionStatus"; -export type Execution = { - id: string; - task_id: string; - status: ExecutionStatus; - /** - * JSON of parameters - */ - arguments: Record; - user_id?: string | null; - session_id?: string | null; - created_at: string; - updated_at: string; -}; diff --git a/sdks/ts/src/api/models/ExecutionTransition.ts b/sdks/ts/src/api/models/ExecutionTransition.ts deleted file mode 100644 index ff02394fc..000000000 --- a/sdks/ts/src/api/models/ExecutionTransition.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { TransitionType } from "./TransitionType"; -export type ExecutionTransition = { - id: string; - execution_id: string; - type: TransitionType; - from: Array; - to: Array | null; - task_token?: string | null; - /** - * Outputs from an Execution Transition - */ - outputs: Record; - /** - * (Optional) metadata - */ - metadata?: Record; - created_at: string; - updated_at?: string; -}; diff --git a/sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts b/sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts new file mode 100644 index 000000000..8fa82be64 --- /dev/null +++ b/sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Payload for creating an execution + */ +export type Executions_CreateExecutionRequest = { + /** + * The input to the execution + */ + input: Record; +}; diff --git a/sdks/ts/src/api/models/Executions_Execution.ts b/sdks/ts/src/api/models/Executions_Execution.ts new file mode 100644 index 000000000..8c972be99 --- /dev/null +++ b/sdks/ts/src/api/models/Executions_Execution.ts @@ -0,0 +1,35 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Executions_Execution = { + /** + * The ID of the task that the execution is running + */ + readonly task_id: Common_uuid; + /** + * The status of the execution + */ + readonly status: + | "queued" + | "starting" + | "running" + | "awaiting_input" + | "succeeded" + | "failed" + | "cancelled"; + /** + * The input to the execution + */ + input: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Executions_ResumeExecutionRequest.ts b/sdks/ts/src/api/models/Executions_ResumeExecutionRequest.ts new file mode 100644 index 000000000..edc634cf1 --- /dev/null +++ b/sdks/ts/src/api/models/Executions_ResumeExecutionRequest.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Executions_UpdateExecutionRequest } from "./Executions_UpdateExecutionRequest"; +export type Executions_ResumeExecutionRequest = + Executions_UpdateExecutionRequest & { + status: "running"; + /** + * The input to resume the execution with + */ + input?: Record; + }; diff --git a/sdks/ts/src/api/models/Executions_StopExecutionRequest.ts b/sdks/ts/src/api/models/Executions_StopExecutionRequest.ts new file mode 100644 index 000000000..597bb9040 --- /dev/null +++ b/sdks/ts/src/api/models/Executions_StopExecutionRequest.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Executions_UpdateExecutionRequest } from "./Executions_UpdateExecutionRequest"; +export type Executions_StopExecutionRequest = + Executions_UpdateExecutionRequest & { + status: "cancelled"; + /** + * The reason for stopping the execution + */ + reason: string | null; + }; diff --git a/sdks/ts/src/api/models/Executions_TaskTokenResumeExecutionRequest.ts b/sdks/ts/src/api/models/Executions_TaskTokenResumeExecutionRequest.ts new file mode 100644 index 000000000..2f988e385 --- /dev/null +++ b/sdks/ts/src/api/models/Executions_TaskTokenResumeExecutionRequest.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Executions_TaskTokenResumeExecutionRequest = { + status: "running"; + /** + * A Task Token is a unique identifier for a specific Task Execution. + */ + task_token: string; + /** + * The input to resume the execution with + */ + input?: Record; +}; diff --git a/sdks/ts/src/api/models/Executions_Transition.ts b/sdks/ts/src/api/models/Executions_Transition.ts new file mode 100644 index 000000000..68a47cf57 --- /dev/null +++ b/sdks/ts/src/api/models/Executions_Transition.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Executions_Transition = { + readonly type: "finish" | "wait" | "error" | "step" | "cancelled"; + readonly execution_id: Common_uuid; + readonly outputs: Record; + readonly current: Array; + readonly next: Array | null; + readonly id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; +}; diff --git a/sdks/ts/src/api/models/Executions_UpdateExecutionRequest.ts b/sdks/ts/src/api/models/Executions_UpdateExecutionRequest.ts new file mode 100644 index 000000000..d14138173 --- /dev/null +++ b/sdks/ts/src/api/models/Executions_UpdateExecutionRequest.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Executions_UpdateExecutionRequest = { + status: + | "queued" + | "starting" + | "running" + | "awaiting_input" + | "succeeded" + | "failed" + | "cancelled"; +}; diff --git a/sdks/ts/src/api/models/FunctionCallOption.ts b/sdks/ts/src/api/models/FunctionCallOption.ts deleted file mode 100644 index 0a314beec..000000000 --- a/sdks/ts/src/api/models/FunctionCallOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. - * - */ -export type FunctionCallOption = { - /** - * The name of the function to call. - */ - name: string; -}; diff --git a/sdks/ts/src/api/models/FunctionDef.ts b/sdks/ts/src/api/models/FunctionDef.ts deleted file mode 100644 index d8e93f764..000000000 --- a/sdks/ts/src/api/models/FunctionDef.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FunctionParameters } from "./FunctionParameters"; -export type FunctionDef = { - /** - * A description of what the function does, used by the model to choose when and how to call the function. - */ - description?: string; - /** - * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - */ - name: string; - /** - * Parameters accepeted by this function - */ - parameters: FunctionParameters; -}; diff --git a/sdks/ts/src/api/models/FunctionParameters.ts b/sdks/ts/src/api/models/FunctionParameters.ts deleted file mode 100644 index cca515ba4..000000000 --- a/sdks/ts/src/api/models/FunctionParameters.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * The parameters the functions accepts, described as a JSON Schema object. - */ -export type FunctionParameters = Record; diff --git a/sdks/ts/src/api/models/IfElseWorkflowStep.ts b/sdks/ts/src/api/models/IfElseWorkflowStep.ts deleted file mode 100644 index d15bc7a51..000000000 --- a/sdks/ts/src/api/models/IfElseWorkflowStep.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { YieldWorkflowStep } from "./YieldWorkflowStep"; -export type IfElseWorkflowStep = { - if: string; - then: YieldWorkflowStep; - else: YieldWorkflowStep; -}; diff --git a/sdks/ts/src/api/models/JobStatus.ts b/sdks/ts/src/api/models/JobStatus.ts deleted file mode 100644 index 719c53696..000000000 --- a/sdks/ts/src/api/models/JobStatus.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type JobStatus = { - /** - * Name of the job - */ - name: string; - /** - * Reason for current state - */ - reason?: string; - /** - * Job created at (RFC-3339 format) - */ - created_at: string; - /** - * Job updated at (RFC-3339 format) - */ - updated_at?: string; - /** - * Job id (UUID) - */ - id: string; - /** - * Whether this Job supports progress updates - */ - has_progress?: boolean; - /** - * Progress percentage - */ - progress?: number; - /** - * Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) - */ - state: - | "pending" - | "in_progress" - | "retrying" - | "succeeded" - | "aborted" - | "failed" - | "unknown"; -}; diff --git a/sdks/ts/src/api/models/Jobs_JobState.ts b/sdks/ts/src/api/models/Jobs_JobState.ts new file mode 100644 index 000000000..886df5653 --- /dev/null +++ b/sdks/ts/src/api/models/Jobs_JobState.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) + */ +export type Jobs_JobState = + | "pending" + | "in_progress" + | "retrying" + | "succeeded" + | "aborted" + | "failed" + | "unknown"; diff --git a/sdks/ts/src/api/models/Jobs_JobStatus.ts b/sdks/ts/src/api/models/Jobs_JobStatus.ts new file mode 100644 index 000000000..9ec75c8c7 --- /dev/null +++ b/sdks/ts/src/api/models/Jobs_JobStatus.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +import type { Jobs_JobState } from "./Jobs_JobState"; +export type Jobs_JobStatus = { + readonly id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the job + */ + name: Common_identifierSafeUnicode; + /** + * Reason for the current state of the job + */ + reason: string; + /** + * Whether this Job supports progress updates + */ + has_progress: boolean; + /** + * Progress percentage + */ + progress: number; + /** + * Current state of the job + */ + state: Jobs_JobState; +}; diff --git a/sdks/ts/src/api/models/Memory.ts b/sdks/ts/src/api/models/Memory.ts deleted file mode 100644 index 2b9018b45..000000000 --- a/sdks/ts/src/api/models/Memory.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Memory = { - /** - * ID of the agent - */ - agent_id: string; - /** - * ID of the user - */ - user_id: string; - /** - * Content of the memory - */ - content: string; - /** - * Memory created at (RFC-3339 format) - */ - created_at: string; - /** - * Memory last accessed at (RFC-3339 format) - */ - last_accessed_at?: string; - /** - * Memory happened at (RFC-3339 format) - */ - timestamp?: string; - /** - * Sentiment (valence) of the memory on a scale of -1 to 1 - */ - sentiment?: number; - /** - * Memory id (UUID) - */ - id: string; - /** - * List of entities mentioned in the memory - */ - entities: Array; -}; diff --git a/sdks/ts/src/api/models/MemoryAccessOptions.ts b/sdks/ts/src/api/models/MemoryAccessOptions.ts deleted file mode 100644 index ecf3ac1a4..000000000 --- a/sdks/ts/src/api/models/MemoryAccessOptions.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type MemoryAccessOptions = { - /** - * Whether previous memories should be recalled or not - */ - recall?: boolean; - /** - * Whether this interaction should be recorded in history or not - */ - record?: boolean; - /** - * Whether this interaction should form memories or not - */ - remember?: boolean; -}; diff --git a/sdks/ts/src/api/models/NamedToolChoice.ts b/sdks/ts/src/api/models/NamedToolChoice.ts deleted file mode 100644 index dabc36dbc..000000000 --- a/sdks/ts/src/api/models/NamedToolChoice.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * Specifies a tool the model should use. Use to force the model to call a specific function. - */ -export type NamedToolChoice = { - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: "function"; - function: { - /** - * The name of the function to call. - */ - name: string; - }; -}; diff --git a/sdks/ts/src/api/models/PartialFunctionDef.ts b/sdks/ts/src/api/models/PartialFunctionDef.ts deleted file mode 100644 index 0854adbf5..000000000 --- a/sdks/ts/src/api/models/PartialFunctionDef.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FunctionParameters } from "./FunctionParameters"; -export type PartialFunctionDef = { - /** - * A description of what the function does, used by the model to choose when and how to call the function. - */ - description?: string; - /** - * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - */ - name?: string; - /** - * Parameters accepeted by this function - */ - parameters?: FunctionParameters; -}; diff --git a/sdks/ts/src/api/models/PatchAgentRequest.ts b/sdks/ts/src/api/models/PatchAgentRequest.ts deleted file mode 100644 index 49d5cd64d..000000000 --- a/sdks/ts/src/api/models/PatchAgentRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AgentDefaultSettings } from "./AgentDefaultSettings"; -/** - * A request for patching an agent - */ -export type PatchAgentRequest = { - /** - * About the agent - */ - about?: string; - /** - * Name of the agent - */ - name?: string; - /** - * Name of the model that the agent is supposed to use - */ - model?: string; - /** - * Default model settings to start every session with - */ - default_settings?: AgentDefaultSettings; - /** - * Optional metadata - */ - metadata?: Record; - /** - * Instructions for the agent - */ - instructions?: string | Array; -}; diff --git a/sdks/ts/src/api/models/PatchSessionRequest.ts b/sdks/ts/src/api/models/PatchSessionRequest.ts deleted file mode 100644 index dc2968c9c..000000000 --- a/sdks/ts/src/api/models/PatchSessionRequest.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * A request for patching a session - */ -export type PatchSessionRequest = { - /** - * Updated situation for this session - */ - situation?: string; - /** - * Optional metadata - */ - metadata?: Record; - /** - * Threshold value for the adaptive context functionality - */ - token_budget?: number; - /** - * Action to start on context window overflow - */ - context_overflow?: string; -}; diff --git a/sdks/ts/src/api/models/PatchToolRequest.ts b/sdks/ts/src/api/models/PatchToolRequest.ts deleted file mode 100644 index 5f243f6dc..000000000 --- a/sdks/ts/src/api/models/PatchToolRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { PartialFunctionDef } from "./PartialFunctionDef"; -export type PatchToolRequest = { - /** - * Function definition and parameters - */ - function: PartialFunctionDef; -}; diff --git a/sdks/ts/src/api/models/PromptWorkflowStep.ts b/sdks/ts/src/api/models/PromptWorkflowStep.ts deleted file mode 100644 index a32b3c368..000000000 --- a/sdks/ts/src/api/models/PromptWorkflowStep.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ChatSettings } from "./ChatSettings"; -import type { InputChatMLMessage } from "./InputChatMLMessage"; -export type PromptWorkflowStep = { - /** - * List of ChatML Messages in Jinja Templates - */ - prompt: Array; - settings: ChatSettings; -}; diff --git a/sdks/ts/src/api/models/ResourceCreatedResponse.ts b/sdks/ts/src/api/models/ResourceCreatedResponse.ts deleted file mode 100644 index e693d7dd0..000000000 --- a/sdks/ts/src/api/models/ResourceCreatedResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ResourceCreatedResponse = { - id: string; - created_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs?: Array; -}; diff --git a/sdks/ts/src/api/models/ResourceDeletedResponse.ts b/sdks/ts/src/api/models/ResourceDeletedResponse.ts deleted file mode 100644 index b5664d03f..000000000 --- a/sdks/ts/src/api/models/ResourceDeletedResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ResourceDeletedResponse = { - id: string; - deleted_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs?: Array; -}; diff --git a/sdks/ts/src/api/models/ResourceUpdatedResponse.ts b/sdks/ts/src/api/models/ResourceUpdatedResponse.ts deleted file mode 100644 index 5d5221a8f..000000000 --- a/sdks/ts/src/api/models/ResourceUpdatedResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ResourceUpdatedResponse = { - id: string; - updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs?: Array; -}; diff --git a/sdks/ts/src/api/models/Session.ts b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts similarity index 53% rename from sdks/ts/src/api/models/Session.ts rename to sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts index 4923838a5..786fd4620 100644 --- a/sdks/ts/src/api/models/Session.ts +++ b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts @@ -2,49 +2,34 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type Session = { - /** - * Session id (UUID) - */ - id: string; +import type { Common_uuid } from "./Common_uuid"; +export type Sessions_CreateOrUpdateSessionRequest = { + id: Common_uuid; /** * User ID of user associated with this session */ - user_id?: string; + user?: Common_uuid; + users?: Array; /** * Agent ID of agent associated with this session */ - agent_id: string; + agent?: Common_uuid; + agents?: Array; /** * A specific situation that sets the background for this session */ - situation?: string; - /** - * (null at the beginning) - generated automatically after every interaction - */ - summary?: string; - /** - * Session created at (RFC-3339 format) - */ - created_at?: string; - /** - * Session updated at (RFC-3339 format) - */ - updated_at?: string; - /** - * Optional metadata - */ - metadata?: Record; + situation: string; /** * Render system and assistant message content as jinja templates */ - render_templates?: boolean; + render_templates: boolean; /** * Threshold value for the adaptive context functionality */ - token_budget?: number; + token_budget: number | null; /** * Action to start on context window overflow */ - context_overflow?: string; + context_overflow: string | null; + metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts new file mode 100644 index 000000000..a92ee261c --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +/** + * Payload for creating a session + */ +export type Sessions_CreateSessionRequest = { + /** + * User ID of user associated with this session + */ + user?: Common_uuid; + users?: Array; + /** + * Agent ID of agent associated with this session + */ + agent?: Common_uuid; + agents?: Array; + /** + * A specific situation that sets the background for this session + */ + situation: string; + /** + * Render system and assistant message content as jinja templates + */ + render_templates: boolean; + /** + * Threshold value for the adaptive context functionality + */ + token_budget: number | null; + /** + * Action to start on context window overflow + */ + context_overflow: string | null; + metadata?: Record; +}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts new file mode 100644 index 000000000..8437427fc --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_MultiAgentMultiUserSession = Sessions_Session & { + agents: Array; + users: Array; +}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts new file mode 100644 index 000000000..a684f2dc2 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_MultiAgentNoUserSession = Sessions_Session & { + agents: Array; +}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts new file mode 100644 index 000000000..7a39383c8 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_MultiAgentSingleUserSession = Sessions_Session & { + agents: Array; + user: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/CreateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts similarity index 59% rename from sdks/ts/src/api/models/CreateSessionRequest.ts rename to sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts index d21b3236f..3361c11bd 100644 --- a/sdks/ts/src/api/models/CreateSessionRequest.ts +++ b/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts @@ -3,25 +3,13 @@ /* tslint:disable */ /* eslint-disable */ /** - * A valid request payload for creating a session + * Payload for patching a session */ -export type CreateSessionRequest = { - /** - * (Optional) User ID of user to associate with this session - */ - user_id?: string; - /** - * Agent ID of agent to associate with this session - */ - agent_id: string; +export type Sessions_PatchSessionRequest = { /** * A specific situation that sets the background for this session */ situation?: string; - /** - * Optional metadata - */ - metadata?: Record; /** * Render system and assistant message content as jinja templates */ @@ -29,9 +17,10 @@ export type CreateSessionRequest = { /** * Threshold value for the adaptive context functionality */ - token_budget?: number; + token_budget?: number | null; /** * Action to start on context window overflow */ - context_overflow?: string; + context_overflow?: string | null; + metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Sessions_Session.ts b/sdks/ts/src/api/models/Sessions_Session.ts new file mode 100644 index 000000000..27f997bd3 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_Session.ts @@ -0,0 +1,41 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Sessions_Session = { + /** + * A specific situation that sets the background for this session + */ + situation: string; + /** + * Summary (null at the beginning) - generated automatically after every interaction + */ + readonly summary: string | null; + /** + * Render system and assistant message content as jinja templates + */ + render_templates: boolean; + /** + * Threshold value for the adaptive context functionality + */ + token_budget: number | null; + /** + * Action to start on context window overflow + */ + context_overflow: string | null; + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Discriminator property for Session. + */ + kind?: string; +}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts new file mode 100644 index 000000000..2fb9ce705 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_SingleAgentMultiUserSession = Sessions_Session & { + agent: Common_uuid; + users: Array; +}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts new file mode 100644 index 000000000..5454c6265 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_SingleAgentNoUserSession = Sessions_Session & { + agent: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts new file mode 100644 index 000000000..b4636829b --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_SingleAgentSingleUserSession = Sessions_Session & { + agent: Common_uuid; + user: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/UpdateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts similarity index 53% rename from sdks/ts/src/api/models/UpdateSessionRequest.ts rename to sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts index 89f13a857..5a55a5d27 100644 --- a/sdks/ts/src/api/models/UpdateSessionRequest.ts +++ b/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts @@ -3,23 +3,24 @@ /* tslint:disable */ /* eslint-disable */ /** - * A valid request payload for updating a session + * Payload for updating a session */ -export type UpdateSessionRequest = { +export type Sessions_UpdateSessionRequest = { /** - * Updated situation for this session + * A specific situation that sets the background for this session */ situation: string; /** - * Optional metadata + * Render system and assistant message content as jinja templates */ - metadata?: Record; + render_templates: boolean; /** * Threshold value for the adaptive context functionality */ - token_budget?: number; + token_budget: number | null; /** * Action to start on context window overflow */ - context_overflow?: string; + context_overflow: string | null; + metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Suggestion.ts b/sdks/ts/src/api/models/Suggestion.ts deleted file mode 100644 index 1d1034430..000000000 --- a/sdks/ts/src/api/models/Suggestion.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Suggestion = { - /** - * Suggestion created at (RFC-3339 format) - */ - created_at?: string; - /** - * Whether the suggestion is for the `agent` or a `user` - */ - target: "user" | "agent"; - /** - * The content of the suggestion - */ - content: string; - /** - * The message that produced it - */ - message_id: string; - /** - * Session this suggestion belongs to - */ - session_id: string; -}; diff --git a/sdks/ts/src/api/models/Tasks_CEL.ts b/sdks/ts/src/api/models/Tasks_CEL.ts new file mode 100644 index 000000000..5780c1adb --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_CEL.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * An object where values are strings in the Common Expression Language that get evaluated before being passed downstream + */ +export type Tasks_CEL = string; diff --git a/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts new file mode 100644 index 000000000..c2ee78e0a --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +export type Tasks_CreateOrUpdateTaskRequest = Record< + string, + Array +>; diff --git a/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts new file mode 100644 index 000000000..194742149 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +/** + * Payload for creating a task + */ +export type Tasks_CreateTaskRequest = Record>; diff --git a/sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts new file mode 100644 index 000000000..45972ed2b --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +export type Tasks_ErrorWorkflowStep = Tasks_WorkflowStep & { + /** + * The error message + */ + error: string; +}; diff --git a/sdks/ts/src/api/models/Tasks_EvaluateStep.ts b/sdks/ts/src/api/models/Tasks_EvaluateStep.ts new file mode 100644 index 000000000..82fda88c5 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_EvaluateStep.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_CEL } from "./Tasks_CEL"; +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +export type Tasks_EvaluateStep = Tasks_WorkflowStep & { + /** + * The expression to evaluate + */ + evaluate: Record; +}; diff --git a/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts new file mode 100644 index 000000000..654200e98 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_CEL } from "./Tasks_CEL"; +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +export type Tasks_IfElseWorkflowStep = Tasks_WorkflowStep & { + /** + * The condition to evaluate + */ + if: Tasks_CEL; + /** + * The steps to run if the condition is true + */ + then: Tasks_WorkflowStep; + /** + * The steps to run if the condition is false + */ + else: Tasks_WorkflowStep; +}; diff --git a/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts b/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts new file mode 100644 index 000000000..c35f3de4b --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +/** + * Payload for patching a task + */ +export type Tasks_PatchTaskRequest = Record>; diff --git a/sdks/ts/src/api/models/Tasks_PromptStep.ts b/sdks/ts/src/api/models/Tasks_PromptStep.ts new file mode 100644 index 000000000..f3fdc6dc3 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_PromptStep.ts @@ -0,0 +1,150 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_CompletionResponseFormat } from "./Chat_CompletionResponseFormat"; +import type { Chat_GenerationPreset } from "./Chat_GenerationPreset"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_logit_bias } from "./Common_logit_bias"; +import type { Entries_InputChatMLMessage } from "./Entries_InputChatMLMessage"; +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +export type Tasks_PromptStep = Tasks_WorkflowStep & { + /** + * The prompt to run + */ + prompt: string | Array; + /** + * Settings for the prompt + */ + settings: + | { + /** + * Identifier of the model to be used + */ + model?: Common_identifierSafeUnicode; + /** + * Indicates if the server should stream the response as it's generated + */ + stream: boolean; + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop?: Array; + /** + * If specified, the system will make a best effort to sample deterministically for that particular seed value + */ + seed?: number; + /** + * The maximum number of tokens to generate in the chat completion + */ + max_tokens?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion + */ + logit_bias?: Record; + /** + * Response format (set to `json_object` to restrict output to JSON) + */ + response_format?: Chat_CompletionResponseFormat; + /** + * Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + */ + preset?: Chat_GenerationPreset; + } + | { + /** + * Identifier of the model to be used + */ + model?: Common_identifierSafeUnicode; + /** + * Indicates if the server should stream the response as it's generated + */ + stream: boolean; + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop?: Array; + /** + * If specified, the system will make a best effort to sample deterministically for that particular seed value + */ + seed?: number; + /** + * The maximum number of tokens to generate in the chat completion + */ + max_tokens?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion + */ + logit_bias?: Record; + /** + * Response format (set to `json_object` to restrict output to JSON) + */ + response_format?: Chat_CompletionResponseFormat; + /** + * 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. + */ + frequency_penalty?: number; + /** + * 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. + */ + presence_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; + } + | { + /** + * Identifier of the model to be used + */ + model?: Common_identifierSafeUnicode; + /** + * Indicates if the server should stream the response as it's generated + */ + stream: boolean; + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop?: Array; + /** + * If specified, the system will make a best effort to sample deterministically for that particular seed value + */ + seed?: number; + /** + * The maximum number of tokens to generate in the chat completion + */ + max_tokens?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion + */ + logit_bias?: Record; + /** + * Response format (set to `json_object` to restrict output to JSON) + */ + response_format?: Chat_CompletionResponseFormat; + /** + * 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. + */ + repetition_penalty?: number; + /** + * Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + */ + length_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; + /** + * Minimum probability compared to leading token to be considered + */ + min_p?: number; + }; +}; diff --git a/sdks/ts/src/api/models/Tasks_Task.ts b/sdks/ts/src/api/models/Tasks_Task.ts new file mode 100644 index 000000000..d325f6bff --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_Task.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +/** + * Object describing a Task + */ +export type Tasks_Task = Record>; diff --git a/sdks/ts/src/api/models/Tasks_ToolCallStep.ts b/sdks/ts/src/api/models/Tasks_ToolCallStep.ts new file mode 100644 index 000000000..d750ca78a --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_ToolCallStep.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_toolRef } from "./Common_toolRef"; +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +export type Tasks_ToolCallStep = Tasks_WorkflowStep & { + /** + * The tool to run + */ + tool: Common_toolRef; + /** + * The input parameters for the tool + */ + arguments: Record; +}; diff --git a/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts new file mode 100644 index 000000000..7d8778e36 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +/** + * Payload for updating a task + */ +export type Tasks_UpdateTaskRequest = Record>; diff --git a/sdks/ts/src/api/models/EvaluateWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_WorkflowStep.ts similarity index 55% rename from sdks/ts/src/api/models/EvaluateWorkflowStep.ts rename to sdks/ts/src/api/models/Tasks_WorkflowStep.ts index 3967b83d1..1042d7ab4 100644 --- a/sdks/ts/src/api/models/EvaluateWorkflowStep.ts +++ b/sdks/ts/src/api/models/Tasks_WorkflowStep.ts @@ -2,7 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { CELObject } from "./CELObject"; -export type EvaluateWorkflowStep = { - evaluate: CELObject; +export type Tasks_WorkflowStep = { + /** + * Discriminator property for WorkflowStep. + */ + kind?: string; }; diff --git a/sdks/ts/src/api/models/Tasks_YieldStep.ts b/sdks/ts/src/api/models/Tasks_YieldStep.ts new file mode 100644 index 000000000..20cbc649a --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_YieldStep.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_CEL } from "./Tasks_CEL"; +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +export type Tasks_YieldStep = Tasks_WorkflowStep & { + /** + * The subworkflow to run + */ + workflow: string; + /** + * The input parameters for the subworkflow + */ + arguments: Record; +}; diff --git a/sdks/ts/src/api/models/Tool.ts b/sdks/ts/src/api/models/Tool.ts deleted file mode 100644 index e7924fca2..000000000 --- a/sdks/ts/src/api/models/Tool.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FunctionDef } from "./FunctionDef"; -export type Tool = { - /** - * Whether this tool is a `function` or a `webhook` (Only `function` tool supported right now) - */ - type: "function" | "webhook"; - /** - * Function definition and parameters - */ - function: FunctionDef; - /** - * Tool ID - */ - id: string; -}; diff --git a/sdks/ts/src/api/models/ToolCallWorkflowStep.ts b/sdks/ts/src/api/models/ToolCallWorkflowStep.ts deleted file mode 100644 index 1f0c7140e..000000000 --- a/sdks/ts/src/api/models/ToolCallWorkflowStep.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CELObject } from "./CELObject"; -export type ToolCallWorkflowStep = { - tool_id: string; - arguments: CELObject; -}; diff --git a/sdks/ts/src/api/models/ToolChoiceOption.ts b/sdks/ts/src/api/models/ToolChoiceOption.ts deleted file mode 100644 index df3cba2b9..000000000 --- a/sdks/ts/src/api/models/ToolChoiceOption.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { NamedToolChoice } from "./NamedToolChoice"; -/** - * Controls which (if any) function is called by the model. - * `none` means the model will not call a function and instead generates a message. - * `auto` means the model can pick between generating a message or calling a function. - * Specifying a particular function via `{"type: "function", "function": {"name": "my_function"}}` forces the model to call that function. - * - * `none` is the default when no functions are present. `auto` is the default if functions are present. - * - */ -export type ToolChoiceOption = "none" | "auto" | NamedToolChoice; diff --git a/sdks/ts/src/api/models/Tools_ChosenFunctionCall.ts b/sdks/ts/src/api/models/Tools_ChosenFunctionCall.ts new file mode 100644 index 000000000..dcd3267ad --- /dev/null +++ b/sdks/ts/src/api/models/Tools_ChosenFunctionCall.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tools_ChosenToolCall } from "./Tools_ChosenToolCall"; +import type { Tools_FunctionCallOption } from "./Tools_FunctionCallOption"; +export type Tools_ChosenFunctionCall = Tools_ChosenToolCall & { + function: Tools_FunctionCallOption; + type: "function"; + /** + * The function to call + */ + function: Tools_FunctionCallOption; +}; diff --git a/sdks/ts/src/api/models/Tools_ChosenToolCall.ts b/sdks/ts/src/api/models/Tools_ChosenToolCall.ts new file mode 100644 index 000000000..d44bad5c5 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_ChosenToolCall.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Tools_FunctionCallOption } from "./Tools_FunctionCallOption"; +import type { Tools_ToolType } from "./Tools_ToolType"; +/** + * The response tool value generated by the model + */ +export type Tools_ChosenToolCall = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type: Tools_ToolType; + function?: Tools_FunctionCallOption; + integration?: any; + system?: any; + api_call?: any; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Tools_CreateToolRequest.ts b/sdks/ts/src/api/models/Tools_CreateToolRequest.ts new file mode 100644 index 000000000..37f621348 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_CreateToolRequest.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tools_FunctionDef } from "./Tools_FunctionDef"; +import type { Tools_ToolType } from "./Tools_ToolType"; +/** + * Payload for creating a tool + */ +export type Tools_CreateToolRequest = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type: Tools_ToolType; + /** + * The tool should be run in the background (not supported at the moment) + */ + background: boolean; + /** + * Whether the tool that can be run interactively (response should contain "stop" boolean field) + */ + interactive: boolean; + function?: Tools_FunctionDef; + integration?: any; + system?: any; + api_call?: any; +}; diff --git a/sdks/ts/src/api/models/ToolResponse.ts b/sdks/ts/src/api/models/Tools_FunctionCallOption.ts similarity index 60% rename from sdks/ts/src/api/models/ToolResponse.ts rename to sdks/ts/src/api/models/Tools_FunctionCallOption.ts index c6808ca3b..ece3304cb 100644 --- a/sdks/ts/src/api/models/ToolResponse.ts +++ b/sdks/ts/src/api/models/Tools_FunctionCallOption.ts @@ -2,10 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type ToolResponse = { +export type Tools_FunctionCallOption = { /** - * Optional Tool ID + * The name of the function */ - id: string; - output: Record; + name: string; }; diff --git a/sdks/ts/src/api/models/Tools_FunctionDef.ts b/sdks/ts/src/api/models/Tools_FunctionDef.ts new file mode 100644 index 000000000..10d1bdef2 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_FunctionDef.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; +/** + * Function definition + */ +export type Tools_FunctionDef = { + /** + * DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + */ + name?: Common_validPythonIdentifier; + /** + * The parameters the function accepts + */ + parameters: Record; + /** + * Description of the function + */ + description?: Common_identifierSafeUnicode; +}; diff --git a/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts new file mode 100644 index 000000000..7a67121a0 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; +/** + * Function definition + */ +export type Tools_FunctionDefUpdate = { + /** + * DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + */ + name?: Common_validPythonIdentifier; + /** + * The parameters the function accepts + */ + parameters?: Record; + /** + * Description of the function + */ + description?: Common_identifierSafeUnicode; +}; diff --git a/sdks/ts/src/api/models/Tools_FunctionTool.ts b/sdks/ts/src/api/models/Tools_FunctionTool.ts new file mode 100644 index 000000000..00f1b1978 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_FunctionTool.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tools_FunctionDef } from "./Tools_FunctionDef"; +import type { Tools_Tool } from "./Tools_Tool"; +export type Tools_FunctionTool = Tools_Tool & { + function: Tools_FunctionDef; + type: "function"; + background: boolean; + interactive: boolean; + /** + * The function to call + */ + function: Tools_FunctionDef; +}; diff --git a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts new file mode 100644 index 000000000..336f24563 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tools_FunctionDefUpdate } from "./Tools_FunctionDefUpdate"; +import type { Tools_ToolType } from "./Tools_ToolType"; +/** + * Payload for patching a tool + */ +export type Tools_PatchToolRequest = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type?: Tools_ToolType; + /** + * The tool should be run in the background (not supported at the moment) + */ + background?: boolean; + /** + * Whether the tool that can be run interactively (response should contain "stop" boolean field) + */ + interactive?: boolean; + function?: Tools_FunctionDefUpdate; + integration?: any; + system?: any; + api_call?: any; +}; diff --git a/sdks/ts/src/api/models/Tools_Tool.ts b/sdks/ts/src/api/models/Tools_Tool.ts new file mode 100644 index 000000000..2f5ee90b7 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_Tool.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Tools_FunctionDef } from "./Tools_FunctionDef"; +import type { Tools_ToolType } from "./Tools_ToolType"; +export type Tools_Tool = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type: Tools_ToolType; + /** + * The tool should be run in the background (not supported at the moment) + */ + background: boolean; + /** + * Whether the tool that can be run interactively (response should contain "stop" boolean field) + */ + interactive: boolean; + function?: Tools_FunctionDef; + integration?: any; + system?: any; + api_call?: any; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Tools_ToolResponse.ts b/sdks/ts/src/api/models/Tools_ToolResponse.ts new file mode 100644 index 000000000..0173f7b91 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_ToolResponse.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Tools_ToolResponse = { + id: Common_uuid; + /** + * The output of the tool + */ + output: Record; +}; diff --git a/sdks/ts/src/api/models/CELObject.ts b/sdks/ts/src/api/models/Tools_ToolType.ts similarity index 61% rename from sdks/ts/src/api/models/CELObject.ts rename to sdks/ts/src/api/models/Tools_ToolType.ts index 8de33f6b3..734b2453f 100644 --- a/sdks/ts/src/api/models/CELObject.ts +++ b/sdks/ts/src/api/models/Tools_ToolType.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type CELObject = Record; +export type Tools_ToolType = "function" | "integration" | "system" | "api_call"; diff --git a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts new file mode 100644 index 000000000..b7608834d --- /dev/null +++ b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tools_FunctionDef } from "./Tools_FunctionDef"; +import type { Tools_ToolType } from "./Tools_ToolType"; +/** + * Payload for updating a tool + */ +export type Tools_UpdateToolRequest = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type: Tools_ToolType; + /** + * The tool should be run in the background (not supported at the moment) + */ + background: boolean; + /** + * Whether the tool that can be run interactively (response should contain "stop" boolean field) + */ + interactive: boolean; + function?: Tools_FunctionDef; + integration?: any; + system?: any; + api_call?: any; +}; diff --git a/sdks/ts/src/api/models/UpdateAgentRequest.ts b/sdks/ts/src/api/models/UpdateAgentRequest.ts deleted file mode 100644 index 1c02fa858..000000000 --- a/sdks/ts/src/api/models/UpdateAgentRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AgentDefaultSettings } from "./AgentDefaultSettings"; -/** - * A valid request payload for updating an agent - */ -export type UpdateAgentRequest = { - /** - * About the agent - */ - about: string; - /** - * Name of the agent - */ - name: string; - /** - * Name of the model that the agent is supposed to use - */ - model?: string; - /** - * Default model settings to start every session with - */ - default_settings?: AgentDefaultSettings; - /** - * Optional metadata - */ - metadata?: Record; - /** - * Instructions for the agent - */ - instructions?: string | Array; -}; diff --git a/sdks/ts/src/api/models/UpdateToolRequest.ts b/sdks/ts/src/api/models/UpdateToolRequest.ts deleted file mode 100644 index 43bbeadbb..000000000 --- a/sdks/ts/src/api/models/UpdateToolRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FunctionDef } from "./FunctionDef"; -export type UpdateToolRequest = { - /** - * Function definition and parameters - */ - function: FunctionDef; -}; diff --git a/sdks/ts/src/api/models/User.ts b/sdks/ts/src/api/models/User.ts deleted file mode 100644 index cb53e2799..000000000 --- a/sdks/ts/src/api/models/User.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type User = { - /** - * Name of the user - */ - name?: string; - /** - * About the user - */ - about?: string; - /** - * User created at (RFC-3339 format) - */ - created_at?: string; - /** - * User updated at (RFC-3339 format) - */ - updated_at?: string; - /** - * User id (UUID) - */ - id: string; - /** - * (Optional) metadata - */ - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts new file mode 100644 index 000000000..35371bac1 --- /dev/null +++ b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts @@ -0,0 +1,18 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Users_CreateOrUpdateUserRequest = { + id: Common_uuid; + metadata?: Record; + /** + * Name of the user + */ + name: Common_identifierSafeUnicode; + /** + * About the user + */ + about: string; +}; diff --git a/sdks/ts/src/api/models/Users_CreateUserRequest.ts b/sdks/ts/src/api/models/Users_CreateUserRequest.ts new file mode 100644 index 000000000..246c6183f --- /dev/null +++ b/sdks/ts/src/api/models/Users_CreateUserRequest.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for creating a user (and associated documents) + */ +export type Users_CreateUserRequest = { + metadata?: Record; + /** + * Name of the user + */ + name: Common_identifierSafeUnicode; + /** + * About the user + */ + about: string; + /** + * Documents to index for this user. (Max: 100 items) + */ + docs: Array; +}; diff --git a/sdks/ts/src/api/models/PatchUserRequest.ts b/sdks/ts/src/api/models/Users_PatchUserRequest.ts similarity index 57% rename from sdks/ts/src/api/models/PatchUserRequest.ts rename to sdks/ts/src/api/models/Users_PatchUserRequest.ts index 0719b0d54..1fe03611b 100644 --- a/sdks/ts/src/api/models/PatchUserRequest.ts +++ b/sdks/ts/src/api/models/Users_PatchUserRequest.ts @@ -2,20 +2,18 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; /** - * A request for patching a user + * Payload for patching a user */ -export type PatchUserRequest = { - /** - * About the user - */ - about?: string; +export type Users_PatchUserRequest = { + metadata?: Record; /** * Name of the user */ - name?: string; + name?: Common_identifierSafeUnicode; /** - * Optional metadata + * About the user */ - metadata?: Record; + about?: string; }; diff --git a/sdks/ts/src/api/models/UpdateUserRequest.ts b/sdks/ts/src/api/models/Users_UpdateUserRequest.ts similarity index 57% rename from sdks/ts/src/api/models/UpdateUserRequest.ts rename to sdks/ts/src/api/models/Users_UpdateUserRequest.ts index 4b5305a54..d9094acf4 100644 --- a/sdks/ts/src/api/models/UpdateUserRequest.ts +++ b/sdks/ts/src/api/models/Users_UpdateUserRequest.ts @@ -2,20 +2,18 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; /** - * A valid request payload for updating a user + * Payload for updating a user */ -export type UpdateUserRequest = { - /** - * About the user - */ - about: string; +export type Users_UpdateUserRequest = { + metadata?: Record; /** * Name of the user */ - name: string; + name: Common_identifierSafeUnicode; /** - * Optional metadata + * About the user */ - metadata?: Record; + about: string; }; diff --git a/sdks/ts/src/api/models/Users_User.ts b/sdks/ts/src/api/models/Users_User.ts new file mode 100644 index 000000000..eb42b433e --- /dev/null +++ b/sdks/ts/src/api/models/Users_User.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Users_User = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the user + */ + name: Common_identifierSafeUnicode; + /** + * About the user + */ + about: string; +}; diff --git a/sdks/ts/src/api/models/WorkflowStep.ts b/sdks/ts/src/api/models/WorkflowStep.ts deleted file mode 100644 index 7efbc95a5..000000000 --- a/sdks/ts/src/api/models/WorkflowStep.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ErrorWorkflowStep } from "./ErrorWorkflowStep"; -import type { EvaluateWorkflowStep } from "./EvaluateWorkflowStep"; -import type { IfElseWorkflowStep } from "./IfElseWorkflowStep"; -import type { PromptWorkflowStep } from "./PromptWorkflowStep"; -import type { ToolCallWorkflowStep } from "./ToolCallWorkflowStep"; -import type { YieldWorkflowStep } from "./YieldWorkflowStep"; -export type WorkflowStep = - | PromptWorkflowStep - | EvaluateWorkflowStep - | YieldWorkflowStep - | ToolCallWorkflowStep - | ErrorWorkflowStep - | IfElseWorkflowStep; diff --git a/sdks/ts/src/api/models/YieldWorkflowStep.ts b/sdks/ts/src/api/models/YieldWorkflowStep.ts deleted file mode 100644 index 051e9ac40..000000000 --- a/sdks/ts/src/api/models/YieldWorkflowStep.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CELObject } from "./CELObject"; -export type YieldWorkflowStep = { - workflow: string; - arguments: CELObject; -}; diff --git a/sdks/ts/src/api/models/agent_id.ts b/sdks/ts/src/api/models/agent_id.ts deleted file mode 100644 index 6e28e9648..000000000 --- a/sdks/ts/src/api/models/agent_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type agent_id = string; diff --git a/sdks/ts/src/api/models/doc_id.ts b/sdks/ts/src/api/models/doc_id.ts deleted file mode 100644 index 166151bc6..000000000 --- a/sdks/ts/src/api/models/doc_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type doc_id = string; diff --git a/sdks/ts/src/api/models/memory_id.ts b/sdks/ts/src/api/models/memory_id.ts deleted file mode 100644 index de53747df..000000000 --- a/sdks/ts/src/api/models/memory_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type memory_id = string; diff --git a/sdks/ts/src/api/models/message_id.ts b/sdks/ts/src/api/models/message_id.ts deleted file mode 100644 index 64a49dfde..000000000 --- a/sdks/ts/src/api/models/message_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type message_id = string; diff --git a/sdks/ts/src/api/models/session_id.ts b/sdks/ts/src/api/models/session_id.ts deleted file mode 100644 index 1b6cedad0..000000000 --- a/sdks/ts/src/api/models/session_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type session_id = string; diff --git a/sdks/ts/src/api/models/task_id.ts b/sdks/ts/src/api/models/task_id.ts deleted file mode 100644 index 8c17f13eb..000000000 --- a/sdks/ts/src/api/models/task_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type task_id = string; diff --git a/sdks/ts/src/api/models/tool_id.ts b/sdks/ts/src/api/models/tool_id.ts deleted file mode 100644 index d0ae2699e..000000000 --- a/sdks/ts/src/api/models/tool_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type tool_id = string; diff --git a/sdks/ts/src/api/models/transition_id.ts b/sdks/ts/src/api/models/transition_id.ts deleted file mode 100644 index 3663e0944..000000000 --- a/sdks/ts/src/api/models/transition_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type transition_id = string; diff --git a/sdks/ts/src/api/models/user_id.ts b/sdks/ts/src/api/models/user_id.ts deleted file mode 100644 index 6e7d60815..000000000 --- a/sdks/ts/src/api/models/user_id.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type user_id = string; diff --git a/sdks/ts/src/api/schemas/$AgentDefaultSettings.ts b/sdks/ts/src/api/schemas/$AgentDefaultSettings.ts deleted file mode 100644 index ebe925fcc..000000000 --- a/sdks/ts/src/api/schemas/$AgentDefaultSettings.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $AgentDefaultSettings = { - properties: { - frequency_penalty: { - type: "number", - description: `(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.`, - isNullable: true, - maximum: 2, - minimum: -2, - }, - length_penalty: { - type: "number", - description: `(Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. `, - isNullable: true, - maximum: 2, - }, - presence_penalty: { - type: "number", - description: `(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.`, - isNullable: true, - maximum: 1, - minimum: -1, - }, - repetition_penalty: { - type: "number", - description: `(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.`, - isNullable: true, - maximum: 2, - }, - temperature: { - type: "number", - description: `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.`, - isNullable: true, - maximum: 3, - }, - top_p: { - type: "number", - description: `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.`, - isNullable: true, - maximum: 1, - }, - min_p: { - type: "number", - description: `Minimum probability compared to leading token to be considered`, - maximum: 1, - exclusiveMaximum: true, - }, - preset: { - type: "Enum", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_Agent.ts b/sdks/ts/src/api/schemas/$Agents_Agent.ts new file mode 100644 index 000000000..72bb0e2b3 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agents_Agent.ts @@ -0,0 +1,89 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agents_Agent = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the agent`, + isRequired: true, + }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + isRequired: true, + }, + instructions: { + type: "any-of", + description: `Instructions for the agent`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$CreateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts similarity index 51% rename from sdks/ts/src/api/schemas/$CreateAgentRequest.ts rename to sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts index f305ebc20..12d4405fe 100644 --- a/sdks/ts/src/api/schemas/$CreateAgentRequest.ts +++ b/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts @@ -2,46 +2,37 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $CreateAgentRequest = { - description: `A valid request payload for creating an agent`, +export const $Agents_CreateAgentRequest = { + description: `Payload for creating a agent (and associated documents)`, properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, name: { - type: "string", + type: "all-of", description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], isRequired: true, }, about: { type: "string", description: `About the agent`, - }, - tools: { - type: "array", - contains: { - type: "CreateToolRequest", - }, - }, - default_settings: { - type: "AgentDefaultSettings", - description: `Default model settings to start every session with`, + isRequired: true, }, model: { type: "string", - description: `Name of the model that the agent is supposed to use`, - }, - docs: { - type: "array", - contains: { - type: "CreateDoc", - }, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + isRequired: true, }, instructions: { - type: "one-of", + type: "any-of", description: `Instructions for the agent`, contains: [ { @@ -54,6 +45,29 @@ export const $CreateAgentRequest = { }, }, ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, + docs: { + type: "array", + contains: { + properties: {}, + }, + isRequired: true, }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$UpdateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest.ts similarity index 53% rename from sdks/ts/src/api/schemas/$UpdateAgentRequest.ts rename to sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest.ts index 063ba6711..c89a9f596 100644 --- a/sdks/ts/src/api/schemas/$UpdateAgentRequest.ts +++ b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest.ts @@ -2,35 +2,40 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $UpdateAgentRequest = { - description: `A valid request payload for updating an agent`, +export const $Agents_CreateOrUpdateAgentRequest = { properties: { - about: { - type: "string", - description: `About the agent`, + id: { + type: "Common_uuid", isRequired: true, }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, name: { - type: "string", + type: "all-of", description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], isRequired: true, }, - model: { + about: { type: "string", - description: `Name of the model that the agent is supposed to use`, - }, - default_settings: { - type: "AgentDefaultSettings", - description: `Default model settings to start every session with`, + description: `About the agent`, + isRequired: true, }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + isRequired: true, }, instructions: { - type: "one-of", + type: "any-of", description: `Instructions for the agent`, contains: [ { @@ -43,6 +48,22 @@ export const $UpdateAgentRequest = { }, }, ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$PatchAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts similarity index 54% rename from sdks/ts/src/api/schemas/$PatchAgentRequest.ts rename to sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts index 7277d2aea..903376a1a 100644 --- a/sdks/ts/src/api/schemas/$PatchAgentRequest.ts +++ b/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts @@ -2,33 +2,34 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $PatchAgentRequest = { - description: `A request for patching an agent`, +export const $Agents_PatchAgentRequest = { + description: `Payload for patching a agent`, properties: { - about: { - type: "string", - description: `About the agent`, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, }, name: { - type: "string", + type: "all-of", description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], }, - model: { + about: { type: "string", - description: `Name of the model that the agent is supposed to use`, - }, - default_settings: { - type: "AgentDefaultSettings", - description: `Default model settings to start every session with`, + description: `About the agent`, }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, }, instructions: { - type: "one-of", + type: "any-of", description: `Instructions for the agent`, contains: [ { @@ -42,5 +43,20 @@ export const $PatchAgentRequest = { }, ], }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Agent.ts b/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts similarity index 61% rename from sdks/ts/src/api/schemas/$Agent.ts rename to sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts index c699548c9..6591bc329 100644 --- a/sdks/ts/src/api/schemas/$Agent.ts +++ b/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts @@ -2,50 +2,37 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Agent = { +export const $Agents_UpdateAgentRequest = { + description: `Payload for updating a agent`, properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, name: { - type: "string", + type: "all-of", description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], isRequired: true, }, about: { type: "string", description: `About the agent`, - }, - created_at: { - type: "string", - description: `Agent created at (RFC-3339 format)`, - format: "date-time", - }, - updated_at: { - type: "string", - description: `Agent updated at (RFC-3339 format)`, - format: "date-time", - }, - id: { - type: "string", - description: `Agent id (UUID)`, isRequired: true, - format: "uuid", - }, - default_settings: { - type: "AgentDefaultSettings", - description: `Default settings for all sessions created by this agent`, }, model: { type: "string", - description: `The model to use with this agent`, + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, isRequired: true, }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, instructions: { - type: "one-of", + type: "any-of", description: `Instructions for the agent`, contains: [ { @@ -58,6 +45,22 @@ export const $Agent = { }, }, ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$ChatInputData.ts b/sdks/ts/src/api/schemas/$ChatInputData.ts deleted file mode 100644 index 6b1acedc1..000000000 --- a/sdks/ts/src/api/schemas/$ChatInputData.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ChatInputData = { - properties: { - messages: { - type: "array", - contains: { - type: "InputChatMLMessage", - }, - isRequired: true, - }, - tools: { - type: "array", - contains: { - type: "Tool", - }, - isNullable: true, - }, - tool_choice: { - type: "one-of", - description: `Can be one of existing tools given to the agent earlier or the ones included in the request`, - contains: [ - { - type: "ToolChoiceOption", - }, - { - type: "NamedToolChoice", - }, - ], - isNullable: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ChatMLImageContentPart.ts b/sdks/ts/src/api/schemas/$ChatMLImageContentPart.ts deleted file mode 100644 index 3d266119a..000000000 --- a/sdks/ts/src/api/schemas/$ChatMLImageContentPart.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ChatMLImageContentPart = { - properties: { - type: { - type: "Enum", - isRequired: true, - }, - image_url: { - description: `Image content part, can be a URL or a base64-encoded image`, - properties: { - url: { - type: "string", - description: `URL or base64 data url (e.g. \`data:image/jpeg;base64,\`)`, - isRequired: true, - }, - detail: { - type: "Enum", - }, - }, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ChatMLMessage.ts b/sdks/ts/src/api/schemas/$ChatMLMessage.ts deleted file mode 100644 index 5ec80af8c..000000000 --- a/sdks/ts/src/api/schemas/$ChatMLMessage.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ChatMLMessage = { - properties: { - role: { - type: "Enum", - isRequired: true, - }, - content: { - type: "one-of", - description: `ChatML content`, - contains: [ - { - type: "string", - }, - ], - isRequired: true, - }, - name: { - type: "string", - description: `ChatML name`, - }, - created_at: { - type: "string", - description: `Message created at (RFC-3339 format)`, - isRequired: true, - format: "date-time", - }, - id: { - type: "string", - description: `Message ID`, - isRequired: true, - format: "uuid", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ChatResponse.ts b/sdks/ts/src/api/schemas/$ChatResponse.ts deleted file mode 100644 index 3c19ea0fc..000000000 --- a/sdks/ts/src/api/schemas/$ChatResponse.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ChatResponse = { - description: `Represents a chat completion response returned by model, based on the provided input.`, - properties: { - id: { - type: "string", - description: `A unique identifier for the chat completion.`, - isRequired: true, - format: "uuid", - }, - finish_reason: { - type: "Enum", - isRequired: true, - }, - response: { - type: "array", - contains: { - type: "array", - contains: { - type: "ChatMLMessage", - }, - }, - isRequired: true, - }, - usage: { - type: "CompletionUsage", - isRequired: true, - }, - jobs: { - type: "array", - contains: { - type: "string", - format: "uuid", - }, - }, - doc_ids: { - type: "DocIds", - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ChatSettings.ts b/sdks/ts/src/api/schemas/$ChatSettings.ts deleted file mode 100644 index 924a8e381..000000000 --- a/sdks/ts/src/api/schemas/$ChatSettings.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ChatSettings = { - properties: { - frequency_penalty: { - type: "number", - description: `(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.`, - isNullable: true, - maximum: 1, - minimum: -1, - }, - length_penalty: { - type: "number", - description: `(Huggingface-like) Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. `, - isNullable: true, - maximum: 2, - }, - logit_bias: { - type: "dictionary", - contains: { - type: "number", - }, - isNullable: true, - }, - max_tokens: { - type: "number", - description: `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. - `, - isNullable: true, - maximum: 16384, - minimum: 1, - }, - presence_penalty: { - type: "number", - description: `(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.`, - isNullable: true, - maximum: 1, - minimum: -1, - }, - repetition_penalty: { - type: "number", - description: `(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.`, - isNullable: true, - maximum: 2, - }, - response_format: { - description: `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. - `, - properties: { - type: { - type: "Enum", - }, - pattern: { - type: "string", - description: `Regular expression pattern to use if \`type\` is \`"regex"\``, - }, - schema: { - description: `JSON Schema to use if \`type\` is \`"json_object"\``, - properties: {}, - }, - }, - }, - seed: { - type: "number", - description: `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. - `, - isNullable: true, - maximum: 9999, - minimum: -1, - }, - stop: { - type: "one-of", - description: `Up to 4 sequences where the API will stop generating further tokens. - `, - contains: [ - { - type: "string", - isNullable: true, - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - }, - stream: { - type: "boolean", - description: `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). - `, - isNullable: true, - }, - temperature: { - type: "number", - description: `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.`, - isNullable: true, - maximum: 2, - }, - top_p: { - type: "number", - description: `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.`, - isNullable: true, - maximum: 1, - exclusiveMinimum: true, - }, - min_p: { - type: "number", - description: `Minimum probability compared to leading token to be considered`, - maximum: 1, - exclusiveMaximum: true, - }, - preset: { - type: "Enum", - }, - model: { - type: "string", - description: `Model name`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$EvaluateWorkflowStep.ts b/sdks/ts/src/api/schemas/$Chat_CompletionResponseFormat.ts similarity index 71% rename from sdks/ts/src/api/schemas/$EvaluateWorkflowStep.ts rename to sdks/ts/src/api/schemas/$Chat_CompletionResponseFormat.ts index f48b89505..1e4dcab53 100644 --- a/sdks/ts/src/api/schemas/$EvaluateWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Chat_CompletionResponseFormat.ts @@ -2,10 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $EvaluateWorkflowStep = { +export const $Chat_CompletionResponseFormat = { properties: { - evaluate: { - type: "CELObject", + type: { + type: "Enum", isRequired: true, }, }, diff --git a/sdks/ts/src/api/schemas/$Chat_GenerationPreset.ts b/sdks/ts/src/api/schemas/$Chat_GenerationPreset.ts new file mode 100644 index 000000000..f4a671436 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_GenerationPreset.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_GenerationPreset = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts b/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts new file mode 100644 index 000000000..fd8b68db1 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_GenerationPresetSettings = { + properties: { + preset: { + type: "all-of", + description: `Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)`, + contains: [ + { + type: "Chat_GenerationPreset", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts b/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts new file mode 100644 index 000000000..61a12ed7e --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_OpenAISettings = { + properties: { + frequency_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + presence_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts b/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts new file mode 100644 index 000000000..5006b6775 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_vLLMSettings = { + properties: { + repetition_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + }, + length_penalty: { + type: "number", + description: `Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.`, + format: "float", + maximum: 2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + min_p: { + type: "number", + description: `Minimum probability compared to leading token to be considered`, + format: "float", + maximum: 1, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_identifierSafeUnicode.ts b/sdks/ts/src/api/schemas/$Common_identifierSafeUnicode.ts new file mode 100644 index 000000000..e3e2e9f0a --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_identifierSafeUnicode.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_identifierSafeUnicode = { + type: "string", + description: `For Unicode character safety + See: https://unicode.org/reports/tr31/ + See: https://www.unicode.org/reports/tr39/#Identifier_Characters`, + pattern: + "^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_limit.ts b/sdks/ts/src/api/schemas/$Common_limit.ts new file mode 100644 index 000000000..444d6f7f9 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_limit.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_limit = { + type: "number", + description: `Limit the number of results`, + format: "uint16", + maximum: 1000, + exclusiveMaximum: true, + minimum: 1, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_logit_bias.ts b/sdks/ts/src/api/schemas/$Common_logit_bias.ts new file mode 100644 index 000000000..1d509202d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_logit_bias.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_logit_bias = { + type: "number", + format: "float", + maximum: 100, + minimum: -100, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_offset.ts b/sdks/ts/src/api/schemas/$Common_offset.ts new file mode 100644 index 000000000..84621fd41 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_offset.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_offset = { + type: "number", + description: `Offset to apply to the results`, + format: "uint32", +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_toolRef.ts b/sdks/ts/src/api/schemas/$Common_toolRef.ts new file mode 100644 index 000000000..96102f9b0 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_toolRef.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_toolRef = { + type: "string", + description: `Naming convention for tool references. Tools are resolved in order: \`step-settings\` -> \`task\` -> \`agent\``, + pattern: "^(function|integration|system|api_call)\\.(\\w+)$", +} as const; diff --git a/sdks/ts/src/api/schemas/$job_id.ts b/sdks/ts/src/api/schemas/$Common_uuid.ts similarity index 85% rename from sdks/ts/src/api/schemas/$job_id.ts rename to sdks/ts/src/api/schemas/$Common_uuid.ts index f7eccf5d7..d6439cd88 100644 --- a/sdks/ts/src/api/schemas/$job_id.ts +++ b/sdks/ts/src/api/schemas/$Common_uuid.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $job_id = { +export const $Common_uuid = { type: "string", format: "uuid", } as const; diff --git a/sdks/ts/src/api/schemas/$TransitionType.ts b/sdks/ts/src/api/schemas/$Common_validPythonIdentifier.ts similarity index 56% rename from sdks/ts/src/api/schemas/$TransitionType.ts rename to sdks/ts/src/api/schemas/$Common_validPythonIdentifier.ts index be66119d5..7be2759cc 100644 --- a/sdks/ts/src/api/schemas/$TransitionType.ts +++ b/sdks/ts/src/api/schemas/$Common_validPythonIdentifier.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $TransitionType = { +export const $Common_validPythonIdentifier = { type: "string", - description: `Execution Status`, - pattern: "^(finish|wait|error|step)$", + description: `Valid python identifier names`, + pattern: "^[^\\W0-9]\\w*$", } as const; diff --git a/sdks/ts/src/api/schemas/$CompletionUsage.ts b/sdks/ts/src/api/schemas/$CompletionUsage.ts deleted file mode 100644 index b1f81d5df..000000000 --- a/sdks/ts/src/api/schemas/$CompletionUsage.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $CompletionUsage = { - description: `Usage statistics for the completion request.`, - properties: { - completion_tokens: { - type: "number", - description: `Number of tokens in the generated completion.`, - isRequired: true, - }, - prompt_tokens: { - type: "number", - description: `Number of tokens in the prompt.`, - isRequired: true, - }, - total_tokens: { - type: "number", - description: `Total number of tokens used in the request (prompt + completion).`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$CreateDoc.ts b/sdks/ts/src/api/schemas/$CreateDoc.ts deleted file mode 100644 index 431578afb..000000000 --- a/sdks/ts/src/api/schemas/$CreateDoc.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $CreateDoc = { - properties: { - title: { - type: "string", - description: `Title describing what this bit of information contains`, - isRequired: true, - }, - content: { - type: "one-of", - description: `Information content`, - contains: [ - { - type: "array", - contains: { - type: "string", - minItems: 1, - }, - }, - { - type: "string", - description: `A single document chunk`, - }, - ], - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$CreateToolRequest.ts b/sdks/ts/src/api/schemas/$CreateToolRequest.ts deleted file mode 100644 index 4ad9c3f44..000000000 --- a/sdks/ts/src/api/schemas/$CreateToolRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $CreateToolRequest = { - properties: { - type: { - type: "Enum", - isRequired: true, - }, - function: { - type: "one-of", - description: `Function definition and parameters`, - contains: [ - { - type: "FunctionDef", - }, - ], - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$DocIds.ts b/sdks/ts/src/api/schemas/$DocIds.ts deleted file mode 100644 index 594e9771a..000000000 --- a/sdks/ts/src/api/schemas/$DocIds.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $DocIds = { - properties: { - agent_doc_ids: { - type: "array", - contains: { - type: "string", - }, - isRequired: true, - }, - user_doc_ids: { - type: "array", - contains: { - type: "string", - }, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Doc.ts b/sdks/ts/src/api/schemas/$Docs_Doc.ts similarity index 57% rename from sdks/ts/src/api/schemas/$Doc.ts rename to sdks/ts/src/api/schemas/$Docs_Doc.ts index d7f5b099c..d6c622cb0 100644 --- a/sdks/ts/src/api/schemas/$Doc.ts +++ b/sdks/ts/src/api/schemas/$Docs_Doc.ts @@ -2,48 +2,56 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Doc = { +export const $Docs_Doc = { properties: { - title: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { type: "string", - description: `Title describing what this bit of information contains`, + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + title: { + type: "all-of", + description: `Title describing what this document contains`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], isRequired: true, }, content: { - type: "one-of", - description: `Information content`, + type: "any-of", + description: `Contents of the document`, contains: [ + { + type: "string", + }, { type: "array", contains: { type: "string", - minItems: 1, }, }, - { - type: "string", - description: `A single document chunk`, - }, ], isRequired: true, }, - id: { - type: "string", - description: `ID of doc`, - isRequired: true, - format: "uuid", - }, - created_at: { - type: "string", - description: `Doc created at`, - isRequired: true, - format: "date-time", - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Docs_DocOwner.ts b/sdks/ts/src/api/schemas/$Docs_DocOwner.ts new file mode 100644 index 000000000..25e2043e2 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_DocOwner.ts @@ -0,0 +1,36 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_DocOwner = { + properties: { + id: { + type: "any-of", + contains: [ + { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + }, + { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + }, + ], + isRequired: true, + }, + role: { + type: "Enum", + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_DocReference.ts b/sdks/ts/src/api/schemas/$Docs_DocReference.ts new file mode 100644 index 000000000..5c02863c3 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_DocReference.ts @@ -0,0 +1,43 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_DocReference = { + properties: { + owner: { + type: "all-of", + description: `The owner of this document.`, + contains: [ + { + type: "Docs_DocOwner", + }, + ], + isRequired: true, + }, + id: { + type: "all-of", + description: `ID of the document`, + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + snippet_index: { + type: "array", + contains: { + type: "number", + format: "uint16", + }, + isRequired: true, + }, + title: { + type: "string", + }, + snippet: { + type: "string", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_DocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_DocSearchRequest.ts new file mode 100644 index 000000000..63a425045 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_DocSearchRequest.ts @@ -0,0 +1,67 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_DocSearchRequest = { + properties: { + text: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + }, + vector: { + type: "any-of", + contains: [ + { + type: "array", + contains: { + type: "number", + }, + }, + { + type: "array", + contains: { + type: "array", + contains: { + type: "number", + }, + }, + }, + ], + }, + mode: { + type: "Enum", + isRequired: true, + }, + confidence: { + type: "number", + description: `The confidence cutoff level`, + isRequired: true, + maximum: 1, + }, + alpha: { + type: "number", + description: `The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;`, + isRequired: true, + maximum: 1, + }, + mmr: { + type: "boolean", + description: `Whether to include the MMR algorithm in the search. Optimizes for diversity in search results.`, + isRequired: true, + }, + lang: { + type: "Enum", + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts new file mode 100644 index 000000000..05ee4a403 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts @@ -0,0 +1,56 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_HybridDocSearchRequest = { + type: "all-of", + contains: [ + { + type: "Docs_DocSearchRequest", + }, + { + properties: { + text: { + type: "any-of", + description: `Text or texts to use in the search. In \`hybrid\` search mode, either \`text\` or both \`text\` and \`vector\` fields are required.`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + }, + vector: { + type: "any-of", + description: `Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown.`, + contains: [ + { + type: "array", + contains: { + type: "number", + }, + }, + { + type: "array", + contains: { + type: "array", + contains: { + type: "number", + }, + }, + }, + ], + }, + mode: { + type: "Enum", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts new file mode 100644 index 000000000..73e03f171 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts @@ -0,0 +1,51 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_TextOnlyDocSearchRequest = { + type: "all-of", + contains: [ + { + type: "Docs_DocSearchRequest", + }, + { + properties: { + text: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + text: { + type: "any-of", + description: `Text or texts to use in the search. In \`text\` search mode, only BM25 is used.`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + mode: { + type: "Enum", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts new file mode 100644 index 000000000..da3c88e4c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts @@ -0,0 +1,63 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_VectorDocSearchRequest = { + type: "all-of", + contains: [ + { + type: "Docs_DocSearchRequest", + }, + { + properties: { + vector: { + type: "any-of", + contains: [ + { + type: "array", + contains: { + type: "number", + }, + }, + { + type: "array", + contains: { + type: "array", + contains: { + type: "number", + }, + }, + }, + ], + isRequired: true, + }, + vector: { + type: "any-of", + description: `Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown.`, + contains: [ + { + type: "array", + contains: { + type: "number", + }, + }, + { + type: "array", + contains: { + type: "array", + contains: { + type: "number", + }, + }, + }, + ], + isRequired: true, + }, + mode: { + type: "Enum", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$ChatMLTextContentPart.ts b/sdks/ts/src/api/schemas/$Entries_BaseChatMLContentPart.ts similarity index 59% rename from sdks/ts/src/api/schemas/$ChatMLTextContentPart.ts rename to sdks/ts/src/api/schemas/$Entries_BaseChatMLContentPart.ts index fcea9f12a..2925d2116 100644 --- a/sdks/ts/src/api/schemas/$ChatMLTextContentPart.ts +++ b/sdks/ts/src/api/schemas/$Entries_BaseChatMLContentPart.ts @@ -2,16 +2,18 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $ChatMLTextContentPart = { +export const $Entries_BaseChatMLContentPart = { properties: { type: { - type: "Enum", + type: "string", + description: `The type of content part`, isRequired: true, }, text: { type: "string", - description: `Text content part`, - isRequired: true, + }, + image_url: { + type: "Entries_ImageURL", }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts b/sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts new file mode 100644 index 000000000..032a0fc55 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entries_ChatMLImageContentPart = { + type: "all-of", + contains: [ + { + type: "Entries_BaseChatMLContentPart", + }, + { + properties: { + image_url: { + type: "Entries_ImageURL", + isRequired: true, + }, + image_url: { + type: "all-of", + description: `The image URL`, + contains: [ + { + type: "Entries_ImageURL", + }, + ], + isRequired: true, + }, + type: { + type: "Enum", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$transition_id.ts b/sdks/ts/src/api/schemas/$Entries_ChatMLRole.ts similarity index 73% rename from sdks/ts/src/api/schemas/$transition_id.ts rename to sdks/ts/src/api/schemas/$Entries_ChatMLRole.ts index 24371a9f8..98dd6ad43 100644 --- a/sdks/ts/src/api/schemas/$transition_id.ts +++ b/sdks/ts/src/api/schemas/$Entries_ChatMLRole.ts @@ -2,6 +2,6 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $transition_id = { - type: "string", +export const $Entries_ChatMLRole = { + type: "Enum", } as const; diff --git a/sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts b/sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts new file mode 100644 index 000000000..9ebd87cc2 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts @@ -0,0 +1,28 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entries_ChatMLTextContentPart = { + type: "all-of", + contains: [ + { + type: "Entries_BaseChatMLContentPart", + }, + { + properties: { + text: { + type: "string", + isRequired: true, + }, + text: { + type: "string", + isRequired: true, + }, + type: { + type: "Enum", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Entries_Entry.ts b/sdks/ts/src/api/schemas/$Entries_Entry.ts new file mode 100644 index 000000000..327efbb6f --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entries_Entry.ts @@ -0,0 +1,62 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entries_Entry = { + properties: { + role: { + type: "Entries_ChatMLRole", + isRequired: true, + }, + name: { + type: "string", + isRequired: true, + isNullable: true, + }, + content: { + type: "any-of", + contains: [ + { + type: "Tools_Tool", + }, + { + type: "Tools_ChosenToolCall", + }, + { + type: "string", + }, + { + type: "Tools_ToolResponse", + }, + ], + isRequired: true, + }, + source: { + type: "Enum", + isRequired: true, + }, + timestamp: { + type: "number", + description: `This is the time that this event refers to.`, + isRequired: true, + format: "int32", + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Entries_History.ts b/sdks/ts/src/api/schemas/$Entries_History.ts new file mode 100644 index 000000000..c75c70678 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entries_History.ts @@ -0,0 +1,39 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entries_History = { + properties: { + entries: { + type: "array", + contains: { + type: "Entries_Entry", + }, + isRequired: true, + }, + relations: { + type: "array", + contains: { + type: "Entries_Relation", + }, + isRequired: true, + }, + session_id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Entries_ImageDetail.ts b/sdks/ts/src/api/schemas/$Entries_ImageDetail.ts new file mode 100644 index 000000000..9d8ebe636 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entries_ImageDetail.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entries_ImageDetail = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Entries_ImageURL.ts b/sdks/ts/src/api/schemas/$Entries_ImageURL.ts new file mode 100644 index 000000000..07dc23052 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entries_ImageURL.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entries_ImageURL = { + properties: { + url: { + type: "string", + description: `Image URL or base64 data url (e.g. \`data:image/jpeg;base64,\`)`, + isRequired: true, + format: "uri", + }, + detail: { + type: "all-of", + description: `The detail level of the image`, + contains: [ + { + type: "Entries_ImageDetail", + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$InputChatMLMessage.ts b/sdks/ts/src/api/schemas/$Entries_InputChatMLMessage.ts similarity index 54% rename from sdks/ts/src/api/schemas/$InputChatMLMessage.ts rename to sdks/ts/src/api/schemas/$Entries_InputChatMLMessage.ts index 3ac482201..2f888d08b 100644 --- a/sdks/ts/src/api/schemas/$InputChatMLMessage.ts +++ b/sdks/ts/src/api/schemas/$Entries_InputChatMLMessage.ts @@ -2,25 +2,37 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $InputChatMLMessage = { +export const $Entries_InputChatMLMessage = { properties: { role: { - type: "Enum", + type: "all-of", + description: `The role of the message`, + contains: [ + { + type: "Entries_ChatMLRole", + }, + ], isRequired: true, }, content: { - type: "one-of", - description: `ChatML content`, + type: "any-of", + description: `The content parts of the message`, contains: [ { type: "string", }, + { + type: "array", + contains: { + type: "string", + }, + }, ], isRequired: true, }, name: { type: "string", - description: `ChatML name`, + description: `Name`, }, continue: { type: "boolean", diff --git a/sdks/ts/src/api/schemas/$IfElseWorkflowStep.ts b/sdks/ts/src/api/schemas/$Entries_Relation.ts similarity index 67% rename from sdks/ts/src/api/schemas/$IfElseWorkflowStep.ts rename to sdks/ts/src/api/schemas/$Entries_Relation.ts index 188eced56..a04fa0fb0 100644 --- a/sdks/ts/src/api/schemas/$IfElseWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Entries_Relation.ts @@ -2,18 +2,18 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $IfElseWorkflowStep = { +export const $Entries_Relation = { properties: { - if: { - type: "string", + head: { + type: "Common_uuid", isRequired: true, }, - then: { - type: "YieldWorkflowStep", + relation: { + type: "string", isRequired: true, }, - else: { - type: "YieldWorkflowStep", + tail: { + type: "Common_uuid", isRequired: true, }, }, diff --git a/sdks/ts/src/api/schemas/$Execution.ts b/sdks/ts/src/api/schemas/$Execution.ts deleted file mode 100644 index aa7617556..000000000 --- a/sdks/ts/src/api/schemas/$Execution.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Execution = { - properties: { - id: { - type: "string", - isRequired: true, - format: "uuid", - }, - task_id: { - type: "string", - isRequired: true, - format: "uuid", - }, - status: { - type: "ExecutionStatus", - isRequired: true, - }, - arguments: { - type: "dictionary", - contains: { - properties: {}, - }, - isRequired: true, - }, - user_id: { - type: "string", - isNullable: true, - format: "uuid", - }, - session_id: { - type: "string", - isNullable: true, - format: "uuid", - }, - created_at: { - type: "string", - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - isRequired: true, - format: "date-time", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ExecutionStatus.ts b/sdks/ts/src/api/schemas/$ExecutionStatus.ts deleted file mode 100644 index 76afcd5ef..000000000 --- a/sdks/ts/src/api/schemas/$ExecutionStatus.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ExecutionStatus = { - type: "string", - description: `Execution Status`, - pattern: "^(queued|starting|running|awaiting_input|succeeded|failed)$", -} as const; diff --git a/sdks/ts/src/api/schemas/$PromptWorkflowStep.ts b/sdks/ts/src/api/schemas/$Executions_CreateExecutionRequest.ts similarity index 54% rename from sdks/ts/src/api/schemas/$PromptWorkflowStep.ts rename to sdks/ts/src/api/schemas/$Executions_CreateExecutionRequest.ts index 4a9f4d82d..c04b13124 100644 --- a/sdks/ts/src/api/schemas/$PromptWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Executions_CreateExecutionRequest.ts @@ -2,18 +2,15 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $PromptWorkflowStep = { +export const $Executions_CreateExecutionRequest = { + description: `Payload for creating an execution`, properties: { - prompt: { - type: "array", + input: { + type: "dictionary", contains: { - type: "InputChatMLMessage", + properties: {}, }, isRequired: true, }, - settings: { - type: "ChatSettings", - isRequired: true, - }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Executions_Execution.ts b/sdks/ts/src/api/schemas/$Executions_Execution.ts new file mode 100644 index 000000000..38dabb425 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Executions_Execution.ts @@ -0,0 +1,55 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Executions_Execution = { + properties: { + task_id: { + type: "all-of", + description: `The ID of the task that the execution is running`, + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + status: { + type: "Enum", + isReadOnly: true, + isRequired: true, + }, + input: { + type: "dictionary", + contains: { + properties: {}, + }, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Executions_ResumeExecutionRequest.ts b/sdks/ts/src/api/schemas/$Executions_ResumeExecutionRequest.ts new file mode 100644 index 000000000..ee70dcf04 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Executions_ResumeExecutionRequest.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Executions_ResumeExecutionRequest = { + type: "all-of", + contains: [ + { + type: "Executions_UpdateExecutionRequest", + }, + { + properties: { + status: { + type: "Enum", + isRequired: true, + }, + input: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Executions_StopExecutionRequest.ts b/sdks/ts/src/api/schemas/$Executions_StopExecutionRequest.ts new file mode 100644 index 000000000..b12ddaeac --- /dev/null +++ b/sdks/ts/src/api/schemas/$Executions_StopExecutionRequest.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Executions_StopExecutionRequest = { + type: "all-of", + contains: [ + { + type: "Executions_UpdateExecutionRequest", + }, + { + properties: { + status: { + type: "Enum", + isRequired: true, + }, + reason: { + type: "string", + description: `The reason for stopping the execution`, + isRequired: true, + isNullable: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$CreateExecution.ts b/sdks/ts/src/api/schemas/$Executions_TaskTokenResumeExecutionRequest.ts similarity index 63% rename from sdks/ts/src/api/schemas/$CreateExecution.ts rename to sdks/ts/src/api/schemas/$Executions_TaskTokenResumeExecutionRequest.ts index 4f5af5910..c6ecd34b4 100644 --- a/sdks/ts/src/api/schemas/$CreateExecution.ts +++ b/sdks/ts/src/api/schemas/$Executions_TaskTokenResumeExecutionRequest.ts @@ -2,23 +2,22 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $CreateExecution = { +export const $Executions_TaskTokenResumeExecutionRequest = { properties: { - task_id: { + status: { + type: "Enum", + isRequired: true, + }, + task_token: { type: "string", + description: `A Task Token is a unique identifier for a specific Task Execution.`, isRequired: true, - format: "uuid", }, - arguments: { + input: { type: "dictionary", contains: { properties: {}, }, - isRequired: true, - }, - status: { - type: "ExecutionStatus", - isRequired: true, }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$ExecutionTransition.ts b/sdks/ts/src/api/schemas/$Executions_Transition.ts similarity index 56% rename from sdks/ts/src/api/schemas/$ExecutionTransition.ts rename to sdks/ts/src/api/schemas/$Executions_Transition.ts index 0ee38aed9..7d426c5f1 100644 --- a/sdks/ts/src/api/schemas/$ExecutionTransition.ts +++ b/sdks/ts/src/api/schemas/$Executions_Transition.ts @@ -2,61 +2,70 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $ExecutionTransition = { +export const $Executions_Transition = { properties: { - id: { - type: "string", + type: { + type: "Enum", + isReadOnly: true, isRequired: true, - format: "uuid", }, execution_id: { - type: "string", - isRequired: true, - format: "uuid", - }, - type: { - type: "TransitionType", + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, isRequired: true, }, - from: { - type: "array", + outputs: { + type: "dictionary", contains: { properties: {}, }, + isReadOnly: true, isRequired: true, }, - to: { + current: { type: "array", contains: { properties: {}, }, + isReadOnly: true, isRequired: true, - isNullable: true, }, - task_token: { - type: "string", - isNullable: true, - }, - outputs: { - type: "dictionary", + next: { + type: "array", contains: { properties: {}, }, + isReadOnly: true, isRequired: true, + isNullable: true, }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, }, created_at: { type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, isRequired: true, format: "date-time", }, updated_at: { type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, format: "date-time", }, }, diff --git a/sdks/ts/src/api/schemas/$ErrorWorkflowStep.ts b/sdks/ts/src/api/schemas/$Executions_UpdateExecutionRequest.ts similarity index 69% rename from sdks/ts/src/api/schemas/$ErrorWorkflowStep.ts rename to sdks/ts/src/api/schemas/$Executions_UpdateExecutionRequest.ts index eebc9d8a2..ae8cb9df3 100644 --- a/sdks/ts/src/api/schemas/$ErrorWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Executions_UpdateExecutionRequest.ts @@ -2,10 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $ErrorWorkflowStep = { +export const $Executions_UpdateExecutionRequest = { properties: { - error: { - type: "string", + status: { + type: "Enum", isRequired: true, }, }, diff --git a/sdks/ts/src/api/schemas/$FunctionCallOption.ts b/sdks/ts/src/api/schemas/$FunctionCallOption.ts deleted file mode 100644 index 5b7e15638..000000000 --- a/sdks/ts/src/api/schemas/$FunctionCallOption.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $FunctionCallOption = { - description: `Specifying a particular function via \`{"name": "my_function"}\` forces the model to call that function. - `, - properties: { - name: { - type: "string", - description: `The name of the function to call.`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$FunctionDef.ts b/sdks/ts/src/api/schemas/$FunctionDef.ts deleted file mode 100644 index 93be88219..000000000 --- a/sdks/ts/src/api/schemas/$FunctionDef.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $FunctionDef = { - properties: { - description: { - type: "string", - description: `A description of what the function does, used by the model to choose when and how to call the function.`, - }, - name: { - type: "string", - description: `The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.`, - isRequired: true, - }, - parameters: { - type: "FunctionParameters", - description: `Parameters accepeted by this function`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$JobStatus.ts b/sdks/ts/src/api/schemas/$JobStatus.ts deleted file mode 100644 index 9f1b6de70..000000000 --- a/sdks/ts/src/api/schemas/$JobStatus.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $JobStatus = { - properties: { - name: { - type: "string", - description: `Name of the job`, - isRequired: true, - }, - reason: { - type: "string", - description: `Reason for current state`, - }, - created_at: { - type: "string", - description: `Job created at (RFC-3339 format)`, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `Job updated at (RFC-3339 format)`, - format: "date-time", - }, - id: { - type: "string", - description: `Job id (UUID)`, - isRequired: true, - format: "uuid", - }, - has_progress: { - type: "boolean", - description: `Whether this Job supports progress updates`, - }, - progress: { - type: "number", - description: `Progress percentage`, - maximum: 100, - }, - state: { - type: "Enum", - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$task_id.ts b/sdks/ts/src/api/schemas/$Jobs_JobState.ts similarity index 75% rename from sdks/ts/src/api/schemas/$task_id.ts rename to sdks/ts/src/api/schemas/$Jobs_JobState.ts index f784afc9c..651b0849f 100644 --- a/sdks/ts/src/api/schemas/$task_id.ts +++ b/sdks/ts/src/api/schemas/$Jobs_JobState.ts @@ -2,6 +2,6 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $task_id = { - type: "string", +export const $Jobs_JobState = { + type: "Enum", } as const; diff --git a/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts b/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts new file mode 100644 index 000000000..3fe2f032b --- /dev/null +++ b/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts @@ -0,0 +1,69 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Jobs_JobStatus = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the job`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + reason: { + type: "string", + description: `Reason for the current state of the job`, + isRequired: true, + }, + has_progress: { + type: "boolean", + description: `Whether this Job supports progress updates`, + isRequired: true, + }, + progress: { + type: "number", + description: `Progress percentage`, + isRequired: true, + format: "float", + maximum: 100, + }, + state: { + type: "all-of", + description: `Current state of the job`, + contains: [ + { + type: "Jobs_JobState", + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Memory.ts b/sdks/ts/src/api/schemas/$Memory.ts deleted file mode 100644 index cb167c123..000000000 --- a/sdks/ts/src/api/schemas/$Memory.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Memory = { - properties: { - agent_id: { - type: "string", - description: `ID of the agent`, - isRequired: true, - format: "uuid", - }, - user_id: { - type: "string", - description: `ID of the user`, - isRequired: true, - format: "uuid", - }, - content: { - type: "string", - description: `Content of the memory`, - isRequired: true, - }, - created_at: { - type: "string", - description: `Memory created at (RFC-3339 format)`, - isRequired: true, - format: "date-time", - }, - last_accessed_at: { - type: "string", - description: `Memory last accessed at (RFC-3339 format)`, - format: "date-time", - }, - timestamp: { - type: "string", - description: `Memory happened at (RFC-3339 format)`, - format: "date-time", - }, - sentiment: { - type: "number", - description: `Sentiment (valence) of the memory on a scale of -1 to 1`, - maximum: 1, - minimum: -1, - }, - id: { - type: "string", - description: `Memory id (UUID)`, - isRequired: true, - format: "uuid", - }, - entities: { - type: "array", - contains: { - properties: {}, - }, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$MemoryAccessOptions.ts b/sdks/ts/src/api/schemas/$MemoryAccessOptions.ts deleted file mode 100644 index 4b0e4a8a8..000000000 --- a/sdks/ts/src/api/schemas/$MemoryAccessOptions.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $MemoryAccessOptions = { - properties: { - recall: { - type: "boolean", - description: `Whether previous memories should be recalled or not`, - }, - record: { - type: "boolean", - description: `Whether this interaction should be recorded in history or not`, - }, - remember: { - type: "boolean", - description: `Whether this interaction should form memories or not`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$NamedToolChoice.ts b/sdks/ts/src/api/schemas/$NamedToolChoice.ts deleted file mode 100644 index 307d0fa29..000000000 --- a/sdks/ts/src/api/schemas/$NamedToolChoice.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $NamedToolChoice = { - description: `Specifies a tool the model should use. Use to force the model to call a specific function.`, - properties: { - type: { - type: "Enum", - isRequired: true, - }, - function: { - properties: { - name: { - type: "string", - description: `The name of the function to call.`, - isRequired: true, - }, - }, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$PartialFunctionDef.ts b/sdks/ts/src/api/schemas/$PartialFunctionDef.ts deleted file mode 100644 index 86e9187cb..000000000 --- a/sdks/ts/src/api/schemas/$PartialFunctionDef.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $PartialFunctionDef = { - properties: { - description: { - type: "string", - description: `A description of what the function does, used by the model to choose when and how to call the function.`, - }, - name: { - type: "string", - description: `The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.`, - }, - parameters: { - type: "FunctionParameters", - description: `Parameters accepeted by this function`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$PatchToolRequest.ts b/sdks/ts/src/api/schemas/$PatchToolRequest.ts deleted file mode 100644 index 3bcfae137..000000000 --- a/sdks/ts/src/api/schemas/$PatchToolRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $PatchToolRequest = { - properties: { - function: { - type: "PartialFunctionDef", - description: `Function definition and parameters`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ResourceCreatedResponse.ts b/sdks/ts/src/api/schemas/$ResourceCreatedResponse.ts deleted file mode 100644 index 55171164a..000000000 --- a/sdks/ts/src/api/schemas/$ResourceCreatedResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ResourceCreatedResponse = { - properties: { - id: { - type: "string", - isRequired: true, - format: "uuid", - }, - created_at: { - type: "string", - isRequired: true, - format: "date-time", - }, - jobs: { - type: "array", - contains: { - type: "string", - format: "uuid", - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ResourceDeletedResponse.ts b/sdks/ts/src/api/schemas/$ResourceDeletedResponse.ts deleted file mode 100644 index 7bd9caa8e..000000000 --- a/sdks/ts/src/api/schemas/$ResourceDeletedResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ResourceDeletedResponse = { - properties: { - id: { - type: "string", - isRequired: true, - format: "uuid", - }, - deleted_at: { - type: "string", - isRequired: true, - format: "date-time", - }, - jobs: { - type: "array", - contains: { - type: "string", - format: "uuid", - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ResourceUpdatedResponse.ts b/sdks/ts/src/api/schemas/$ResourceUpdatedResponse.ts deleted file mode 100644 index 9c4a7bd5f..000000000 --- a/sdks/ts/src/api/schemas/$ResourceUpdatedResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ResourceUpdatedResponse = { - properties: { - id: { - type: "string", - isRequired: true, - format: "uuid", - }, - updated_at: { - type: "string", - isRequired: true, - format: "date-time", - }, - jobs: { - type: "array", - contains: { - type: "string", - format: "uuid", - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Session.ts b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts similarity index 61% rename from sdks/ts/src/api/schemas/$Session.ts rename to sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts index 3ee4727c2..c9749d218 100644 --- a/sdks/ts/src/api/schemas/$Session.ts +++ b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts @@ -2,60 +2,70 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Session = { +export const $Sessions_CreateOrUpdateSessionRequest = { properties: { id: { - type: "string", - description: `Session id (UUID)`, + type: "Common_uuid", isRequired: true, - format: "uuid", }, - user_id: { - type: "string", + user: { + type: "all-of", description: `User ID of user associated with this session`, - format: "uuid", + contains: [ + { + type: "Common_uuid", + }, + ], }, - agent_id: { - type: "string", + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + }, + agent: { + type: "all-of", description: `Agent ID of agent associated with this session`, - isRequired: true, - format: "uuid", + contains: [ + { + type: "Common_uuid", + }, + ], + }, + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, }, situation: { type: "string", description: `A specific situation that sets the background for this session`, - }, - summary: { - type: "string", - description: `(null at the beginning) - generated automatically after every interaction`, - }, - created_at: { - type: "string", - description: `Session created at (RFC-3339 format)`, - format: "date-time", - }, - updated_at: { - type: "string", - description: `Session updated at (RFC-3339 format)`, - format: "date-time", - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, + isRequired: true, }, render_templates: { type: "boolean", description: `Render system and assistant message content as jinja templates`, + isRequired: true, }, token_budget: { type: "number", description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", }, context_overflow: { type: "string", description: `Action to start on context window overflow`, + isRequired: true, + isNullable: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts new file mode 100644 index 000000000..7fcec21fb --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts @@ -0,0 +1,68 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_CreateSessionRequest = { + description: `Payload for creating a session`, + properties: { + user: { + type: "all-of", + description: `User ID of user associated with this session`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + }, + agent: { + type: "all-of", + description: `Agent ID of agent associated with this session`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + }, + situation: { + type: "string", + description: `A specific situation that sets the background for this session`, + isRequired: true, + }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, + isRequired: true, + }, + token_budget: { + type: "number", + description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", + }, + context_overflow: { + type: "string", + description: `Action to start on context window overflow`, + isRequired: true, + isNullable: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts new file mode 100644 index 000000000..846bf8b92 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_MultiAgentMultiUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts new file mode 100644 index 000000000..36f2ada1d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_MultiAgentNoUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts new file mode 100644 index 000000000..17146caa9 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_MultiAgentSingleUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + user: { + type: "Common_uuid", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$PatchSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts similarity index 58% rename from sdks/ts/src/api/schemas/$PatchSessionRequest.ts rename to sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts index 2127ce498..1cd43cf8e 100644 --- a/sdks/ts/src/api/schemas/$PatchSessionRequest.ts +++ b/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts @@ -2,26 +2,33 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $PatchSessionRequest = { - description: `A request for patching a session`, +export const $Sessions_PatchSessionRequest = { + description: `Payload for patching a session`, properties: { situation: { type: "string", - description: `Updated situation for this session`, + description: `A specific situation that sets the background for this session`, }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, }, token_budget: { type: "number", description: `Threshold value for the adaptive context functionality`, + isNullable: true, + format: "uint16", }, context_overflow: { type: "string", description: `Action to start on context window overflow`, + isNullable: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_Session.ts b/sdks/ts/src/api/schemas/$Sessions_Session.ts new file mode 100644 index 000000000..8357ed5d3 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_Session.ts @@ -0,0 +1,72 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_Session = { + properties: { + situation: { + type: "string", + description: `A specific situation that sets the background for this session`, + isRequired: true, + }, + summary: { + type: "string", + description: `Summary (null at the beginning) - generated automatically after every interaction`, + isReadOnly: true, + isRequired: true, + isNullable: true, + }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, + isRequired: true, + }, + token_budget: { + type: "number", + description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", + }, + context_overflow: { + type: "string", + description: `Action to start on context window overflow`, + isRequired: true, + isNullable: true, + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + kind: { + type: "string", + description: `Discriminator property for Session.`, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts new file mode 100644 index 000000000..25e5a0f92 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_SingleAgentMultiUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agent: { + type: "Common_uuid", + isRequired: true, + }, + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$ChatInput.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts similarity index 50% rename from sdks/ts/src/api/schemas/$ChatInput.ts rename to sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts index 26821639c..e234326b9 100644 --- a/sdks/ts/src/api/schemas/$ChatInput.ts +++ b/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts @@ -2,17 +2,19 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $ChatInput = { +export const $Sessions_SingleAgentNoUserSession = { type: "all-of", contains: [ { - type: "ChatInputData", + type: "Sessions_Session", }, { - type: "ChatSettings", - }, - { - type: "MemoryAccessOptions", + properties: { + agent: { + type: "Common_uuid", + isRequired: true, + }, + }, }, ], } as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts new file mode 100644 index 000000000..943fd645d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_SingleAgentSingleUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agent: { + type: "Common_uuid", + isRequired: true, + }, + user: { + type: "Common_uuid", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$CreateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts similarity index 67% rename from sdks/ts/src/api/schemas/$CreateSessionRequest.ts rename to sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts index edc694fb7..fa7f1fe8e 100644 --- a/sdks/ts/src/api/schemas/$CreateSessionRequest.ts +++ b/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts @@ -2,41 +2,37 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $CreateSessionRequest = { - description: `A valid request payload for creating a session`, +export const $Sessions_UpdateSessionRequest = { + description: `Payload for updating a session`, properties: { - user_id: { - type: "string", - description: `(Optional) User ID of user to associate with this session`, - format: "uuid", - }, - agent_id: { - type: "string", - description: `Agent ID of agent to associate with this session`, - isRequired: true, - format: "uuid", - }, situation: { type: "string", description: `A specific situation that sets the background for this session`, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, + isRequired: true, }, render_templates: { type: "boolean", description: `Render system and assistant message content as jinja templates`, + isRequired: true, }, token_budget: { type: "number", description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", }, context_overflow: { type: "string", description: `Action to start on context window overflow`, + isRequired: true, + isNullable: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Suggestion.ts b/sdks/ts/src/api/schemas/$Suggestion.ts deleted file mode 100644 index 28cdaea7f..000000000 --- a/sdks/ts/src/api/schemas/$Suggestion.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Suggestion = { - properties: { - created_at: { - type: "string", - description: `Suggestion created at (RFC-3339 format)`, - format: "date-time", - }, - target: { - type: "Enum", - isRequired: true, - }, - content: { - type: "string", - description: `The content of the suggestion`, - isRequired: true, - }, - message_id: { - type: "string", - description: `The message that produced it`, - isRequired: true, - format: "uuid", - }, - session_id: { - type: "string", - description: `Session this suggestion belongs to`, - isRequired: true, - format: "uuid", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CEL.ts b/sdks/ts/src/api/schemas/$Tasks_CEL.ts new file mode 100644 index 000000000..3995b701c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_CEL.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_CEL = { + type: "string", + description: `An object where values are strings in the Common Expression Language that get evaluated before being passed downstream`, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts new file mode 100644 index 000000000..deb0f3130 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_CreateOrUpdateTaskRequest = { + type: "dictionary", + contains: { + type: "array", + contains: { + type: "Tasks_WorkflowStep", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$CreateTask.ts b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts similarity index 61% rename from sdks/ts/src/api/schemas/$CreateTask.ts rename to sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts index a17ba8506..25e99372f 100644 --- a/sdks/ts/src/api/schemas/$CreateTask.ts +++ b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts @@ -2,9 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $CreateTask = { +export const $Tasks_CreateTaskRequest = { type: "dictionary", contains: { - properties: {}, + type: "array", + contains: { + type: "Tasks_WorkflowStep", + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts new file mode 100644 index 000000000..dedf2f52b --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_ErrorWorkflowStep = { + type: "all-of", + contains: [ + { + type: "Tasks_WorkflowStep", + }, + { + properties: { + error: { + type: "string", + description: `The error message`, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts b/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts new file mode 100644 index 000000000..abd8d11ad --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_EvaluateStep = { + type: "all-of", + contains: [ + { + type: "Tasks_WorkflowStep", + }, + { + properties: { + evaluate: { + type: "dictionary", + contains: { + type: "Tasks_CEL", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts new file mode 100644 index 000000000..ee1ded4d2 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts @@ -0,0 +1,46 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_IfElseWorkflowStep = { + type: "all-of", + contains: [ + { + type: "Tasks_WorkflowStep", + }, + { + properties: { + if: { + type: "all-of", + description: `The condition to evaluate`, + contains: [ + { + type: "Tasks_CEL", + }, + ], + isRequired: true, + }, + then: { + type: "all-of", + description: `The steps to run if the condition is true`, + contains: [ + { + type: "Tasks_WorkflowStep", + }, + ], + isRequired: true, + }, + else: { + type: "all-of", + description: `The steps to run if the condition is false`, + contains: [ + { + type: "Tasks_WorkflowStep", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$FunctionParameters.ts b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts similarity index 61% rename from sdks/ts/src/api/schemas/$FunctionParameters.ts rename to sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts index 96254a75e..4cecc3538 100644 --- a/sdks/ts/src/api/schemas/$FunctionParameters.ts +++ b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts @@ -2,9 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $FunctionParameters = { +export const $Tasks_PatchTaskRequest = { type: "dictionary", contains: { - properties: {}, + type: "array", + contains: { + type: "Tasks_WorkflowStep", + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts b/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts new file mode 100644 index 000000000..16f36326a --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts @@ -0,0 +1,260 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_PromptStep = { + type: "all-of", + contains: [ + { + type: "Tasks_WorkflowStep", + }, + { + properties: { + prompt: { + type: "any-of", + description: `The prompt to run`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "Entries_InputChatMLMessage", + }, + }, + ], + isRequired: true, + }, + settings: { + type: "any-of", + description: `Settings for the prompt`, + contains: [ + { + properties: { + model: { + type: "all-of", + description: `Identifier of the model to be used`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + stream: { + type: "boolean", + description: `Indicates if the server should stream the response as it's generated`, + isRequired: true, + }, + stop: { + type: "array", + contains: { + type: "string", + }, + }, + seed: { + type: "number", + description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, + format: "int16", + maximum: 1000, + minimum: -1, + }, + max_tokens: { + type: "number", + description: `The maximum number of tokens to generate in the chat completion`, + format: "uint32", + minimum: 1, + }, + logit_bias: { + type: "dictionary", + contains: { + type: "Common_logit_bias", + }, + }, + response_format: { + type: "all-of", + description: `Response format (set to \`json_object\` to restrict output to JSON)`, + contains: [ + { + type: "Chat_CompletionResponseFormat", + }, + ], + }, + preset: { + type: "all-of", + description: `Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)`, + contains: [ + { + type: "Chat_GenerationPreset", + }, + ], + }, + }, + }, + { + properties: { + model: { + type: "all-of", + description: `Identifier of the model to be used`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + stream: { + type: "boolean", + description: `Indicates if the server should stream the response as it's generated`, + isRequired: true, + }, + stop: { + type: "array", + contains: { + type: "string", + }, + }, + seed: { + type: "number", + description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, + format: "int16", + maximum: 1000, + minimum: -1, + }, + max_tokens: { + type: "number", + description: `The maximum number of tokens to generate in the chat completion`, + format: "uint32", + minimum: 1, + }, + logit_bias: { + type: "dictionary", + contains: { + type: "Common_logit_bias", + }, + }, + response_format: { + type: "all-of", + description: `Response format (set to \`json_object\` to restrict output to JSON)`, + contains: [ + { + type: "Chat_CompletionResponseFormat", + }, + ], + }, + frequency_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + presence_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + }, + }, + { + properties: { + model: { + type: "all-of", + description: `Identifier of the model to be used`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + stream: { + type: "boolean", + description: `Indicates if the server should stream the response as it's generated`, + isRequired: true, + }, + stop: { + type: "array", + contains: { + type: "string", + }, + }, + seed: { + type: "number", + description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, + format: "int16", + maximum: 1000, + minimum: -1, + }, + max_tokens: { + type: "number", + description: `The maximum number of tokens to generate in the chat completion`, + format: "uint32", + minimum: 1, + }, + logit_bias: { + type: "dictionary", + contains: { + type: "Common_logit_bias", + }, + }, + response_format: { + type: "all-of", + description: `Response format (set to \`json_object\` to restrict output to JSON)`, + contains: [ + { + type: "Chat_CompletionResponseFormat", + }, + ], + }, + repetition_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + }, + length_penalty: { + type: "number", + description: `Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.`, + format: "float", + maximum: 2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + min_p: { + type: "number", + description: `Minimum probability compared to leading token to be considered`, + format: "float", + maximum: 1, + }, + }, + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$CELObject.ts b/sdks/ts/src/api/schemas/$Tasks_Task.ts similarity index 63% rename from sdks/ts/src/api/schemas/$CELObject.ts rename to sdks/ts/src/api/schemas/$Tasks_Task.ts index 9fc257ff6..2de09403a 100644 --- a/sdks/ts/src/api/schemas/$CELObject.ts +++ b/sdks/ts/src/api/schemas/$Tasks_Task.ts @@ -2,9 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $CELObject = { +export const $Tasks_Task = { type: "dictionary", contains: { - properties: {}, + type: "array", + contains: { + type: "Tasks_WorkflowStep", + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts b/sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts new file mode 100644 index 000000000..3e07ea532 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts @@ -0,0 +1,33 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_ToolCallStep = { + type: "all-of", + contains: [ + { + type: "Tasks_WorkflowStep", + }, + { + properties: { + tool: { + type: "all-of", + description: `The tool to run`, + contains: [ + { + type: "Common_toolRef", + }, + ], + isRequired: true, + }, + arguments: { + type: "dictionary", + contains: { + properties: {}, + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Task.ts b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts similarity index 61% rename from sdks/ts/src/api/schemas/$Task.ts rename to sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts index 7aadab6d3..5e77093f7 100644 --- a/sdks/ts/src/api/schemas/$Task.ts +++ b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts @@ -2,9 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Task = { +export const $Tasks_UpdateTaskRequest = { type: "dictionary", contains: { - properties: {}, + type: "array", + contains: { + type: "Tasks_WorkflowStep", + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$ToolCallWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_WorkflowStep.ts similarity index 56% rename from sdks/ts/src/api/schemas/$ToolCallWorkflowStep.ts rename to sdks/ts/src/api/schemas/$Tasks_WorkflowStep.ts index f464de281..68ac08931 100644 --- a/sdks/ts/src/api/schemas/$ToolCallWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_WorkflowStep.ts @@ -2,15 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $ToolCallWorkflowStep = { +export const $Tasks_WorkflowStep = { properties: { - tool_id: { + kind: { type: "string", - isRequired: true, - }, - arguments: { - type: "CELObject", - isRequired: true, + description: `Discriminator property for WorkflowStep.`, }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts b/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts new file mode 100644 index 000000000..7c9bd85e0 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts @@ -0,0 +1,28 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_YieldStep = { + type: "all-of", + contains: [ + { + type: "Tasks_WorkflowStep", + }, + { + properties: { + workflow: { + type: "string", + description: `The subworkflow to run`, + isRequired: true, + }, + arguments: { + type: "dictionary", + contains: { + type: "Tasks_CEL", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tool.ts b/sdks/ts/src/api/schemas/$Tool.ts deleted file mode 100644 index 47cd471b8..000000000 --- a/sdks/ts/src/api/schemas/$Tool.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tool = { - properties: { - type: { - type: "Enum", - isRequired: true, - }, - function: { - type: "one-of", - description: `Function definition and parameters`, - contains: [ - { - type: "FunctionDef", - }, - ], - isRequired: true, - }, - id: { - type: "string", - description: `Tool ID`, - isRequired: true, - format: "uuid", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$ToolChoiceOption.ts b/sdks/ts/src/api/schemas/$ToolChoiceOption.ts deleted file mode 100644 index f674625a9..000000000 --- a/sdks/ts/src/api/schemas/$ToolChoiceOption.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ToolChoiceOption = { - type: "one-of", - description: `Controls which (if any) function is called by the model. - \`none\` means the model will not call a function and instead generates a message. - \`auto\` means the model can pick between generating a message or calling a function. - Specifying a particular function via \`{"type: "function", "function": {"name": "my_function"}}\` forces the model to call that function. - \`none\` is the default when no functions are present. \`auto\` is the default if functions are present. - `, - contains: [ - { - type: "Enum", - }, - { - type: "NamedToolChoice", - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_ChosenFunctionCall.ts b/sdks/ts/src/api/schemas/$Tools_ChosenFunctionCall.ts new file mode 100644 index 000000000..3d550db11 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_ChosenFunctionCall.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_ChosenFunctionCall = { + type: "all-of", + contains: [ + { + type: "Tools_ChosenToolCall", + }, + { + properties: { + function: { + type: "Tools_FunctionCallOption", + isRequired: true, + }, + type: { + type: "Enum", + isRequired: true, + }, + function: { + type: "all-of", + description: `The function to call`, + contains: [ + { + type: "Tools_FunctionCallOption", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_ChosenToolCall.ts b/sdks/ts/src/api/schemas/$Tools_ChosenToolCall.ts new file mode 100644 index 000000000..9db118f36 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_ChosenToolCall.ts @@ -0,0 +1,41 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_ChosenToolCall = { + description: `The response tool value generated by the model`, + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + isRequired: true, + }, + function: { + type: "Tools_FunctionCallOption", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts new file mode 100644 index 000000000..5d23a1dbd --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts @@ -0,0 +1,41 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_CreateToolRequest = { + description: `Payload for creating a tool`, + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + isRequired: true, + }, + background: { + type: "boolean", + description: `The tool should be run in the background (not supported at the moment)`, + isRequired: true, + }, + interactive: { + type: "boolean", + description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, + isRequired: true, + }, + function: { + type: "Tools_FunctionDef", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$YieldWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tools_FunctionCallOption.ts similarity index 63% rename from sdks/ts/src/api/schemas/$YieldWorkflowStep.ts rename to sdks/ts/src/api/schemas/$Tools_FunctionCallOption.ts index 413834a65..11630b918 100644 --- a/sdks/ts/src/api/schemas/$YieldWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Tools_FunctionCallOption.ts @@ -2,14 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $YieldWorkflowStep = { +export const $Tools_FunctionCallOption = { properties: { - workflow: { + name: { type: "string", - isRequired: true, - }, - arguments: { - type: "CELObject", + description: `The name of the function`, isRequired: true, }, }, diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionDef.ts b/sdks/ts/src/api/schemas/$Tools_FunctionDef.ts new file mode 100644 index 000000000..8646379bc --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_FunctionDef.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_FunctionDef = { + description: `Function definition`, + properties: { + name: { + type: "all-of", + description: `DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons.`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], + }, + parameters: { + type: "dictionary", + contains: { + properties: {}, + }, + isRequired: true, + }, + description: { + type: "all-of", + description: `Description of the function`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts new file mode 100644 index 000000000..90605f5ee --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts @@ -0,0 +1,33 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_FunctionDefUpdate = { + description: `Function definition`, + properties: { + name: { + type: "all-of", + description: `DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons.`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], + }, + parameters: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + description: { + type: "all-of", + description: `Description of the function`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionTool.ts b/sdks/ts/src/api/schemas/$Tools_FunctionTool.ts new file mode 100644 index 000000000..2e2fbfd24 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_FunctionTool.ts @@ -0,0 +1,42 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_FunctionTool = { + type: "all-of", + contains: [ + { + type: "Tools_Tool", + }, + { + properties: { + function: { + type: "Tools_FunctionDef", + isRequired: true, + }, + type: { + type: "Enum", + isRequired: true, + }, + background: { + type: "boolean", + isRequired: true, + }, + interactive: { + type: "boolean", + isRequired: true, + }, + function: { + type: "all-of", + description: `The function to call`, + contains: [ + { + type: "Tools_FunctionDef", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts new file mode 100644 index 000000000..befda0e74 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_PatchToolRequest = { + description: `Payload for patching a tool`, + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + }, + background: { + type: "boolean", + description: `The tool should be run in the background (not supported at the moment)`, + }, + interactive: { + type: "boolean", + description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, + }, + function: { + type: "Tools_FunctionDefUpdate", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_Tool.ts b/sdks/ts/src/api/schemas/$Tools_Tool.ts new file mode 100644 index 000000000..83f98195f --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_Tool.ts @@ -0,0 +1,64 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_Tool = { + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + isRequired: true, + }, + background: { + type: "boolean", + description: `The tool should be run in the background (not supported at the moment)`, + isRequired: true, + }, + interactive: { + type: "boolean", + description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, + isRequired: true, + }, + function: { + type: "Tools_FunctionDef", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$ToolResponse.ts b/sdks/ts/src/api/schemas/$Tools_ToolResponse.ts similarity index 74% rename from sdks/ts/src/api/schemas/$ToolResponse.ts rename to sdks/ts/src/api/schemas/$Tools_ToolResponse.ts index e42939779..177317cd9 100644 --- a/sdks/ts/src/api/schemas/$ToolResponse.ts +++ b/sdks/ts/src/api/schemas/$Tools_ToolResponse.ts @@ -2,13 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $ToolResponse = { +export const $Tools_ToolResponse = { properties: { id: { - type: "string", - description: `Optional Tool ID`, + type: "Common_uuid", isRequired: true, - format: "uuid", }, output: { type: "dictionary", diff --git a/sdks/ts/src/api/schemas/$execution_id.ts b/sdks/ts/src/api/schemas/$Tools_ToolType.ts similarity index 74% rename from sdks/ts/src/api/schemas/$execution_id.ts rename to sdks/ts/src/api/schemas/$Tools_ToolType.ts index 4088abff6..af2dc0d3d 100644 --- a/sdks/ts/src/api/schemas/$execution_id.ts +++ b/sdks/ts/src/api/schemas/$Tools_ToolType.ts @@ -2,6 +2,6 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $execution_id = { - type: "string", +export const $Tools_ToolType = { + type: "Enum", } as const; diff --git a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts new file mode 100644 index 000000000..6764f9c5a --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts @@ -0,0 +1,41 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_UpdateToolRequest = { + description: `Payload for updating a tool`, + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + isRequired: true, + }, + background: { + type: "boolean", + description: `The tool should be run in the background (not supported at the moment)`, + isRequired: true, + }, + interactive: { + type: "boolean", + description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, + isRequired: true, + }, + function: { + type: "Tools_FunctionDef", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$UpdateSessionRequest.ts b/sdks/ts/src/api/schemas/$UpdateSessionRequest.ts deleted file mode 100644 index 64dd9230e..000000000 --- a/sdks/ts/src/api/schemas/$UpdateSessionRequest.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $UpdateSessionRequest = { - description: `A valid request payload for updating a session`, - properties: { - situation: { - type: "string", - description: `Updated situation for this session`, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - token_budget: { - type: "number", - description: `Threshold value for the adaptive context functionality`, - }, - context_overflow: { - type: "string", - description: `Action to start on context window overflow`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$UpdateToolRequest.ts b/sdks/ts/src/api/schemas/$UpdateToolRequest.ts deleted file mode 100644 index 060fa3e1e..000000000 --- a/sdks/ts/src/api/schemas/$UpdateToolRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $UpdateToolRequest = { - properties: { - function: { - type: "FunctionDef", - description: `Function definition and parameters`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$CreateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest.ts similarity index 59% rename from sdks/ts/src/api/schemas/$CreateUserRequest.ts rename to sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest.ts index 962738359..856df4898 100644 --- a/sdks/ts/src/api/schemas/$CreateUserRequest.ts +++ b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest.ts @@ -2,22 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $CreateUserRequest = { - description: `A valid request payload for creating a user`, +export const $Users_CreateOrUpdateUserRequest = { properties: { - name: { - type: "string", - description: `Name of the user`, - }, - about: { - type: "string", - description: `About the user`, - }, - docs: { - type: "array", - contains: { - type: "CreateDoc", - }, + id: { + type: "Common_uuid", + isRequired: true, }, metadata: { type: "dictionary", @@ -25,5 +14,20 @@ export const $CreateUserRequest = { properties: {}, }, }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the user`, + isRequired: true, + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$User.ts b/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts similarity index 52% rename from sdks/ts/src/api/schemas/$User.ts rename to sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts index 77f4b8377..290d1bffb 100644 --- a/sdks/ts/src/api/schemas/$User.ts +++ b/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts @@ -2,37 +2,36 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $User = { +export const $Users_CreateUserRequest = { + description: `Payload for creating a user (and associated documents)`, properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, name: { - type: "string", + type: "all-of", description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, }, about: { type: "string", description: `About the user`, - }, - created_at: { - type: "string", - description: `User created at (RFC-3339 format)`, - format: "date-time", - }, - updated_at: { - type: "string", - description: `User updated at (RFC-3339 format)`, - format: "date-time", - }, - id: { - type: "string", - description: `User id (UUID)`, isRequired: true, - format: "uuid", }, - metadata: { - type: "dictionary", + docs: { + type: "array", contains: { properties: {}, }, + isRequired: true, }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$PatchUserRequest.ts b/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts similarity index 66% rename from sdks/ts/src/api/schemas/$PatchUserRequest.ts rename to sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts index fc1c4e487..060855d65 100644 --- a/sdks/ts/src/api/schemas/$PatchUserRequest.ts +++ b/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts @@ -2,22 +2,27 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $PatchUserRequest = { - description: `A request for patching a user`, +export const $Users_PatchUserRequest = { + description: `Payload for patching a user`, properties: { - about: { - type: "string", - description: `About the user`, - }, - name: { - type: "string", - description: `Name of the user`, - }, metadata: { type: "dictionary", contains: { properties: {}, }, }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + about: { + type: "string", + description: `About the user`, + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$UpdateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts similarity index 68% rename from sdks/ts/src/api/schemas/$UpdateUserRequest.ts rename to sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts index 720d558de..cef57aa63 100644 --- a/sdks/ts/src/api/schemas/$UpdateUserRequest.ts +++ b/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts @@ -2,24 +2,29 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $UpdateUserRequest = { - description: `A valid request payload for updating a user`, +export const $Users_UpdateUserRequest = { + description: `Payload for updating a user`, properties: { - about: { - type: "string", - description: `About the user`, - isRequired: true, - }, - name: { - type: "string", - description: `Name of the user`, - isRequired: true, - }, metadata: { type: "dictionary", contains: { properties: {}, }, }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the user`, + isRequired: true, + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Users_User.ts b/sdks/ts/src/api/schemas/$Users_User.ts new file mode 100644 index 000000000..232c618c3 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Users_User.ts @@ -0,0 +1,53 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Users_User = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the user`, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$WorkflowStep.ts b/sdks/ts/src/api/schemas/$WorkflowStep.ts deleted file mode 100644 index a1192b028..000000000 --- a/sdks/ts/src/api/schemas/$WorkflowStep.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $WorkflowStep = { - type: "any-of", - contains: [ - { - type: "PromptWorkflowStep", - description: `Workflow Step for the Prompt`, - }, - { - type: "EvaluateWorkflowStep", - description: `Workflow Step for the Evaluate using CEL`, - }, - { - type: "YieldWorkflowStep", - description: `Workflow Step to call another Workflow`, - }, - { - type: "ToolCallWorkflowStep", - description: `Workflow Step for calling a Tool`, - }, - { - type: "ErrorWorkflowStep", - description: `Workflow Step for handling an Error`, - }, - { - type: "IfElseWorkflowStep", - description: `Workflow Step for If, Then, Else`, - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$agent_id.ts b/sdks/ts/src/api/schemas/$agent_id.ts deleted file mode 100644 index a4ca39146..000000000 --- a/sdks/ts/src/api/schemas/$agent_id.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $agent_id = { - type: "string", - format: "uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$doc_id.ts b/sdks/ts/src/api/schemas/$doc_id.ts deleted file mode 100644 index f0929dc25..000000000 --- a/sdks/ts/src/api/schemas/$doc_id.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $doc_id = { - type: "string", - format: "uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$memory_id.ts b/sdks/ts/src/api/schemas/$memory_id.ts deleted file mode 100644 index b4c4052a7..000000000 --- a/sdks/ts/src/api/schemas/$memory_id.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $memory_id = { - type: "string", - format: "uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$message_id.ts b/sdks/ts/src/api/schemas/$message_id.ts deleted file mode 100644 index f3891d563..000000000 --- a/sdks/ts/src/api/schemas/$message_id.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $message_id = { - type: "string", - format: "uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$session_id.ts b/sdks/ts/src/api/schemas/$session_id.ts deleted file mode 100644 index 08cda09db..000000000 --- a/sdks/ts/src/api/schemas/$session_id.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $session_id = { - type: "string", - format: "uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$tool_id.ts b/sdks/ts/src/api/schemas/$tool_id.ts deleted file mode 100644 index f9676d0ea..000000000 --- a/sdks/ts/src/api/schemas/$tool_id.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $tool_id = { - type: "string", - format: "uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$user_id.ts b/sdks/ts/src/api/schemas/$user_id.ts deleted file mode 100644 index 4c5c8afcb..000000000 --- a/sdks/ts/src/api/schemas/$user_id.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $user_id = { - type: "string", - format: "uuid", -} as const; diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index 030caa617..667092cac 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -2,1161 +2,1825 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Agent } from "../models/Agent"; -import type { ChatInput } from "../models/ChatInput"; -import type { ChatMLMessage } from "../models/ChatMLMessage"; -import type { ChatResponse } from "../models/ChatResponse"; -import type { CreateAgentRequest } from "../models/CreateAgentRequest"; -import type { CreateDoc } from "../models/CreateDoc"; -import type { CreateExecution } from "../models/CreateExecution"; -import type { CreateSessionRequest } from "../models/CreateSessionRequest"; -import type { CreateTask } from "../models/CreateTask"; -import type { CreateToolRequest } from "../models/CreateToolRequest"; -import type { CreateUserRequest } from "../models/CreateUserRequest"; -import type { Doc } from "../models/Doc"; -import type { Execution } from "../models/Execution"; -import type { ExecutionTransition } from "../models/ExecutionTransition"; -import type { JobStatus } from "../models/JobStatus"; -import type { Memory } from "../models/Memory"; -import type { PatchAgentRequest } from "../models/PatchAgentRequest"; -import type { PatchSessionRequest } from "../models/PatchSessionRequest"; -import type { PatchToolRequest } from "../models/PatchToolRequest"; -import type { PatchUserRequest } from "../models/PatchUserRequest"; -import type { ResourceCreatedResponse } from "../models/ResourceCreatedResponse"; -import type { ResourceDeletedResponse } from "../models/ResourceDeletedResponse"; -import type { ResourceUpdatedResponse } from "../models/ResourceUpdatedResponse"; -import type { Session } from "../models/Session"; -import type { Suggestion } from "../models/Suggestion"; -import type { Task } from "../models/Task"; -import type { Tool } from "../models/Tool"; -import type { ToolResponse } from "../models/ToolResponse"; -import type { UpdateAgentRequest } from "../models/UpdateAgentRequest"; -import type { UpdateSessionRequest } from "../models/UpdateSessionRequest"; -import type { UpdateToolRequest } from "../models/UpdateToolRequest"; -import type { UpdateUserRequest } from "../models/UpdateUserRequest"; -import type { User } from "../models/User"; +import type { Agents_Agent } from "../models/Agents_Agent"; +import type { Agents_CreateAgentRequest } from "../models/Agents_CreateAgentRequest"; +import type { Agents_CreateOrUpdateAgentRequest } from "../models/Agents_CreateOrUpdateAgentRequest"; +import type { Agents_PatchAgentRequest } from "../models/Agents_PatchAgentRequest"; +import type { Agents_UpdateAgentRequest } from "../models/Agents_UpdateAgentRequest"; +import type { Common_limit } from "../models/Common_limit"; +import type { Common_offset } from "../models/Common_offset"; +import type { Common_uuid } from "../models/Common_uuid"; +import type { Docs_Doc } from "../models/Docs_Doc"; +import type { Docs_DocReference } from "../models/Docs_DocReference"; +import type { Docs_DocSearchRequest } from "../models/Docs_DocSearchRequest"; +import type { Entries_History } from "../models/Entries_History"; +import type { Executions_CreateExecutionRequest } from "../models/Executions_CreateExecutionRequest"; +import type { Executions_Execution } from "../models/Executions_Execution"; +import type { Executions_TaskTokenResumeExecutionRequest } from "../models/Executions_TaskTokenResumeExecutionRequest"; +import type { Executions_Transition } from "../models/Executions_Transition"; +import type { Executions_UpdateExecutionRequest } from "../models/Executions_UpdateExecutionRequest"; +import type { Jobs_JobStatus } from "../models/Jobs_JobStatus"; +import type { Sessions_CreateOrUpdateSessionRequest } from "../models/Sessions_CreateOrUpdateSessionRequest"; +import type { Sessions_CreateSessionRequest } from "../models/Sessions_CreateSessionRequest"; +import type { Sessions_PatchSessionRequest } from "../models/Sessions_PatchSessionRequest"; +import type { Sessions_Session } from "../models/Sessions_Session"; +import type { Sessions_UpdateSessionRequest } from "../models/Sessions_UpdateSessionRequest"; +import type { Tasks_CreateOrUpdateTaskRequest } from "../models/Tasks_CreateOrUpdateTaskRequest"; +import type { Tasks_CreateTaskRequest } from "../models/Tasks_CreateTaskRequest"; +import type { Tasks_PatchTaskRequest } from "../models/Tasks_PatchTaskRequest"; +import type { Tasks_Task } from "../models/Tasks_Task"; +import type { Tasks_UpdateTaskRequest } from "../models/Tasks_UpdateTaskRequest"; +import type { Tools_PatchToolRequest } from "../models/Tools_PatchToolRequest"; +import type { Tools_Tool } from "../models/Tools_Tool"; +import type { Tools_UpdateToolRequest } from "../models/Tools_UpdateToolRequest"; +import type { Users_CreateOrUpdateUserRequest } from "../models/Users_CreateOrUpdateUserRequest"; +import type { Users_CreateUserRequest } from "../models/Users_CreateUserRequest"; +import type { Users_PatchUserRequest } from "../models/Users_PatchUserRequest"; +import type { Users_UpdateUserRequest } from "../models/Users_UpdateUserRequest"; +import type { Users_User } from "../models/Users_User"; import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class DefaultService { constructor(public readonly httpRequest: BaseHttpRequest) {} /** - * Create a new session - * Create a session between an agent and a user - * @returns ResourceCreatedResponse Session successfully created + * List undefined items + * @returns any The request has succeeded. * @throws ApiError */ - public createSession({ - requestBody, - }: { - /** - * Session initialization options - */ - requestBody?: CreateSessionRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/sessions", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * List sessions - * List sessions created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) - * @returns any List of sessions (sorted created_at descending order) with limit+offset pagination - * @throws ApiError - */ - public listSessions({ + public agentsRouteList({ limit = 100, offset, - metadataFilter = "{}", sortBy = "created_at", - order = "desc", + direction = "asc", + metadataFilter = "{}", }: { /** - * Number of sessions to return + * Limit the number of undefined items returned */ - limit?: number; + limit?: Common_limit; /** - * Number of sessions to skip (sorted created_at descending order) + * Offset the undefined items returned */ - offset?: number; + offset: Common_offset; /** - * JSON object that should be used to filter objects by metadata + * Sort by a field */ - metadataFilter?: string; + sortBy?: "created_at" | "updated_at" | "deleted_at"; /** - * Which field to sort by: `created_at` or `updated_at` + * Sort direction */ - sortBy?: "created_at" | "updated_at"; + direction?: "asc" | "desc"; /** - * Which order should the sort be: `asc` (ascending) or `desc` (descending) + * JSON string of object that should be used to filter objects by metadata */ - order?: "asc" | "desc"; + metadataFilter?: string; }): CancelablePromise<{ - items: Array; + results: Array; }> { return this.httpRequest.request({ method: "GET", - url: "/sessions", + url: "/agents", query: { limit: limit, offset: offset, - metadata_filter: metadataFilter, sort_by: sortBy, - order: order, + direction: direction, + metadata_filter: metadataFilter, }, }); } /** - * Create a new user - * Create a new user - * @returns ResourceCreatedResponse User successfully created + * Create new undefined + * @returns any The request has succeeded and a new resource has been created as a result. * @throws ApiError */ - public createUser({ + public agentsRouteCreate({ requestBody, }: { + requestBody: Agents_CreateAgentRequest; + }): CancelablePromise<{ + /** + * ID of created undefined + */ + id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; /** - * User create options + * IDs (if any) of jobs created as part of this request */ - requestBody?: CreateUserRequest; - }): CancelablePromise { + jobs: Array; + }> { return this.httpRequest.request({ method: "POST", - url: "/users", + url: "/agents", body: requestBody, mediaType: "application/json", }); } /** - * List users - * List users created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) - * @returns any List of users (sorted created_at descending order) with limit+offset pagination + * Create or update undefined (ID is required in payload; existing resource will be overwritten) + * @returns any The request has succeeded. * @throws ApiError */ - public listUsers({ - limit = 100, - offset, - metadataFilter = "{}", - sortBy = "created_at", - order = "desc", + public agentsRouteCreateOrUpdate({ + requestBody, }: { + requestBody: Agents_CreateOrUpdateAgentRequest; + }): CancelablePromise<{ /** - * Number of items to return - */ - limit?: number; - /** - * Number of items to skip (sorted created_at descending order) - */ - offset?: number; - /** - * JSON object that should be used to filter objects by metadata + * ID of updated undefined */ - metadataFilter?: string; + id: Common_uuid; /** - * Which field to sort by: `created_at` or `updated_at` + * When this resource was updated as UTC date-time */ - sortBy?: "created_at" | "updated_at"; + readonly updated_at: string; /** - * Which order should the sort be: `asc` (ascending) or `desc` (descending) + * IDs (if any) of jobs created as part of this request */ - order?: "asc" | "desc"; - }): CancelablePromise<{ - items: Array; + jobs: Array; }> { return this.httpRequest.request({ - method: "GET", - url: "/users", - query: { - limit: limit, - offset: offset, - metadata_filter: metadataFilter, - sort_by: sortBy, - order: order, - }, + method: "PUT", + url: "/agents", + body: requestBody, + mediaType: "application/json", }); } /** - * Create a new agent - * Create a new agent - * @returns ResourceCreatedResponse Agent successfully created + * Update undefined by id (overwrite) + * @returns any The request has succeeded. * @throws ApiError */ - public createAgent({ + public agentsRouteUpdate({ + id, requestBody, }: { /** - * Agent create options + * ID of the undefined + */ + id: Common_uuid; + requestBody: Agents_UpdateAgentRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request */ - requestBody?: CreateAgentRequest; - }): CancelablePromise { + jobs: Array; + }> { return this.httpRequest.request({ - method: "POST", - url: "/agents", + method: "PUT", + url: "/agents/{id}", + path: { + id: id, + }, body: requestBody, mediaType: "application/json", }); } /** - * List agents - * List agents created (use limit/offset pagination to get large number of sessions; sorted by descending order of `created_at` by default) - * @returns any List of agents (sorted created_at descending order) with limit+offset pagination + * Patch undefined by id (merge changes) + * @returns any The request has succeeded. * @throws ApiError */ - public listAgents({ - limit = 100, - offset, - metadataFilter = "{}", - sortBy = "created_at", - order = "desc", + public agentsRoutePatch({ + id, + requestBody, }: { /** - * Number of items to return + * ID of the undefined */ - limit?: number; - /** - * Number of items to skip (sorted created_at descending order) - */ - offset?: number; + id: Common_uuid; + requestBody: Agents_PatchAgentRequest; + }): CancelablePromise<{ /** - * JSON object that should be used to filter objects by metadata + * ID of updated undefined */ - metadataFilter?: string; + id: Common_uuid; /** - * Which field to sort by: `created_at` or `updated_at` + * When this resource was updated as UTC date-time */ - sortBy?: "created_at" | "updated_at"; + readonly updated_at: string; /** - * Which order should the sort be: `asc` (ascending) or `desc` (descending) + * IDs (if any) of jobs created as part of this request */ - order?: "asc" | "desc"; - }): CancelablePromise<{ - items: Array; + jobs: Array; }> { return this.httpRequest.request({ - method: "GET", - url: "/agents", - query: { - limit: limit, - offset: offset, - metadata_filter: metadataFilter, - sort_by: sortBy, - order: order, - }, - }); - } - /** - * Get details of the session - * @returns Session - * @throws ApiError - */ - public getSession({ - sessionId, - }: { - sessionId: string; - }): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/sessions/{session_id}", + method: "PATCH", + url: "/agents/{id}", path: { - session_id: sessionId, + id: id, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Delete session - * @returns ResourceDeletedResponse + * Delete undefined by id + * @returns any The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public deleteSession({ - sessionId, + public agentsRouteDelete({ + id, }: { - sessionId: string; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise<{ + /** + * ID of deleted undefined + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ method: "DELETE", - url: "/sessions/{session_id}", - path: { - session_id: sessionId, - }, - }); - } - /** - * Update session parameters - * @returns ResourceUpdatedResponse - * @throws ApiError - */ - public updateSession({ - sessionId, - requestBody, - }: { - sessionId: string; - requestBody?: UpdateSessionRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/sessions/{session_id}", + url: "/agents/{id}", path: { - session_id: sessionId, + id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Patch Session parameters (merge instead of replace) - * @returns ResourceUpdatedResponse + * Get undefined by id + * @returns Agents_Agent The request has succeeded. * @throws ApiError */ - public patchSession({ - sessionId, - requestBody, + public agentsRouteGet({ + id, }: { - sessionId: string; - requestBody?: PatchSessionRequest; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise { return this.httpRequest.request({ - method: "PATCH", - url: "/sessions/{session_id}", + method: "GET", + url: "/agents/{id}", path: { - session_id: sessionId, + id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Get autogenerated suggestions for session user and agent - * Sorted (created_at descending) - * @returns any + * List undefined items of parent undefined + * @returns any The request has succeeded. * @throws ApiError */ - public getSuggestions({ - sessionId, + public agentDocsRouteList({ + id, limit = 100, offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { - sessionId: string; - limit?: number; - offset?: number; + /** + * ID of parent undefined + */ + id: Common_uuid; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; }): CancelablePromise<{ - items?: Array; + results: Array; }> { return this.httpRequest.request({ method: "GET", - url: "/sessions/{session_id}/suggestions", + url: "/agents/{id}/docs", path: { - session_id: sessionId, + id: id, }, query: { limit: limit, offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, }, }); } /** - * Get all messages in a session - * Sorted (created_at ascending) - * @returns any + * Search for documents owned by undefined + * @returns any The request has succeeded. * @throws ApiError */ - public getHistory({ - sessionId, + public agentsDocsSearchRouteSearch({ + id, + requestBody, limit = 100, offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { - sessionId: string; - limit?: number; - offset?: number; + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: { + body: Docs_DocSearchRequest; + }; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; }): CancelablePromise<{ - items?: Array; + results: Array; }> { return this.httpRequest.request({ - method: "GET", - url: "/sessions/{session_id}/history", + method: "POST", + url: "/agents/{id}/search", path: { - session_id: sessionId, + id: id, }, query: { limit: limit, offset: offset, - }, - }); - } - /** - * Delete session history (does NOT delete related memories) - * @returns ResourceDeletedResponse - * @throws ApiError - */ - public deleteSessionHistory({ - sessionId, - }: { - sessionId: string; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/sessions/{session_id}/history", - path: { - session_id: sessionId, - }, - }); - } - /** - * Interact with the session - * @returns ChatResponse - * @throws ApiError - */ - public chat({ - sessionId, - accept = "application/json", - requestBody, - }: { - sessionId: string; - accept?: "application/json" | "text/event-stream"; - requestBody?: ChatInput; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/sessions/{session_id}/chat", - path: { - session_id: sessionId, - }, - headers: { - Accept: accept, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, }, body: requestBody, mediaType: "application/json", }); } /** - * Get memories of the agent - * Sorted (created_at descending) - * @returns any + * List undefined items of parent undefined + * @returns any The request has succeeded. * @throws ApiError */ - public getAgentMemories({ - agentId, - query, - userId, - limit, + public agentToolsRouteList({ + id, + limit = 100, offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { - agentId: string; - query: string; - userId?: string; - limit?: number; - offset?: number; + /** + * ID of parent undefined + */ + id: Common_uuid; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; }): CancelablePromise<{ - items?: Array; + results: Array; }> { return this.httpRequest.request({ method: "GET", - url: "/agents/{agent_id}/memories", + url: "/agents/{id}/tools", path: { - agent_id: agentId, + id: id, }, query: { - query: query, - user_id: userId, limit: limit, offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, }, }); } /** - * Get details of the user - * @returns User + * Create new undefined + * @returns any The request has succeeded and a new resource has been created as a result. * @throws ApiError */ - public getUser({ userId }: { userId: string }): CancelablePromise { + public agentToolsRouteCreate({ + id, + requestBody, + }: { + /** + * ID of parent undefined + */ + id: Common_uuid; + requestBody: Agents_CreateAgentRequest; + }): CancelablePromise<{ + /** + * ID of created undefined + */ + id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "GET", - url: "/users/{user_id}", + method: "POST", + url: "/agents/{id}/tools", path: { - user_id: userId, + id: id, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Delete user - * @returns ResourceDeletedResponse + * Get undefined by id + * @returns Docs_Doc The request has succeeded. * @throws ApiError */ - public deleteUser({ - userId, + public individualDocsRouteGet({ + id, }: { - userId: string; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise { return this.httpRequest.request({ - method: "DELETE", - url: "/users/{user_id}", + method: "GET", + url: "/docs/{id}", path: { - user_id: userId, + id: id, }, }); } /** - * Update user parameters - * @returns ResourceUpdatedResponse + * Delete undefined by id + * @returns any The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public updateUser({ - userId, - requestBody, + public individualDocsRouteDelete({ + id, }: { - userId: string; - requestBody?: UpdateUserRequest; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise<{ + /** + * ID of deleted undefined + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "PUT", - url: "/users/{user_id}", + method: "DELETE", + url: "/docs/{id}", path: { - user_id: userId, + id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Patch User parameters (merge instead of replace) - * @returns ResourceUpdatedResponse + * Update undefined by id (overwrite) + * @returns any The request has succeeded. * @throws ApiError */ - public patchUser({ - userId, + public executionsRouteUpdate({ + id, requestBody, }: { - userId: string; - requestBody?: PatchUserRequest; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Executions_UpdateExecutionRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "PATCH", - url: "/users/{user_id}", + method: "PUT", + url: "/executions/{id}", path: { - user_id: userId, + id: id, }, body: requestBody, mediaType: "application/json", }); } /** - * Get details of the agent - * @returns Agent + * Get undefined by id + * @returns Executions_Execution The request has succeeded. * @throws ApiError */ - public getAgent({ agentId }: { agentId: string }): CancelablePromise { + public executionsRouteGet({ + id, + }: { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise { return this.httpRequest.request({ method: "GET", - url: "/agents/{agent_id}", + url: "/executions/{id}", path: { - agent_id: agentId, + id: id, }, }); } /** - * Delete agent - * @returns ResourceDeletedResponse + * List undefined items of parent undefined + * @returns any The request has succeeded. * @throws ApiError */ - public deleteAgent({ - agentId, - }: { - agentId: string; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/agents/{agent_id}", - path: { - agent_id: agentId, - }, - }); - } - /** - * Update agent parameters - * @returns ResourceUpdatedResponse - * @throws ApiError - */ - public updateAgent({ - agentId, - requestBody, + public executionTransitionsRouteList({ + id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { - agentId: string; - requestBody?: UpdateAgentRequest; - }): CancelablePromise { + /** + * ID of parent undefined + */ + id: Common_uuid; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array<{ + transitions: Array; + }>; + }> { return this.httpRequest.request({ - method: "PUT", - url: "/agents/{agent_id}", + method: "GET", + url: "/executions/{id}/transitions", path: { - agent_id: agentId, + id: id, + }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Patch Agent parameters (merge instead of replace) - * @returns ResourceUpdatedResponse + * Get undefined by id + * @returns Jobs_JobStatus The request has succeeded. * @throws ApiError */ - public patchAgent({ - agentId, - requestBody, + public jobRouteGet({ + id, }: { - agentId: string; - requestBody?: PatchAgentRequest; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise { return this.httpRequest.request({ - method: "PATCH", - url: "/agents/{agent_id}", + method: "GET", + url: "/jobs/{id}", path: { - agent_id: agentId, + id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Get docs of the agent - * Sorted (created_at descending) - * @returns any + * List undefined items + * @returns any The request has succeeded. * @throws ApiError */ - public getAgentDocs({ - agentId, - limit, + public sessionsRouteList({ + limit = 100, offset, - metadataFilter = "{}", sortBy = "created_at", - order = "desc", - requestBody, + direction = "asc", + metadataFilter = "{}", }: { - agentId: string; - limit?: number; - offset?: number; /** - * JSON object that should be used to filter objects by metadata + * Limit the number of undefined items returned */ - metadataFilter?: string; + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; /** - * Which field to sort by: `created_at` or `updated_at` + * Sort by a field */ - sortBy?: "created_at" | "updated_at"; + sortBy?: "created_at" | "updated_at" | "deleted_at"; /** - * Which order should the sort be: `asc` (ascending) or `desc` (descending) + * Sort direction */ - order?: "asc" | "desc"; - requestBody?: any; + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; }): CancelablePromise<{ - items?: Array; + results: Array; }> { return this.httpRequest.request({ method: "GET", - url: "/agents/{agent_id}/docs", - path: { - agent_id: agentId, - }, + url: "/sessions", query: { limit: limit, offset: offset, - metadata_filter: metadataFilter, sort_by: sortBy, - order: order, + direction: direction, + metadata_filter: metadataFilter, }, - body: requestBody, }); } /** - * Create doc of the agent - * @returns ResourceCreatedResponse + * Create new undefined + * @returns any The request has succeeded and a new resource has been created as a result. * @throws ApiError */ - public createAgentDoc({ - agentId, + public sessionsRouteCreate({ requestBody, }: { - agentId: string; - requestBody?: CreateDoc; - }): CancelablePromise { + requestBody: Sessions_CreateSessionRequest; + }): CancelablePromise<{ + /** + * ID of created undefined + */ + id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ method: "POST", - url: "/agents/{agent_id}/docs", - path: { - agent_id: agentId, - }, + url: "/sessions", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Create or update undefined (ID is required in payload; existing resource will be overwritten) + * @returns any The request has succeeded. + * @throws ApiError + */ + public sessionsRouteCreateOrUpdate({ + requestBody, + }: { + requestBody: Sessions_CreateOrUpdateSessionRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { + return this.httpRequest.request({ + method: "PUT", + url: "/sessions", body: requestBody, mediaType: "application/json", }); } /** - * Get docs of the user - * Sorted (created_at descending) - * @returns any + * List undefined items of parent undefined + * @returns any The request has succeeded. * @throws ApiError */ - public getUserDocs({ - userId, - limit, + public historyRouteList({ + id, + limit = 100, offset, - metadataFilter = "{}", sortBy = "created_at", - order = "desc", - requestBody, + direction = "asc", + metadataFilter = "{}", }: { - userId: string; - limit?: number; - offset?: number; /** - * JSON object that should be used to filter objects by metadata + * ID of parent undefined */ - metadataFilter?: string; + id: Common_uuid; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; /** - * Which field to sort by: `created_at` or `updated_at` + * Sort direction */ - sortBy?: "created_at" | "updated_at"; + direction?: "asc" | "desc"; /** - * Which order should the sort be: `asc` (ascending) or `desc` (descending) + * JSON string of object that should be used to filter objects by metadata */ - order?: "asc" | "desc"; - requestBody?: any; + metadataFilter?: string; }): CancelablePromise<{ - items?: Array; + results: Array; }> { return this.httpRequest.request({ method: "GET", - url: "/users/{user_id}/docs", + url: "/sessions/history/{id}", path: { - user_id: userId, + id: id, }, query: { limit: limit, offset: offset, - metadata_filter: metadataFilter, sort_by: sortBy, - order: order, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Delete undefined by id + * @returns any The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public historyRouteDelete({ + id, + }: { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise<{ + /** + * ID of deleted undefined + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { + return this.httpRequest.request({ + method: "DELETE", + url: "/sessions/history/{id}", + path: { + id: id, }, - body: requestBody, }); } /** - * Create doc of the user - * @returns ResourceCreatedResponse + * Update undefined by id (overwrite) + * @returns any The request has succeeded. * @throws ApiError */ - public createUserDoc({ - userId, + public sessionsRouteUpdate({ + id, requestBody, }: { - userId: string; - requestBody?: CreateDoc; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Sessions_UpdateSessionRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "POST", - url: "/users/{user_id}/docs", + method: "PUT", + url: "/sessions/{id}", path: { - user_id: userId, + id: id, }, body: requestBody, mediaType: "application/json", }); } /** - * Delete doc by id - * @returns ResourceDeletedResponse + * Patch undefined by id (merge changes) + * @returns any The request has succeeded. * @throws ApiError */ - public deleteUserDoc({ - userId, - docId, + public sessionsRoutePatch({ + id, + requestBody, }: { - userId: string; - docId: string; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Sessions_PatchSessionRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "DELETE", - url: "/users/{user_id}/docs/{doc_id}", + method: "PATCH", + url: "/sessions/{id}", path: { - user_id: userId, - doc_id: docId, + id: id, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Delete doc by id - * @returns ResourceDeletedResponse + * Delete undefined by id + * @returns any The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public deleteAgentDoc({ - agentId, - docId, + public sessionsRouteDelete({ + id, }: { - agentId: string; - docId: string; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise<{ + /** + * ID of deleted undefined + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ method: "DELETE", - url: "/agents/{agent_id}/docs/{doc_id}", + url: "/sessions/{id}", path: { - agent_id: agentId, - doc_id: docId, + id: id, }, }); } /** - * Delete memory of the agent by id - * @returns ResourceDeletedResponse + * Get undefined by id + * @returns Sessions_Session The request has succeeded. * @throws ApiError */ - public deleteAgentMemory({ - agentId, - memoryId, + public sessionsRouteGet({ + id, }: { - agentId: string; - memoryId: string; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise { return this.httpRequest.request({ - method: "DELETE", - url: "/agents/{agent_id}/memories/{memory_id}", + method: "GET", + url: "/sessions/{id}", path: { - agent_id: agentId, - memory_id: memoryId, + id: id, }, }); } /** - * Get tools of the agent - * Sorted (created_at descending) - * @returns any + * List undefined items + * @returns any The request has succeeded. * @throws ApiError */ - public getAgentTools({ - agentId, - limit, + public tasksRouteList({ + limit = 100, offset, - requestBody, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { - agentId: string; - limit?: number; - offset?: number; - requestBody?: any; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; }): CancelablePromise<{ - items?: Array; + results: Array; }> { return this.httpRequest.request({ method: "GET", - url: "/agents/{agent_id}/tools", - path: { - agent_id: agentId, - }, + url: "/tasks", query: { limit: limit, offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, }, - body: requestBody, }); } /** - * Create tool for the agent - * @returns ResourceCreatedResponse + * Create or update undefined (ID is required in payload; existing resource will be overwritten) + * @returns any The request has succeeded. * @throws ApiError */ - public createAgentTool({ - agentId, + public tasksRouteCreateOrUpdate({ requestBody, }: { - agentId: string; - requestBody?: CreateToolRequest; - }): CancelablePromise { + requestBody: Tasks_CreateOrUpdateTaskRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "POST", - url: "/agents/{agent_id}/tools", - path: { - agent_id: agentId, - }, + method: "PUT", + url: "/tasks", body: requestBody, mediaType: "application/json", }); } /** - * Delete tool by id - * @returns ResourceDeletedResponse + * Create new undefined + * @returns any The request has succeeded and a new resource has been created as a result. * @throws ApiError */ - public deleteAgentTool({ - agentId, - toolId, + public tasksRouteCreate({ + requestBody, }: { - agentId: string; - toolId: string; - }): CancelablePromise { + requestBody: Tasks_CreateTaskRequest; + }): CancelablePromise<{ + /** + * ID of created undefined + */ + id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "DELETE", - url: "/agents/{agent_id}/tools/{tool_id}", - path: { - agent_id: agentId, - tool_id: toolId, - }, + method: "POST", + url: "/tasks", + body: requestBody, + mediaType: "application/json", }); } /** - * Update agent tool definition - * @returns ResourceUpdatedResponse + * Update undefined by id (overwrite) + * @returns any The request has succeeded. * @throws ApiError */ - public updateAgentTool({ - agentId, - toolId, + public tasksRouteUpdate({ + id, requestBody, }: { - agentId: string; - toolId: string; - requestBody?: UpdateToolRequest; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Tasks_UpdateTaskRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ method: "PUT", - url: "/agents/{agent_id}/tools/{tool_id}", + url: "/tasks/{id}", path: { - agent_id: agentId, - tool_id: toolId, + id: id, }, body: requestBody, mediaType: "application/json", }); } /** - * Patch Agent tool parameters (merge instead of replace) - * @returns ResourceUpdatedResponse + * Patch undefined by id (merge changes) + * @returns any The request has succeeded. * @throws ApiError */ - public patchAgentTool({ - agentId, - toolId, + public tasksRoutePatch({ + id, requestBody, }: { - agentId: string; - toolId: string; - requestBody?: PatchToolRequest; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Tasks_PatchTaskRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ method: "PATCH", - url: "/agents/{agent_id}/tools/{tool_id}", + url: "/tasks/{id}", path: { - agent_id: agentId, - tool_id: toolId, + id: id, }, body: requestBody, mediaType: "application/json", }); } /** - * Get status of the job - * @returns JobStatus + * Delete undefined by id + * @returns any The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public getJobStatus({ - jobId, + public tasksRouteDelete({ + id, }: { - jobId: string; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise<{ + /** + * ID of deleted undefined + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "GET", - url: "/jobs/{job_id}", + method: "DELETE", + url: "/tasks/{id}", path: { - job_id: jobId, + id: id, }, }); } /** - * Get a list of tasks - * @returns Task + * Create new undefined + * @returns any The request has succeeded and a new resource has been created as a result. * @throws ApiError */ - public listTasks({ - agentId, + public taskExecutionsRouteCreate({ + id, + requestBody, }: { - agentId: string; - }): CancelablePromise> { - return this.httpRequest.request({ - method: "GET", - url: "/agents/{agent_id}/tasks", - path: { - agent_id: agentId, - }, - }); - } - /** - * Create a Task - * @returns ResourceCreatedResponse - * @throws ApiError + /** + * ID of parent undefined + */ + id: Common_uuid; + requestBody: Executions_CreateExecutionRequest; + }): CancelablePromise<{ + /** + * ID of created undefined + */ + id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { + return this.httpRequest.request({ + method: "POST", + url: "/tasks/{id}/executions", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * List undefined items of parent undefined + * @returns any The request has succeeded. + * @throws ApiError */ - public createTask({ - agentId, + public taskExecutionsRouteList({ + id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * ID of parent undefined + */ + id: Common_uuid; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { + return this.httpRequest.request({ + method: "GET", + url: "/tasks/{id}/executions", + path: { + id: id, + }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Resume an execution with a task token + * @returns any The request has succeeded. + * @throws ApiError + */ + public taskExecutionsRouteResumeWithTaskToken({ + id, requestBody, }: { - agentId: string; - requestBody?: CreateTask; - }): CancelablePromise { + /** + * ID of parent Task + */ + id: Common_uuid; + /** + * Request to resume an execution with a task token + */ + requestBody: Executions_TaskTokenResumeExecutionRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "POST", - url: "/agents/{agent_id}/tasks", + method: "PUT", + url: "/tasks/{id}/executions", path: { - agent_id: agentId, + id: id, }, body: requestBody, mediaType: "application/json", }); } /** - * Create (or start) an execution of a Task - * @returns ResourceCreatedResponse + * Update undefined by id (overwrite) + * @returns any The request has succeeded. * @throws ApiError */ - public startTaskExecution({ - agentId, - taskId, + public toolRouteUpdate({ + id, requestBody, }: { - agentId: string; - taskId: string; - requestBody?: CreateExecution; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Tools_UpdateToolRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "POST", - url: "/agents/{agent_id}/tasks/{task_id}/executions", + method: "PUT", + url: "/tools/{id}", path: { - agent_id: agentId, - task_id: taskId, + id: id, }, body: requestBody, mediaType: "application/json", }); } /** - * List Executions of a Task - * @returns Execution + * Patch undefined by id (merge changes) + * @returns any The request has succeeded. * @throws ApiError */ - public getTaskExecution({ - agentId, - taskId, + public toolRoutePatch({ + id, + requestBody, }: { - agentId: string; - taskId: string; - }): CancelablePromise> { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Tools_PatchToolRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "GET", - url: "/agents/{agent_id}/tasks/{task_id}/executions", + method: "PATCH", + url: "/tools/{id}", path: { - agent_id: agentId, - task_id: taskId, + id: id, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Get a Task by ID - * @returns Task + * Delete undefined by id + * @returns any The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public getTask({ - agentId, - taskId, + public toolRouteDelete({ + id, }: { - agentId: string; - taskId: string; - }): CancelablePromise { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise<{ + /** + * ID of deleted undefined + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ - method: "GET", - url: "/agents/{agent_id}/tasks/{task_id}", + method: "DELETE", + url: "/tools/{id}", path: { - agent_id: agentId, - task_id: taskId, + id: id, }, }); } /** - * Get an Execution Transition - * @returns ExecutionTransition + * List undefined items + * @returns any The request has succeeded. * @throws ApiError */ - public getExecutionTransition({ - executionId, - transitionId, + public usersRouteList({ + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { - executionId: string; - transitionId: string; - }): CancelablePromise { + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { return this.httpRequest.request({ method: "GET", - url: "/executions/{execution_id}/transitions/{transition_id}", - path: { - execution_id: executionId, - transition_id: transitionId, + url: "/users", + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, }, }); } /** - * @returns ResourceUpdatedResponse + * Create new undefined + * @returns any The request has succeeded and a new resource has been created as a result. * @throws ApiError */ - public resumeToolExecution({ - executionId, - transitionId, + public usersRouteCreate({ requestBody, }: { - executionId: string; - transitionId: string; - requestBody?: { - responses: Array; - }; - }): CancelablePromise { + requestBody: Users_CreateUserRequest; + }): CancelablePromise<{ + /** + * ID of created undefined + */ + id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { + return this.httpRequest.request({ + method: "POST", + url: "/users", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Create or update undefined (ID is required in payload; existing resource will be overwritten) + * @returns any The request has succeeded. + * @throws ApiError + */ + public usersRouteCreateOrUpdate({ + requestBody, + }: { + requestBody: Users_CreateOrUpdateUserRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { + return this.httpRequest.request({ + method: "PUT", + url: "/users", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update undefined by id (overwrite) + * @returns any The request has succeeded. + * @throws ApiError + */ + public usersRouteUpdate({ + id, + requestBody, + }: { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Users_UpdateUserRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { return this.httpRequest.request({ method: "PUT", - url: "/executions/{execution_id}/transitions/{transition_id}", + url: "/users/{id}", path: { - execution_id: executionId, - transition_id: transitionId, + id: id, }, body: requestBody, mediaType: "application/json", }); } /** - * Get Task Execution By ID - * @returns Execution + * Patch undefined by id (merge changes) + * @returns any The request has succeeded. + * @throws ApiError + */ + public usersRoutePatch({ + id, + requestBody, + }: { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: Users_PatchUserRequest; + }): CancelablePromise<{ + /** + * ID of updated undefined + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { + return this.httpRequest.request({ + method: "PATCH", + url: "/users/{id}", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Delete undefined by id + * @returns any The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public usersRouteDelete({ + id, + }: { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise<{ + /** + * ID of deleted undefined + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; + }> { + return this.httpRequest.request({ + method: "DELETE", + url: "/users/{id}", + path: { + id: id, + }, + }); + } + /** + * Get undefined by id + * @returns Users_User The request has succeeded. * @throws ApiError */ - public getTaskExecution1({ - taskId, - executionId, + public usersRouteGet({ + id, }: { - taskId: string; - executionId: string; - }): CancelablePromise> { + /** + * ID of the undefined + */ + id: Common_uuid; + }): CancelablePromise { return this.httpRequest.request({ method: "GET", - url: "/tasks/{task_id}/executions/{execution_id}", + url: "/users/{id}", path: { - task_id: taskId, - execution_id: executionId, + id: id, }, }); } /** - * List Transitions of an Execution - * @returns ExecutionTransition + * List undefined items of parent undefined + * @returns any The request has succeeded. * @throws ApiError */ - public getExecutionTransition1({ - executionId, + public userDocsRouteList({ + id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { - executionId: string; - }): CancelablePromise> { + /** + * ID of parent undefined + */ + id: Common_uuid; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { return this.httpRequest.request({ method: "GET", - url: "/executions/{execution_id}/transitions/", + url: "/users/{id}/docs", path: { - execution_id: executionId, + id: id, }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Search for documents owned by undefined + * @returns any The request has succeeded. + * @throws ApiError + */ + public userDocsSearchRouteSearch({ + id, + requestBody, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * ID of the undefined + */ + id: Common_uuid; + requestBody: { + body: Docs_DocSearchRequest; + }; + /** + * Limit the number of undefined items returned + */ + limit?: Common_limit; + /** + * Offset the undefined items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { + return this.httpRequest.request({ + method: "POST", + url: "/users/{id}/search", + path: { + id: id, + }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + body: requestBody, + mediaType: "application/json", }); } } diff --git a/typespec/main.tsp b/typespec/main.tsp index 632b7943d..7800269b1 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -93,11 +93,11 @@ namespace Api { @route("/sessions") interface SessionsRoute extends Sessions.Endpoints {} - @route("/sessions/{id}/history") + @route("/sessions/history") interface HistoryRoute extends Entries.Endpoints {} - @route("/docs/{id}") - interface AgentIndividualDocsRoute extends Docs.IndividualDocEndpoints {} + @route("/docs") + interface IndividualDocsRoute extends Docs.IndividualDocEndpoints {} @route("/tasks") interface TasksRoute extends Tasks.Endpoints {} diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index cfee449a6..d285a53a1 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -8,10 +8,10 @@ namespace Sessions; // SESSION MODELS // -@discriminator("__kind") +@discriminator("kind") model Session { @visibility("none") - __kind: ( + kind: ( | "single_agent_no_user" | "single_agent_single_user" | "single_agent_multi_user" @@ -57,7 +57,7 @@ model Session { model SingleAgentNoUserSession extends Session { @visibility("none") - __kind: "single_agent_no_user" = "single_agent_no_user"; + kind: "single_agent_no_user" = "single_agent_no_user"; user?: never; users?: never; @@ -68,7 +68,7 @@ model SingleAgentNoUserSession extends Session { model SingleAgentSingleUserSession extends Session { @visibility("none") - __kind: "single_agent_single_user" = "single_agent_single_user"; + kind: "single_agent_single_user" = "single_agent_single_user"; users?: never; agents?: never; @@ -79,7 +79,7 @@ model SingleAgentSingleUserSession extends Session { model SingleAgentMultiUserSession extends Session { @visibility("none") - __kind: "single_agent_multi_user" = "single_agent_multi_user"; + kind: "single_agent_multi_user" = "single_agent_multi_user"; user?: never; agents?: never; @@ -90,7 +90,7 @@ model SingleAgentMultiUserSession extends Session { model MultiAgentNoUserSession extends Session { @visibility("none") - __kind: "multi_agent_no_user" = "multi_agent_no_user"; + kind: "multi_agent_no_user" = "multi_agent_no_user"; user?: never; users?: never; @@ -101,7 +101,7 @@ model MultiAgentNoUserSession extends Session { model MultiAgentSingleUserSession extends Session { @visibility("none") - __kind: "multi_agent_single_user" = "multi_agent_single_user"; + kind: "multi_agent_single_user" = "multi_agent_single_user"; users?: never; agent?: never; @@ -112,7 +112,7 @@ model MultiAgentSingleUserSession extends Session { model MultiAgentMultiUserSession extends Session { @visibility("none") - __kind: "multi_agent_multi_user" = "multi_agent_multi_user"; + kind: "multi_agent_multi_user" = "multi_agent_multi_user"; user?: never; agent?: never; diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 097dc311f..7571ea1c1 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -40,15 +40,15 @@ alias WorkflowStepKind = ( | "error" ); -@discriminator("__kind") +@discriminator("kind") model WorkflowStep { @visibility("none") - __kind?: WorkflowStepKind; + kind?: WorkflowStepKind; } model ToolCallStep extends WorkflowStep { @visibility("none") - __kind: "tool_call" = "tool_call"; + kind: "tool_call" = "tool_call"; /** The tool to run */ tool: toolRef; @@ -63,7 +63,7 @@ alias CELObject = Record; model YieldStep extends WorkflowStep { @visibility("none") - __kind: "yield" = "yield"; + kind: "yield" = "yield"; /** The subworkflow to run */ workflow: string; @@ -74,7 +74,7 @@ model YieldStep extends WorkflowStep { model PromptStep extends WorkflowStep { @visibility("none") - __kind: "prompt" = "prompt"; + kind: "prompt" = "prompt"; /** The prompt to run */ prompt: string | InputChatMLMessage[]; @@ -85,7 +85,7 @@ model PromptStep extends WorkflowStep { model EvaluateStep extends WorkflowStep { @visibility("none") - __kind: "evaluate" = "evaluate"; + kind: "evaluate" = "evaluate"; /** The expression to evaluate */ evaluate: CELObject; @@ -93,7 +93,7 @@ model EvaluateStep extends WorkflowStep { model IfElseWorkflowStep extends WorkflowStep { @visibility("none") - __kind: "if_else" = "if_else"; + kind: "if_else" = "if_else"; /** The condition to evaluate */ `if`: CEL; @@ -107,7 +107,7 @@ model IfElseWorkflowStep extends WorkflowStep { model ErrorWorkflowStep extends WorkflowStep { @visibility("none") - __kind: "error" = "error"; + kind: "error" = "error"; /** The error message */ error: string; From cc54e2602c1df043955eee789b1b63bed3253a6d Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 15 Jul 2024 17:17:50 -0400 Subject: [PATCH 12/36] feat(fern): Upgrade fern and fern-python Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Agents.py | 2 +- agents-api/agents_api/autogen/Chat.py | 2 +- agents-api/agents_api/autogen/Common.py | 2 +- agents-api/agents_api/autogen/Docs.py | 2 +- agents-api/agents_api/autogen/Entries.py | 2 +- agents-api/agents_api/autogen/Executions.py | 2 +- agents-api/agents_api/autogen/Jobs.py | 2 +- agents-api/agents_api/autogen/Sessions.py | 2 +- agents-api/agents_api/autogen/Tasks.py | 2 +- agents-api/agents_api/autogen/Tools.py | 2 +- agents-api/agents_api/autogen/Users.py | 2 +- agents-api/agents_api/autogen/__init__.py | 2 +- fern/generators.yml | 2 +- sdks/python/julep/api/README.md | 141 + sdks/python/julep/api/client.py | 6554 +++++++++++------ sdks/python/julep/api/core/__init__.py | 13 + sdks/python/julep/api/core/client_wrapper.py | 46 +- sdks/python/julep/api/core/file.py | 43 + sdks/python/julep/api/core/http_client.py | 558 ++ .../python/julep/api/core/jsonable_encoder.py | 18 +- .../julep/api/core/pydantic_utilities.py | 28 + sdks/python/julep/api/core/query_encoder.py | 39 + .../julep/api/core/remove_none_from_dict.py | 4 +- sdks/python/julep/api/core/request_options.py | 32 + sdks/python/julep/api/reference.md | 4819 ++++++++++++ .../julep/api/tests/utils/test_http_client.py | 59 + .../api/tests/utils/test_query_encoding.py | 19 + ...agent_docs_route_list_request_direction.py | 18 +- .../agent_docs_route_list_request_sort_by.py | 24 +- .../types/agent_docs_route_list_response.py | 22 +- .../agent_tools_route_create_response.py | 41 +- ...gent_tools_route_list_request_direction.py | 18 +- .../agent_tools_route_list_request_sort_by.py | 24 +- .../types/agent_tools_route_list_response.py | 22 +- sdks/python/julep/api/types/agents_agent.py | 75 +- .../types/agents_agent_default_settings.py | 1 - .../api/types/agents_create_agent_request.py | 67 +- ...s_create_agent_request_default_settings.py | 1 - ...r_update_agent_request_default_settings.py | 1 - ...s_search_route_search_request_direction.py | 18 +- ...ocs_search_route_search_request_sort_by.py | 24 +- ...gents_docs_search_route_search_response.py | 22 +- ...ts_patch_agent_request_default_settings.py | 1 - .../agents_route_create_or_update_response.py | 41 +- .../api/types/agents_route_create_response.py | 41 +- .../api/types/agents_route_delete_response.py | 41 +- .../agents_route_list_request_direction.py | 18 +- .../agents_route_list_request_sort_by.py | 24 +- .../api/types/agents_route_list_response.py | 22 +- .../api/types/agents_route_patch_response.py | 41 +- .../api/types/agents_route_update_response.py | 41 +- ...s_update_agent_request_default_settings.py | 1 - .../types/chat_completion_response_format.py | 29 +- .../chat_completion_response_format_type.py | 24 +- .../julep/api/types/chat_generation_preset.py | 63 +- .../types/chat_generation_preset_settings.py | 29 +- .../julep/api/types/chat_open_ai_settings.py | 55 +- .../julep/api/types/chat_v_llm_settings.py | 63 +- sdks/python/julep/api/types/docs_doc.py | 45 +- sdks/python/julep/api/types/docs_doc_owner.py | 22 +- .../julep/api/types/docs_doc_owner_role.py | 16 +- .../julep/api/types/docs_doc_reference.py | 44 +- .../api/types/docs_doc_search_request.py | 168 +- .../types/docs_hybrid_doc_search_request.py | 37 +- .../docs_text_only_doc_search_request.py | 29 +- .../types/docs_vector_doc_search_request.py | 29 +- .../entries_base_chat_ml_content_part.py | 64 +- .../entries_chat_ml_image_content_part.py | 27 +- .../julep/api/types/entries_chat_ml_role.py | 53 +- .../entries_chat_ml_text_content_part.py | 22 +- sdks/python/julep/api/types/entries_entry.py | 40 +- .../julep/api/types/entries_entry_content.py | 12 - .../api/types/entries_entry_content_item.py | 11 - .../types/entries_entry_content_item_item.py | 72 +- .../julep/api/types/entries_entry_source.py | 39 +- .../python/julep/api/types/entries_history.py | 29 +- .../julep/api/types/entries_image_detail.py | 26 +- .../julep/api/types/entries_image_url.py | 35 +- .../types/entries_input_chat_ml_message.py | 49 +- .../entries_input_chat_ml_message_content.py | 4 - ...ries_input_chat_ml_message_content_item.py | 72 +- .../julep/api/types/entries_relation.py | 22 +- ...ransitions_route_list_request_direction.py | 18 +- ..._transitions_route_list_request_sort_by.py | 24 +- ...ecution_transitions_route_list_response.py | 22 +- ...itions_route_list_response_results_item.py | 22 +- .../julep/api/types/executions_execution.py | 64 +- .../api/types/executions_execution_status.py | 53 +- .../executions_resume_execution_request.py | 29 +- .../types/executions_route_update_response.py | 41 +- .../executions_stop_execution_request.py | 29 +- .../julep/api/types/executions_transition.py | 39 +- .../api/types/executions_transition_type.py | 32 +- .../executions_update_execution_request.py | 71 +- .../types/history_route_delete_response.py | 41 +- .../history_route_list_request_direction.py | 18 +- .../history_route_list_request_sort_by.py | 24 +- .../api/types/history_route_list_response.py | 22 +- .../individual_docs_route_delete_response.py | 41 +- sdks/python/julep/api/types/jobs_job_state.py | 53 +- .../python/julep/api/types/jobs_job_status.py | 69 +- ...sessions_multi_agent_multi_user_session.py | 22 +- .../sessions_multi_agent_no_user_session.py | 22 +- ...essions_multi_agent_single_user_session.py | 22 +- ...essions_route_create_or_update_response.py | 41 +- .../types/sessions_route_create_response.py | 41 +- .../types/sessions_route_delete_response.py | 41 +- .../sessions_route_list_request_direction.py | 18 +- .../sessions_route_list_request_sort_by.py | 24 +- .../api/types/sessions_route_list_response.py | 22 +- .../types/sessions_route_patch_response.py | 41 +- .../types/sessions_route_update_response.py | 41 +- .../julep/api/types/sessions_session.py | 299 +- ...essions_single_agent_multi_user_session.py | 22 +- .../sessions_single_agent_no_user_session.py | 22 +- ...ssions_single_agent_single_user_session.py | 22 +- .../task_executions_route_create_response.py | 41 +- ...executions_route_list_request_direction.py | 18 +- ...k_executions_route_list_request_sort_by.py | 24 +- .../task_executions_route_list_response.py | 22 +- ...s_route_resume_with_task_token_response.py | 41 +- .../api/types/tasks_error_workflow_step.py | 27 +- .../julep/api/types/tasks_evaluate_step.py | 29 +- .../api/types/tasks_if_else_workflow_step.py | 44 +- .../julep/api/types/tasks_prompt_step.py | 33 +- .../api/types/tasks_prompt_step_prompt.py | 9 - .../api/types/tasks_prompt_step_settings.py | 5 - ..._prompt_step_settings_frequency_penalty.py | 109 +- ...sks_prompt_step_settings_length_penalty.py | 117 +- .../tasks_prompt_step_settings_preset.py | 85 +- .../tasks_route_create_or_update_response.py | 41 +- .../api/types/tasks_route_create_response.py | 41 +- .../api/types/tasks_route_delete_response.py | 41 +- .../tasks_route_list_request_direction.py | 16 +- .../types/tasks_route_list_request_sort_by.py | 24 +- .../api/types/tasks_route_list_response.py | 22 +- .../api/types/tasks_route_patch_response.py | 41 +- .../api/types/tasks_route_update_response.py | 41 +- sdks/python/julep/api/types/tasks_task.py | 69 +- .../julep/api/types/tasks_tool_call_step.py | 33 +- .../julep/api/types/tasks_workflow_step.py | 246 +- .../julep/api/types/tasks_yield_step.py | 33 +- .../api/types/tool_route_delete_response.py | 41 +- .../api/types/tool_route_patch_response.py | 41 +- .../api/types/tool_route_update_response.py | 41 +- .../api/types/tools_chosen_function_call.py | 29 +- .../julep/api/types/tools_chosen_tool_call.py | 66 +- .../api/types/tools_create_tool_request.py | 54 +- .../api/types/tools_function_call_option.py | 27 +- .../julep/api/types/tools_function_def.py | 45 +- .../api/types/tools_function_def_update.py | 45 +- .../julep/api/types/tools_function_tool.py | 27 +- sdks/python/julep/api/types/tools_tool.py | 100 +- .../julep/api/types/tools_tool_response.py | 29 +- .../python/julep/api/types/tools_tool_type.py | 28 +- .../user_docs_route_list_request_direction.py | 18 +- .../user_docs_route_list_request_sort_by.py | 24 +- .../types/user_docs_route_list_response.py | 22 +- ...s_search_route_search_request_direction.py | 18 +- ...ocs_search_route_search_request_sort_by.py | 24 +- .../user_docs_search_route_search_response.py | 22 +- .../users_route_create_or_update_response.py | 41 +- .../api/types/users_route_create_response.py | 41 +- .../api/types/users_route_delete_response.py | 41 +- .../users_route_list_request_direction.py | 16 +- .../types/users_route_list_request_sort_by.py | 24 +- .../api/types/users_route_list_response.py | 22 +- .../api/types/users_route_patch_response.py | 41 +- .../api/types/users_route_update_response.py | 41 +- sdks/python/julep/api/types/users_user.py | 51 +- 170 files changed, 13303 insertions(+), 4658 deletions(-) create mode 100644 sdks/python/julep/api/README.md create mode 100644 sdks/python/julep/api/core/file.py create mode 100644 sdks/python/julep/api/core/http_client.py create mode 100644 sdks/python/julep/api/core/pydantic_utilities.py create mode 100644 sdks/python/julep/api/core/query_encoder.py create mode 100644 sdks/python/julep/api/core/request_options.py create mode 100644 sdks/python/julep/api/reference.md create mode 100644 sdks/python/julep/api/tests/utils/test_http_client.py create mode 100644 sdks/python/julep/api/tests/utils/test_query_encoding.py diff --git a/agents-api/agents_api/autogen/Agents.py b/agents-api/agents_api/autogen/Agents.py index 03397c4bf..8aef17747 100644 --- a/agents-api/agents_api/autogen/Agents.py +++ b/agents-api/agents_api/autogen/Agents.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index 844f8c48f..0f750278d 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Common.py b/agents-api/agents_api/autogen/Common.py index 6c4ee61df..53b5cf635 100644 --- a/agents-api/agents_api/autogen/Common.py +++ b/agents-api/agents_api/autogen/Common.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py index ceeef0443..1d3211300 100644 --- a/agents-api/agents_api/autogen/Docs.py +++ b/agents-api/agents_api/autogen/Docs.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index 7d6fcc54b..ed801092a 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Executions.py b/agents-api/agents_api/autogen/Executions.py index 233a3337a..42b775995 100644 --- a/agents-api/agents_api/autogen/Executions.py +++ b/agents-api/agents_api/autogen/Executions.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Jobs.py b/agents-api/agents_api/autogen/Jobs.py index 04e128546..af323ebbd 100644 --- a/agents-api/agents_api/autogen/Jobs.py +++ b/agents-api/agents_api/autogen/Jobs.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Sessions.py b/agents-api/agents_api/autogen/Sessions.py index caab97c3f..89898aac3 100644 --- a/agents-api/agents_api/autogen/Sessions.py +++ b/agents-api/agents_api/autogen/Sessions.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py index 707d0ea50..65c299427 100644 --- a/agents-api/agents_api/autogen/Tasks.py +++ b/agents-api/agents_api/autogen/Tasks.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index ace4e0b51..88d26954e 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Users.py b/agents-api/agents_api/autogen/Users.py index 884b48a95..fc1e90745 100644 --- a/agents-api/agents_api/autogen/Users.py +++ b/agents-api/agents_api/autogen/Users.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/__init__.py b/agents-api/agents_api/autogen/__init__.py index 4c26f83b8..a58641dd2 100644 --- a/agents-api/agents_api/autogen/__init__.py +++ b/agents-api/agents_api/autogen/__init__.py @@ -1,3 +1,3 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:10:09+00:00 +# timestamp: 2024-07-15T21:17:24+00:00 diff --git a/fern/generators.yml b/fern/generators.yml index 8d3a40112..d072b43ca 100644 --- a/fern/generators.yml +++ b/fern/generators.yml @@ -3,7 +3,7 @@ groups: local: generators: - name: fernapi/fern-python-sdk - version: 0.9.1 + version: 2.15.3 config: timeout_in_seconds: 300 # 5 minutes client_class_name: JulepApi diff --git a/sdks/python/julep/api/README.md b/sdks/python/julep/api/README.md new file mode 100644 index 000000000..41da1e6ca --- /dev/null +++ b/sdks/python/julep/api/README.md @@ -0,0 +1,141 @@ +# Julep Python Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern) +[![pypi](https://img.shields.io/pypi/v/julep)](https://pypi.python.org/pypi/julep) + +The Julep Python library provides convenient access to the Julep API from Python. + +## Installation + +```sh +pip install julep +``` + +## Usage + +Instantiate and use the client with the following: + +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", + docs=[], +) +``` + +## Async Client + +The SDK also exports an `async` client so that you can make non-blocking calls to our API. + +```python +import asyncio + +from julep.client import AsyncJulepApi + +client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) + + +async def main() -> None: + await client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", + docs=[], + ) + + +asyncio.run(main()) +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error +will be thrown. + +```python +from .api_error import ApiError + +try: + client.agents_route_create(...) +except ApiError as e: + print(e.status_code) + print(e.body) +``` + +## Advanced + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retriable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retriable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `max_retries` request option to configure this behavior. + +```python +client.agents_route_create(...,{ + max_retries=1 +}) +``` + +### Timeouts + +The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. + +```python + +from julep.client import JulepApi + +client = JulepApi(..., { timeout=20.0 }, ) + + +# Override timeout for a specific method +client.agents_route_create(...,{ + timeout_in_seconds=1 +}) +``` + +### Custom Client + +You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies +and transports. +```python +import httpx +from julep.client import JulepApi + +client = JulepApi( + ..., + http_client=httpx.Client( + proxies="http://my.test.proxy.example.com", + transport=httpx.HTTPTransport(local_address="0.0.0.0"), + ), +) +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index bce26ce0b..1fd1fda02 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -1,7 +1,6 @@ # This file was auto-generated by Fern from our API Definition. import typing -import urllib.parse from json.decoder import JSONDecodeError import httpx @@ -9,7 +8,8 @@ from .core.api_error import ApiError from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .core.jsonable_encoder import jsonable_encoder -from .core.remove_none_from_dict import remove_none_from_dict +from .core.pydantic_utilities import pydantic_v1 +from .core.request_options import RequestOptions from .environment import JulepApiEnvironment from .types.agent_docs_route_list_request_direction import ( AgentDocsRouteListRequestDirection, @@ -25,7 +25,12 @@ ) from .types.agent_tools_route_list_response import AgentToolsRouteListResponse from .types.agents_agent import AgentsAgent -from .types.agents_create_agent_request import AgentsCreateAgentRequest +from .types.agents_create_agent_request_default_settings import ( + AgentsCreateAgentRequestDefaultSettings, +) +from .types.agents_create_agent_request_instructions import ( + AgentsCreateAgentRequestInstructions, +) from .types.agents_create_or_update_agent_request_default_settings import ( AgentsCreateOrUpdateAgentRequestDefaultSettings, ) @@ -159,16 +164,49 @@ from .types.users_route_update_response import UsersRouteUpdateResponse from .types.users_user import UsersUser -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) class JulepApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : typing.Optional[str] + The base url to use for requests from the client. + + environment : JulepApiEnvironment + The environment to use for requests from the client. from .environment import JulepApiEnvironment + + + + Defaults to JulepApiEnvironment.DEFAULT + + + + auth_key : str + api_key : str + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 300 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.Client] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + """ + def __init__( self, *, @@ -176,16 +214,29 @@ def __init__( environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, auth_key: str, api_key: str, - timeout: typing.Optional[float] = 300, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None, ): + _defaulted_timeout = ( + timeout if timeout is not None else 300 if httpx_client is None else None + ) self._client_wrapper = SyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), auth_key=auth_key, api_key=api_key, httpx_client=( - httpx.Client(timeout=timeout) if httpx_client is None else httpx_client + httpx_client + if httpx_client is not None + else ( + httpx.Client( + timeout=_defaulted_timeout, follow_redirects=follow_redirects + ) + if follow_redirects is not None + else httpx.Client(timeout=_defaulted_timeout) + ) ), + timeout=_defaulted_timeout, ) def agents_route_list( @@ -196,22 +247,38 @@ def agents_route_list( sort_by: AgentsRouteListRequestSortBy, direction: AgentsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned + + offset : CommonOffset + Offset the undefined items returned + + sort_by : AgentsRouteListRequestSortBy + Sort by a field - - offset: CommonOffset. Offset the undefined items returned + direction : AgentsRouteListRequestDirection + Sort direction - - sort_by: AgentsRouteListRequestSortBy. Sort by a field + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - direction: AgentsRouteListRequestDirection. Sort direction + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import AgentsRouteListRequestDirection, AgentsRouteListRequestSortBy + Returns + ------- + AgentsRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -221,44 +288,80 @@ def agents_route_list( client.agents_route_list( limit=1, offset=1, - sort_by=AgentsRouteListRequestSortBy.CREATED_AT, - direction=AgentsRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "agents", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) def agents_route_create( - self, *, request: AgentsCreateAgentRequest + self, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + docs: typing.Sequence[typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteCreateResponse: """ Create new undefined - Parameters: - - request: AgentsCreateAgentRequest. - --- - from julep import AgentsCreateAgentRequest + Parameters + ---------- + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + docs : typing.Sequence[typing.Any] + Documents to index for this agent. (Max: 100 items) + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -266,24 +369,31 @@ def agents_route_create( api_key="YOUR_API_KEY", ) client.agents_route_create( - request=AgentsCreateAgentRequest( - name="name", - about="about", - model="model", - docs=[], - ), + name="name", + about="about", + model="model", + instructions="instructions", + docs=[], ) """ _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore + "agents", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + "docs": docs, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -293,33 +403,50 @@ def agents_route_create_or_update( self, *, id: CommonUuid, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, model: str, instructions: AgentsCreateOrUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, default_settings: typing.Optional[ AgentsCreateOrUpdateAgentRequestDefaultSettings ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid + + name : CommonIdentifierSafeUnicode + Name of the agent - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + about : str + About the agent - - name: CommonIdentifierSafeUnicode. Name of the agent + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - - about: str. About the agent + instructions : AgentsCreateOrUpdateAgentRequestInstructions + Instructions for the agent - - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - instructions: AgentsCreateOrUpdateAgentRequestInstructions. Instructions for the agent + default_settings : typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent - - default_settings: typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent - --- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -331,41 +458,53 @@ def agents_route_create_or_update( name="name", about="about", model="model", + instructions="instructions", ) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - } - if metadata is not OMIT: - _request["metadata"] = metadata - if default_settings is not OMIT: - _request["default_settings"] = default_settings _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "agents", + method="PUT", + json={ + "id": id, + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_get(self, id: CommonUuid) -> AgentsAgent: + def agents_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsAgent: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsAgent + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -377,16 +516,13 @@ def agents_route_get(self, id: CommonUuid) -> AgentsAgent: ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsAgent, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -396,33 +532,51 @@ def agents_route_update( self, id: CommonUuid, *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, model: str, instructions: AgentsUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, default_settings: typing.Optional[ AgentsUpdateAgentRequestDefaultSettings ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent - - name: CommonIdentifierSafeUnicode. Name of the agent + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - about: str. About the agent + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent - - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - instructions: AgentsUpdateAgentRequestInstructions. Instructions for the agent + Returns + ------- + AgentsRouteUpdateResponse + The request has succeeded. - - default_settings: typing.Optional[AgentsUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent - --- + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -434,42 +588,52 @@ def agents_route_update( name="name", about="about", model="model", + instructions="instructions", ) """ - _request: typing.Dict[str, typing.Any] = { - "name": name, - "about": about, - "model": model, - "instructions": instructions, - } - if metadata is not OMIT: - _request["metadata"] = metadata - if default_settings is not OMIT: - _request["default_settings"] = default_settings _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="PUT", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_delete(self, id: CommonUuid) -> AgentsRouteDeleteResponse: + def agents_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -481,16 +645,13 @@ def agents_route_delete(self, id: CommonUuid) -> AgentsRouteDeleteResponse: ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -508,25 +669,43 @@ def agents_route_patch( default_settings: typing.Optional[ AgentsPatchAgentRequestDefaultSettings ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the agent + + about : typing.Optional[str] + About the agent - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + model : typing.Optional[str] + Model name to use (gpt-4-turbo, gemini-nano etc) - - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the agent + instructions : typing.Optional[AgentsPatchAgentRequestInstructions] + Instructions for the agent - - about: typing.Optional[str]. About the agent + default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] + Default settings for all sessions created by this agent - - model: typing.Optional[str]. Model name to use (gpt-4-turbo, gemini-nano etc) + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - instructions: typing.Optional[AgentsPatchAgentRequestInstructions]. Instructions for the agent + Returns + ------- + AgentsRoutePatchResponse + The request has succeeded. - - default_settings: typing.Optional[AgentsPatchAgentRequestDefaultSettings]. Default settings for all sessions created by this agent - --- + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -537,31 +716,23 @@ def agents_route_patch( id="id", ) """ - _request: typing.Dict[str, typing.Any] = {} - if metadata is not OMIT: - _request["metadata"] = metadata - if name is not OMIT: - _request["name"] = name - if about is not OMIT: - _request["about"] = about - if model is not OMIT: - _request["model"] = model - if instructions is not OMIT: - _request["instructions"] = instructions - if default_settings is not OMIT: - _request["default_settings"] = default_settings _response = self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="PATCH", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -576,27 +747,41 @@ def agent_docs_route_list( sort_by: AgentDocsRouteListRequestSortBy, direction: AgentDocsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentDocsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: AgentDocsRouteListRequestSortBy. Sort by a field + sort_by : AgentDocsRouteListRequestSortBy + Sort by a field - - direction: AgentDocsRouteListRequestDirection. Sort direction + direction : AgentDocsRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - AgentDocsRouteListRequestDirection, - AgentDocsRouteListRequestSortBy, - ) + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentDocsRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -607,31 +792,26 @@ def agent_docs_route_list( id="id", limit=1, offset=1, - sort_by=AgentDocsRouteListRequestSortBy.CREATED_AT, - direction=AgentDocsRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/docs" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/docs", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -647,46 +827,84 @@ def agents_docs_search_route_search( direction: AgentsDocsSearchRouteSearchRequestDirection, metadata_filter: str, body: DocsDocSearchRequest, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsDocsSearchRouteSearchResponse: """ Search for documents owned by undefined - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + limit : CommonLimit + Limit the number of undefined items returned - - limit: CommonLimit. Limit the number of undefined items returned + offset : CommonOffset + Offset the undefined items returned - - offset: CommonOffset. Offset the undefined items returned + sort_by : AgentsDocsSearchRouteSearchRequestSortBy + Sort by a field - - sort_by: AgentsDocsSearchRouteSearchRequestSortBy. Sort by a field + direction : AgentsDocsSearchRouteSearchRequestDirection + Sort direction - - direction: AgentsDocsSearchRouteSearchRequestDirection. Sort direction + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata + body : DocsDocSearchRequest - - body: DocsDocSearchRequest. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsDocsSearchRouteSearchResponse + The request has succeeded. + + Examples + -------- + from julep import DocsDocSearchRequest_Vector + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.agents_docs_search_route_search( + id="string", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="string", + body=DocsDocSearchRequest_Vector( + text="string", + vector=[1.1], + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), + ) """ _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/search" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - json=jsonable_encoder({"body": body}), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -701,27 +919,41 @@ def agent_tools_route_list( sort_by: AgentToolsRouteListRequestSortBy, direction: AgentToolsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentToolsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: AgentToolsRouteListRequestSortBy. Sort by a field + sort_by : AgentToolsRouteListRequestSortBy + Sort by a field - - direction: AgentToolsRouteListRequestDirection. Sort direction + direction : AgentToolsRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - AgentToolsRouteListRequestDirection, - AgentToolsRouteListRequestSortBy, - ) + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentToolsRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -732,48 +964,84 @@ def agent_tools_route_list( id="id", limit=1, offset=1, - sort_by=AgentToolsRouteListRequestSortBy.CREATED_AT, - direction=AgentToolsRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/tools", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) def agent_tools_route_create( - self, id: CommonUuid, *, request: AgentsCreateAgentRequest + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + docs: typing.Sequence[typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentToolsRouteCreateResponse: """ Create new undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - - request: AgentsCreateAgentRequest. - --- - from julep import AgentsCreateAgentRequest + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + docs : typing.Sequence[typing.Any] + Documents to index for this agent. (Max: 100 items) + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentToolsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -782,38 +1050,57 @@ def agent_tools_route_create( ) client.agent_tools_route_create( id="id", - request=AgentsCreateAgentRequest( - name="name", - about="about", - model="model", - docs=[], - ), + name="name", + about="about", + model="model", + instructions="instructions", + docs=[], ) """ _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" - ), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/tools", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + "docs": docs, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def individual_docs_route_get(self, id: CommonUuid) -> DocsDoc: + def individual_docs_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> DocsDoc: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DocsDoc + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -825,30 +1112,39 @@ def individual_docs_route_get(self, id: CommonUuid) -> DocsDoc: ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"docs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(DocsDoc, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) def individual_docs_route_delete( - self, id: CommonUuid + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> IndividualDocsRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + IndividualDocsRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -860,28 +1156,39 @@ def individual_docs_route_delete( ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"docs/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def executions_route_get(self, id: CommonUuid) -> ExecutionsExecution: + def executions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExecutionsExecution: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionsExecution + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -893,44 +1200,69 @@ def executions_route_get(self, id: CommonUuid) -> ExecutionsExecution: ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"executions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) def executions_route_update( - self, id: CommonUuid, *, request: ExecutionsUpdateExecutionRequest + self, + id: CommonUuid, + *, + request: ExecutionsUpdateExecutionRequest, + request_options: typing.Optional[RequestOptions] = None, ) -> ExecutionsRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request : ExecutionsUpdateExecutionRequest - - request: ExecutionsUpdateExecutionRequest. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionsRouteUpdateResponse + The request has succeeded. + + Examples + -------- + from julep import ExecutionsUpdateExecutionRequest_Cancelled + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.executions_route_update( + id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), + ) """ _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" - ), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"executions/{jsonable_encoder(id)}", + method="PUT", + json=request, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -945,27 +1277,41 @@ def execution_transitions_route_list( sort_by: ExecutionTransitionsRouteListRequestSortBy, direction: ExecutionTransitionsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> ExecutionTransitionsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: ExecutionTransitionsRouteListRequestSortBy. Sort by a field + sort_by : ExecutionTransitionsRouteListRequestSortBy + Sort by a field - - direction: ExecutionTransitionsRouteListRequestDirection. Sort direction + direction : ExecutionTransitionsRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - ExecutionTransitionsRouteListRequestDirection, - ExecutionTransitionsRouteListRequestSortBy, - ) + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionTransitionsRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -976,44 +1322,52 @@ def execution_transitions_route_list( id="id", limit=1, offset=1, - sort_by=ExecutionTransitionsRouteListRequestSortBy.CREATED_AT, - direction=ExecutionTransitionsRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"executions/{id}/transitions", - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"executions/{jsonable_encoder(id)}/transitions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def job_route_get(self, id: CommonUuid) -> JobsJobStatus: + def job_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> JobsJobStatus: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + JobsJobStatus + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1025,16 +1379,13 @@ def job_route_get(self, id: CommonUuid) -> JobsJobStatus: ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"jobs/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"jobs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1048,25 +1399,38 @@ def sessions_route_list( sort_by: SessionsRouteListRequestSortBy, direction: SessionsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: SessionsRouteListRequestSortBy. Sort by a field + sort_by : SessionsRouteListRequestSortBy + Sort by a field - - direction: SessionsRouteListRequestDirection. Sort direction + direction : SessionsRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - SessionsRouteListRequestDirection, - SessionsRouteListRequestSortBy, - ) + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1076,29 +1440,26 @@ def sessions_route_list( client.sessions_route_list( limit=1, offset=1, - sort_by=SessionsRouteListRequestSortBy.CREATED_AT, - direction=SessionsRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "sessions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1107,38 +1468,56 @@ def sessions_route_list( def sessions_route_create( self, *, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.List[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.List[CommonUuid]] = OMIT, situation: str, render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteCreateResponse: """ Create new undefined - Parameters: - - user: typing.Optional[CommonUuid]. User ID of user associated with this session + Parameters + ---------- + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + user : typing.Optional[CommonUuid] + User ID of user associated with this session - - users: typing.Optional[typing.List[CommonUuid]]. + users : typing.Optional[typing.Sequence[CommonUuid]] - - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - - agents: typing.Optional[typing.List[CommonUuid]]. + agents : typing.Optional[typing.Sequence[CommonUuid]] - - situation: str. A specific situation that sets the background for this session + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - - render_templates: bool. Render system and assistant message content as jinja templates + context_overflow : typing.Optional[str] + Action to start on context window overflow - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - context_overflow: typing.Optional[str]. Action to start on context window overflow + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- + Returns + ------- + SessionsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1150,34 +1529,26 @@ def sessions_route_create( render_templates=True, ) """ - _request: typing.Dict[str, typing.Any] = { - "situation": situation, - "render_templates": render_templates, - } - if user is not OMIT: - _request["user"] = user - if users is not OMIT: - _request["users"] = users - if agent is not OMIT: - _request["agent"] = agent - if agents is not OMIT: - _request["agents"] = agents - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore + "sessions", + method="POST", + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1187,40 +1558,58 @@ def sessions_route_create_or_update( self, *, id: CommonUuid, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.List[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.List[CommonUuid]] = OMIT, situation: str, render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid + + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates - - user: typing.Optional[CommonUuid]. User ID of user associated with this session + user : typing.Optional[CommonUuid] + User ID of user associated with this session - - users: typing.Optional[typing.List[CommonUuid]]. + users : typing.Optional[typing.Sequence[CommonUuid]] - - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - - agents: typing.Optional[typing.List[CommonUuid]]. + agents : typing.Optional[typing.Sequence[CommonUuid]] - - situation: str. A specific situation that sets the background for this session + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - - render_templates: bool. Render system and assistant message content as jinja templates + context_overflow : typing.Optional[str] + Action to start on context window overflow - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - context_overflow: typing.Optional[str]. Action to start on context window overflow + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- + Returns + ------- + SessionsRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1233,35 +1622,27 @@ def sessions_route_create_or_update( render_templates=True, ) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "situation": situation, - "render_templates": render_templates, - } - if user is not OMIT: - _request["user"] = user - if users is not OMIT: - _request["users"] = users - if agent is not OMIT: - _request["agent"] = agent - if agents is not OMIT: - _request["agents"] = agents - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "sessions", + method="PUT", + json={ + "id": id, + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1276,27 +1657,41 @@ def history_route_list( sort_by: HistoryRouteListRequestSortBy, direction: HistoryRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> HistoryRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: HistoryRouteListRequestSortBy. Sort by a field + sort_by : HistoryRouteListRequestSortBy + Sort by a field - - direction: HistoryRouteListRequestDirection. Sort direction + direction : HistoryRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - HistoryRouteListRequestDirection, - HistoryRouteListRequestSortBy, - ) + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HistoryRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1307,43 +1702,52 @@ def history_route_list( id="id", limit=1, offset=1, - sort_by=HistoryRouteListRequestSortBy.CREATED_AT, - direction=HistoryRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/history/{jsonable_encoder(id)}", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_delete(self, id: CommonUuid) -> HistoryRouteDeleteResponse: + def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> HistoryRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HistoryRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1355,39 +1759,57 @@ def history_route_delete(self, id: CommonUuid) -> HistoryRouteDeleteResponse: ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/history/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_get(self, id: CommonUuid) -> SessionsSession: + def sessions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsSession: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsSession + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_get( + id="string", + ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsSession, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1402,23 +1824,40 @@ def sessions_route_update( token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + situation : str + A specific situation that sets the background for this session - - situation: str. A specific situation that sets the background for this session + render_templates : bool + Render system and assistant message content as jinja templates - - render_templates: bool. Render system and assistant message content as jinja templates + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + context_overflow : typing.Optional[str] + Action to start on context window overflow - - context_overflow: typing.Optional[str]. Action to start on context window overflow + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteUpdateResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1431,40 +1870,48 @@ def sessions_route_update( render_templates=True, ) """ - _request: typing.Dict[str, typing.Any] = { - "situation": situation, - "render_templates": render_templates, - } - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="PUT", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_delete(self, id: CommonUuid) -> SessionsRouteDeleteResponse: + def sessions_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1476,16 +1923,13 @@ def sessions_route_delete(self, id: CommonUuid) -> SessionsRouteDeleteResponse: ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1500,23 +1944,40 @@ def sessions_route_patch( token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined - - situation: typing.Optional[str]. A specific situation that sets the background for this session + situation : typing.Optional[str] + A specific situation that sets the background for this session - - render_templates: typing.Optional[bool]. Render system and assistant message content as jinja templates + render_templates : typing.Optional[bool] + Render system and assistant message content as jinja templates - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - - context_overflow: typing.Optional[str]. Action to start on context window overflow + context_overflow : typing.Optional[str] + Action to start on context window overflow - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRoutePatchResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1527,29 +1988,22 @@ def sessions_route_patch( id="id", ) """ - _request: typing.Dict[str, typing.Any] = {} - if situation is not OMIT: - _request["situation"] = situation - if render_templates is not OMIT: - _request["render_templates"] = render_templates - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="PATCH", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1563,22 +2017,38 @@ def tasks_route_list( sort_by: TasksRouteListRequestSortBy, direction: TasksRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: TasksRouteListRequestSortBy. Sort by a field + sort_by : TasksRouteListRequestSortBy + Sort by a field - - direction: TasksRouteListRequestDirection. Sort direction + direction : TasksRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import TasksRouteListRequestDirection, TasksRouteListRequestSortBy + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1588,29 +2058,26 @@ def tasks_route_list( client.tasks_route_list( limit=1, offset=1, - sort_by=TasksRouteListRequestSortBy.CREATED_AT, - direction=TasksRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "tasks", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1621,28 +2088,44 @@ def tasks_route_create( *, name: str, description: str, - main: typing.List[TasksWorkflowStep], - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.List[ToolsCreateToolRequest], + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteCreateResponse: """ Create new undefined - Parameters: - - name: str. + Parameters + ---------- + name : str + + description : str + + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - - description: str. + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. - --- - from julep import ToolsCreateToolRequest, ToolsToolType + Returns + ------- + TasksRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( @@ -1655,7 +2138,7 @@ def tasks_route_create( main=[], tools=[ ToolsCreateToolRequest( - type=ToolsToolType.FUNCTION, + type="function", background=True, interactive=True, ) @@ -1663,25 +2146,23 @@ def tasks_route_create( inherit_tools=True, ) """ - _request: typing.Dict[str, typing.Any] = { - "name": name, - "description": description, - "main": main, - "tools": tools, - "inherit_tools": inherit_tools, - } - if input_schema is not OMIT: - _request["input_schema"] = input_schema _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore + "tasks", + method="POST", + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1693,30 +2174,46 @@ def tasks_route_create_or_update( id: CommonUuid, name: str, description: str, - main: typing.List[TasksWorkflowStep], - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.List[ToolsCreateToolRequest], + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid - - name: str. + name : str - - description: str. + description : str - - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. - --- - from julep import ToolsCreateToolRequest, ToolsToolType + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- + from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( @@ -1730,7 +2227,7 @@ def tasks_route_create_or_update( main=[], tools=[ ToolsCreateToolRequest( - type=ToolsToolType.FUNCTION, + type="function", background=True, interactive=True, ) @@ -1738,26 +2235,24 @@ def tasks_route_create_or_update( inherit_tools=True, ) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "name": name, - "description": description, - "main": main, - "tools": tools, - "inherit_tools": inherit_tools, - } - if input_schema is not OMIT: - _request["input_schema"] = input_schema _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "tasks", + method="PUT", + json={ + "id": id, + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1768,28 +2263,45 @@ def tasks_route_update( id: CommonUuid, *, description: str, - main: typing.List[TasksWorkflowStep], - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.List[ToolsCreateToolRequest], + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + description : str + + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - - description: str. + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. - --- - from julep import ToolsCreateToolRequest, ToolsToolType + Returns + ------- + TasksRouteUpdateResponse + The request has succeeded. + + Examples + -------- + from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( @@ -1802,7 +2314,7 @@ def tasks_route_update( main=[], tools=[ ToolsCreateToolRequest( - type=ToolsToolType.FUNCTION, + type="function", background=True, interactive=True, ) @@ -1810,38 +2322,48 @@ def tasks_route_update( inherit_tools=True, ) """ - _request: typing.Dict[str, typing.Any] = { - "description": description, - "main": main, - "tools": tools, - "inherit_tools": inherit_tools, - } - if input_schema is not OMIT: - _request["input_schema"] = input_schema _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}", + method="PUT", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_delete(self, id: CommonUuid) -> TasksRouteDeleteResponse: + def tasks_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> TasksRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1853,16 +2375,13 @@ def tasks_route_delete(self, id: CommonUuid) -> TasksRouteDeleteResponse: ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1873,27 +2392,44 @@ def tasks_route_patch( id: CommonUuid, *, description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.List[TasksWorkflowStep]] = OMIT, + main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.List[ToolsCreateToolRequest]] = OMIT, + tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, inherit_tools: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + description : typing.Optional[str] + + main : typing.Optional[typing.Sequence[TasksWorkflowStep]] + The entrypoint of the task. - - description: typing.Optional[str]. + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - - main: typing.Optional[typing.List[TasksWorkflowStep]]. The entrypoint of the task. + tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] + Tools defined specifically for this task not included in the Agent itself. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. - - tools: typing.Optional[typing.List[ToolsCreateToolRequest]]. Tools defined specifically for this task not included in the Agent itself. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - inherit_tools: typing.Optional[bool]. Whether to inherit tools from the parent agent or not. Defaults to true. - --- + Returns + ------- + TasksRoutePatchResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1904,29 +2440,22 @@ def tasks_route_patch( id="id", ) """ - _request: typing.Dict[str, typing.Any] = {} - if description is not OMIT: - _request["description"] = description - if main is not OMIT: - _request["main"] = main - if input_schema is not OMIT: - _request["input_schema"] = input_schema - if tools is not OMIT: - _request["tools"] = tools - if inherit_tools is not OMIT: - _request["inherit_tools"] = inherit_tools _response = self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}", + method="PATCH", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1941,27 +2470,41 @@ def task_executions_route_list( sort_by: TaskExecutionsRouteListRequestSortBy, direction: TaskExecutionsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: TaskExecutionsRouteListRequestSortBy. Sort by a field + sort_by : TaskExecutionsRouteListRequestSortBy + Sort by a field - - direction: TaskExecutionsRouteListRequestDirection. Sort direction + direction : TaskExecutionsRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - TaskExecutionsRouteListRequestDirection, - TaskExecutionsRouteListRequestSortBy, - ) + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskExecutionsRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -1972,47 +2515,59 @@ def task_executions_route_list( id="id", limit=1, offset=1, - sort_by=TaskExecutionsRouteListRequestSortBy.CREATED_AT, - direction=TaskExecutionsRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}/executions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) def task_executions_route_create( - self, id: CommonUuid, *, input: typing.Dict[str, typing.Any] + self, + id: CommonUuid, + *, + input: typing.Dict[str, typing.Any], + request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteCreateResponse: """ Create new undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined + + input : typing.Dict[str, typing.Any] + The input to the execution - - input: typing.Dict[str, typing.Any]. The input to the execution - --- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskExecutionsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2025,17 +2580,15 @@ def task_executions_route_create( ) """ _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" - ), - json=jsonable_encoder({"input": input}), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}/executions", + method="POST", + json={"input": input}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2047,17 +2600,32 @@ def task_executions_route_resume_with_task_token( *, task_token: str, input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteResumeWithTaskTokenResponse: """ Resume an execution with a task token - Parameters: - - id: CommonUuid. ID of parent Task + Parameters + ---------- + id : CommonUuid + ID of parent Task + + task_token : str + A Task Token is a unique identifier for a specific Task Execution. - - task_token: str. A Task Token is a unique identifier for a specific Task Execution. + input : typing.Optional[typing.Dict[str, typing.Any]] + The input to resume the execution with - - input: typing.Optional[typing.Dict[str, typing.Any]]. The input to resume the execution with - --- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskExecutionsRouteResumeWithTaskTokenResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2066,28 +2634,19 @@ def task_executions_route_resume_with_task_token( ) client.task_executions_route_resume_with_task_token( id="id", - status="running", task_token="task_token", ) """ - _request: typing.Dict[str, typing.Any] = { - "status": status, - "task_token": task_token, - } - if input is not OMIT: - _request["input"] = input _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}/executions", + method="PUT", + json={"task_token": task_token, "input": input, "status": "running"}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2104,28 +2663,43 @@ def tool_route_update( integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> ToolRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + type : ToolsToolType + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - type: ToolsToolType. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + background : bool + The tool should be run in the background (not supported at the moment) - - background: bool. The tool should be run in the background (not supported at the moment) + interactive : bool + Whether the tool that can be run interactively (response should contain "stop" boolean field) - - interactive: bool. Whether the tool that can be run interactively (response should contain "stop" boolean field) + function : typing.Optional[ToolsFunctionDef] - - function: typing.Optional[ToolsFunctionDef]. + integration : typing.Optional[typing.Any] - - integration: typing.Optional[typing.Any]. + system : typing.Optional[typing.Any] - - system: typing.Optional[typing.Any]. + api_call : typing.Optional[typing.Any] - - api_call: typing.Optional[typing.Any]. - --- - from julep import ToolsToolType + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolRouteUpdateResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2134,48 +2708,55 @@ def tool_route_update( ) client.tool_route_update( id="id", - type=ToolsToolType.FUNCTION, + type="function", background=True, interactive=True, ) """ - _request: typing.Dict[str, typing.Any] = { - "type": type.value, - "background": background, - "interactive": interactive, - } - if function is not OMIT: - _request["function"] = function - if integration is not OMIT: - _request["integration"] = integration - if system is not OMIT: - _request["system"] = system - if api_call is not OMIT: - _request["api_call"] = api_call _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tools/{jsonable_encoder(id)}", + method="PUT", + json={ + "type": type, + "background": background, + "interactive": interactive, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tool_route_delete(self, id: CommonUuid) -> ToolRouteDeleteResponse: + def tool_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ToolRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2187,16 +2768,13 @@ def tool_route_delete(self, id: CommonUuid) -> ToolRouteDeleteResponse: ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tools/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2213,27 +2791,43 @@ def tool_route_patch( integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> ToolRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + type : typing.Optional[ToolsToolType] + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - type: typing.Optional[ToolsToolType]. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + background : typing.Optional[bool] + The tool should be run in the background (not supported at the moment) - - background: typing.Optional[bool]. The tool should be run in the background (not supported at the moment) + interactive : typing.Optional[bool] + Whether the tool that can be run interactively (response should contain "stop" boolean field) - - interactive: typing.Optional[bool]. Whether the tool that can be run interactively (response should contain "stop" boolean field) + function : typing.Optional[ToolsFunctionDefUpdate] - - function: typing.Optional[ToolsFunctionDefUpdate]. + integration : typing.Optional[typing.Any] - - integration: typing.Optional[typing.Any]. + system : typing.Optional[typing.Any] - - system: typing.Optional[typing.Any]. + api_call : typing.Optional[typing.Any] - - api_call: typing.Optional[typing.Any]. - --- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolRoutePatchResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2244,33 +2838,24 @@ def tool_route_patch( id="id", ) """ - _request: typing.Dict[str, typing.Any] = {} - if type is not OMIT: - _request["type"] = type.value - if background is not OMIT: - _request["background"] = background - if interactive is not OMIT: - _request["interactive"] = interactive - if function is not OMIT: - _request["function"] = function - if integration is not OMIT: - _request["integration"] = integration - if system is not OMIT: - _request["system"] = system - if api_call is not OMIT: - _request["api_call"] = api_call _response = self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tools/{jsonable_encoder(id)}", + method="PATCH", + json={ + "type": type, + "background": background, + "interactive": interactive, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2284,22 +2869,38 @@ def users_route_list( sort_by: UsersRouteListRequestSortBy, direction: UsersRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned + + offset : CommonOffset + Offset the undefined items returned - - offset: CommonOffset. Offset the undefined items returned + sort_by : UsersRouteListRequestSortBy + Sort by a field - - sort_by: UsersRouteListRequestSortBy. Sort by a field + direction : UsersRouteListRequestDirection + Sort direction - - direction: UsersRouteListRequestDirection. Sort direction + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import UsersRouteListRequestDirection, UsersRouteListRequestSortBy + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2309,29 +2910,26 @@ def users_route_list( client.users_route_list( limit=1, offset=1, - sort_by=UsersRouteListRequestSortBy.CREATED_AT, - direction=UsersRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "users", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2340,23 +2938,38 @@ def users_route_list( def users_route_create( self, *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, - docs: typing.List[typing.Any], + docs: typing.Sequence[typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteCreateResponse: """ Create new undefined - Parameters: - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + Parameters + ---------- + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + docs : typing.Sequence[typing.Any] + Documents to index for this user. (Max: 100 items) + + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - name: CommonIdentifierSafeUnicode. Name of the user + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - about: str. About the user + Returns + ------- + UsersRouteCreateResponse + The request has succeeded and a new resource has been created as a result. - - docs: typing.List[typing.Any]. Documents to index for this user. (Max: 100 items) - --- + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2369,23 +2982,16 @@ def users_route_create( docs=[], ) """ - _request: typing.Dict[str, typing.Any] = { - "name": name, - "about": about, - "docs": docs, - } - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore + "users", + method="POST", + json={"metadata": metadata, "name": name, "about": about, "docs": docs}, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2395,22 +3001,36 @@ def users_route_create_or_update( self, *, id: CommonUuid, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid + + name : CommonIdentifierSafeUnicode + Name of the user - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + about : str + About the user - - name: CommonIdentifierSafeUnicode. Name of the user + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - about: str. About the user - --- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2423,35 +3043,42 @@ def users_route_create_or_update( about="about", ) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "name": name, - "about": about, - } - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "users", + method="PUT", + json={"id": id, "metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def users_route_get(self, id: CommonUuid) -> UsersUser: + def users_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersUser: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersUser + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2463,16 +3090,13 @@ def users_route_get(self, id: CommonUuid) -> UsersUser: ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersUser, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2482,22 +3106,37 @@ def users_route_update( self, id: CommonUuid, *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - name: CommonIdentifierSafeUnicode. Name of the user + Returns + ------- + UsersRouteUpdateResponse + The request has succeeded. - - about: str. About the user - --- + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2510,33 +3149,42 @@ def users_route_update( about="about", ) """ - _request: typing.Dict[str, typing.Any] = {"name": name, "about": about} - if metadata is not OMIT: - _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="PUT", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def users_route_delete(self, id: CommonUuid) -> UsersRouteDeleteResponse: + def users_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2548,16 +3196,13 @@ def users_route_delete(self, id: CommonUuid) -> UsersRouteDeleteResponse: ) """ _response = self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2570,19 +3215,34 @@ def users_route_patch( metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, about: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the user + + about : typing.Optional[str] + About the user - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the user + Returns + ------- + UsersRoutePatchResponse + The request has succeeded. - - about: typing.Optional[str]. About the user - --- + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2593,25 +3253,16 @@ def users_route_patch( id="id", ) """ - _request: typing.Dict[str, typing.Any] = {} - if metadata is not OMIT: - _request["metadata"] = metadata - if name is not OMIT: - _request["name"] = name - if about is not OMIT: - _request["about"] = about _response = self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="PATCH", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2626,27 +3277,41 @@ def user_docs_route_list( sort_by: UserDocsRouteListRequestSortBy, direction: UserDocsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: UserDocsRouteListRequestSortBy. Sort by a field + sort_by : UserDocsRouteListRequestSortBy + Sort by a field - - direction: UserDocsRouteListRequestDirection. Sort direction + direction : UserDocsRouteListRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - UserDocsRouteListRequestDirection, - UserDocsRouteListRequestSortBy, - ) + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserDocsRouteListResponse + The request has succeeded. + + Examples + -------- from julep.client import JulepApi client = JulepApi( @@ -2657,31 +3322,26 @@ def user_docs_route_list( id="id", limit=1, offset=1, - sort_by=UserDocsRouteListRequestSortBy.CREATED_AT, - direction=UserDocsRouteListRequestDirection.ASC, + sort_by="created_at", + direction="asc", metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}/docs" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}/docs", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2697,46 +3357,84 @@ def user_docs_search_route_search( direction: UserDocsSearchRouteSearchRequestDirection, metadata_filter: str, body: DocsDocSearchRequest, + request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsSearchRouteSearchResponse: """ Search for documents owned by undefined - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + limit : CommonLimit + Limit the number of undefined items returned - - limit: CommonLimit. Limit the number of undefined items returned + offset : CommonOffset + Offset the undefined items returned - - offset: CommonOffset. Offset the undefined items returned + sort_by : UserDocsSearchRouteSearchRequestSortBy + Sort by a field - - sort_by: UserDocsSearchRouteSearchRequestSortBy. Sort by a field + direction : UserDocsSearchRouteSearchRequestDirection + Sort direction - - direction: UserDocsSearchRouteSearchRequestDirection. Sort direction + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata + body : DocsDocSearchRequest - - body: DocsDocSearchRequest. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserDocsSearchRouteSearchResponse + The request has succeeded. + + Examples + -------- + from julep import DocsDocSearchRequest_Vector + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.user_docs_search_route_search( + id="string", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="string", + body=DocsDocSearchRequest_Vector( + text="string", + vector=[1.1], + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), + ) """ _response = self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}/search" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - json=jsonable_encoder({"body": body}), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2744,6 +3442,44 @@ def user_docs_search_route_search( class AsyncJulepApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : typing.Optional[str] + The base url to use for requests from the client. + + environment : JulepApiEnvironment + The environment to use for requests from the client. from .environment import JulepApiEnvironment + + + + Defaults to JulepApiEnvironment.DEFAULT + + + + auth_key : str + api_key : str + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 300 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + """ + def __init__( self, *, @@ -2751,18 +3487,29 @@ def __init__( environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, auth_key: str, api_key: str, - timeout: typing.Optional[float] = 300, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None, ): + _defaulted_timeout = ( + timeout if timeout is not None else 300 if httpx_client is None else None + ) self._client_wrapper = AsyncClientWrapper( base_url=_get_base_url(base_url=base_url, environment=environment), auth_key=auth_key, api_key=api_key, httpx_client=( - httpx.AsyncClient(timeout=timeout) - if httpx_client is None - else httpx_client + httpx_client + if httpx_client is not None + else ( + httpx.AsyncClient( + timeout=_defaulted_timeout, follow_redirects=follow_redirects + ) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout) + ) ), + timeout=_defaulted_timeout, ) async def agents_route_list( @@ -2773,94 +3520,169 @@ async def agents_route_list( sort_by: AgentsRouteListRequestSortBy, direction: AgentsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned + + offset : CommonOffset + Offset the undefined items returned + + sort_by : AgentsRouteListRequestSortBy + Sort by a field + + direction : AgentsRouteListRequestDirection + Sort direction - - offset: CommonOffset. Offset the undefined items returned + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - sort_by: AgentsRouteListRequestSortBy. Sort by a field + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - direction: AgentsRouteListRequestDirection. Sort direction + Returns + ------- + AgentsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import AgentsRouteListRequestDirection, AgentsRouteListRequestSortBy from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agents_route_list( - limit=1, - offset=1, - sort_by=AgentsRouteListRequestSortBy.CREATED_AT, - direction=AgentsRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.agents_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "agents", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) async def agents_route_create( - self, *, request: AgentsCreateAgentRequest + self, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + docs: typing.Sequence[typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteCreateResponse: """ Create new undefined - Parameters: - - request: AgentsCreateAgentRequest. - --- - from julep import AgentsCreateAgentRequest + Parameters + ---------- + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + docs : typing.Sequence[typing.Any] + Documents to index for this agent. (Max: 100 items) + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agents_route_create( - request=AgentsCreateAgentRequest( + + + async def main() -> None: + await client.agents_route_create( name="name", about="about", model="model", + instructions="instructions", docs=[], - ), - ) + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore + "agents", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + "docs": docs, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2870,100 +3692,142 @@ async def agents_route_create_or_update( self, *, id: CommonUuid, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, model: str, instructions: AgentsCreateOrUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, default_settings: typing.Optional[ AgentsCreateOrUpdateAgentRequestDefaultSettings ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + instructions : AgentsCreateOrUpdateAgentRequestInstructions + Instructions for the agent - - name: CommonIdentifierSafeUnicode. Name of the agent + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - about: str. About the agent + default_settings : typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent - - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - instructions: AgentsCreateOrUpdateAgentRequestInstructions. Instructions for the agent + Returns + ------- + AgentsRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - default_settings: typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agents_route_create_or_update( - id="id", - name="name", - about="about", - model="model", - ) + + + async def main() -> None: + await client.agents_route_create_or_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - } - if metadata is not OMIT: - _request["metadata"] = metadata - if default_settings is not OMIT: - _request["default_settings"] = default_settings _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "agents"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "agents", + method="PUT", + json={ + "id": id, + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_get(self, id: CommonUuid) -> AgentsAgent: + async def agents_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsAgent: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsAgent + The request has succeeded. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agents_route_get( - id="id", - ) + + + async def main() -> None: + await client.agents_route_get( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsAgent, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2973,101 +3837,142 @@ async def agents_route_update( self, id: CommonUuid, *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, model: str, instructions: AgentsUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, default_settings: typing.Optional[ AgentsUpdateAgentRequestDefaultSettings ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + name : CommonIdentifierSafeUnicode + Name of the agent - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + about : str + About the agent - - name: CommonIdentifierSafeUnicode. Name of the agent + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - - about: str. About the agent + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent - - model: str. Model name to use (gpt-4-turbo, gemini-nano etc) + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - instructions: AgentsUpdateAgentRequestInstructions. Instructions for the agent + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRouteUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - default_settings: typing.Optional[AgentsUpdateAgentRequestDefaultSettings]. Default settings for all sessions created by this agent - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agents_route_update( - id="id", - name="name", - about="about", - model="model", - ) + + + async def main() -> None: + await client.agents_route_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "name": name, - "about": about, - "model": model, - "instructions": instructions, - } - if metadata is not OMIT: - _request["metadata"] = metadata - if default_settings is not OMIT: - _request["default_settings"] = default_settings _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="PUT", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_delete(self, id: CommonUuid) -> AgentsRouteDeleteResponse: + async def agents_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agents_route_delete( - id="id", - ) + + + async def main() -> None: + await client.agents_route_delete( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3085,60 +3990,78 @@ async def agents_route_patch( default_settings: typing.Optional[ AgentsPatchAgentRequestDefaultSettings ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the agent - - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the agent + about : typing.Optional[str] + About the agent - - about: typing.Optional[str]. About the agent + model : typing.Optional[str] + Model name to use (gpt-4-turbo, gemini-nano etc) - - model: typing.Optional[str]. Model name to use (gpt-4-turbo, gemini-nano etc) + instructions : typing.Optional[AgentsPatchAgentRequestInstructions] + Instructions for the agent - - instructions: typing.Optional[AgentsPatchAgentRequestInstructions]. Instructions for the agent + default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRoutePatchResponse + The request has succeeded. + + Examples + -------- + import asyncio - - default_settings: typing.Optional[AgentsPatchAgentRequestDefaultSettings]. Default settings for all sessions created by this agent - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agents_route_patch( - id="id", - ) + + + async def main() -> None: + await client.agents_route_patch( + id="id", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = {} - if metadata is not OMIT: - _request["metadata"] = metadata - if name is not OMIT: - _request["name"] = name - if about is not OMIT: - _request["about"] = about - if model is not OMIT: - _request["model"] = model - if instructions is not OMIT: - _request["instructions"] = instructions - if default_settings is not OMIT: - _request["default_settings"] = default_settings _response = await self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}", + method="PATCH", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3153,62 +4076,79 @@ async def agent_docs_route_list( sort_by: AgentDocsRouteListRequestSortBy, direction: AgentDocsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentDocsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: AgentDocsRouteListRequestSortBy. Sort by a field + sort_by : AgentDocsRouteListRequestSortBy + Sort by a field - - direction: AgentDocsRouteListRequestDirection. Sort direction + direction : AgentDocsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentDocsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - AgentDocsRouteListRequestDirection, - AgentDocsRouteListRequestSortBy, - ) from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agent_docs_route_list( - id="id", - limit=1, - offset=1, - sort_by=AgentDocsRouteListRequestSortBy.CREATED_AT, - direction=AgentDocsRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.agent_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/docs" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/docs", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3224,46 +4164,92 @@ async def agents_docs_search_route_search( direction: AgentsDocsSearchRouteSearchRequestDirection, metadata_filter: str, body: DocsDocSearchRequest, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentsDocsSearchRouteSearchResponse: """ Search for documents owned by undefined - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + limit : CommonLimit + Limit the number of undefined items returned + + offset : CommonOffset + Offset the undefined items returned + + sort_by : AgentsDocsSearchRouteSearchRequestSortBy + Sort by a field + + direction : AgentsDocsSearchRouteSearchRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + body : DocsDocSearchRequest - - limit: CommonLimit. Limit the number of undefined items returned + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - offset: CommonOffset. Offset the undefined items returned + Returns + ------- + AgentsDocsSearchRouteSearchResponse + The request has succeeded. - - sort_by: AgentsDocsSearchRouteSearchRequestSortBy. Sort by a field + Examples + -------- + import asyncio - - direction: AgentsDocsSearchRouteSearchRequestDirection. Sort direction + from julep import DocsDocSearchRequest_Vector + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_docs_search_route_search( + id="string", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="string", + body=DocsDocSearchRequest_Vector( + text="string", + vector=[1.1], + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), + ) - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - - body: DocsDocSearchRequest. + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/search" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - json=jsonable_encoder({"body": body}), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3278,236 +4264,398 @@ async def agent_tools_route_list( sort_by: AgentToolsRouteListRequestSortBy, direction: AgentToolsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> AgentToolsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: AgentToolsRouteListRequestSortBy. Sort by a field + sort_by : AgentToolsRouteListRequestSortBy + Sort by a field - - direction: AgentToolsRouteListRequestDirection. Sort direction + direction : AgentToolsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentToolsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - AgentToolsRouteListRequestDirection, - AgentToolsRouteListRequestSortBy, - ) from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agent_tools_route_list( - id="id", - limit=1, - offset=1, - sort_by=AgentToolsRouteListRequestSortBy.CREATED_AT, - direction=AgentToolsRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.agent_tools_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/tools", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) async def agent_tools_route_create( - self, id: CommonUuid, *, request: AgentsCreateAgentRequest - ) -> AgentToolsRouteCreateResponse: - """ - Create new undefined - - Parameters: - - id: CommonUuid. ID of parent undefined - - - request: AgentsCreateAgentRequest. - --- - from julep import AgentsCreateAgentRequest - from julep.client import AsyncJulepApi + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + docs: typing.Sequence[typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentToolsRouteCreateResponse: + """ + Create new undefined + + Parameters + ---------- + id : CommonUuid + ID of parent undefined + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + docs : typing.Sequence[typing.Any] + Documents to index for this agent. (Max: 100 items) + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentToolsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.agent_tools_route_create( - id="id", - request=AgentsCreateAgentRequest( + + + async def main() -> None: + await client.agent_tools_route_create( + id="id", name="name", about="about", model="model", + instructions="instructions", docs=[], - ), - ) + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"agents/{id}/tools" - ), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"agents/{jsonable_encoder(id)}/tools", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + "docs": docs, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def individual_docs_route_get(self, id: CommonUuid) -> DocsDoc: + async def individual_docs_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> DocsDoc: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DocsDoc + The request has succeeded. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.individual_docs_route_get( - id="id", - ) + + + async def main() -> None: + await client.individual_docs_route_get( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"docs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(DocsDoc, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) async def individual_docs_route_delete( - self, id: CommonUuid + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> IndividualDocsRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + IndividualDocsRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.individual_docs_route_delete( - id="id", - ) + + + async def main() -> None: + await client.individual_docs_route_delete( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"docs/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"docs/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def executions_route_get(self, id: CommonUuid) -> ExecutionsExecution: + async def executions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExecutionsExecution: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionsExecution + The request has succeeded. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.executions_route_get( - id="id", - ) + + + async def main() -> None: + await client.executions_route_get( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"executions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) async def executions_route_update( - self, id: CommonUuid, *, request: ExecutionsUpdateExecutionRequest + self, + id: CommonUuid, + *, + request: ExecutionsUpdateExecutionRequest, + request_options: typing.Optional[RequestOptions] = None, ) -> ExecutionsRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request : ExecutionsUpdateExecutionRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionsRouteUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - request: ExecutionsUpdateExecutionRequest. + from julep import ExecutionsUpdateExecutionRequest_Cancelled + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.executions_route_update( + id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"executions/{id}" - ), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"executions/{jsonable_encoder(id)}", + method="PUT", + json=request, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3522,96 +4670,131 @@ async def execution_transitions_route_list( sort_by: ExecutionTransitionsRouteListRequestSortBy, direction: ExecutionTransitionsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> ExecutionTransitionsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: ExecutionTransitionsRouteListRequestSortBy. Sort by a field + sort_by : ExecutionTransitionsRouteListRequestSortBy + Sort by a field - - direction: ExecutionTransitionsRouteListRequestDirection. Sort direction + direction : ExecutionTransitionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionTransitionsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - ExecutionTransitionsRouteListRequestDirection, - ExecutionTransitionsRouteListRequestSortBy, - ) from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.execution_transitions_route_list( - id="id", - limit=1, - offset=1, - sort_by=ExecutionTransitionsRouteListRequestSortBy.CREATED_AT, - direction=ExecutionTransitionsRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", - f"executions/{id}/transitions", - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"executions/{jsonable_encoder(id)}/transitions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def job_route_get(self, id: CommonUuid) -> JobsJobStatus: + async def job_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> JobsJobStatus: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + JobsJobStatus + The request has succeeded. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.job_route_get( - id="id", - ) + + + async def main() -> None: + await client.job_route_get( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"jobs/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"jobs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3625,57 +4808,75 @@ async def sessions_route_list( sort_by: SessionsRouteListRequestSortBy, direction: SessionsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: SessionsRouteListRequestSortBy. Sort by a field + sort_by : SessionsRouteListRequestSortBy + Sort by a field - - direction: SessionsRouteListRequestDirection. Sort direction + direction : SessionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - SessionsRouteListRequestDirection, - SessionsRouteListRequestSortBy, - ) from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.sessions_route_list( - limit=1, - offset=1, - sort_by=SessionsRouteListRequestSortBy.CREATED_AT, - direction=SessionsRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.sessions_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "sessions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3684,77 +4885,95 @@ async def sessions_route_list( async def sessions_route_create( self, *, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.List[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.List[CommonUuid]] = OMIT, situation: str, render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteCreateResponse: """ Create new undefined - Parameters: - - user: typing.Optional[CommonUuid]. User ID of user associated with this session + Parameters + ---------- + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + user : typing.Optional[CommonUuid] + User ID of user associated with this session + + users : typing.Optional[typing.Sequence[CommonUuid]] + + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - - users: typing.Optional[typing.List[CommonUuid]]. + agents : typing.Optional[typing.Sequence[CommonUuid]] - - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - - agents: typing.Optional[typing.List[CommonUuid]]. + context_overflow : typing.Optional[str] + Action to start on context window overflow - - situation: str. A specific situation that sets the background for this session + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - render_templates: bool. Render system and assistant message content as jinja templates + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + Returns + ------- + SessionsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. - - context_overflow: typing.Optional[str]. Action to start on context window overflow + Examples + -------- + import asyncio - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.sessions_route_create( - situation="situation", - render_templates=True, - ) + + + async def main() -> None: + await client.sessions_route_create( + situation="situation", + render_templates=True, + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "situation": situation, - "render_templates": render_templates, - } - if user is not OMIT: - _request["user"] = user - if users is not OMIT: - _request["users"] = users - if agent is not OMIT: - _request["agent"] = agent - if agents is not OMIT: - _request["agents"] = agents - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore + "sessions", + method="POST", + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3764,81 +4983,99 @@ async def sessions_route_create_or_update( self, *, id: CommonUuid, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.List[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.List[CommonUuid]] = OMIT, situation: str, render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid + + situation : str + A specific situation that sets the background for this session - - user: typing.Optional[CommonUuid]. User ID of user associated with this session + render_templates : bool + Render system and assistant message content as jinja templates - - users: typing.Optional[typing.List[CommonUuid]]. + user : typing.Optional[CommonUuid] + User ID of user associated with this session - - agent: typing.Optional[CommonUuid]. Agent ID of agent associated with this session + users : typing.Optional[typing.Sequence[CommonUuid]] - - agents: typing.Optional[typing.List[CommonUuid]]. + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - - situation: str. A specific situation that sets the background for this session + agents : typing.Optional[typing.Sequence[CommonUuid]] - - render_templates: bool. Render system and assistant message content as jinja templates + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + context_overflow : typing.Optional[str] + Action to start on context window overflow - - context_overflow: typing.Optional[str]. Action to start on context window overflow + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.sessions_route_create_or_update( - id="id", - situation="situation", - render_templates=True, - ) + + + async def main() -> None: + await client.sessions_route_create_or_update( + id="id", + situation="situation", + render_templates=True, + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "situation": situation, - "render_templates": render_templates, - } - if user is not OMIT: - _request["user"] = user - if users is not OMIT: - _request["users"] = users - if agent is not OMIT: - _request["agent"] = agent - if agents is not OMIT: - _request["agents"] = agents - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "sessions"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "sessions", + method="PUT", + json={ + "id": id, + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3853,118 +5090,183 @@ async def history_route_list( sort_by: HistoryRouteListRequestSortBy, direction: HistoryRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> HistoryRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: HistoryRouteListRequestSortBy. Sort by a field + sort_by : HistoryRouteListRequestSortBy + Sort by a field - - direction: HistoryRouteListRequestDirection. Sort direction + direction : HistoryRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HistoryRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - HistoryRouteListRequestDirection, - HistoryRouteListRequestSortBy, - ) from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by=HistoryRouteListRequestSortBy.CREATED_AT, - direction=HistoryRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.history_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/history/{jsonable_encoder(id)}", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_delete(self, id: CommonUuid) -> HistoryRouteDeleteResponse: + async def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> HistoryRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HistoryRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.history_route_delete( - id="id", - ) + + + async def main() -> None: + await client.history_route_delete( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/history/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/history/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_get(self, id: CommonUuid) -> SessionsSession: + async def sessions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsSession: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsSession + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.sessions_route_get( + id="string", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsSession, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3979,92 +5281,128 @@ async def sessions_route_update( token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + situation : str + A specific situation that sets the background for this session - - situation: str. A specific situation that sets the background for this session + render_templates : bool + Render system and assistant message content as jinja templates - - render_templates: bool. Render system and assistant message content as jinja templates + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + context_overflow : typing.Optional[str] + Action to start on context window overflow - - context_overflow: typing.Optional[str]. Action to start on context window overflow + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.sessions_route_update( - id="id", - situation="situation", - render_templates=True, - ) + + + async def main() -> None: + await client.sessions_route_update( + id="id", + situation="situation", + render_templates=True, + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "situation": situation, - "render_templates": render_templates, - } - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="PUT", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) async def sessions_route_delete( - self, id: CommonUuid + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> SessionsRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.sessions_route_delete( - id="id", - ) + + + async def main() -> None: + await client.sessions_route_delete( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4079,56 +5417,74 @@ async def sessions_route_patch( token_budget: typing.Optional[int] = OMIT, context_overflow: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + situation : typing.Optional[str] + A specific situation that sets the background for this session + + render_templates : typing.Optional[bool] + Render system and assistant message content as jinja templates + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[str] + Action to start on context window overflow - - situation: typing.Optional[str]. A specific situation that sets the background for this session + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - render_templates: typing.Optional[bool]. Render system and assistant message content as jinja templates + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - token_budget: typing.Optional[int]. Threshold value for the adaptive context functionality + Returns + ------- + SessionsRoutePatchResponse + The request has succeeded. - - context_overflow: typing.Optional[str]. Action to start on context window overflow + Examples + -------- + import asyncio - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.sessions_route_patch( - id="id", - ) + + + async def main() -> None: + await client.sessions_route_patch( + id="id", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = {} - if situation is not OMIT: - _request["situation"] = situation - if render_templates is not OMIT: - _request["render_templates"] = render_templates - if token_budget is not OMIT: - _request["token_budget"] = token_budget - if context_overflow is not OMIT: - _request["context_overflow"] = context_overflow - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"sessions/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"sessions/{jsonable_encoder(id)}", + method="PATCH", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4142,54 +5498,75 @@ async def tasks_route_list( sort_by: TasksRouteListRequestSortBy, direction: TasksRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned + + offset : CommonOffset + Offset the undefined items returned + + sort_by : TasksRouteListRequestSortBy + Sort by a field - - offset: CommonOffset. Offset the undefined items returned + direction : TasksRouteListRequestDirection + Sort direction - - sort_by: TasksRouteListRequestSortBy. Sort by a field + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - direction: TasksRouteListRequestDirection. Sort direction + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import TasksRouteListRequestDirection, TasksRouteListRequestSortBy from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tasks_route_list( - limit=1, - offset=1, - sort_by=TasksRouteListRequestSortBy.CREATED_AT, - direction=TasksRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.tasks_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "tasks", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4200,67 +5577,89 @@ async def tasks_route_create( *, name: str, description: str, - main: typing.List[TasksWorkflowStep], - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.List[ToolsCreateToolRequest], + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteCreateResponse: """ Create new undefined - Parameters: - - name: str. + Parameters + ---------- + name : str + + description : str - - description: str. + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. - --- - from julep import ToolsCreateToolRequest, ToolsToolType + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + + from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tasks_route_create( - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type=ToolsToolType.FUNCTION, - background=True, - interactive=True, - ) - ], - inherit_tools=True, - ) + + + async def main() -> None: + await client.tasks_route_create( + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + background=True, + interactive=True, + ) + ], + inherit_tools=True, + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "name": name, - "description": description, - "main": main, - "tools": tools, - "inherit_tools": inherit_tools, - } - if input_schema is not OMIT: - _request["input_schema"] = input_schema _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore + "tasks", + method="POST", + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4272,71 +5671,93 @@ async def tasks_route_create_or_update( id: CommonUuid, name: str, description: str, - main: typing.List[TasksWorkflowStep], - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.List[ToolsCreateToolRequest], + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid - - name: str. + name : str - - description: str. + description : str - - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. - --- - from julep import ToolsCreateToolRequest, ToolsToolType + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tasks_route_create_or_update( - id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type=ToolsToolType.FUNCTION, - background=True, - interactive=True, - ) - ], - inherit_tools=True, - ) + + + async def main() -> None: + await client.tasks_route_create_or_update( + id="id", + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + background=True, + interactive=True, + ) + ], + inherit_tools=True, + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "name": name, - "description": description, - "main": main, - "tools": tools, - "inherit_tools": inherit_tools, - } - if input_schema is not OMIT: - _request["input_schema"] = input_schema _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "tasks"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "tasks", + method="PUT", + json={ + "id": id, + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4347,101 +5768,141 @@ async def tasks_route_update( id: CommonUuid, *, description: str, - main: typing.List[TasksWorkflowStep], - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.List[ToolsCreateToolRequest], + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + description : str + + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - - description: str. + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - - main: typing.List[TasksWorkflowStep]. The entrypoint of the task. + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - - tools: typing.List[ToolsCreateToolRequest]. Tools defined specifically for this task not included in the Agent itself. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - inherit_tools: bool. Whether to inherit tools from the parent agent or not. Defaults to true. - --- - from julep import ToolsCreateToolRequest, ToolsToolType + Returns + ------- + TasksRouteUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tasks_route_update( - id="id", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type=ToolsToolType.FUNCTION, - background=True, - interactive=True, - ) - ], - inherit_tools=True, - ) + + + async def main() -> None: + await client.tasks_route_update( + id="id", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + background=True, + interactive=True, + ) + ], + inherit_tools=True, + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "description": description, - "main": main, - "tools": tools, - "inherit_tools": inherit_tools, - } - if input_schema is not OMIT: - _request["input_schema"] = input_schema _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}", + method="PUT", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_delete(self, id: CommonUuid) -> TasksRouteDeleteResponse: + async def tasks_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> TasksRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tasks_route_delete( - id="id", - ) + + + async def main() -> None: + await client.tasks_route_delete( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4452,60 +5913,78 @@ async def tasks_route_patch( id: CommonUuid, *, description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.List[TasksWorkflowStep]] = OMIT, + main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.List[ToolsCreateToolRequest]] = OMIT, + tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, inherit_tools: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TasksRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + description : typing.Optional[str] + + main : typing.Optional[typing.Sequence[TasksWorkflowStep]] + The entrypoint of the task. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - - description: typing.Optional[str]. + tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] + Tools defined specifically for this task not included in the Agent itself. - - main: typing.Optional[typing.List[TasksWorkflowStep]]. The entrypoint of the task. + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema: typing.Optional[typing.Dict[str, typing.Any]]. The schema for the input to the task. `null` means all inputs are valid. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - tools: typing.Optional[typing.List[ToolsCreateToolRequest]]. Tools defined specifically for this task not included in the Agent itself. + Returns + ------- + TasksRoutePatchResponse + The request has succeeded. + + Examples + -------- + import asyncio - - inherit_tools: typing.Optional[bool]. Whether to inherit tools from the parent agent or not. Defaults to true. - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tasks_route_patch( - id="id", - ) + + + async def main() -> None: + await client.tasks_route_patch( + id="id", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = {} - if description is not OMIT: - _request["description"] = description - if main is not OMIT: - _request["main"] = main - if input_schema is not OMIT: - _request["input_schema"] = input_schema - if tools is not OMIT: - _request["tools"] = tools - if inherit_tools is not OMIT: - _request["inherit_tools"] = inherit_tools _response = await self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}", + method="PATCH", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4520,101 +5999,141 @@ async def task_executions_route_list( sort_by: TaskExecutionsRouteListRequestSortBy, direction: TaskExecutionsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: TaskExecutionsRouteListRequestSortBy. Sort by a field + sort_by : TaskExecutionsRouteListRequestSortBy + Sort by a field - - direction: TaskExecutionsRouteListRequestDirection. Sort direction + direction : TaskExecutionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskExecutionsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - TaskExecutionsRouteListRequestDirection, - TaskExecutionsRouteListRequestSortBy, - ) from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.task_executions_route_list( - id="id", - limit=1, - offset=1, - sort_by=TaskExecutionsRouteListRequestSortBy.CREATED_AT, - direction=TaskExecutionsRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.task_executions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}/executions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) async def task_executions_route_create( - self, id: CommonUuid, *, input: typing.Dict[str, typing.Any] + self, + id: CommonUuid, + *, + input: typing.Dict[str, typing.Any], + request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteCreateResponse: """ Create new undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined + + input : typing.Dict[str, typing.Any] + The input to the execution + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskExecutionsRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio - - input: typing.Dict[str, typing.Any]. The input to the execution - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.task_executions_route_create( - id="id", - input={}, - ) + + + async def main() -> None: + await client.task_executions_route_create( + id="id", + input={}, + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" - ), - json=jsonable_encoder({"input": input}), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}/executions", + method="POST", + json={"input": input}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4626,47 +6145,61 @@ async def task_executions_route_resume_with_task_token( *, task_token: str, input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteResumeWithTaskTokenResponse: """ Resume an execution with a task token - Parameters: - - id: CommonUuid. ID of parent Task + Parameters + ---------- + id : CommonUuid + ID of parent Task + + task_token : str + A Task Token is a unique identifier for a specific Task Execution. - - task_token: str. A Task Token is a unique identifier for a specific Task Execution. + input : typing.Optional[typing.Dict[str, typing.Any]] + The input to resume the execution with + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskExecutionsRouteResumeWithTaskTokenResponse + The request has succeeded. + + Examples + -------- + import asyncio - - input: typing.Optional[typing.Dict[str, typing.Any]]. The input to resume the execution with - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.task_executions_route_resume_with_task_token( - id="id", - status="running", - task_token="task_token", - ) + + + async def main() -> None: + await client.task_executions_route_resume_with_task_token( + id="id", + task_token="task_token", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "status": status, - "task_token": task_token, - } - if input is not OMIT: - _request["input"] = input _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tasks/{id}/executions" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tasks/{jsonable_encoder(id)}/executions", + method="PUT", + json={"task_token": task_token, "input": input, "status": "running"}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4683,99 +6216,134 @@ async def tool_route_update( integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> ToolRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + type : ToolsToolType + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - type: ToolsToolType. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + background : bool + The tool should be run in the background (not supported at the moment) - - background: bool. The tool should be run in the background (not supported at the moment) + interactive : bool + Whether the tool that can be run interactively (response should contain "stop" boolean field) - - interactive: bool. Whether the tool that can be run interactively (response should contain "stop" boolean field) + function : typing.Optional[ToolsFunctionDef] - - function: typing.Optional[ToolsFunctionDef]. + integration : typing.Optional[typing.Any] - - integration: typing.Optional[typing.Any]. + system : typing.Optional[typing.Any] - - system: typing.Optional[typing.Any]. + api_call : typing.Optional[typing.Any] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolRouteUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - api_call: typing.Optional[typing.Any]. - --- - from julep import ToolsToolType from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tool_route_update( - id="id", - type=ToolsToolType.FUNCTION, - background=True, - interactive=True, - ) + + + async def main() -> None: + await client.tool_route_update( + id="id", + type="function", + background=True, + interactive=True, + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "type": type.value, - "background": background, - "interactive": interactive, - } - if function is not OMIT: - _request["function"] = function - if integration is not OMIT: - _request["integration"] = integration - if system is not OMIT: - _request["system"] = system - if api_call is not OMIT: - _request["api_call"] = api_call _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tools/{jsonable_encoder(id)}", + method="PUT", + json={ + "type": type, + "background": background, + "interactive": interactive, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tool_route_delete(self, id: CommonUuid) -> ToolRouteDeleteResponse: + async def tool_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ToolRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tool_route_delete( - id="id", - ) + + + async def main() -> None: + await client.tool_route_delete( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tools/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4792,64 +6360,79 @@ async def tool_route_patch( integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> ToolRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + type : typing.Optional[ToolsToolType] + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - type: typing.Optional[ToolsToolType]. Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + background : typing.Optional[bool] + The tool should be run in the background (not supported at the moment) - - background: typing.Optional[bool]. The tool should be run in the background (not supported at the moment) + interactive : typing.Optional[bool] + Whether the tool that can be run interactively (response should contain "stop" boolean field) - - interactive: typing.Optional[bool]. Whether the tool that can be run interactively (response should contain "stop" boolean field) + function : typing.Optional[ToolsFunctionDefUpdate] - - function: typing.Optional[ToolsFunctionDefUpdate]. + integration : typing.Optional[typing.Any] - - integration: typing.Optional[typing.Any]. + system : typing.Optional[typing.Any] - - system: typing.Optional[typing.Any]. + api_call : typing.Optional[typing.Any] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ToolRoutePatchResponse + The request has succeeded. + + Examples + -------- + import asyncio - - api_call: typing.Optional[typing.Any]. - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.tool_route_patch( - id="id", - ) + + + async def main() -> None: + await client.tool_route_patch( + id="id", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = {} - if type is not OMIT: - _request["type"] = type.value - if background is not OMIT: - _request["background"] = background - if interactive is not OMIT: - _request["interactive"] = interactive - if function is not OMIT: - _request["function"] = function - if integration is not OMIT: - _request["integration"] = integration - if system is not OMIT: - _request["system"] = system - if api_call is not OMIT: - _request["api_call"] = api_call _response = await self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"tools/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"tools/{jsonable_encoder(id)}", + method="PATCH", + json={ + "type": type, + "background": background, + "interactive": interactive, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4863,54 +6446,75 @@ async def users_route_list( sort_by: UsersRouteListRequestSortBy, direction: UsersRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteListResponse: """ List undefined items - Parameters: - - limit: CommonLimit. Limit the number of undefined items returned + Parameters + ---------- + limit : CommonLimit + Limit the number of undefined items returned + + offset : CommonOffset + Offset the undefined items returned + + sort_by : UsersRouteListRequestSortBy + Sort by a field - - offset: CommonOffset. Offset the undefined items returned + direction : UsersRouteListRequestDirection + Sort direction - - sort_by: UsersRouteListRequestSortBy. Sort by a field + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - direction: UsersRouteListRequestDirection. Sort direction + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import UsersRouteListRequestDirection, UsersRouteListRequestSortBy from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.users_route_list( - limit=1, - offset=1, - sort_by=UsersRouteListRequestSortBy.CREATED_AT, - direction=UsersRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.users_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + "users", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4919,52 +6523,68 @@ async def users_route_list( async def users_route_create( self, *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, - docs: typing.List[typing.Any], + docs: typing.Sequence[typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteCreateResponse: """ Create new undefined - Parameters: - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + Parameters + ---------- + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + docs : typing.Sequence[typing.Any] + Documents to index for this user. (Max: 100 items) + + metadata : typing.Optional[typing.Dict[str, typing.Any]] - - name: CommonIdentifierSafeUnicode. Name of the user + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - about: str. About the user + Returns + ------- + UsersRouteCreateResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio - - docs: typing.List[typing.Any]. Documents to index for this user. (Max: 100 items) - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.users_route_create( - name="name", - about="about", - docs=[], - ) + + + async def main() -> None: + await client.users_route_create( + name="name", + about="about", + docs=[], + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "name": name, - "about": about, - "docs": docs, - } - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore + "users", + method="POST", + json={"metadata": metadata, "name": name, "about": about, "docs": docs}, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4974,84 +6594,118 @@ async def users_route_create_or_update( self, *, id: CommonUuid, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteCreateOrUpdateResponse: """ Create or update undefined (ID is required in payload; existing resource will be overwritten) - Parameters: - - id: CommonUuid. + Parameters + ---------- + id : CommonUuid + + name : CommonIdentifierSafeUnicode + Name of the user - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + about : str + About the user - - name: CommonIdentifierSafeUnicode. Name of the user + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteCreateOrUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - about: str. About the user - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.users_route_create_or_update( - id="id", - name="name", - about="about", - ) + + + async def main() -> None: + await client.users_route_create_or_update( + id="id", + name="name", + about="about", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = { - "id": id, - "name": name, - "about": about, - } - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, - ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore + "users", + method="PUT", + json={"id": id, "metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, + ) try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_get(self, id: CommonUuid) -> UsersUser: + async def users_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersUser: """ Get undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersUser + The request has succeeded. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.users_route_get( - id="id", - ) + + + async def main() -> None: + await client.users_route_get( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersUser, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5061,82 +6715,119 @@ async def users_route_update( self, id: CommonUuid, *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: CommonIdentifierSafeUnicode, about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteUpdateResponse: """ Update undefined by id (overwrite) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + name : CommonIdentifierSafeUnicode + Name of the user - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + about : str + About the user - - name: CommonIdentifierSafeUnicode. Name of the user + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteUpdateResponse + The request has succeeded. + + Examples + -------- + import asyncio - - about: str. About the user - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.users_route_update( - id="id", - name="name", - about="about", - ) + + + async def main() -> None: + await client.users_route_update( + id="id", + name="name", + about="about", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = {"name": name, "about": about} - if metadata is not OMIT: - _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( - "PUT", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="PUT", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_delete(self, id: CommonUuid) -> UsersRouteDeleteResponse: + async def users_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersRouteDeleteResponse: """ Delete undefined by id - Parameters: - - id: CommonUuid. ID of the undefined - --- + Parameters + ---------- + id : CommonUuid + ID of the undefined + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteDeleteResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.users_route_delete( - id="id", - ) + + + async def main() -> None: + await client.users_route_delete( + id="id", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "DELETE", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5149,48 +6840,62 @@ async def users_route_patch( metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, about: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> UsersRoutePatchResponse: """ Patch undefined by id (merge changes) - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the user + + about : typing.Optional[str] + About the user - - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - - name: typing.Optional[CommonIdentifierSafeUnicode]. Name of the user + Returns + ------- + UsersRoutePatchResponse + The request has succeeded. + + Examples + -------- + import asyncio - - about: typing.Optional[str]. About the user - --- from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.users_route_patch( - id="id", - ) + + + async def main() -> None: + await client.users_route_patch( + id="id", + ) + + + asyncio.run(main()) """ - _request: typing.Dict[str, typing.Any] = {} - if metadata is not OMIT: - _request["metadata"] = metadata - if name is not OMIT: - _request["name"] = name - if about is not OMIT: - _request["about"] = about _response = await self._client_wrapper.httpx_client.request( - "PATCH", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}" - ), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}", + method="PATCH", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5205,62 +6910,79 @@ async def user_docs_route_list( sort_by: UserDocsRouteListRequestSortBy, direction: UserDocsRouteListRequestDirection, metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsRouteListResponse: """ List undefined items of parent undefined - Parameters: - - id: CommonUuid. ID of parent undefined + Parameters + ---------- + id : CommonUuid + ID of parent undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: UserDocsRouteListRequestSortBy. Sort by a field + sort_by : UserDocsRouteListRequestSortBy + Sort by a field - - direction: UserDocsRouteListRequestDirection. Sort direction + direction : UserDocsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserDocsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata - --- - from julep import ( - UserDocsRouteListRequestDirection, - UserDocsRouteListRequestSortBy, - ) from julep.client import AsyncJulepApi client = AsyncJulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - await client.user_docs_route_list( - id="id", - limit=1, - offset=1, - sort_by=UserDocsRouteListRequestSortBy.CREATED_AT, - direction=UserDocsRouteListRequestDirection.ASC, - metadata_filter="metadata_filter", - ) + + + async def main() -> None: + await client.user_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "GET", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}/docs" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}/docs", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5276,46 +6998,92 @@ async def user_docs_search_route_search( direction: UserDocsSearchRouteSearchRequestDirection, metadata_filter: str, body: DocsDocSearchRequest, + request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsSearchRouteSearchResponse: """ Search for documents owned by undefined - Parameters: - - id: CommonUuid. ID of the undefined + Parameters + ---------- + id : CommonUuid + ID of the undefined - - limit: CommonLimit. Limit the number of undefined items returned + limit : CommonLimit + Limit the number of undefined items returned - - offset: CommonOffset. Offset the undefined items returned + offset : CommonOffset + Offset the undefined items returned - - sort_by: UserDocsSearchRouteSearchRequestSortBy. Sort by a field + sort_by : UserDocsSearchRouteSearchRequestSortBy + Sort by a field - - direction: UserDocsSearchRouteSearchRequestDirection. Sort direction + direction : UserDocsSearchRouteSearchRequestDirection + Sort direction - - metadata_filter: str. JSON string of object that should be used to filter objects by metadata + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - - body: DocsDocSearchRequest. + body : DocsDocSearchRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserDocsSearchRouteSearchResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import DocsDocSearchRequest_Vector + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.user_docs_search_route_search( + id="string", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="string", + body=DocsDocSearchRequest_Vector( + text="string", + vector=[1.1], + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), + ) + + + asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "POST", - urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"users/{id}/search" - ), - params=remove_none_from_dict( - { - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - } - ), - json=jsonable_encoder({"body": body}), - headers=self._client_wrapper.get_headers(), - timeout=300, + f"users/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, + request_options=request_options, + omit=OMIT, ) - if 200 <= _response.status_code < 300: - return pydantic.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) diff --git a/sdks/python/julep/api/core/__init__.py b/sdks/python/julep/api/core/__init__.py index 24149550b..58ad52ad2 100644 --- a/sdks/python/julep/api/core/__init__.py +++ b/sdks/python/julep/api/core/__init__.py @@ -3,15 +3,28 @@ from .api_error import ApiError from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper from .datetime_utils import serialize_datetime +from .file import File, convert_file_dict_to_httpx_tuples +from .http_client import AsyncHttpClient, HttpClient from .jsonable_encoder import jsonable_encoder +from .pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .query_encoder import encode_query from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions __all__ = [ "ApiError", "AsyncClientWrapper", + "AsyncHttpClient", "BaseClientWrapper", + "File", + "HttpClient", + "RequestOptions", "SyncClientWrapper", + "convert_file_dict_to_httpx_tuples", + "deep_union_pydantic_dicts", + "encode_query", "jsonable_encoder", + "pydantic_v1", "remove_none_from_dict", "serialize_datetime", ] diff --git a/sdks/python/julep/api/core/client_wrapper.py b/sdks/python/julep/api/core/client_wrapper.py index 4c9a0b2e4..4052836ae 100644 --- a/sdks/python/julep/api/core/client_wrapper.py +++ b/sdks/python/julep/api/core/client_wrapper.py @@ -4,12 +4,22 @@ import httpx +from .http_client import AsyncHttpClient, HttpClient + class BaseClientWrapper: - def __init__(self, *, auth_key: str, api_key: str, base_url: str): + def __init__( + self, + *, + auth_key: str, + api_key: str, + base_url: str, + timeout: typing.Optional[float] = None + ): self._auth_key = auth_key self.api_key = api_key self._base_url = base_url + self._timeout = timeout def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = {"X-Fern-Language": "Python"} @@ -20,13 +30,29 @@ def get_headers(self) -> typing.Dict[str, str]: def get_base_url(self) -> str: return self._base_url + def get_timeout(self) -> typing.Optional[float]: + return self._timeout + class SyncClientWrapper(BaseClientWrapper): def __init__( - self, *, auth_key: str, api_key: str, base_url: str, httpx_client: httpx.Client + self, + *, + auth_key: str, + api_key: str, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.Client ): - super().__init__(auth_key=auth_key, api_key=api_key, base_url=base_url) - self.httpx_client = httpx_client + super().__init__( + auth_key=auth_key, api_key=api_key, base_url=base_url, timeout=timeout + ) + self.httpx_client = HttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers(), + base_timeout=self.get_timeout(), + base_url=self.get_base_url(), + ) class AsyncClientWrapper(BaseClientWrapper): @@ -36,7 +62,15 @@ def __init__( auth_key: str, api_key: str, base_url: str, + timeout: typing.Optional[float] = None, httpx_client: httpx.AsyncClient ): - super().__init__(auth_key=auth_key, api_key=api_key, base_url=base_url) - self.httpx_client = httpx_client + super().__init__( + auth_key=auth_key, api_key=api_key, base_url=base_url, timeout=timeout + ) + self.httpx_client = AsyncHttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers(), + base_timeout=self.get_timeout(), + base_url=self.get_base_url(), + ) diff --git a/sdks/python/julep/api/core/file.py b/sdks/python/julep/api/core/file.py new file mode 100644 index 000000000..2ad89f5e5 --- /dev/null +++ b/sdks/python/julep/api/core/file.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +# File typing inspired by the flexibility of types within the httpx library +# https://github.com/encode/httpx/blob/master/httpx/_types.py +FileContent = typing.Union[typing.IO[bytes], bytes, str] +File = typing.Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + typing.Tuple[typing.Optional[str], FileContent], + # (filename, file (or bytes), content_type) + typing.Tuple[typing.Optional[str], FileContent, typing.Optional[str]], + # (filename, file (or bytes), content_type, headers) + typing.Tuple[ + typing.Optional[str], + FileContent, + typing.Optional[str], + typing.Mapping[str, str], + ], +] + + +def convert_file_dict_to_httpx_tuples( + d: typing.Dict[str, typing.Union[File, typing.List[File]]] +) -> typing.List[typing.Tuple[str, File]]: + """ + The format we use is a list of tuples, where the first element is the + name of the file and the second is the file object. Typically HTTPX wants + a dict, but to be able to send lists of files, you have to use the list + approach (which also works for non-lists) + https://github.com/encode/httpx/pull/1032 + """ + + httpx_tuples = [] + for key, file_like in d.items(): + if isinstance(file_like, list): + for file_like_item in file_like: + httpx_tuples.append((key, file_like_item)) + else: + httpx_tuples.append((key, file_like)) + return httpx_tuples diff --git a/sdks/python/julep/api/core/http_client.py b/sdks/python/julep/api/core/http_client.py new file mode 100644 index 000000000..3897fa66c --- /dev/null +++ b/sdks/python/julep/api/core/http_client.py @@ -0,0 +1,558 @@ +# This file was auto-generated by Fern from our API Definition. + +import asyncio +import email.utils +import json +import re +import time +import typing +import urllib.parse +from contextlib import asynccontextmanager, contextmanager +from random import random + +import httpx + +from .file import File, convert_file_dict_to_httpx_tuples +from .jsonable_encoder import jsonable_encoder +from .query_encoder import encode_query +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions + +INITIAL_RETRY_DELAY_SECONDS = 0.5 +MAX_RETRY_DELAY_SECONDS = 10 +MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 + + +def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: + """ + This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. + + Inspired by the urllib3 retry implementation. + """ + retry_after_ms = response_headers.get("retry-after-ms") + if retry_after_ms is not None: + try: + return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 + except Exception: + pass + + retry_after = response_headers.get("retry-after") + if retry_after is None: + return None + + # Attempt to parse the header as an int. + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = float(retry_after) + # Fallback to parsing it as a date. + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + return None + if retry_date_tuple[9] is None: # Python 2 + # Assume UTC if no timezone was specified + # On Python2.7, parsedate_tz returns None for a timezone offset + # instead of 0 if no timezone is given, where mktime_tz treats + # a None timezone offset as local time. + retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + +def _retry_timeout(response: httpx.Response, retries: int) -> float: + """ + Determine the amount of time to wait before retrying a request. + This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff + with a jitter to determine the number of seconds to wait. + """ + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = _parse_retry_after(response.headers) + if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: + return retry_after + + # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. + retry_delay = min( + INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS + ) + + # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. + timeout = retry_delay * (1 - 0.25 * random()) + return timeout if timeout >= 0 else 0 + + +def _should_retry(response: httpx.Response) -> bool: + retriable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retriable_400s + + +def remove_omit_from_dict( + original: typing.Dict[str, typing.Optional[typing.Any]], + omit: typing.Optional[typing.Any], +) -> typing.Dict[str, typing.Any]: + if omit is None: + return original + new: typing.Dict[str, typing.Any] = {} + for key, value in original.items(): + if value is not omit: + new[key] = value + return new + + +def maybe_filter_request_body( + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Optional[typing.Any]: + if data is None: + return ( + jsonable_encoder(request_options.get("additional_body_parameters", {})) + or {} + if request_options is not None + else None + ) + elif not isinstance(data, typing.Mapping): + data_content = jsonable_encoder(data) + else: + data_content = { + **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore + **( + jsonable_encoder(request_options.get("additional_body_parameters", {})) + or {} + if request_options is not None + else {} + ), + } + return data_content + + +# Abstracted out for testing purposes +def get_request_body( + *, + json: typing.Optional[typing.Any], + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: + json_body = None + data_body = None + if data is not None: + data_body = maybe_filter_request_body(data, request_options, omit) + else: + # If both data and json are None, we send json data in the event extra properties are specified + json_body = maybe_filter_request_body(json, request_options, omit) + + return json_body, data_body + + +class HttpClient: + def __init__( + self, + *, + httpx_client: httpx.Client, + base_timeout: typing.Optional[float], + base_headers: typing.Dict[str, str], + base_url: typing.Optional[str] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = self.base_url if maybe_base_url is None else maybe_base_url + if base_url is None: + raise ValueError( + "A base_url is required to make this request, please provide one and try again." + ) + return base_url + + def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[ + typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] + ] = None, + files: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None + and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body( + json=json, data=data, request_options=request_options, omit=omit + ) + + response = self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **( + request_options.get("additional_headers", {}) or {} + if request_options is not None + else {} + ), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get( + "additional_query_parameters", {} + ) + or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=( + convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) + if files is not None + else None + ), + timeout=timeout, + ) + + max_retries: int = ( + request_options.get("max_retries", 0) if request_options is not None else 0 + ) + if _should_retry(response=response): + if max_retries > retries: + time.sleep(_retry_timeout(response=response, retries=retries)) + return self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + + return response + + @contextmanager + def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[ + typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] + ] = None, + files: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> typing.Iterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None + and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body( + json=json, data=data, request_options=request_options, omit=omit + ) + + with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **( + request_options.get("additional_headers", {}) + if request_options is not None + else {} + ), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get( + "additional_query_parameters", {} + ) + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=( + convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) + if files is not None + else None + ), + timeout=timeout, + ) as stream: + yield stream + + +class AsyncHttpClient: + def __init__( + self, + *, + httpx_client: httpx.AsyncClient, + base_timeout: typing.Optional[float], + base_headers: typing.Dict[str, str], + base_url: typing.Optional[str] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = self.base_url if maybe_base_url is None else maybe_base_url + if base_url is None: + raise ValueError( + "A base_url is required to make this request, please provide one and try again." + ) + return base_url + + async def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[ + typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] + ] = None, + files: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None + and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body( + json=json, data=data, request_options=request_options, omit=omit + ) + + # Add the input to each of these and do None-safety checks + response = await self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **( + request_options.get("additional_headers", {}) or {} + if request_options is not None + else {} + ), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get( + "additional_query_parameters", {} + ) + or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=( + convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) + if files is not None + else None + ), + timeout=timeout, + ) + + max_retries: int = ( + request_options.get("max_retries", 0) if request_options is not None else 0 + ) + if _should_retry(response=response): + if max_retries > retries: + await asyncio.sleep(_retry_timeout(response=response, retries=retries)) + return await self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + return response + + @asynccontextmanager + async def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[ + typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]] + ] = None, + files: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]] + ] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> typing.AsyncIterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None + and request_options.get("timeout_in_seconds") is not None + else self.base_timeout + ) + + json_body, data_body = get_request_body( + json=json, data=data, request_options=request_options, omit=omit + ) + + async with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers, + **(headers if headers is not None else {}), + **( + request_options.get("additional_headers", {}) + if request_options is not None + else {} + ), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get( + "additional_query_parameters", {} + ) + if request_options is not None + else {} + ), + }, + omit=omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=( + convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) + if files is not None + else None + ), + timeout=timeout, + ) as stream: + yield stream diff --git a/sdks/python/julep/api/core/jsonable_encoder.py b/sdks/python/julep/api/core/jsonable_encoder.py index 0e297e18f..e42ef372b 100644 --- a/sdks/python/julep/api/core/jsonable_encoder.py +++ b/sdks/python/julep/api/core/jsonable_encoder.py @@ -16,12 +16,8 @@ from types import GeneratorType from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - from .datetime_utils import serialize_datetime +from .pydantic_utilities import pydantic_v1 SetIntStr = Set[Union[int, str]] DictIntStrAny = Dict[Union[int, str], Any] @@ -39,7 +35,7 @@ def generate_encoders_by_class_tuples( encoders_by_class_tuples = generate_encoders_by_class_tuples( - pydantic.json.ENCODERS_BY_TYPE + pydantic_v1.json.ENCODERS_BY_TYPE ) @@ -54,7 +50,7 @@ def jsonable_encoder( for encoder_type, encoder_instance in custom_encoder.items(): if isinstance(obj, encoder_type): return encoder_instance(obj) - if isinstance(obj, pydantic.BaseModel): + if isinstance(obj, pydantic_v1.BaseModel): encoder = getattr(obj.__config__, "json_encoders", {}) if custom_encoder: encoder.update(custom_encoder) @@ -71,10 +67,10 @@ def jsonable_encoder( return str(obj) if isinstance(obj, (str, int, float, type(None))): return obj - if isinstance(obj, dt.date): - return str(obj) if isinstance(obj, dt.datetime): return serialize_datetime(obj) + if isinstance(obj, dt.date): + return str(obj) if isinstance(obj, dict): encoded_dict = {} allowed_keys = set(obj.keys()) @@ -90,8 +86,8 @@ def jsonable_encoder( encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) return encoded_list - if type(obj) in pydantic.json.ENCODERS_BY_TYPE: - return pydantic.json.ENCODERS_BY_TYPE[type(obj)](obj) + if type(obj) in pydantic_v1.json.ENCODERS_BY_TYPE: + return pydantic_v1.json.ENCODERS_BY_TYPE[type(obj)](obj) for encoder, classes_tuple in encoders_by_class_tuples.items(): if isinstance(obj, classes_tuple): return encoder(obj) diff --git a/sdks/python/julep/api/core/pydantic_utilities.py b/sdks/python/julep/api/core/pydantic_utilities.py new file mode 100644 index 000000000..a72c1a52f --- /dev/null +++ b/sdks/python/julep/api/core/pydantic_utilities.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic + +IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") + +if IS_PYDANTIC_V2: + import pydantic.v1 as pydantic_v1 # type: ignore # nopycln: import +else: + import pydantic as pydantic_v1 # type: ignore # nopycln: import + + +def deep_union_pydantic_dicts( + source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any] +) -> typing.Dict[str, typing.Any]: + for key, value in source.items(): + if isinstance(value, dict): + node = destination.setdefault(key, {}) + deep_union_pydantic_dicts(value, node) + else: + destination[key] = value + + return destination + + +__all__ = ["pydantic_v1"] diff --git a/sdks/python/julep/api/core/query_encoder.py b/sdks/python/julep/api/core/query_encoder.py new file mode 100644 index 000000000..069633086 --- /dev/null +++ b/sdks/python/julep/api/core/query_encoder.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from collections import ChainMap +from typing import Any, Dict, Optional + +from .pydantic_utilities import pydantic_v1 + + +# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict +def traverse_query_dict( + dict_flat: Dict[str, Any], key_prefix: Optional[str] = None +) -> Dict[str, Any]: + result = {} + for k, v in dict_flat.items(): + key = f"{key_prefix}[{k}]" if key_prefix is not None else k + if isinstance(v, dict): + result.update(traverse_query_dict(v, key)) + else: + result[key] = v + return result + + +def single_query_encoder(query_key: str, query_value: Any) -> Dict[str, Any]: + if isinstance(query_value, pydantic_v1.BaseModel) or isinstance(query_value, dict): + if isinstance(query_value, pydantic_v1.BaseModel): + obj_dict = query_value.dict(by_alias=True) + else: + obj_dict = query_value + return traverse_query_dict(obj_dict, query_key) + + return {query_key: query_value} + + +def encode_query(query: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]: + return ( + dict(ChainMap(*[single_query_encoder(k, v) for k, v in query.items()])) + if query is not None + else None + ) diff --git a/sdks/python/julep/api/core/remove_none_from_dict.py b/sdks/python/julep/api/core/remove_none_from_dict.py index 2da30f713..c2298143f 100644 --- a/sdks/python/julep/api/core/remove_none_from_dict.py +++ b/sdks/python/julep/api/core/remove_none_from_dict.py @@ -1,9 +1,9 @@ # This file was auto-generated by Fern from our API Definition. -from typing import Any, Dict, Optional +from typing import Any, Dict, Mapping, Optional -def remove_none_from_dict(original: Dict[str, Optional[Any]]) -> Dict[str, Any]: +def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: new: Dict[str, Any] = {} for key, value in original.items(): if value is not None: diff --git a/sdks/python/julep/api/core/request_options.py b/sdks/python/julep/api/core/request_options.py new file mode 100644 index 000000000..d0bf0dbce --- /dev/null +++ b/sdks/python/julep/api/core/request_options.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +try: + from typing import NotRequired # type: ignore +except ImportError: + from typing_extensions import NotRequired + + +class RequestOptions(typing.TypedDict, total=False): + """ + Additional options for request-specific configuration when calling APIs via the SDK. + This is used primarily as an optional final parameter for service functions. + + Attributes: + - timeout_in_seconds: int. The number of seconds to await an API call before timing out. + + - max_retries: int. The max number of retries to attempt if the API call fails. + + - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict + + - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict + + - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict + """ + + timeout_in_seconds: NotRequired[int] + max_retries: NotRequired[int] + additional_headers: NotRequired[typing.Dict[str, typing.Any]] + additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] + additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md new file mode 100644 index 000000000..dafee3783 --- /dev/null +++ b/sdks/python/julep/api/reference.md @@ -0,0 +1,4819 @@ +# Reference +
client.agents_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `AgentsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `AgentsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agents_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", + docs=[], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the agent + +
+
+ +
+
+ +**about:** `str` — About the agent + +
+
+ +
+
+ +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) + +
+
+ +
+
+ +**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent + +
+
+ +
+
+ +**docs:** `typing.Sequence[typing.Any]` — Documents to index for this agent. (Max: 100 items) + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agents_route_create_or_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update undefined (ID is required in payload; existing resource will be overwritten) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_create_or_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the agent + +
+
+ +
+
+ +**about:** `str` — About the agent + +
+
+ +
+
+ +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) + +
+
+ +
+
+ +**instructions:** `AgentsCreateOrUpdateAgentRequestInstructions` — Instructions for the agent + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**default_settings:** `typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agents_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agents_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update undefined by id (overwrite) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the agent + +
+
+ +
+
+ +**about:** `str` — About the agent + +
+
+ +
+
+ +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) + +
+
+ +
+
+ +**instructions:** `AgentsUpdateAgentRequestInstructions` — Instructions for the agent + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**default_settings:** `typing.Optional[AgentsUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agents_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agents_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Patch undefined by id (merge changes) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_patch( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**name:** `typing.Optional[CommonIdentifierSafeUnicode]` — Name of the agent + +
+
+ +
+
+ +**about:** `typing.Optional[str]` — About the agent + +
+
+ +
+
+ +**model:** `typing.Optional[str]` — Model name to use (gpt-4-turbo, gemini-nano etc) + +
+
+ +
+
+ +**instructions:** `typing.Optional[AgentsPatchAgentRequestInstructions]` — Instructions for the agent + +
+
+ +
+
+ +**default_settings:** `typing.Optional[AgentsPatchAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_docs_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items of parent undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `AgentDocsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `AgentDocsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agents_docs_search_route_search(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Search for documents owned by undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import DocsDocSearchRequest_Vector +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_docs_search_route_search( + id="string", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="string", + body=DocsDocSearchRequest_Vector( + text="string", + vector=[1.1], + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `AgentsDocsSearchRouteSearchRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `AgentsDocsSearchRouteSearchRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**body:** `DocsDocSearchRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_tools_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items of parent undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `AgentToolsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `AgentToolsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_tools_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_create( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + docs=[], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the agent + +
+
+ +
+
+ +**about:** `str` — About the agent + +
+
+ +
+
+ +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) + +
+
+ +
+
+ +**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent + +
+
+ +
+
+ +**docs:** `typing.Sequence[typing.Any]` — Documents to index for this agent. (Max: 100 items) + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.individual_docs_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.individual_docs_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.individual_docs_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.individual_docs_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.executions_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.executions_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.executions_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update undefined by id (overwrite) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import ExecutionsUpdateExecutionRequest_Cancelled +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.executions_route_update( + id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request:** `ExecutionsUpdateExecutionRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.execution_transitions_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items of parent undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `ExecutionTransitionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `ExecutionTransitionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.job_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.job_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `SessionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `SessionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_create( + situation="situation", + render_templates=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**situation:** `str` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `bool` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session + +
+
+ +
+
+ +**users:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session + +
+
+ +
+
+ +**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_create_or_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update undefined (ID is required in payload; existing resource will be overwritten) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_create_or_update( + id="id", + situation="situation", + render_templates=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` + +
+
+ +
+
+ +**situation:** `str` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `bool` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session + +
+
+ +
+
+ +**users:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session + +
+
+ +
+
+ +**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.history_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items of parent undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.history_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `HistoryRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.history_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.history_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_get( + id="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update undefined by id (overwrite) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_update( + id="id", + situation="situation", + render_templates=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**situation:** `str` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `bool` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Patch undefined by id (merge changes) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_patch( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**situation:** `typing.Optional[str]` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `typing.Optional[bool]` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `TasksRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `TasksRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import ToolsCreateToolRequest +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_create( + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + background=True, + interactive=True, + ) + ], + inherit_tools=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `str` + +
+
+ +
+
+ +**description:** `str` + +
+
+ +
+
+ +**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. + +
+
+ +
+
+ +**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_create_or_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update undefined (ID is required in payload; existing resource will be overwritten) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import ToolsCreateToolRequest +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_create_or_update( + id="id", + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + background=True, + interactive=True, + ) + ], + inherit_tools=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` + +
+
+ +
+
+ +**name:** `str` + +
+
+ +
+
+ +**description:** `str` + +
+
+ +
+
+ +**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. + +
+
+ +
+
+ +**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update undefined by id (overwrite) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import ToolsCreateToolRequest +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_update( + id="id", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + background=True, + interactive=True, + ) + ], + inherit_tools=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**description:** `str` + +
+
+ +
+
+ +**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. + +
+
+ +
+
+ +**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Patch undefined by id (merge changes) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_patch( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**description:** `typing.Optional[str]` + +
+
+ +
+
+ +**main:** `typing.Optional[typing.Sequence[TasksWorkflowStep]]` — The entrypoint of the task. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**tools:** `typing.Optional[typing.Sequence[ToolsCreateToolRequest]]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `typing.Optional[bool]` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.task_executions_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items of parent undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.task_executions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `TaskExecutionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `TaskExecutionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.task_executions_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.task_executions_route_create( + id="id", + input={}, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**input:** `typing.Dict[str, typing.Any]` — The input to the execution + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.task_executions_route_resume_with_task_token(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Resume an execution with a task token +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.task_executions_route_resume_with_task_token( + id="id", + task_token="task_token", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent Task + +
+
+ +
+
+ +**task_token:** `str` — A Task Token is a unique identifier for a specific Task Execution. + +
+
+ +
+
+ +**input:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input to resume the execution with + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tool_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update undefined by id (overwrite) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tool_route_update( + id="id", + type="function", + background=True, + interactive=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**type:** `ToolsToolType` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + +
+
+ +
+
+ +**background:** `bool` — The tool should be run in the background (not supported at the moment) + +
+
+ +
+
+ +**interactive:** `bool` — Whether the tool that can be run interactively (response should contain "stop" boolean field) + +
+
+ +
+
+ +**function:** `typing.Optional[ToolsFunctionDef]` + +
+
+ +
+
+ +**integration:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**system:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**api_call:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tool_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tool_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tool_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Patch undefined by id (merge changes) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tool_route_patch( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**type:** `typing.Optional[ToolsToolType]` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + +
+
+ +
+
+ +**background:** `typing.Optional[bool]` — The tool should be run in the background (not supported at the moment) + +
+
+ +
+
+ +**interactive:** `typing.Optional[bool]` — Whether the tool that can be run interactively (response should contain "stop" boolean field) + +
+
+ +
+
+ +**function:** `typing.Optional[ToolsFunctionDefUpdate]` + +
+
+ +
+
+ +**integration:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**system:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**api_call:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.users_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `UsersRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `UsersRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.users_route_create( + name="name", + about="about", + docs=[], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the user + +
+
+ +
+
+ +**about:** `str` — About the user + +
+
+ +
+
+ +**docs:** `typing.Sequence[typing.Any]` — Documents to index for this user. (Max: 100 items) + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users_route_create_or_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update undefined (ID is required in payload; existing resource will be overwritten) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.users_route_create_or_update( + id="id", + name="name", + about="about", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the user + +
+
+ +
+
+ +**about:** `str` — About the user + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.users_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update undefined by id (overwrite) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.users_route_update( + id="id", + name="name", + about="about", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the user + +
+
+ +
+
+ +**about:** `str` — About the user + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete undefined by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.users_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.users_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Patch undefined by id (merge changes) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.users_route_patch( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**name:** `typing.Optional[CommonIdentifierSafeUnicode]` — Name of the user + +
+
+ +
+
+ +**about:** `typing.Optional[str]` — About the user + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.user_docs_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List undefined items of parent undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.user_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `UserDocsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `UserDocsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.user_docs_search_route_search(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Search for documents owned by undefined +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import DocsDocSearchRequest_Vector +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.user_docs_search_route_search( + id="string", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="string", + body=DocsDocSearchRequest_Vector( + text="string", + vector=[1.1], + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the undefined + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of undefined items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the undefined items returned + +
+
+ +
+
+ +**sort_by:** `UserDocsSearchRouteSearchRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `UserDocsSearchRouteSearchRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**body:** `DocsDocSearchRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ diff --git a/sdks/python/julep/api/tests/utils/test_http_client.py b/sdks/python/julep/api/tests/utils/test_http_client.py new file mode 100644 index 000000000..86ebca59f --- /dev/null +++ b/sdks/python/julep/api/tests/utils/test_http_client.py @@ -0,0 +1,59 @@ +# This file was auto-generated by Fern from our API Definition. + +from julep.core.http_client import get_request_body +from julep.core.request_options import RequestOptions + + +def get_request_options() -> RequestOptions: + return {"additional_body_parameters": {"see you": "later"}} + + +def test_get_json_request_body() -> None: + json_body, data_body = get_request_body( + json={"hello": "world"}, data=None, request_options=None, omit=None + ) + assert json_body == {"hello": "world"} + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={"goodbye": "world"}, + data=None, + request_options=get_request_options(), + omit=None, + ) + + assert json_body_extras == {"goodbye": "world", "see you": "later"} + assert data_body_extras is None + + +def test_get_files_request_body() -> None: + json_body, data_body = get_request_body( + json=None, data={"hello": "world"}, request_options=None, omit=None + ) + assert data_body == {"hello": "world"} + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, + data={"goodbye": "world"}, + request_options=get_request_options(), + omit=None, + ) + + assert data_body_extras == {"goodbye": "world", "see you": "later"} + assert json_body_extras is None + + +def test_get_none_request_body() -> None: + json_body, data_body = get_request_body( + json=None, data=None, request_options=None, omit=None + ) + assert data_body is None + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"see you": "later"} + assert data_body_extras is None diff --git a/sdks/python/julep/api/tests/utils/test_query_encoding.py b/sdks/python/julep/api/tests/utils/test_query_encoding.py new file mode 100644 index 000000000..422d70d93 --- /dev/null +++ b/sdks/python/julep/api/tests/utils/test_query_encoding.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +from julep.core.query_encoder import encode_query + + +def test_query_encoding() -> None: + assert encode_query({"hello world": "hello world"}) == { + "hello world": "hello world" + } + assert encode_query({"hello_world": {"hello": "world"}}) == { + "hello_world[hello]": "world" + } + assert encode_query( + {"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"} + ) == { + "hello_world[hello][world]": "today", + "hello_world[test]": "this", + "hi": "there", + } diff --git a/sdks/python/julep/api/types/agent_docs_route_list_request_direction.py b/sdks/python/julep/api/types/agent_docs_route_list_request_direction.py index 33bb8e404..e1d4a11bb 100644 --- a/sdks/python/julep/api/types/agent_docs_route_list_request_direction.py +++ b/sdks/python/julep/api/types/agent_docs_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentDocsRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is AgentDocsRouteListRequestDirection.ASC: - return asc() - if self is AgentDocsRouteListRequestDirection.DESC: - return desc() +AgentDocsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py b/sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py index f7c61ab5a..48208aafe 100644 --- a/sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/agent_docs_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentDocsRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is AgentDocsRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is AgentDocsRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is AgentDocsRouteListRequestSortBy.DELETED_AT: - return deleted_at() +AgentDocsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/agent_docs_route_list_response.py b/sdks/python/julep/api/types/agent_docs_route_list_response.py index 13d9208cb..e982ced31 100644 --- a/sdks/python/julep/api/types/agent_docs_route_list_response.py +++ b/sdks/python/julep/api/types/agent_docs_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_doc import DocsDoc -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class AgentDocsRouteListResponse(pydantic.BaseModel): +class AgentDocsRouteListResponse(pydantic_v1.BaseModel): results: typing.List[DocsDoc] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agent_tools_route_create_response.py b/sdks/python/julep/api/types/agent_tools_route_create_response.py index 4c580bd0a..ba3b9eb58 100644 --- a/sdks/python/julep/api/types/agent_tools_route_create_response.py +++ b/sdks/python/julep/api/types/agent_tools_route_create_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class AgentToolsRouteCreateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of created undefined + """ -class AgentToolsRouteCreateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of created undefined") - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py b/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py index 69e7cdcd9..b968f7b7c 100644 --- a/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py +++ b/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentToolsRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is AgentToolsRouteListRequestDirection.ASC: - return asc() - if self is AgentToolsRouteListRequestDirection.DESC: - return desc() +AgentToolsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py b/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py index d1321b821..5584ba780 100644 --- a/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentToolsRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is AgentToolsRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is AgentToolsRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is AgentToolsRouteListRequestSortBy.DELETED_AT: - return deleted_at() +AgentToolsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_response.py b/sdks/python/julep/api/types/agent_tools_route_list_response.py index ccc348710..9e56ed1a1 100644 --- a/sdks/python/julep/api/types/agent_tools_route_list_response.py +++ b/sdks/python/julep/api/types/agent_tools_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tools_tool import ToolsTool -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class AgentToolsRouteListResponse(pydantic.BaseModel): +class AgentToolsRouteListResponse(pydantic_v1.BaseModel): results: typing.List[ToolsTool] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_agent.py b/sdks/python/julep/api/types/agents_agent.py index 554bc6766..04827f31f 100644 --- a/sdks/python/julep/api/types/agents_agent.py +++ b/sdks/python/julep/api/types/agents_agent.py @@ -4,37 +4,52 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .agents_agent_default_settings import AgentsAgentDefaultSettings from .agents_agent_instructions import AgentsAgentInstructions from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class AgentsAgent(pydantic.BaseModel): +class AgentsAgent(pydantic_v1.BaseModel): id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the agent") - about: str = pydantic.Field(description="About the agent") - model: str = pydantic.Field( - description="Model name to use (gpt-4-turbo, gemini-nano etc)" - ) - instructions: AgentsAgentInstructions = pydantic.Field( - description="Instructions for the agent" - ) - default_settings: typing.Optional[AgentsAgentDefaultSettings] = pydantic.Field( - description="Default settings for all sessions created by this agent" + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the agent + """ + + about: str = pydantic_v1.Field() + """ + About the agent + """ + + model: str = pydantic_v1.Field() + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + + instructions: AgentsAgentInstructions = pydantic_v1.Field() + """ + Instructions for the agent + """ + + default_settings: typing.Optional[AgentsAgentDefaultSettings] = pydantic_v1.Field( + default=None ) + """ + Default settings for all sessions created by this agent + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -45,14 +60,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_agent_default_settings.py b/sdks/python/julep/api/types/agents_agent_default_settings.py index a2b453aa2..71b82cfc2 100644 --- a/sdks/python/julep/api/types/agents_agent_default_settings.py +++ b/sdks/python/julep/api/types/agents_agent_default_settings.py @@ -2,7 +2,6 @@ import typing -from .chat_generation_preset import ChatGenerationPreset from .chat_generation_preset_settings import ChatGenerationPresetSettings from .chat_open_ai_settings import ChatOpenAiSettings from .chat_v_llm_settings import ChatVLlmSettings diff --git a/sdks/python/julep/api/types/agents_create_agent_request.py b/sdks/python/julep/api/types/agents_create_agent_request.py index c5d76306e..61050e062 100644 --- a/sdks/python/julep/api/types/agents_create_agent_request.py +++ b/sdks/python/julep/api/types/agents_create_agent_request.py @@ -4,6 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .agents_create_agent_request_default_settings import ( AgentsCreateAgentRequestDefaultSettings, ) @@ -12,34 +13,44 @@ ) from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class AgentsCreateAgentRequest(pydantic.BaseModel): +class AgentsCreateAgentRequest(pydantic_v1.BaseModel): """ Payload for creating a agent (and associated documents) """ - metadata: typing.Optional[typing.Dict[str, typing.Any]] - name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the agent") - about: str = pydantic.Field(description="About the agent") - model: str = pydantic.Field( - description="Model name to use (gpt-4-turbo, gemini-nano etc)" - ) - instructions: AgentsCreateAgentRequestInstructions = pydantic.Field( - description="Instructions for the agent" - ) + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the agent + """ + + about: str = pydantic_v1.Field() + """ + About the agent + """ + + model: str = pydantic_v1.Field() + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + + instructions: AgentsCreateAgentRequestInstructions = pydantic_v1.Field() + """ + Instructions for the agent + """ + default_settings: typing.Optional[AgentsCreateAgentRequestDefaultSettings] = ( - pydantic.Field( - description="Default settings for all sessions created by this agent" - ) - ) - docs: typing.List[typing.Any] = pydantic.Field( - description="Documents to index for this agent. (Max: 100 items)" + pydantic_v1.Field(default=None) ) + """ + Default settings for all sessions created by this agent + """ + + docs: typing.List[typing.Any] = pydantic_v1.Field() + """ + Documents to index for this agent. (Max: 100 items) + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -50,14 +61,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py index 9e893905b..da2d239bf 100644 --- a/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py +++ b/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py @@ -2,7 +2,6 @@ import typing -from .chat_generation_preset import ChatGenerationPreset from .chat_generation_preset_settings import ChatGenerationPresetSettings from .chat_open_ai_settings import ChatOpenAiSettings from .chat_v_llm_settings import ChatVLlmSettings diff --git a/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py index 121add81e..d3393d4e7 100644 --- a/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py +++ b/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py @@ -2,7 +2,6 @@ import typing -from .chat_generation_preset import ChatGenerationPreset from .chat_generation_preset_settings import ChatGenerationPresetSettings from .chat_open_ai_settings import ChatOpenAiSettings from .chat_v_llm_settings import ChatVLlmSettings diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py index ac49ec44e..07c53fe78 100644 --- a/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py +++ b/sdks/python/julep/api/types/agents_docs_search_route_search_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentsDocsSearchRouteSearchRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is AgentsDocsSearchRouteSearchRequestDirection.ASC: - return asc() - if self is AgentsDocsSearchRouteSearchRequestDirection.DESC: - return desc() +AgentsDocsSearchRouteSearchRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py index 33953d12b..c687edfeb 100644 --- a/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py +++ b/sdks/python/julep/api/types/agents_docs_search_route_search_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentsDocsSearchRouteSearchRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is AgentsDocsSearchRouteSearchRequestSortBy.CREATED_AT: - return created_at() - if self is AgentsDocsSearchRouteSearchRequestSortBy.UPDATED_AT: - return updated_at() - if self is AgentsDocsSearchRouteSearchRequestSortBy.DELETED_AT: - return deleted_at() +AgentsDocsSearchRouteSearchRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_response.py b/sdks/python/julep/api/types/agents_docs_search_route_search_response.py index c8ee082fa..400d1a51d 100644 --- a/sdks/python/julep/api/types/agents_docs_search_route_search_response.py +++ b/sdks/python/julep/api/types/agents_docs_search_route_search_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_doc_reference import DocsDocReference -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class AgentsDocsSearchRouteSearchResponse(pydantic.BaseModel): +class AgentsDocsSearchRouteSearchResponse(pydantic_v1.BaseModel): results: typing.List[DocsDocReference] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py index 457af4a38..2ce2b4fc3 100644 --- a/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py +++ b/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py @@ -2,7 +2,6 @@ import typing -from .chat_generation_preset import ChatGenerationPreset from .chat_generation_preset_settings import ChatGenerationPresetSettings from .chat_open_ai_settings import ChatOpenAiSettings from .chat_v_llm_settings import ChatVLlmSettings diff --git a/sdks/python/julep/api/types/agents_route_create_or_update_response.py b/sdks/python/julep/api/types/agents_route_create_or_update_response.py index c1d4bed53..303003714 100644 --- a/sdks/python/julep/api/types/agents_route_create_or_update_response.py +++ b/sdks/python/julep/api/types/agents_route_create_or_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class AgentsRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class AgentsRouteCreateOrUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_create_response.py b/sdks/python/julep/api/types/agents_route_create_response.py index 0114ae2c1..ee367369b 100644 --- a/sdks/python/julep/api/types/agents_route_create_response.py +++ b/sdks/python/julep/api/types/agents_route_create_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class AgentsRouteCreateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of created undefined + """ -class AgentsRouteCreateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of created undefined") - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_delete_response.py b/sdks/python/julep/api/types/agents_route_delete_response.py index 61b360a23..0efc11c4a 100644 --- a/sdks/python/julep/api/types/agents_route_delete_response.py +++ b/sdks/python/julep/api/types/agents_route_delete_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class AgentsRouteDeleteResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of deleted undefined + """ -class AgentsRouteDeleteResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of deleted undefined") - deleted_at: dt.datetime = pydantic.Field( - description="When this resource was deleted as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + deleted_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was deleted as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_list_request_direction.py b/sdks/python/julep/api/types/agents_route_list_request_direction.py index 603bb8a82..c2c39fb15 100644 --- a/sdks/python/julep/api/types/agents_route_list_request_direction.py +++ b/sdks/python/julep/api/types/agents_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentsRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is AgentsRouteListRequestDirection.ASC: - return asc() - if self is AgentsRouteListRequestDirection.DESC: - return desc() +AgentsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/agents_route_list_request_sort_by.py b/sdks/python/julep/api/types/agents_route_list_request_sort_by.py index 80373a1cd..88dcc2fcf 100644 --- a/sdks/python/julep/api/types/agents_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/agents_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class AgentsRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is AgentsRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is AgentsRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is AgentsRouteListRequestSortBy.DELETED_AT: - return deleted_at() +AgentsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/agents_route_list_response.py b/sdks/python/julep/api/types/agents_route_list_response.py index 1e008fd66..98362162e 100644 --- a/sdks/python/julep/api/types/agents_route_list_response.py +++ b/sdks/python/julep/api/types/agents_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .agents_agent import AgentsAgent -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class AgentsRouteListResponse(pydantic.BaseModel): +class AgentsRouteListResponse(pydantic_v1.BaseModel): results: typing.List[AgentsAgent] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_patch_response.py b/sdks/python/julep/api/types/agents_route_patch_response.py index f67b8a7a0..58788fe66 100644 --- a/sdks/python/julep/api/types/agents_route_patch_response.py +++ b/sdks/python/julep/api/types/agents_route_patch_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class AgentsRoutePatchResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class AgentsRoutePatchResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_update_response.py b/sdks/python/julep/api/types/agents_route_update_response.py index f110e1504..5ad80c1fc 100644 --- a/sdks/python/julep/api/types/agents_route_update_response.py +++ b/sdks/python/julep/api/types/agents_route_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class AgentsRouteUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class AgentsRouteUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py index 25fb2d882..dc6ff15ab 100644 --- a/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py +++ b/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py @@ -2,7 +2,6 @@ import typing -from .chat_generation_preset import ChatGenerationPreset from .chat_generation_preset_settings import ChatGenerationPresetSettings from .chat_open_ai_settings import ChatOpenAiSettings from .chat_v_llm_settings import ChatVLlmSettings diff --git a/sdks/python/julep/api/types/chat_completion_response_format.py b/sdks/python/julep/api/types/chat_completion_response_format.py index 0143fa265..0a7af6bfa 100644 --- a/sdks/python/julep/api/types/chat_completion_response_format.py +++ b/sdks/python/julep/api/types/chat_completion_response_format.py @@ -4,18 +4,15 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .chat_completion_response_format_type import ChatCompletionResponseFormatType -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ChatCompletionResponseFormat(pydantic.BaseModel): - type: ChatCompletionResponseFormatType = pydantic.Field( - description="The format of the response" - ) +class ChatCompletionResponseFormat(pydantic_v1.BaseModel): + type: ChatCompletionResponseFormatType = pydantic_v1.Field() + """ + The format of the response + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -26,14 +23,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_completion_response_format_type.py b/sdks/python/julep/api/types/chat_completion_response_format_type.py index 1c461620e..dd40a4842 100644 --- a/sdks/python/julep/api/types/chat_completion_response_format_type.py +++ b/sdks/python/julep/api/types/chat_completion_response_format_type.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class ChatCompletionResponseFormatType(str, enum.Enum): - """ - The format of the response - """ - - TEXT = "text" - JSON_OBJECT = "json_object" - - def visit( - self, - text: typing.Callable[[], T_Result], - json_object: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ChatCompletionResponseFormatType.TEXT: - return text() - if self is ChatCompletionResponseFormatType.JSON_OBJECT: - return json_object() +ChatCompletionResponseFormatType = typing.Union[ + typing.Literal["text", "json_object"], typing.Any +] diff --git a/sdks/python/julep/api/types/chat_generation_preset.py b/sdks/python/julep/api/types/chat_generation_preset.py index 7e644ee3c..fcf1a3a1b 100644 --- a/sdks/python/julep/api/types/chat_generation_preset.py +++ b/sdks/python/julep/api/types/chat_generation_preset.py @@ -1,53 +1,18 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class ChatGenerationPreset(str, enum.Enum): - """ - Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - """ - - PROBLEM_SOLVING = "problem_solving" - CONVERSATIONAL = "conversational" - FUN = "fun" - PROSE = "prose" - CREATIVE = "creative" - BUSINESS = "business" - DETERMINISTIC = "deterministic" - CODE = "code" - MULTILINGUAL = "multilingual" - - def visit( - self, - problem_solving: typing.Callable[[], T_Result], - conversational: typing.Callable[[], T_Result], - fun: typing.Callable[[], T_Result], - prose: typing.Callable[[], T_Result], - creative: typing.Callable[[], T_Result], - business: typing.Callable[[], T_Result], - deterministic: typing.Callable[[], T_Result], - code: typing.Callable[[], T_Result], - multilingual: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ChatGenerationPreset.PROBLEM_SOLVING: - return problem_solving() - if self is ChatGenerationPreset.CONVERSATIONAL: - return conversational() - if self is ChatGenerationPreset.FUN: - return fun() - if self is ChatGenerationPreset.PROSE: - return prose() - if self is ChatGenerationPreset.CREATIVE: - return creative() - if self is ChatGenerationPreset.BUSINESS: - return business() - if self is ChatGenerationPreset.DETERMINISTIC: - return deterministic() - if self is ChatGenerationPreset.CODE: - return code() - if self is ChatGenerationPreset.MULTILINGUAL: - return multilingual() +ChatGenerationPreset = typing.Union[ + typing.Literal[ + "problem_solving", + "conversational", + "fun", + "prose", + "creative", + "business", + "deterministic", + "code", + "multilingual", + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/chat_generation_preset_settings.py b/sdks/python/julep/api/types/chat_generation_preset_settings.py index 48cdadaba..7ce09ceff 100644 --- a/sdks/python/julep/api/types/chat_generation_preset_settings.py +++ b/sdks/python/julep/api/types/chat_generation_preset_settings.py @@ -4,18 +4,15 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .chat_generation_preset import ChatGenerationPreset -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ChatGenerationPresetSettings(pydantic.BaseModel): - preset: typing.Optional[ChatGenerationPreset] = pydantic.Field( - description="Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)" - ) +class ChatGenerationPresetSettings(pydantic_v1.BaseModel): + preset: typing.Optional[ChatGenerationPreset] = pydantic_v1.Field(default=None) + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -26,14 +23,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_open_ai_settings.py b/sdks/python/julep/api/types/chat_open_ai_settings.py index ff9fe786e..0bb5a0799 100644 --- a/sdks/python/julep/api/types/chat_open_ai_settings.py +++ b/sdks/python/julep/api/types/chat_open_ai_settings.py @@ -4,26 +4,29 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ChatOpenAiSettings(pydantic.BaseModel): - frequency_penalty: typing.Optional[float] = pydantic.Field( - description="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." - ) - presence_penalty: typing.Optional[float] = pydantic.Field( - description="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." - ) - temperature: typing.Optional[float] = pydantic.Field( - description="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] = pydantic.Field( - description="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." - ) + +class ChatOpenAiSettings(pydantic_v1.BaseModel): + frequency_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + presence_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -34,14 +37,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_v_llm_settings.py b/sdks/python/julep/api/types/chat_v_llm_settings.py index bf984695f..897c25b2f 100644 --- a/sdks/python/julep/api/types/chat_v_llm_settings.py +++ b/sdks/python/julep/api/types/chat_v_llm_settings.py @@ -4,29 +4,34 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ChatVLlmSettings(pydantic.BaseModel): - repetition_penalty: typing.Optional[float] = pydantic.Field( - description="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." - ) - length_penalty: typing.Optional[float] = pydantic.Field( - description="Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated." - ) - temperature: typing.Optional[float] = pydantic.Field( - description="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] = pydantic.Field( - description="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." - ) - min_p: typing.Optional[float] = pydantic.Field( - description="Minimum probability compared to leading token to be considered" - ) + +class ChatVLlmSettings(pydantic_v1.BaseModel): + repetition_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + length_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ + + min_p: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Minimum probability compared to leading token to be considered + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -37,14 +42,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_doc.py b/sdks/python/julep/api/types/docs_doc.py index a66bba71f..f29464941 100644 --- a/sdks/python/julep/api/types/docs_doc.py +++ b/sdks/python/julep/api/types/docs_doc.py @@ -4,26 +4,29 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_uuid import CommonUuid from .docs_doc_content import DocsDocContent -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class DocsDoc(pydantic.BaseModel): +class DocsDoc(pydantic_v1.BaseModel): id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - title: CommonIdentifierSafeUnicode = pydantic.Field( - description="Title describing what this document contains" - ) - content: DocsDocContent = pydantic.Field(description="Contents of the document") + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + title: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Title describing what this document contains + """ + + content: DocsDocContent = pydantic_v1.Field() + """ + Contents of the document + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -34,14 +37,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_doc_owner.py b/sdks/python/julep/api/types/docs_doc_owner.py index a8766900f..dd497928b 100644 --- a/sdks/python/julep/api/types/docs_doc_owner.py +++ b/sdks/python/julep/api/types/docs_doc_owner.py @@ -4,16 +4,12 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid from .docs_doc_owner_role import DocsDocOwnerRole -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class DocsDocOwner(pydantic.BaseModel): +class DocsDocOwner(pydantic_v1.BaseModel): id: CommonUuid role: DocsDocOwnerRole @@ -26,14 +22,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_doc_owner_role.py b/sdks/python/julep/api/types/docs_doc_owner_role.py index f9c6b55c6..c5aa7a541 100644 --- a/sdks/python/julep/api/types/docs_doc_owner_role.py +++ b/sdks/python/julep/api/types/docs_doc_owner_role.py @@ -1,19 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class DocsDocOwnerRole(str, enum.Enum): - USER = "user" - AGENT = "agent" - - def visit( - self, user: typing.Callable[[], T_Result], agent: typing.Callable[[], T_Result] - ) -> T_Result: - if self is DocsDocOwnerRole.USER: - return user() - if self is DocsDocOwnerRole.AGENT: - return agent() +DocsDocOwnerRole = typing.Union[typing.Literal["user", "agent"], typing.Any] diff --git a/sdks/python/julep/api/types/docs_doc_reference.py b/sdks/python/julep/api/types/docs_doc_reference.py index 3ea189cd5..6d7ddb9c7 100644 --- a/sdks/python/julep/api/types/docs_doc_reference.py +++ b/sdks/python/julep/api/types/docs_doc_reference.py @@ -4,23 +4,29 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid from .docs_doc_owner import DocsDocOwner -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class DocsDocReference(pydantic_v1.BaseModel): + owner: DocsDocOwner = pydantic_v1.Field() + """ + The owner of this document. + """ -class DocsDocReference(pydantic.BaseModel): - owner: DocsDocOwner = pydantic.Field(description="The owner of this document.") - id: CommonUuid = pydantic.Field(description="ID of the document") - snippet_index: typing.List[int] = pydantic.Field( - description="Snippets referred to of the document" - ) - title: typing.Optional[str] - snippet: typing.Optional[str] + id: CommonUuid = pydantic_v1.Field() + """ + ID of the document + """ + + snippet_index: typing.List[int] = pydantic_v1.Field() + """ + Snippets referred to of the document + """ + + title: typing.Optional[str] = None + snippet: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -31,14 +37,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_doc_search_request.py b/sdks/python/julep/api/types/docs_doc_search_request.py index 72ae36c4c..6b6ef5b85 100644 --- a/sdks/python/julep/api/types/docs_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_doc_search_request.py @@ -5,34 +5,38 @@ import datetime as dt import typing -import typing_extensions - from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_doc_search_request_text import DocsDocSearchRequestText from .docs_doc_search_request_vector import DocsDocSearchRequestVector -from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest -from .docs_text_only_doc_search_request import DocsTextOnlyDocSearchRequest -from .docs_vector_doc_search_request import DocsVectorDocSearchRequest - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Base(pydantic.BaseModel): - text: typing.Optional[DocsDocSearchRequestText] - vector: typing.Optional[DocsDocSearchRequestVector] - confidence: float = pydantic.Field(description="The confidence cutoff level") - alpha: float = pydantic.Field( - description="The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector;" - ) - mmr: bool = pydantic.Field( - description="Whether to include the MMR algorithm in the search. Optimizes for diversity in search results." - ) - lang: typing_extensions.Literal["en-US"] = pydantic.Field( - description="The language to be used for text-only search. Support for other languages coming soon." - ) +from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText +from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector +from .docs_text_only_doc_search_request_text import DocsTextOnlyDocSearchRequestText +from .docs_vector_doc_search_request_vector import DocsVectorDocSearchRequestVector + + +class Base(pydantic_v1.BaseModel): + text: typing.Optional[DocsDocSearchRequestText] = None + vector: typing.Optional[DocsDocSearchRequestVector] = None + confidence: float = pydantic_v1.Field() + """ + The confidence cutoff level + """ + + alpha: float = pydantic_v1.Field() + """ + The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + """ + + mmr: bool = pydantic_v1.Field() + """ + Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. + """ + + lang: typing.Literal["en-US"] = pydantic_v1.Field(default="en-US") + """ + The language to be used for text-only search. Support for other languages coming soon. + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -43,44 +47,142 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} -class DocsDocSearchRequest_Vector(DocsVectorDocSearchRequest, Base): - mode: typing_extensions.Literal["vector"] +class DocsDocSearchRequest_Vector(Base): + vector: DocsVectorDocSearchRequestVector + mode: typing.Literal["vector"] = "vector" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} -class DocsDocSearchRequest_Text(DocsTextOnlyDocSearchRequest, Base): - mode: typing_extensions.Literal["text"] +class DocsDocSearchRequest_Text(Base): + text: DocsTextOnlyDocSearchRequestText + mode: typing.Literal["text"] = "text" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} -class DocsDocSearchRequest_Hybrid(DocsHybridDocSearchRequest, Base): - mode: typing_extensions.Literal["hybrid"] +class DocsDocSearchRequest_Hybrid(Base): + text: typing.Optional[DocsHybridDocSearchRequestText] = None + vector: typing.Optional[DocsHybridDocSearchRequestVector] = None + mode: typing.Literal["hybrid"] = "hybrid" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} DocsDocSearchRequest = typing.Union[ diff --git a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py index e5ef4d895..5413e101b 100644 --- a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class DocsHybridDocSearchRequest(pydantic.BaseModel): - text: typing.Optional[DocsHybridDocSearchRequestText] = pydantic.Field( - description="Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required." +class DocsHybridDocSearchRequest(pydantic_v1.BaseModel): + text: typing.Optional[DocsHybridDocSearchRequestText] = pydantic_v1.Field( + default=None ) - vector: typing.Optional[DocsHybridDocSearchRequestVector] = pydantic.Field( - description="Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown." + """ + Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. + """ + + vector: typing.Optional[DocsHybridDocSearchRequestVector] = pydantic_v1.Field( + default=None ) + """ + Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_text_only_doc_search_request.py b/sdks/python/julep/api/types/docs_text_only_doc_search_request.py index 2b881449f..d22329b16 100644 --- a/sdks/python/julep/api/types/docs_text_only_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_text_only_doc_search_request.py @@ -4,18 +4,15 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_text_only_doc_search_request_text import DocsTextOnlyDocSearchRequestText -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class DocsTextOnlyDocSearchRequest(pydantic.BaseModel): - text: DocsTextOnlyDocSearchRequestText = pydantic.Field( - description="Text or texts to use in the search. In `text` search mode, only BM25 is used." - ) +class DocsTextOnlyDocSearchRequest(pydantic_v1.BaseModel): + text: DocsTextOnlyDocSearchRequestText = pydantic_v1.Field() + """ + Text or texts to use in the search. In `text` search mode, only BM25 is used. + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -26,14 +23,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_vector_doc_search_request.py b/sdks/python/julep/api/types/docs_vector_doc_search_request.py index 9a05db11f..428b223c3 100644 --- a/sdks/python/julep/api/types/docs_vector_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_vector_doc_search_request.py @@ -4,18 +4,15 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_vector_doc_search_request_vector import DocsVectorDocSearchRequestVector -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class DocsVectorDocSearchRequest(pydantic.BaseModel): - vector: DocsVectorDocSearchRequestVector = pydantic.Field( - description="Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown." - ) +class DocsVectorDocSearchRequest(pydantic_v1.BaseModel): + vector: DocsVectorDocSearchRequestVector = pydantic_v1.Field() + """ + Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -26,14 +23,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py b/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py index d6d025200..26ab046d0 100644 --- a/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py +++ b/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py @@ -5,22 +5,15 @@ import datetime as dt import typing -import typing_extensions - from ..core.datetime_utils import serialize_datetime -from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .entries_image_detail import EntriesImageDetail from .entries_image_url import EntriesImageUrl -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class Base(pydantic.BaseModel): - text: typing.Optional[str] - image_url: typing.Optional[EntriesImageUrl] +class Base(pydantic_v1.BaseModel): + text: typing.Optional[str] = None + image_url: typing.Optional[EntriesImageUrl] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -31,26 +24,65 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} -class EntriesBaseChatMlContentPart_ImageUrl(EntriesChatMlImageContentPart, Base): - type: typing_extensions.Literal["image_url"] +class EntriesBaseChatMlContentPart_ImageUrl(Base): + image_url: EntriesImageUrl + type: typing.Literal["image_url"] = "image_url" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} -EntriesBaseChatMlContentPart = typing.Union[EntriesBaseChatMlContentPart_ImageUrl] +EntriesBaseChatMlContentPart = EntriesBaseChatMlContentPart_ImageUrl diff --git a/sdks/python/julep/api/types/entries_chat_ml_image_content_part.py b/sdks/python/julep/api/types/entries_chat_ml_image_content_part.py index e12d1a534..716fd31a7 100644 --- a/sdks/python/julep/api/types/entries_chat_ml_image_content_part.py +++ b/sdks/python/julep/api/types/entries_chat_ml_image_content_part.py @@ -4,16 +4,15 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .entries_image_url import EntriesImageUrl -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class EntriesChatMlImageContentPart(pydantic.BaseModel): - image_url: EntriesImageUrl = pydantic.Field(description="The image URL") +class EntriesChatMlImageContentPart(pydantic_v1.BaseModel): + image_url: EntriesImageUrl = pydantic_v1.Field() + """ + The image URL + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -24,14 +23,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_chat_ml_role.py b/sdks/python/julep/api/types/entries_chat_ml_role.py index 215fc8ddd..9c61bb75a 100644 --- a/sdks/python/julep/api/types/entries_chat_ml_role.py +++ b/sdks/python/julep/api/types/entries_chat_ml_role.py @@ -1,45 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class EntriesChatMlRole(str, enum.Enum): - """ - ChatML role (system|assistant|user|function_call|function|function_response|auto) - """ - - USER = "user" - AGENT = "agent" - SYSTEM = "system" - FUNCTION = "function" - FUNCTION_RESPONSE = "function_response" - FUNCTION_CALL = "function_call" - AUTO = "auto" - - def visit( - self, - user: typing.Callable[[], T_Result], - agent: typing.Callable[[], T_Result], - system: typing.Callable[[], T_Result], - function: typing.Callable[[], T_Result], - function_response: typing.Callable[[], T_Result], - function_call: typing.Callable[[], T_Result], - auto: typing.Callable[[], T_Result], - ) -> T_Result: - if self is EntriesChatMlRole.USER: - return user() - if self is EntriesChatMlRole.AGENT: - return agent() - if self is EntriesChatMlRole.SYSTEM: - return system() - if self is EntriesChatMlRole.FUNCTION: - return function() - if self is EntriesChatMlRole.FUNCTION_RESPONSE: - return function_response() - if self is EntriesChatMlRole.FUNCTION_CALL: - return function_call() - if self is EntriesChatMlRole.AUTO: - return auto() +EntriesChatMlRole = typing.Union[ + typing.Literal[ + "user", + "agent", + "system", + "function", + "function_response", + "function_call", + "auto", + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/entries_chat_ml_text_content_part.py b/sdks/python/julep/api/types/entries_chat_ml_text_content_part.py index fc0ef695b..08b6236e0 100644 --- a/sdks/python/julep/api/types/entries_chat_ml_text_content_part.py +++ b/sdks/python/julep/api/types/entries_chat_ml_text_content_part.py @@ -4,14 +4,10 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class EntriesChatMlTextContentPart(pydantic.BaseModel): +class EntriesChatMlTextContentPart(pydantic_v1.BaseModel): text: str def json(self, **kwargs: typing.Any) -> str: @@ -23,14 +19,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_entry.py b/sdks/python/julep/api/types/entries_entry.py index f30ee9c2b..c76038a11 100644 --- a/sdks/python/julep/api/types/entries_entry.py +++ b/sdks/python/julep/api/types/entries_entry.py @@ -4,28 +4,28 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid from .entries_chat_ml_role import EntriesChatMlRole from .entries_entry_content import EntriesEntryContent from .entries_entry_source import EntriesEntrySource -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class EntriesEntry(pydantic.BaseModel): +class EntriesEntry(pydantic_v1.BaseModel): role: EntriesChatMlRole - name: typing.Optional[str] + name: typing.Optional[str] = None content: EntriesEntryContent source: EntriesEntrySource - timestamp: int = pydantic.Field( - description="This is the time that this event refers to." - ) - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) + timestamp: int = pydantic_v1.Field() + """ + This is the time that this event refers to. + """ + + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + id: CommonUuid def json(self, **kwargs: typing.Any) -> str: @@ -37,14 +37,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_entry_content.py b/sdks/python/julep/api/types/entries_entry_content.py index 318a0fff6..8f33f71ee 100644 --- a/sdks/python/julep/api/types/entries_entry_content.py +++ b/sdks/python/julep/api/types/entries_entry_content.py @@ -2,20 +2,8 @@ import typing -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid -from .common_valid_python_identifier import CommonValidPythonIdentifier -from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart -from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart from .entries_entry_content_item import EntriesEntryContentItem -from .entries_entry_content_item_item import EntriesEntryContentItemItem -from .entries_image_detail import EntriesImageDetail -from .entries_image_url import EntriesImageUrl -from .tools_chosen_function_call import ToolsChosenFunctionCall from .tools_chosen_tool_call import ToolsChosenToolCall -from .tools_function_call_option import ToolsFunctionCallOption -from .tools_function_def import ToolsFunctionDef -from .tools_function_tool import ToolsFunctionTool from .tools_tool import ToolsTool from .tools_tool_response import ToolsToolResponse diff --git a/sdks/python/julep/api/types/entries_entry_content_item.py b/sdks/python/julep/api/types/entries_entry_content_item.py index 91aed2fca..2d4adf723 100644 --- a/sdks/python/julep/api/types/entries_entry_content_item.py +++ b/sdks/python/julep/api/types/entries_entry_content_item.py @@ -2,19 +2,8 @@ import typing -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid -from .common_valid_python_identifier import CommonValidPythonIdentifier -from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart -from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart from .entries_entry_content_item_item import EntriesEntryContentItemItem -from .entries_image_detail import EntriesImageDetail -from .entries_image_url import EntriesImageUrl -from .tools_chosen_function_call import ToolsChosenFunctionCall from .tools_chosen_tool_call import ToolsChosenToolCall -from .tools_function_call_option import ToolsFunctionCallOption -from .tools_function_def import ToolsFunctionDef -from .tools_function_tool import ToolsFunctionTool from .tools_tool import ToolsTool from .tools_tool_response import ToolsToolResponse diff --git a/sdks/python/julep/api/types/entries_entry_content_item_item.py b/sdks/python/julep/api/types/entries_entry_content_item_item.py index 8318dc29c..609757926 100644 --- a/sdks/python/julep/api/types/entries_entry_content_item_item.py +++ b/sdks/python/julep/api/types/entries_entry_content_item_item.py @@ -2,30 +2,84 @@ from __future__ import annotations +import datetime as dt import typing -import typing_extensions +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .entries_image_url import EntriesImageUrl -from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart -from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart +class EntriesEntryContentItemItem_Text(pydantic_v1.BaseModel): + text: str + type: typing.Literal["text"] = "text" -class EntriesEntryContentItemItem_Text(EntriesChatMlTextContentPart): - type: typing_extensions.Literal["text"] + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class EntriesEntryContentItemItem_ImageUrl(pydantic_v1.BaseModel): + image_url: EntriesImageUrl + type: typing.Literal["image_url"] = "image_url" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class EntriesEntryContentItemItem_ImageUrl(EntriesChatMlImageContentPart): - type: typing_extensions.Literal["image_url"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} EntriesEntryContentItemItem = typing.Union[ diff --git a/sdks/python/julep/api/types/entries_entry_source.py b/sdks/python/julep/api/types/entries_entry_source.py index c1af48448..134e34fd7 100644 --- a/sdks/python/julep/api/types/entries_entry_source.py +++ b/sdks/python/julep/api/types/entries_entry_source.py @@ -1,37 +1,10 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class EntriesEntrySource(str, enum.Enum): - API_REQUEST = "api_request" - API_RESPONSE = "api_response" - TOOL_RESPONSE = "tool_response" - INTERNAL = "internal" - SUMMARIZER = "summarizer" - META = "meta" - - def visit( - self, - api_request: typing.Callable[[], T_Result], - api_response: typing.Callable[[], T_Result], - tool_response: typing.Callable[[], T_Result], - internal: typing.Callable[[], T_Result], - summarizer: typing.Callable[[], T_Result], - meta: typing.Callable[[], T_Result], - ) -> T_Result: - if self is EntriesEntrySource.API_REQUEST: - return api_request() - if self is EntriesEntrySource.API_RESPONSE: - return api_response() - if self is EntriesEntrySource.TOOL_RESPONSE: - return tool_response() - if self is EntriesEntrySource.INTERNAL: - return internal() - if self is EntriesEntrySource.SUMMARIZER: - return summarizer() - if self is EntriesEntrySource.META: - return meta() +EntriesEntrySource = typing.Union[ + typing.Literal[ + "api_request", "api_response", "tool_response", "internal", "summarizer", "meta" + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/entries_history.py b/sdks/python/julep/api/types/entries_history.py index b67c572f7..d3d124ffe 100644 --- a/sdks/python/julep/api/types/entries_history.py +++ b/sdks/python/julep/api/types/entries_history.py @@ -4,23 +4,20 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid from .entries_entry import EntriesEntry from .entries_relation import EntriesRelation -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class EntriesHistory(pydantic.BaseModel): +class EntriesHistory(pydantic_v1.BaseModel): entries: typing.List[EntriesEntry] relations: typing.List[EntriesRelation] session_id: CommonUuid - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -31,14 +28,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_image_detail.py b/sdks/python/julep/api/types/entries_image_detail.py index 3ebc73cb7..f36a03596 100644 --- a/sdks/python/julep/api/types/entries_image_detail.py +++ b/sdks/python/julep/api/types/entries_image_detail.py @@ -1,29 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class EntriesImageDetail(str, enum.Enum): - """ - Image detail level - """ - - LOW = "low" - HIGH = "high" - AUTO = "auto" - - def visit( - self, - low: typing.Callable[[], T_Result], - high: typing.Callable[[], T_Result], - auto: typing.Callable[[], T_Result], - ) -> T_Result: - if self is EntriesImageDetail.LOW: - return low() - if self is EntriesImageDetail.HIGH: - return high() - if self is EntriesImageDetail.AUTO: - return auto() +EntriesImageDetail = typing.Union[typing.Literal["low", "high", "auto"], typing.Any] diff --git a/sdks/python/julep/api/types/entries_image_url.py b/sdks/python/julep/api/types/entries_image_url.py index bbc1b26fe..c0d32a9c1 100644 --- a/sdks/python/julep/api/types/entries_image_url.py +++ b/sdks/python/julep/api/types/entries_image_url.py @@ -4,21 +4,20 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .entries_image_detail import EntriesImageDetail -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class EntriesImageUrl(pydantic_v1.BaseModel): + url: str = pydantic_v1.Field() + """ + Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + """ -class EntriesImageUrl(pydantic.BaseModel): - url: str = pydantic.Field( - description="Image URL or base64 data url (e.g. `data:image/jpeg;base64,`)" - ) - detail: EntriesImageDetail = pydantic.Field( - description="The detail level of the image" - ) + detail: EntriesImageDetail = pydantic_v1.Field() + """ + The detail level of the image + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -29,14 +28,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_input_chat_ml_message.py b/sdks/python/julep/api/types/entries_input_chat_ml_message.py index de6c7edb9..b1ce4c8f9 100644 --- a/sdks/python/julep/api/types/entries_input_chat_ml_message.py +++ b/sdks/python/julep/api/types/entries_input_chat_ml_message.py @@ -4,25 +4,31 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .entries_chat_ml_role import EntriesChatMlRole from .entries_input_chat_ml_message_content import EntriesInputChatMlMessageContent -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class EntriesInputChatMlMessage(pydantic_v1.BaseModel): + role: EntriesChatMlRole = pydantic_v1.Field() + """ + The role of the message + """ -class EntriesInputChatMlMessage(pydantic.BaseModel): - role: EntriesChatMlRole = pydantic.Field(description="The role of the message") - content: EntriesInputChatMlMessageContent = pydantic.Field( - description="The content parts of the message" - ) - name: typing.Optional[str] = pydantic.Field(description="Name") - continue_: typing.Optional[bool] = pydantic.Field( - alias="continue", - description="Whether to continue this message or return a new one", - ) + content: EntriesInputChatMlMessageContent = pydantic_v1.Field() + """ + The content parts of the message + """ + + name: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Name + """ + + continue_: typing.Optional[bool] = pydantic_v1.Field(alias="continue", default=None) + """ + Whether to continue this message or return a new one + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -33,15 +39,26 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_input_chat_ml_message_content.py b/sdks/python/julep/api/types/entries_input_chat_ml_message_content.py index bdc8aa0e8..55b5324ea 100644 --- a/sdks/python/julep/api/types/entries_input_chat_ml_message_content.py +++ b/sdks/python/julep/api/types/entries_input_chat_ml_message_content.py @@ -2,10 +2,6 @@ import typing -from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart -from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart -from .entries_image_detail import EntriesImageDetail -from .entries_image_url import EntriesImageUrl from .entries_input_chat_ml_message_content_item import ( EntriesInputChatMlMessageContentItem, ) diff --git a/sdks/python/julep/api/types/entries_input_chat_ml_message_content_item.py b/sdks/python/julep/api/types/entries_input_chat_ml_message_content_item.py index f7c1db687..35a559036 100644 --- a/sdks/python/julep/api/types/entries_input_chat_ml_message_content_item.py +++ b/sdks/python/julep/api/types/entries_input_chat_ml_message_content_item.py @@ -2,30 +2,84 @@ from __future__ import annotations +import datetime as dt import typing -import typing_extensions +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .entries_image_url import EntriesImageUrl -from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart -from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart +class EntriesInputChatMlMessageContentItem_Text(pydantic_v1.BaseModel): + text: str + type: typing.Literal["text"] = "text" -class EntriesInputChatMlMessageContentItem_Text(EntriesChatMlTextContentPart): - type: typing_extensions.Literal["text"] + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class EntriesInputChatMlMessageContentItem_ImageUrl(pydantic_v1.BaseModel): + image_url: EntriesImageUrl + type: typing.Literal["image_url"] = "image_url" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class EntriesInputChatMlMessageContentItem_ImageUrl(EntriesChatMlImageContentPart): - type: typing_extensions.Literal["image_url"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} EntriesInputChatMlMessageContentItem = typing.Union[ diff --git a/sdks/python/julep/api/types/entries_relation.py b/sdks/python/julep/api/types/entries_relation.py index ea520eb6e..127ee3345 100644 --- a/sdks/python/julep/api/types/entries_relation.py +++ b/sdks/python/julep/api/types/entries_relation.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class EntriesRelation(pydantic.BaseModel): +class EntriesRelation(pydantic_v1.BaseModel): head: CommonUuid relation: str tail: CommonUuid @@ -26,14 +22,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py b/sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py index 0ae70bf0a..4fbd37a42 100644 --- a/sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py +++ b/sdks/python/julep/api/types/execution_transitions_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class ExecutionTransitionsRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is ExecutionTransitionsRouteListRequestDirection.ASC: - return asc() - if self is ExecutionTransitionsRouteListRequestDirection.DESC: - return desc() +ExecutionTransitionsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py b/sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py index a4f0227dc..ee56f1700 100644 --- a/sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/execution_transitions_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class ExecutionTransitionsRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ExecutionTransitionsRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is ExecutionTransitionsRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is ExecutionTransitionsRouteListRequestSortBy.DELETED_AT: - return deleted_at() +ExecutionTransitionsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/execution_transitions_route_list_response.py b/sdks/python/julep/api/types/execution_transitions_route_list_response.py index 16b314ed0..2f7c2a235 100644 --- a/sdks/python/julep/api/types/execution_transitions_route_list_response.py +++ b/sdks/python/julep/api/types/execution_transitions_route_list_response.py @@ -4,17 +4,13 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .execution_transitions_route_list_response_results_item import ( ExecutionTransitionsRouteListResponseResultsItem, ) -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ExecutionTransitionsRouteListResponse(pydantic.BaseModel): +class ExecutionTransitionsRouteListResponse(pydantic_v1.BaseModel): results: typing.List[ExecutionTransitionsRouteListResponseResultsItem] def json(self, **kwargs: typing.Any) -> str: @@ -26,14 +22,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py b/sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py index 14a06247d..67f6c028c 100644 --- a/sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py +++ b/sdks/python/julep/api/types/execution_transitions_route_list_response_results_item.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .executions_transition import ExecutionsTransition -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ExecutionTransitionsRouteListResponseResultsItem(pydantic.BaseModel): +class ExecutionTransitionsRouteListResponseResultsItem(pydantic_v1.BaseModel): transitions: typing.List[ExecutionsTransition] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_execution.py b/sdks/python/julep/api/types/executions_execution.py index 5ec778e2a..975a78e0a 100644 --- a/sdks/python/julep/api/types/executions_execution.py +++ b/sdks/python/julep/api/types/executions_execution.py @@ -4,31 +4,37 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid from .executions_execution_status import ExecutionsExecutionStatus -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class ExecutionsExecution(pydantic.BaseModel): - task_id: CommonUuid = pydantic.Field( - description="The ID of the task that the execution is running" - ) - status: ExecutionsExecutionStatus = pydantic.Field( - description="The status of the execution" - ) - input: typing.Dict[str, typing.Any] = pydantic.Field( - description="The input to the execution" - ) - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) + +class ExecutionsExecution(pydantic_v1.BaseModel): + task_id: CommonUuid = pydantic_v1.Field() + """ + The ID of the task that the execution is running + """ + + status: ExecutionsExecutionStatus = pydantic_v1.Field() + """ + The status of the execution + """ + + input: typing.Dict[str, typing.Any] = pydantic_v1.Field() + """ + The input to the execution + """ + + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + id: CommonUuid def json(self, **kwargs: typing.Any) -> str: @@ -40,14 +46,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_execution_status.py b/sdks/python/julep/api/types/executions_execution_status.py index 841464f6c..f224fb947 100644 --- a/sdks/python/julep/api/types/executions_execution_status.py +++ b/sdks/python/julep/api/types/executions_execution_status.py @@ -1,45 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class ExecutionsExecutionStatus(str, enum.Enum): - """ - The status of the execution - """ - - QUEUED = "queued" - STARTING = "starting" - RUNNING = "running" - AWAITING_INPUT = "awaiting_input" - SUCCEEDED = "succeeded" - FAILED = "failed" - CANCELLED = "cancelled" - - def visit( - self, - queued: typing.Callable[[], T_Result], - starting: typing.Callable[[], T_Result], - running: typing.Callable[[], T_Result], - awaiting_input: typing.Callable[[], T_Result], - succeeded: typing.Callable[[], T_Result], - failed: typing.Callable[[], T_Result], - cancelled: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ExecutionsExecutionStatus.QUEUED: - return queued() - if self is ExecutionsExecutionStatus.STARTING: - return starting() - if self is ExecutionsExecutionStatus.RUNNING: - return running() - if self is ExecutionsExecutionStatus.AWAITING_INPUT: - return awaiting_input() - if self is ExecutionsExecutionStatus.SUCCEEDED: - return succeeded() - if self is ExecutionsExecutionStatus.FAILED: - return failed() - if self is ExecutionsExecutionStatus.CANCELLED: - return cancelled() +ExecutionsExecutionStatus = typing.Union[ + typing.Literal[ + "queued", + "starting", + "running", + "awaiting_input", + "succeeded", + "failed", + "cancelled", + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/executions_resume_execution_request.py b/sdks/python/julep/api/types/executions_resume_execution_request.py index 3fe258b34..6de703e4e 100644 --- a/sdks/python/julep/api/types/executions_resume_execution_request.py +++ b/sdks/python/julep/api/types/executions_resume_execution_request.py @@ -4,17 +4,16 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ExecutionsResumeExecutionRequest(pydantic.BaseModel): - input: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="The input to resume the execution with" +class ExecutionsResumeExecutionRequest(pydantic_v1.BaseModel): + input: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + default=None ) + """ + The input to resume the execution with + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -25,14 +24,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_route_update_response.py b/sdks/python/julep/api/types/executions_route_update_response.py index 9dd6369c4..acc4a0cd1 100644 --- a/sdks/python/julep/api/types/executions_route_update_response.py +++ b/sdks/python/julep/api/types/executions_route_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class ExecutionsRouteUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class ExecutionsRouteUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_stop_execution_request.py b/sdks/python/julep/api/types/executions_stop_execution_request.py index 15a954901..5cff7da0a 100644 --- a/sdks/python/julep/api/types/executions_stop_execution_request.py +++ b/sdks/python/julep/api/types/executions_stop_execution_request.py @@ -4,17 +4,14 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ExecutionsStopExecutionRequest(pydantic.BaseModel): - reason: typing.Optional[str] = pydantic.Field( - description="The reason for stopping the execution" - ) +class ExecutionsStopExecutionRequest(pydantic_v1.BaseModel): + reason: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + The reason for stopping the execution + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -25,14 +22,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_transition.py b/sdks/python/julep/api/types/executions_transition.py index ef40ec138..229d5e7e2 100644 --- a/sdks/python/julep/api/types/executions_transition.py +++ b/sdks/python/julep/api/types/executions_transition.py @@ -4,28 +4,27 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid from .executions_transition_type import ExecutionsTransitionType -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ExecutionsTransition(pydantic.BaseModel): +class ExecutionsTransition(pydantic_v1.BaseModel): type: ExecutionsTransitionType execution_id: CommonUuid outputs: typing.Dict[str, typing.Any] current: typing.List[typing.Any] - next: typing.Optional[typing.List[typing.Any]] + next: typing.Optional[typing.List[typing.Any]] = None id: CommonUuid - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -36,14 +35,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/executions_transition_type.py b/sdks/python/julep/api/types/executions_transition_type.py index e5b59ecc0..380895d0c 100644 --- a/sdks/python/julep/api/types/executions_transition_type.py +++ b/sdks/python/julep/api/types/executions_transition_type.py @@ -1,33 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class ExecutionsTransitionType(str, enum.Enum): - FINISH = "finish" - WAIT = "wait" - ERROR = "error" - STEP = "step" - CANCELLED = "cancelled" - - def visit( - self, - finish: typing.Callable[[], T_Result], - wait: typing.Callable[[], T_Result], - error: typing.Callable[[], T_Result], - step: typing.Callable[[], T_Result], - cancelled: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ExecutionsTransitionType.FINISH: - return finish() - if self is ExecutionsTransitionType.WAIT: - return wait() - if self is ExecutionsTransitionType.ERROR: - return error() - if self is ExecutionsTransitionType.STEP: - return step() - if self is ExecutionsTransitionType.CANCELLED: - return cancelled() +ExecutionsTransitionType = typing.Union[ + typing.Literal["finish", "wait", "error", "step", "cancelled"], typing.Any +] diff --git a/sdks/python/julep/api/types/executions_update_execution_request.py b/sdks/python/julep/api/types/executions_update_execution_request.py index 424b74405..71422bb65 100644 --- a/sdks/python/julep/api/types/executions_update_execution_request.py +++ b/sdks/python/julep/api/types/executions_update_execution_request.py @@ -2,30 +2,83 @@ from __future__ import annotations +import datetime as dt import typing -import typing_extensions +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .executions_resume_execution_request import ExecutionsResumeExecutionRequest -from .executions_stop_execution_request import ExecutionsStopExecutionRequest +class ExecutionsUpdateExecutionRequest_Cancelled(pydantic_v1.BaseModel): + reason: typing.Optional[str] = None + status: typing.Literal["cancelled"] = "cancelled" -class ExecutionsUpdateExecutionRequest_Cancelled(ExecutionsStopExecutionRequest): - status: typing_extensions.Literal["cancelled"] + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class ExecutionsUpdateExecutionRequest_Running(pydantic_v1.BaseModel): + input: typing.Optional[typing.Dict[str, typing.Any]] = None + status: typing.Literal["running"] = "running" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class ExecutionsUpdateExecutionRequest_Running(ExecutionsResumeExecutionRequest): - status: typing_extensions.Literal["running"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} ExecutionsUpdateExecutionRequest = typing.Union[ diff --git a/sdks/python/julep/api/types/history_route_delete_response.py b/sdks/python/julep/api/types/history_route_delete_response.py index 34cec6434..4e070a537 100644 --- a/sdks/python/julep/api/types/history_route_delete_response.py +++ b/sdks/python/julep/api/types/history_route_delete_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class HistoryRouteDeleteResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of deleted undefined + """ -class HistoryRouteDeleteResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of deleted undefined") - deleted_at: dt.datetime = pydantic.Field( - description="When this resource was deleted as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + deleted_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was deleted as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/history_route_list_request_direction.py b/sdks/python/julep/api/types/history_route_list_request_direction.py index 6795d5657..cd09bd721 100644 --- a/sdks/python/julep/api/types/history_route_list_request_direction.py +++ b/sdks/python/julep/api/types/history_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class HistoryRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is HistoryRouteListRequestDirection.ASC: - return asc() - if self is HistoryRouteListRequestDirection.DESC: - return desc() +HistoryRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/history_route_list_request_sort_by.py b/sdks/python/julep/api/types/history_route_list_request_sort_by.py index 2fde6f7a0..7e656e2c7 100644 --- a/sdks/python/julep/api/types/history_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/history_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class HistoryRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is HistoryRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is HistoryRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is HistoryRouteListRequestSortBy.DELETED_AT: - return deleted_at() +HistoryRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/history_route_list_response.py b/sdks/python/julep/api/types/history_route_list_response.py index 97ed6088b..626facd34 100644 --- a/sdks/python/julep/api/types/history_route_list_response.py +++ b/sdks/python/julep/api/types/history_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .entries_history import EntriesHistory -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class HistoryRouteListResponse(pydantic.BaseModel): +class HistoryRouteListResponse(pydantic_v1.BaseModel): results: typing.List[EntriesHistory] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/individual_docs_route_delete_response.py b/sdks/python/julep/api/types/individual_docs_route_delete_response.py index 0b09a5d95..8489bf115 100644 --- a/sdks/python/julep/api/types/individual_docs_route_delete_response.py +++ b/sdks/python/julep/api/types/individual_docs_route_delete_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class IndividualDocsRouteDeleteResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of deleted undefined + """ -class IndividualDocsRouteDeleteResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of deleted undefined") - deleted_at: dt.datetime = pydantic.Field( - description="When this resource was deleted as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + deleted_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was deleted as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/jobs_job_state.py b/sdks/python/julep/api/types/jobs_job_state.py index efacd8154..5dbc9903b 100644 --- a/sdks/python/julep/api/types/jobs_job_state.py +++ b/sdks/python/julep/api/types/jobs_job_state.py @@ -1,45 +1,16 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class JobsJobState(str, enum.Enum): - """ - Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) - """ - - PENDING = "pending" - IN_PROGRESS = "in_progress" - RETRYING = "retrying" - SUCCEEDED = "succeeded" - ABORTED = "aborted" - FAILED = "failed" - UNKNOWN = "unknown" - - def visit( - self, - pending: typing.Callable[[], T_Result], - in_progress: typing.Callable[[], T_Result], - retrying: typing.Callable[[], T_Result], - succeeded: typing.Callable[[], T_Result], - aborted: typing.Callable[[], T_Result], - failed: typing.Callable[[], T_Result], - unknown: typing.Callable[[], T_Result], - ) -> T_Result: - if self is JobsJobState.PENDING: - return pending() - if self is JobsJobState.IN_PROGRESS: - return in_progress() - if self is JobsJobState.RETRYING: - return retrying() - if self is JobsJobState.SUCCEEDED: - return succeeded() - if self is JobsJobState.ABORTED: - return aborted() - if self is JobsJobState.FAILED: - return failed() - if self is JobsJobState.UNKNOWN: - return unknown() +JobsJobState = typing.Union[ + typing.Literal[ + "pending", + "in_progress", + "retrying", + "succeeded", + "aborted", + "failed", + "unknown", + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/jobs_job_status.py b/sdks/python/julep/api/types/jobs_job_status.py index cc6061efb..cc29891d8 100644 --- a/sdks/python/julep/api/types/jobs_job_status.py +++ b/sdks/python/julep/api/types/jobs_job_status.py @@ -4,31 +4,48 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_uuid import CommonUuid from .jobs_job_state import JobsJobState -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class JobsJobStatus(pydantic.BaseModel): +class JobsJobStatus(pydantic_v1.BaseModel): id: CommonUuid - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the job") - reason: str = pydantic.Field(description="Reason for the current state of the job") - has_progress: bool = pydantic.Field( - description="Whether this Job supports progress updates" - ) - progress: float = pydantic.Field(description="Progress percentage") - state: JobsJobState = pydantic.Field(description="Current state of the job") + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the job + """ + + reason: str = pydantic_v1.Field() + """ + Reason for the current state of the job + """ + + has_progress: bool = pydantic_v1.Field() + """ + Whether this Job supports progress updates + """ + + progress: float = pydantic_v1.Field() + """ + Progress percentage + """ + + state: JobsJobState = pydantic_v1.Field() + """ + Current state of the job + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -39,14 +56,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py index 0277daa62..057c70ebf 100644 --- a/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py +++ b/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class SessionsMultiAgentMultiUserSession(pydantic.BaseModel): +class SessionsMultiAgentMultiUserSession(pydantic_v1.BaseModel): agents: typing.List[CommonUuid] users: typing.List[CommonUuid] @@ -25,14 +21,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py index 8cbf56316..8814b09f3 100644 --- a/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py +++ b/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class SessionsMultiAgentNoUserSession(pydantic.BaseModel): +class SessionsMultiAgentNoUserSession(pydantic_v1.BaseModel): agents: typing.List[CommonUuid] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py index 88b6d3006..cda61b7a1 100644 --- a/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py +++ b/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class SessionsMultiAgentSingleUserSession(pydantic.BaseModel): +class SessionsMultiAgentSingleUserSession(pydantic_v1.BaseModel): agents: typing.List[CommonUuid] user: CommonUuid @@ -25,14 +21,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_create_or_update_response.py b/sdks/python/julep/api/types/sessions_route_create_or_update_response.py index 1bed8fd79..06b2b1c6b 100644 --- a/sdks/python/julep/api/types/sessions_route_create_or_update_response.py +++ b/sdks/python/julep/api/types/sessions_route_create_or_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class SessionsRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class SessionsRouteCreateOrUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_create_response.py b/sdks/python/julep/api/types/sessions_route_create_response.py index 7f13b6d47..183fac1bb 100644 --- a/sdks/python/julep/api/types/sessions_route_create_response.py +++ b/sdks/python/julep/api/types/sessions_route_create_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class SessionsRouteCreateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of created undefined + """ -class SessionsRouteCreateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of created undefined") - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_delete_response.py b/sdks/python/julep/api/types/sessions_route_delete_response.py index fa753c106..077994096 100644 --- a/sdks/python/julep/api/types/sessions_route_delete_response.py +++ b/sdks/python/julep/api/types/sessions_route_delete_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class SessionsRouteDeleteResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of deleted undefined + """ -class SessionsRouteDeleteResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of deleted undefined") - deleted_at: dt.datetime = pydantic.Field( - description="When this resource was deleted as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + deleted_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was deleted as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_list_request_direction.py b/sdks/python/julep/api/types/sessions_route_list_request_direction.py index 870b3e7eb..c419b7e2b 100644 --- a/sdks/python/julep/api/types/sessions_route_list_request_direction.py +++ b/sdks/python/julep/api/types/sessions_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class SessionsRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is SessionsRouteListRequestDirection.ASC: - return asc() - if self is SessionsRouteListRequestDirection.DESC: - return desc() +SessionsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py b/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py index 5b4ca464e..add82a7be 100644 --- a/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class SessionsRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is SessionsRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is SessionsRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is SessionsRouteListRequestSortBy.DELETED_AT: - return deleted_at() +SessionsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/sessions_route_list_response.py b/sdks/python/julep/api/types/sessions_route_list_response.py index bd7a35361..874d1bd1e 100644 --- a/sdks/python/julep/api/types/sessions_route_list_response.py +++ b/sdks/python/julep/api/types/sessions_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .sessions_session import SessionsSession -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class SessionsRouteListResponse(pydantic.BaseModel): +class SessionsRouteListResponse(pydantic_v1.BaseModel): results: typing.List[SessionsSession] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_patch_response.py b/sdks/python/julep/api/types/sessions_route_patch_response.py index 04a74bd4d..657193f75 100644 --- a/sdks/python/julep/api/types/sessions_route_patch_response.py +++ b/sdks/python/julep/api/types/sessions_route_patch_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class SessionsRoutePatchResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class SessionsRoutePatchResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_update_response.py b/sdks/python/julep/api/types/sessions_route_update_response.py index c1dc79fc2..e5de2b7bc 100644 --- a/sdks/python/julep/api/types/sessions_route_update_response.py +++ b/sdks/python/julep/api/types/sessions_route_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class SessionsRouteUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class SessionsRouteUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_session.py b/sdks/python/julep/api/types/sessions_session.py index 5a84ac490..a78ed68ed 100644 --- a/sdks/python/julep/api/types/sessions_session.py +++ b/sdks/python/julep/api/types/sessions_session.py @@ -5,53 +5,48 @@ import datetime as dt import typing -import typing_extensions - from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession -from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession -from .sessions_multi_agent_single_user_session import ( - SessionsMultiAgentSingleUserSession, -) -from .sessions_single_agent_multi_user_session import ( - SessionsSingleAgentMultiUserSession, -) -from .sessions_single_agent_no_user_session import SessionsSingleAgentNoUserSession -from .sessions_single_agent_single_user_session import ( - SessionsSingleAgentSingleUserSession, -) - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Base(pydantic.BaseModel): - situation: str = pydantic.Field( - description="A specific situation that sets the background for this session" - ) - summary: typing.Optional[str] = pydantic.Field( - description="Summary (null at the beginning) - generated automatically after every interaction" - ) - render_templates: bool = pydantic.Field( - description="Render system and assistant message content as jinja templates" - ) - token_budget: typing.Optional[int] = pydantic.Field( - description="Threshold value for the adaptive context functionality" - ) - context_overflow: typing.Optional[str] = pydantic.Field( - description="Action to start on context window overflow" - ) + + +class Base(pydantic_v1.BaseModel): + situation: str = pydantic_v1.Field() + """ + A specific situation that sets the background for this session + """ + + summary: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Summary (null at the beginning) - generated automatically after every interaction + """ + + render_templates: bool = pydantic_v1.Field() + """ + Render system and assistant message content as jinja templates + """ + + token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + Threshold value for the adaptive context functionality + """ + + context_overflow: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Action to start on context window overflow + """ + id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -62,71 +57,259 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} -class SessionsSession_SingleAgentNoUser(SessionsSingleAgentNoUserSession, Base): - kind: typing_extensions.Literal["single_agent_no_user"] +class SessionsSession_SingleAgentNoUser(Base): + agent: CommonUuid + kind: typing.Literal["single_agent_no_user"] = "single_agent_no_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_SingleAgentSingleUser(Base): + agent: CommonUuid + user: CommonUuid + kind: typing.Literal["single_agent_single_user"] = "single_agent_single_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class SessionsSession_SingleAgentSingleUser(SessionsSingleAgentSingleUserSession, Base): - kind: typing_extensions.Literal["single_agent_single_user"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_SingleAgentMultiUser(Base): + agent: CommonUuid + users: typing.List[CommonUuid] + kind: typing.Literal["single_agent_multi_user"] = "single_agent_multi_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class SessionsSession_SingleAgentMultiUser(SessionsSingleAgentMultiUserSession, Base): - kind: typing_extensions.Literal["single_agent_multi_user"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_MultiAgentNoUser(Base): + agents: typing.List[CommonUuid] + kind: typing.Literal["multi_agent_no_user"] = "multi_agent_no_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class SessionsSession_MultiAgentNoUser(SessionsMultiAgentNoUserSession, Base): - kind: typing_extensions.Literal["multi_agent_no_user"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_MultiAgentSingleUser(Base): + agents: typing.List[CommonUuid] + user: CommonUuid + kind: typing.Literal["multi_agent_single_user"] = "multi_agent_single_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class SessionsSession_MultiAgentSingleUser(SessionsMultiAgentSingleUserSession, Base): - kind: typing_extensions.Literal["multi_agent_single_user"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_MultiAgentMultiUser(Base): + agents: typing.List[CommonUuid] + users: typing.List[CommonUuid] + kind: typing.Literal["multi_agent_multi_user"] = "multi_agent_multi_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } -class SessionsSession_MultiAgentMultiUser(SessionsMultiAgentMultiUserSession, Base): - kind: typing_extensions.Literal["multi_agent_multi_user"] + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} SessionsSession = typing.Union[ diff --git a/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py index 10c6d7e97..66d652b02 100644 --- a/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py +++ b/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class SessionsSingleAgentMultiUserSession(pydantic.BaseModel): +class SessionsSingleAgentMultiUserSession(pydantic_v1.BaseModel): agent: CommonUuid users: typing.List[CommonUuid] @@ -25,14 +21,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py index 3076ed67b..8b7866b62 100644 --- a/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py +++ b/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class SessionsSingleAgentNoUserSession(pydantic.BaseModel): +class SessionsSingleAgentNoUserSession(pydantic_v1.BaseModel): agent: CommonUuid def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py index 415c84bfc..9ba35bb4b 100644 --- a/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py +++ b/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class SessionsSingleAgentSingleUserSession(pydantic.BaseModel): +class SessionsSingleAgentSingleUserSession(pydantic_v1.BaseModel): agent: CommonUuid user: CommonUuid @@ -25,14 +21,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task_executions_route_create_response.py b/sdks/python/julep/api/types/task_executions_route_create_response.py index 800c2f79b..cc1c0fa69 100644 --- a/sdks/python/julep/api/types/task_executions_route_create_response.py +++ b/sdks/python/julep/api/types/task_executions_route_create_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TaskExecutionsRouteCreateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of created undefined + """ -class TaskExecutionsRouteCreateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of created undefined") - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task_executions_route_list_request_direction.py b/sdks/python/julep/api/types/task_executions_route_list_request_direction.py index 9a184e984..a79b988a8 100644 --- a/sdks/python/julep/api/types/task_executions_route_list_request_direction.py +++ b/sdks/python/julep/api/types/task_executions_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class TaskExecutionsRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is TaskExecutionsRouteListRequestDirection.ASC: - return asc() - if self is TaskExecutionsRouteListRequestDirection.DESC: - return desc() +TaskExecutionsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py b/sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py index ead7f15eb..32907e8bc 100644 --- a/sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/task_executions_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class TaskExecutionsRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is TaskExecutionsRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is TaskExecutionsRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is TaskExecutionsRouteListRequestSortBy.DELETED_AT: - return deleted_at() +TaskExecutionsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/task_executions_route_list_response.py b/sdks/python/julep/api/types/task_executions_route_list_response.py index 5000bf531..07ce269b8 100644 --- a/sdks/python/julep/api/types/task_executions_route_list_response.py +++ b/sdks/python/julep/api/types/task_executions_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .executions_execution import ExecutionsExecution -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TaskExecutionsRouteListResponse(pydantic.BaseModel): +class TaskExecutionsRouteListResponse(pydantic_v1.BaseModel): results: typing.List[ExecutionsExecution] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py b/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py index 2c7a35030..a363844ab 100644 --- a/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py +++ b/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TaskExecutionsRouteResumeWithTaskTokenResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class TaskExecutionsRouteResumeWithTaskTokenResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_error_workflow_step.py b/sdks/python/julep/api/types/tasks_error_workflow_step.py index 34c1aa47b..cc3a4e641 100644 --- a/sdks/python/julep/api/types/tasks_error_workflow_step.py +++ b/sdks/python/julep/api/types/tasks_error_workflow_step.py @@ -4,15 +4,14 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TasksErrorWorkflowStep(pydantic.BaseModel): - error: str = pydantic.Field(description="The error message") +class TasksErrorWorkflowStep(pydantic_v1.BaseModel): + error: str = pydantic_v1.Field() + """ + The error message + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -23,14 +22,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_evaluate_step.py b/sdks/python/julep/api/types/tasks_evaluate_step.py index b660b2265..114b84349 100644 --- a/sdks/python/julep/api/types/tasks_evaluate_step.py +++ b/sdks/python/julep/api/types/tasks_evaluate_step.py @@ -4,18 +4,15 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tasks_cel import TasksCel -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TasksEvaluateStep(pydantic.BaseModel): - evaluate: typing.Dict[str, TasksCel] = pydantic.Field( - description="The expression to evaluate" - ) +class TasksEvaluateStep(pydantic_v1.BaseModel): + evaluate: typing.Dict[str, TasksCel] = pydantic_v1.Field() + """ + The expression to evaluate + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -26,14 +23,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_if_else_workflow_step.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py index f834f3db5..da0400ac4 100644 --- a/sdks/python/julep/api/types/tasks_if_else_workflow_step.py +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py @@ -6,22 +6,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tasks_cel import TasksCel -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksIfElseWorkflowStep(pydantic_v1.BaseModel): + if_: TasksCel = pydantic_v1.Field(alias="if") + """ + The condition to evaluate + """ -class TasksIfElseWorkflowStep(pydantic.BaseModel): - if_: TasksCel = pydantic.Field(alias="if", description="The condition to evaluate") - then: "TasksWorkflowStep" = pydantic.Field( - description="The steps to run if the condition is true" - ) - else_: "TasksWorkflowStep" = pydantic.Field( - alias="else", description="The steps to run if the condition is false" - ) + then: TasksWorkflowStep = pydantic_v1.Field() + """ + The steps to run if the condition is true + """ + + else_: TasksWorkflowStep = pydantic_v1.Field(alias="else") + """ + The steps to run if the condition is false + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -32,20 +35,31 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} from .tasks_workflow_step import TasksWorkflowStep # noqa: E402 -TasksIfElseWorkflowStep.update_forward_refs(TasksWorkflowStep=TasksWorkflowStep) +TasksIfElseWorkflowStep.update_forward_refs() diff --git a/sdks/python/julep/api/types/tasks_prompt_step.py b/sdks/python/julep/api/types/tasks_prompt_step.py index a7a99b08f..be1a880d7 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step.py +++ b/sdks/python/julep/api/types/tasks_prompt_step.py @@ -4,20 +4,21 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tasks_prompt_step_prompt import TasksPromptStepPrompt from .tasks_prompt_step_settings import TasksPromptStepSettings -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksPromptStep(pydantic_v1.BaseModel): + prompt: TasksPromptStepPrompt = pydantic_v1.Field() + """ + The prompt to run + """ -class TasksPromptStep(pydantic.BaseModel): - prompt: TasksPromptStepPrompt = pydantic.Field(description="The prompt to run") - settings: TasksPromptStepSettings = pydantic.Field( - description="Settings for the prompt" - ) + settings: TasksPromptStepSettings = pydantic_v1.Field() + """ + Settings for the prompt + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -28,14 +29,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_prompt_step_prompt.py b/sdks/python/julep/api/types/tasks_prompt_step_prompt.py index bf293072c..de671d743 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_prompt.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_prompt.py @@ -2,15 +2,6 @@ import typing -from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart -from .entries_chat_ml_role import EntriesChatMlRole -from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart -from .entries_image_detail import EntriesImageDetail -from .entries_image_url import EntriesImageUrl from .entries_input_chat_ml_message import EntriesInputChatMlMessage -from .entries_input_chat_ml_message_content import EntriesInputChatMlMessageContent -from .entries_input_chat_ml_message_content_item import ( - EntriesInputChatMlMessageContentItem, -) TasksPromptStepPrompt = typing.Union[str, typing.List[EntriesInputChatMlMessage]] diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings.py b/sdks/python/julep/api/types/tasks_prompt_step_settings.py index a0c882a18..86e3f63cb 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings.py @@ -2,11 +2,6 @@ import typing -from .chat_completion_response_format import ChatCompletionResponseFormat -from .chat_completion_response_format_type import ChatCompletionResponseFormatType -from .chat_generation_preset import ChatGenerationPreset -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_logit_bias import CommonLogitBias from .tasks_prompt_step_settings_frequency_penalty import ( TasksPromptStepSettingsFrequencyPenalty, ) diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py index ba14f18b3..38d311acf 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py @@ -4,50 +4,73 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .chat_completion_response_format import ChatCompletionResponseFormat from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_logit_bias import CommonLogitBias -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TasksPromptStepSettingsFrequencyPenalty(pydantic.BaseModel): - model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( - description="Identifier of the model to be used" - ) - stream: bool = pydantic.Field( - description="Indicates if the server should stream the response as it's generated" - ) - stop: typing.Optional[typing.List[str]] = pydantic.Field( - description="Up to 4 sequences where the API will stop generating further tokens." - ) - seed: typing.Optional[int] = pydantic.Field( - description="If specified, the system will make a best effort to sample deterministically for that particular seed value" - ) - max_tokens: typing.Optional[int] = pydantic.Field( - description="The maximum number of tokens to generate in the chat completion" - ) - logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic.Field( - description="Modify the likelihood of specified tokens appearing in the completion" +class TasksPromptStepSettingsFrequencyPenalty(pydantic_v1.BaseModel): + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None ) - response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic.Field( - description="Response format (set to `json_object` to restrict output to JSON)" - ) - frequency_penalty: typing.Optional[float] = pydantic.Field( - description="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." - ) - presence_penalty: typing.Optional[float] = pydantic.Field( - description="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." - ) - temperature: typing.Optional[float] = pydantic.Field( - description="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." + """ + Identifier of the model to be used + """ + + stream: bool = pydantic_v1.Field() + """ + Indicates if the server should stream the response as it's generated + """ + + stop: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + + seed: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + + max_tokens: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + The maximum number of tokens to generate in the chat completion + """ + + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic_v1.Field( + default=None ) - top_p: typing.Optional[float] = pydantic.Field( - description="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." + """ + Modify the likelihood of specified tokens appearing in the completion + """ + + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic_v1.Field( + default=None ) + """ + Response format (set to `json_object` to restrict output to JSON) + """ + + frequency_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + presence_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -58,14 +81,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py index 9f9e67428..c2cf0f30e 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py @@ -4,53 +4,78 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .chat_completion_response_format import ChatCompletionResponseFormat from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_logit_bias import CommonLogitBias -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TasksPromptStepSettingsLengthPenalty(pydantic.BaseModel): - model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( - description="Identifier of the model to be used" - ) - stream: bool = pydantic.Field( - description="Indicates if the server should stream the response as it's generated" - ) - stop: typing.Optional[typing.List[str]] = pydantic.Field( - description="Up to 4 sequences where the API will stop generating further tokens." - ) - seed: typing.Optional[int] = pydantic.Field( - description="If specified, the system will make a best effort to sample deterministically for that particular seed value" - ) - max_tokens: typing.Optional[int] = pydantic.Field( - description="The maximum number of tokens to generate in the chat completion" - ) - logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic.Field( - description="Modify the likelihood of specified tokens appearing in the completion" - ) - response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic.Field( - description="Response format (set to `json_object` to restrict output to JSON)" +class TasksPromptStepSettingsLengthPenalty(pydantic_v1.BaseModel): + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None ) - repetition_penalty: typing.Optional[float] = pydantic.Field( - description="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." - ) - length_penalty: typing.Optional[float] = pydantic.Field( - description="Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated." - ) - temperature: typing.Optional[float] = pydantic.Field( - description="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] = pydantic.Field( - description="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." + """ + Identifier of the model to be used + """ + + stream: bool = pydantic_v1.Field() + """ + Indicates if the server should stream the response as it's generated + """ + + stop: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + + seed: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + + max_tokens: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + The maximum number of tokens to generate in the chat completion + """ + + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic_v1.Field( + default=None ) - min_p: typing.Optional[float] = pydantic.Field( - description="Minimum probability compared to leading token to be considered" + """ + Modify the likelihood of specified tokens appearing in the completion + """ + + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic_v1.Field( + default=None ) + """ + Response format (set to `json_object` to restrict output to JSON) + """ + + repetition_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + length_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ + + min_p: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Minimum probability compared to leading token to be considered + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -61,14 +86,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py index 325d26a0e..c9ef75698 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py @@ -4,42 +4,59 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .chat_completion_response_format import ChatCompletionResponseFormat from .chat_generation_preset import ChatGenerationPreset from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_logit_bias import CommonLogitBias -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TasksPromptStepSettingsPreset(pydantic.BaseModel): - model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( - description="Identifier of the model to be used" - ) - stream: bool = pydantic.Field( - description="Indicates if the server should stream the response as it's generated" - ) - stop: typing.Optional[typing.List[str]] = pydantic.Field( - description="Up to 4 sequences where the API will stop generating further tokens." - ) - seed: typing.Optional[int] = pydantic.Field( - description="If specified, the system will make a best effort to sample deterministically for that particular seed value" - ) - max_tokens: typing.Optional[int] = pydantic.Field( - description="The maximum number of tokens to generate in the chat completion" +class TasksPromptStepSettingsPreset(pydantic_v1.BaseModel): + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None ) - logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic.Field( - description="Modify the likelihood of specified tokens appearing in the completion" - ) - response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic.Field( - description="Response format (set to `json_object` to restrict output to JSON)" + """ + Identifier of the model to be used + """ + + stream: bool = pydantic_v1.Field() + """ + Indicates if the server should stream the response as it's generated + """ + + stop: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + + seed: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + + max_tokens: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + The maximum number of tokens to generate in the chat completion + """ + + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic_v1.Field( + default=None ) - preset: typing.Optional[ChatGenerationPreset] = pydantic.Field( - description="Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)" + """ + Modify the likelihood of specified tokens appearing in the completion + """ + + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic_v1.Field( + default=None ) + """ + Response format (set to `json_object` to restrict output to JSON) + """ + + preset: typing.Optional[ChatGenerationPreset] = pydantic_v1.Field(default=None) + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -50,14 +67,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_create_or_update_response.py b/sdks/python/julep/api/types/tasks_route_create_or_update_response.py index d197303a9..22be59ce9 100644 --- a/sdks/python/julep/api/types/tasks_route_create_or_update_response.py +++ b/sdks/python/julep/api/types/tasks_route_create_or_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class TasksRouteCreateOrUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_create_response.py b/sdks/python/julep/api/types/tasks_route_create_response.py index 5ab4617c6..395c6619b 100644 --- a/sdks/python/julep/api/types/tasks_route_create_response.py +++ b/sdks/python/julep/api/types/tasks_route_create_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksRouteCreateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of created undefined + """ -class TasksRouteCreateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of created undefined") - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_delete_response.py b/sdks/python/julep/api/types/tasks_route_delete_response.py index 6d6a273ec..07a5a7519 100644 --- a/sdks/python/julep/api/types/tasks_route_delete_response.py +++ b/sdks/python/julep/api/types/tasks_route_delete_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksRouteDeleteResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of deleted undefined + """ -class TasksRouteDeleteResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of deleted undefined") - deleted_at: dt.datetime = pydantic.Field( - description="When this resource was deleted as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + deleted_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was deleted as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_list_request_direction.py b/sdks/python/julep/api/types/tasks_route_list_request_direction.py index 2ed0763c6..33e5271b8 100644 --- a/sdks/python/julep/api/types/tasks_route_list_request_direction.py +++ b/sdks/python/julep/api/types/tasks_route_list_request_direction.py @@ -1,19 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class TasksRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is TasksRouteListRequestDirection.ASC: - return asc() - if self is TasksRouteListRequestDirection.DESC: - return desc() +TasksRouteListRequestDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] diff --git a/sdks/python/julep/api/types/tasks_route_list_request_sort_by.py b/sdks/python/julep/api/types/tasks_route_list_request_sort_by.py index c80bbefaa..4c6430a35 100644 --- a/sdks/python/julep/api/types/tasks_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/tasks_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class TasksRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is TasksRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is TasksRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is TasksRouteListRequestSortBy.DELETED_AT: - return deleted_at() +TasksRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/tasks_route_list_response.py b/sdks/python/julep/api/types/tasks_route_list_response.py index f687a3763..ba718b849 100644 --- a/sdks/python/julep/api/types/tasks_route_list_response.py +++ b/sdks/python/julep/api/types/tasks_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tasks_task import TasksTask -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TasksRouteListResponse(pydantic.BaseModel): +class TasksRouteListResponse(pydantic_v1.BaseModel): results: typing.List[TasksTask] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_patch_response.py b/sdks/python/julep/api/types/tasks_route_patch_response.py index a6b8208eb..bf6170ca1 100644 --- a/sdks/python/julep/api/types/tasks_route_patch_response.py +++ b/sdks/python/julep/api/types/tasks_route_patch_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksRoutePatchResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class TasksRoutePatchResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_update_response.py b/sdks/python/julep/api/types/tasks_route_update_response.py index 597685dd4..7d7d3e34a 100644 --- a/sdks/python/julep/api/types/tasks_route_update_response.py +++ b/sdks/python/julep/api/types/tasks_route_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksRouteUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class TasksRouteUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_task.py b/sdks/python/julep/api/types/tasks_task.py index 67706ce9e..30961f3c4 100644 --- a/sdks/python/julep/api/types/tasks_task.py +++ b/sdks/python/julep/api/types/tasks_task.py @@ -4,43 +4,52 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid from .tasks_workflow_step import TasksWorkflowStep from .tools_create_tool_request import ToolsCreateToolRequest -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class TasksTask(pydantic.BaseModel): +class TasksTask(pydantic_v1.BaseModel): """ Object describing a Task """ name: str description: str - main: typing.List[TasksWorkflowStep] = pydantic.Field( - description="The entrypoint of the task." - ) - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="The schema for the input to the task. `null` means all inputs are valid." - ) - tools: typing.List[ToolsCreateToolRequest] = pydantic.Field( - description="Tools defined specifically for this task not included in the Agent itself." - ) - inherit_tools: bool = pydantic.Field( - description="Whether to inherit tools from the parent agent or not. Defaults to true." + main: typing.List[TasksWorkflowStep] = pydantic_v1.Field() + """ + The entrypoint of the task. + """ + + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + default=None ) + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + + tools: typing.List[ToolsCreateToolRequest] = pydantic_v1.Field() + """ + Tools defined specifically for this task not included in the Agent itself. + """ + + inherit_tools: bool = pydantic_v1.Field() + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + agent_id: CommonUuid id: CommonUuid - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -51,14 +60,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_tool_call_step.py b/sdks/python/julep/api/types/tasks_tool_call_step.py index b861d623a..e9ee19b9e 100644 --- a/sdks/python/julep/api/types/tasks_tool_call_step.py +++ b/sdks/python/julep/api/types/tasks_tool_call_step.py @@ -4,19 +4,20 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_tool_ref import CommonToolRef -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksToolCallStep(pydantic_v1.BaseModel): + tool: CommonToolRef = pydantic_v1.Field() + """ + The tool to run + """ -class TasksToolCallStep(pydantic.BaseModel): - tool: CommonToolRef = pydantic.Field(description="The tool to run") - arguments: typing.Dict[str, typing.Any] = pydantic.Field( - description="The input parameters for the tool" - ) + arguments: typing.Dict[str, typing.Any] = pydantic_v1.Field() + """ + The input parameters for the tool + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -27,14 +28,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_workflow_step.py b/sdks/python/julep/api/types/tasks_workflow_step.py index e03804d82..588a761c8 100644 --- a/sdks/python/julep/api/types/tasks_workflow_step.py +++ b/sdks/python/julep/api/types/tasks_workflow_step.py @@ -2,69 +2,238 @@ from __future__ import annotations +import datetime as dt import typing -import typing_extensions - -from .tasks_error_workflow_step import TasksErrorWorkflowStep -from .tasks_evaluate_step import TasksEvaluateStep -from .tasks_prompt_step import TasksPromptStep -from .tasks_tool_call_step import TasksToolCallStep -from .tasks_yield_step import TasksYieldStep - - -class TasksWorkflowStep_ToolCall(TasksToolCallStep): - kind: typing_extensions.Literal["tool_call"] +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_tool_ref import CommonToolRef +from .tasks_cel import TasksCel +from .tasks_prompt_step_prompt import TasksPromptStepPrompt +from .tasks_prompt_step_settings import TasksPromptStepSettings + + +class TasksWorkflowStep_ToolCall(pydantic_v1.BaseModel): + tool: CommonToolRef + arguments: typing.Dict[str, typing.Any] + kind: typing.Literal["tool_call"] = "tool_call" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True - - -class TasksWorkflowStep_Yield(TasksYieldStep): - kind: typing_extensions.Literal["yield"] + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksWorkflowStep_Yield(pydantic_v1.BaseModel): + workflow: str + arguments: typing.Dict[str, TasksCel] + kind: typing.Literal["yield"] = "yield" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True - - -class TasksWorkflowStep_Prompt(TasksPromptStep): - kind: typing_extensions.Literal["prompt"] + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksWorkflowStep_Prompt(pydantic_v1.BaseModel): + prompt: TasksPromptStepPrompt + settings: TasksPromptStepSettings + kind: typing.Literal["prompt"] = "prompt" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True - - -class TasksWorkflowStep_Evaluate(TasksEvaluateStep): - kind: typing_extensions.Literal["evaluate"] + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksWorkflowStep_Evaluate(pydantic_v1.BaseModel): + evaluate: typing.Dict[str, TasksCel] + kind: typing.Literal["evaluate"] = "evaluate" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True - - -class TasksWorkflowStep_IfElse(TasksIfElseWorkflowStep): - kind: typing_extensions.Literal["if_else"] + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksWorkflowStep_IfElse(pydantic_v1.BaseModel): + if_: TasksCel = pydantic_v1.Field(alias="if") + then: TasksWorkflowStep + else_: TasksWorkflowStep = pydantic_v1.Field(alias="else") + kind: typing.Literal["if_else"] = "if_else" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True - - -class TasksWorkflowStep_Error(TasksErrorWorkflowStep): - kind: typing_extensions.Literal["error"] + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class TasksWorkflowStep_Error(pydantic_v1.BaseModel): + error: str + kind: typing.Literal["error"] = "error" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True - allow_population_by_field_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} TasksWorkflowStep = typing.Union[ @@ -75,8 +244,3 @@ class Config: TasksWorkflowStep_IfElse, TasksWorkflowStep_Error, ] -from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep # noqa: E402 - -TasksWorkflowStep_IfElse.update_forward_refs( - TasksIfElseWorkflowStep=TasksIfElseWorkflowStep, TasksWorkflowStep=TasksWorkflowStep -) diff --git a/sdks/python/julep/api/types/tasks_yield_step.py b/sdks/python/julep/api/types/tasks_yield_step.py index 5cdc89a69..d1e1ed585 100644 --- a/sdks/python/julep/api/types/tasks_yield_step.py +++ b/sdks/python/julep/api/types/tasks_yield_step.py @@ -4,19 +4,20 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tasks_cel import TasksCel -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class TasksYieldStep(pydantic_v1.BaseModel): + workflow: str = pydantic_v1.Field() + """ + The subworkflow to run + """ -class TasksYieldStep(pydantic.BaseModel): - workflow: str = pydantic.Field(description="The subworkflow to run") - arguments: typing.Dict[str, TasksCel] = pydantic.Field( - description="The input parameters for the subworkflow" - ) + arguments: typing.Dict[str, TasksCel] = pydantic_v1.Field() + """ + The input parameters for the subworkflow + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -27,14 +28,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_route_delete_response.py b/sdks/python/julep/api/types/tool_route_delete_response.py index 23ff6a7f1..39e54da62 100644 --- a/sdks/python/julep/api/types/tool_route_delete_response.py +++ b/sdks/python/julep/api/types/tool_route_delete_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class ToolRouteDeleteResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of deleted undefined + """ -class ToolRouteDeleteResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of deleted undefined") - deleted_at: dt.datetime = pydantic.Field( - description="When this resource was deleted as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + deleted_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was deleted as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_route_patch_response.py b/sdks/python/julep/api/types/tool_route_patch_response.py index 7f9b62834..6ad7439a9 100644 --- a/sdks/python/julep/api/types/tool_route_patch_response.py +++ b/sdks/python/julep/api/types/tool_route_patch_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class ToolRoutePatchResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class ToolRoutePatchResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_route_update_response.py b/sdks/python/julep/api/types/tool_route_update_response.py index 476b756ba..ad6a36cd0 100644 --- a/sdks/python/julep/api/types/tool_route_update_response.py +++ b/sdks/python/julep/api/types/tool_route_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class ToolRouteUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class ToolRouteUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_chosen_function_call.py b/sdks/python/julep/api/types/tools_chosen_function_call.py index 6f79ae527..58afb9e09 100644 --- a/sdks/python/julep/api/types/tools_chosen_function_call.py +++ b/sdks/python/julep/api/types/tools_chosen_function_call.py @@ -4,18 +4,15 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tools_function_call_option import ToolsFunctionCallOption -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ToolsChosenFunctionCall(pydantic.BaseModel): - function: ToolsFunctionCallOption = pydantic.Field( - description="The function to call" - ) +class ToolsChosenFunctionCall(pydantic_v1.BaseModel): + function: ToolsFunctionCallOption = pydantic_v1.Field() + """ + The function to call + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -26,14 +23,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_chosen_tool_call.py b/sdks/python/julep/api/types/tools_chosen_tool_call.py index d15cc12e4..226a92a5b 100644 --- a/sdks/python/julep/api/types/tools_chosen_tool_call.py +++ b/sdks/python/julep/api/types/tools_chosen_tool_call.py @@ -5,21 +5,14 @@ import datetime as dt import typing -import typing_extensions - from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -from .tools_chosen_function_call import ToolsChosenFunctionCall from .tools_function_call_option import ToolsFunctionCallOption -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class Base(pydantic.BaseModel): - function: typing.Optional[ToolsFunctionCallOption] +class Base(pydantic_v1.BaseModel): + function: typing.Optional[ToolsFunctionCallOption] = None integration: typing.Any system: typing.Any api_call: typing.Any @@ -34,26 +27,69 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} -class ToolsChosenToolCall_Function(ToolsChosenFunctionCall, Base): - type: typing_extensions.Literal["function"] +class ToolsChosenToolCall_Function(Base): + """ + The response tool value generated by the model + """ + + function: ToolsFunctionCallOption + type: typing.Literal["function"] = "function" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} -ToolsChosenToolCall = typing.Union[ToolsChosenToolCall_Function] +ToolsChosenToolCall = ToolsChosenToolCall_Function diff --git a/sdks/python/julep/api/types/tools_create_tool_request.py b/sdks/python/julep/api/types/tools_create_tool_request.py index c6e8fc2f4..fb051faeb 100644 --- a/sdks/python/julep/api/types/tools_create_tool_request.py +++ b/sdks/python/julep/api/types/tools_create_tool_request.py @@ -4,33 +4,35 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tools_function_def import ToolsFunctionDef from .tools_tool_type import ToolsToolType -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ToolsCreateToolRequest(pydantic.BaseModel): +class ToolsCreateToolRequest(pydantic_v1.BaseModel): """ Payload for creating a tool """ - type: ToolsToolType = pydantic.Field( - description="Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)" - ) - background: bool = pydantic.Field( - description="The tool should be run in the background (not supported at the moment)" - ) - interactive: bool = pydantic.Field( - description='Whether the tool that can be run interactively (response should contain "stop" boolean field)' - ) - function: typing.Optional[ToolsFunctionDef] - integration: typing.Optional[typing.Any] - system: typing.Optional[typing.Any] - api_call: typing.Optional[typing.Any] + type: ToolsToolType = pydantic_v1.Field() + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + + background: bool = pydantic_v1.Field() + """ + The tool should be run in the background (not supported at the moment) + """ + + interactive: bool = pydantic_v1.Field() + """ + Whether the tool that can be run interactively (response should contain "stop" boolean field) + """ + + function: typing.Optional[ToolsFunctionDef] = None + integration: typing.Optional[typing.Any] = None + system: typing.Optional[typing.Any] = None + api_call: typing.Optional[typing.Any] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -41,14 +43,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_function_call_option.py b/sdks/python/julep/api/types/tools_function_call_option.py index 7944fa8c2..631f4ea89 100644 --- a/sdks/python/julep/api/types/tools_function_call_option.py +++ b/sdks/python/julep/api/types/tools_function_call_option.py @@ -4,15 +4,14 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ToolsFunctionCallOption(pydantic.BaseModel): - name: str = pydantic.Field(description="The name of the function") +class ToolsFunctionCallOption(pydantic_v1.BaseModel): + name: str = pydantic_v1.Field() + """ + The name of the function + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -23,14 +22,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_function_def.py b/sdks/python/julep/api/types/tools_function_def.py index 8b6ac24c9..458c4e2e5 100644 --- a/sdks/python/julep/api/types/tools_function_def.py +++ b/sdks/python/julep/api/types/tools_function_def.py @@ -4,29 +4,32 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_valid_python_identifier import CommonValidPythonIdentifier -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ToolsFunctionDef(pydantic.BaseModel): +class ToolsFunctionDef(pydantic_v1.BaseModel): """ Function definition """ - name: typing.Optional[CommonValidPythonIdentifier] = pydantic.Field( - description="DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons." - ) - parameters: typing.Dict[str, typing.Any] = pydantic.Field( - description="The parameters the function accepts" - ) - description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( - description="Description of the function" + name: typing.Optional[CommonValidPythonIdentifier] = pydantic_v1.Field(default=None) + """ + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + """ + + parameters: typing.Dict[str, typing.Any] = pydantic_v1.Field() + """ + The parameters the function accepts + """ + + description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None ) + """ + Description of the function + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -37,14 +40,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_function_def_update.py b/sdks/python/julep/api/types/tools_function_def_update.py index 770bafa04..8a776f71a 100644 --- a/sdks/python/julep/api/types/tools_function_def_update.py +++ b/sdks/python/julep/api/types/tools_function_def_update.py @@ -4,29 +4,34 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_valid_python_identifier import CommonValidPythonIdentifier -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ToolsFunctionDefUpdate(pydantic.BaseModel): +class ToolsFunctionDefUpdate(pydantic_v1.BaseModel): """ Function definition """ - name: typing.Optional[CommonValidPythonIdentifier] = pydantic.Field( - description="DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons." - ) - parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field( - description="The parameters the function accepts" + name: typing.Optional[CommonValidPythonIdentifier] = pydantic_v1.Field(default=None) + """ + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + """ + + parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + default=None ) - description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic.Field( - description="Description of the function" + """ + The parameters the function accepts + """ + + description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None ) + """ + Description of the function + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -37,14 +42,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_function_tool.py b/sdks/python/julep/api/types/tools_function_tool.py index 93a4e2331..1feccdd6e 100644 --- a/sdks/python/julep/api/types/tools_function_tool.py +++ b/sdks/python/julep/api/types/tools_function_tool.py @@ -4,18 +4,17 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .tools_function_def import ToolsFunctionDef -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ToolsFunctionTool(pydantic.BaseModel): +class ToolsFunctionTool(pydantic_v1.BaseModel): background: bool interactive: bool - function: ToolsFunctionDef = pydantic.Field(description="The function to call") + function: ToolsFunctionDef = pydantic_v1.Field() + """ + The function to call + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -26,14 +25,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_tool.py b/sdks/python/julep/api/types/tools_tool.py index 3f90bf959..3ab88d890 100644 --- a/sdks/python/julep/api/types/tools_tool.py +++ b/sdks/python/julep/api/types/tools_tool.py @@ -5,38 +5,39 @@ import datetime as dt import typing -import typing_extensions - from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_uuid import CommonUuid from .common_valid_python_identifier import CommonValidPythonIdentifier from .tools_function_def import ToolsFunctionDef -from .tools_function_tool import ToolsFunctionTool - -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - - -class Base(pydantic.BaseModel): - background: bool = pydantic.Field( - description="The tool should be run in the background (not supported at the moment)" - ) - interactive: bool = pydantic.Field( - description='Whether the tool that can be run interactively (response should contain "stop" boolean field)' - ) - function: typing.Optional[ToolsFunctionDef] + + +class Base(pydantic_v1.BaseModel): + background: bool = pydantic_v1.Field() + """ + The tool should be run in the background (not supported at the moment) + """ + + interactive: bool = pydantic_v1.Field() + """ + Whether the tool that can be run interactively (response should contain "stop" boolean field) + """ + + function: typing.Optional[ToolsFunctionDef] = None integration: typing.Any system: typing.Any api_call: typing.Any - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + id: CommonUuid def json(self, **kwargs: typing.Any) -> str: @@ -48,26 +49,67 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} -class ToolsTool_Function(ToolsFunctionTool, Base): - type: typing_extensions.Literal["function"] +class ToolsTool_Function(Base): + background: bool + interactive: bool + function: ToolsFunctionDef + type: typing.Literal["function"] = "function" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} -ToolsTool = typing.Union[ToolsTool_Function] +ToolsTool = ToolsTool_Function diff --git a/sdks/python/julep/api/types/tools_tool_response.py b/sdks/python/julep/api/types/tools_tool_response.py index 2870953ae..216c82b08 100644 --- a/sdks/python/julep/api/types/tools_tool_response.py +++ b/sdks/python/julep/api/types/tools_tool_response.py @@ -4,19 +4,16 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class ToolsToolResponse(pydantic.BaseModel): +class ToolsToolResponse(pydantic_v1.BaseModel): id: CommonUuid - output: typing.Dict[str, typing.Any] = pydantic.Field( - description="The output of the tool" - ) + output: typing.Dict[str, typing.Any] = pydantic_v1.Field() + """ + The output of the tool + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -27,14 +24,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_tool_type.py b/sdks/python/julep/api/types/tools_tool_type.py index 639cb1775..41d90cfaf 100644 --- a/sdks/python/julep/api/types/tools_tool_type.py +++ b/sdks/python/julep/api/types/tools_tool_type.py @@ -1,29 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class ToolsToolType(str, enum.Enum): - FUNCTION = "function" - INTEGRATION = "integration" - SYSTEM = "system" - API_CALL = "api_call" - - def visit( - self, - function: typing.Callable[[], T_Result], - integration: typing.Callable[[], T_Result], - system: typing.Callable[[], T_Result], - api_call: typing.Callable[[], T_Result], - ) -> T_Result: - if self is ToolsToolType.FUNCTION: - return function() - if self is ToolsToolType.INTEGRATION: - return integration() - if self is ToolsToolType.SYSTEM: - return system() - if self is ToolsToolType.API_CALL: - return api_call() +ToolsToolType = typing.Union[ + typing.Literal["function", "integration", "system", "api_call"], typing.Any +] diff --git a/sdks/python/julep/api/types/user_docs_route_list_request_direction.py b/sdks/python/julep/api/types/user_docs_route_list_request_direction.py index 3c4fa8ae2..01408584f 100644 --- a/sdks/python/julep/api/types/user_docs_route_list_request_direction.py +++ b/sdks/python/julep/api/types/user_docs_route_list_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class UserDocsRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is UserDocsRouteListRequestDirection.ASC: - return asc() - if self is UserDocsRouteListRequestDirection.DESC: - return desc() +UserDocsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py b/sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py index 18f659d71..862c6e9e7 100644 --- a/sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/user_docs_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class UserDocsRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is UserDocsRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is UserDocsRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is UserDocsRouteListRequestSortBy.DELETED_AT: - return deleted_at() +UserDocsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/user_docs_route_list_response.py b/sdks/python/julep/api/types/user_docs_route_list_response.py index 3760ad130..45f8d6088 100644 --- a/sdks/python/julep/api/types/user_docs_route_list_response.py +++ b/sdks/python/julep/api/types/user_docs_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_doc import DocsDoc -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class UserDocsRouteListResponse(pydantic.BaseModel): +class UserDocsRouteListResponse(pydantic_v1.BaseModel): results: typing.List[DocsDoc] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py index 414bb3d0f..3a2ef70a8 100644 --- a/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py +++ b/sdks/python/julep/api/types/user_docs_search_route_search_request_direction.py @@ -1,19 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class UserDocsSearchRouteSearchRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is UserDocsSearchRouteSearchRequestDirection.ASC: - return asc() - if self is UserDocsSearchRouteSearchRequestDirection.DESC: - return desc() +UserDocsSearchRouteSearchRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py index 2d42b02bd..4a604b920 100644 --- a/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py +++ b/sdks/python/julep/api/types/user_docs_search_route_search_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class UserDocsSearchRouteSearchRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is UserDocsSearchRouteSearchRequestSortBy.CREATED_AT: - return created_at() - if self is UserDocsSearchRouteSearchRequestSortBy.UPDATED_AT: - return updated_at() - if self is UserDocsSearchRouteSearchRequestSortBy.DELETED_AT: - return deleted_at() +UserDocsSearchRouteSearchRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_response.py b/sdks/python/julep/api/types/user_docs_search_route_search_response.py index bc43c1139..9206fc909 100644 --- a/sdks/python/julep/api/types/user_docs_search_route_search_response.py +++ b/sdks/python/julep/api/types/user_docs_search_route_search_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .docs_doc_reference import DocsDocReference -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class UserDocsSearchRouteSearchResponse(pydantic.BaseModel): +class UserDocsSearchRouteSearchResponse(pydantic_v1.BaseModel): results: typing.List[DocsDocReference] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_create_or_update_response.py b/sdks/python/julep/api/types/users_route_create_or_update_response.py index 4cde96361..e8f8f6b24 100644 --- a/sdks/python/julep/api/types/users_route_create_or_update_response.py +++ b/sdks/python/julep/api/types/users_route_create_or_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class UsersRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class UsersRouteCreateOrUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_create_response.py b/sdks/python/julep/api/types/users_route_create_response.py index 5d569b66a..f8d878dcd 100644 --- a/sdks/python/julep/api/types/users_route_create_response.py +++ b/sdks/python/julep/api/types/users_route_create_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class UsersRouteCreateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of created undefined + """ -class UsersRouteCreateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of created undefined") - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_delete_response.py b/sdks/python/julep/api/types/users_route_delete_response.py index f1a06fe55..75e51a63d 100644 --- a/sdks/python/julep/api/types/users_route_delete_response.py +++ b/sdks/python/julep/api/types/users_route_delete_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class UsersRouteDeleteResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of deleted undefined + """ -class UsersRouteDeleteResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of deleted undefined") - deleted_at: dt.datetime = pydantic.Field( - description="When this resource was deleted as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + deleted_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was deleted as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_list_request_direction.py b/sdks/python/julep/api/types/users_route_list_request_direction.py index 876e3e297..0bd478d82 100644 --- a/sdks/python/julep/api/types/users_route_list_request_direction.py +++ b/sdks/python/julep/api/types/users_route_list_request_direction.py @@ -1,19 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class UsersRouteListRequestDirection(str, enum.Enum): - ASC = "asc" - DESC = "desc" - - def visit( - self, asc: typing.Callable[[], T_Result], desc: typing.Callable[[], T_Result] - ) -> T_Result: - if self is UsersRouteListRequestDirection.ASC: - return asc() - if self is UsersRouteListRequestDirection.DESC: - return desc() +UsersRouteListRequestDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] diff --git a/sdks/python/julep/api/types/users_route_list_request_sort_by.py b/sdks/python/julep/api/types/users_route_list_request_sort_by.py index bfab3f205..2e45a9857 100644 --- a/sdks/python/julep/api/types/users_route_list_request_sort_by.py +++ b/sdks/python/julep/api/types/users_route_list_request_sort_by.py @@ -1,25 +1,7 @@ # This file was auto-generated by Fern from our API Definition. -import enum import typing -T_Result = typing.TypeVar("T_Result") - - -class UsersRouteListRequestSortBy(str, enum.Enum): - CREATED_AT = "created_at" - UPDATED_AT = "updated_at" - DELETED_AT = "deleted_at" - - def visit( - self, - created_at: typing.Callable[[], T_Result], - updated_at: typing.Callable[[], T_Result], - deleted_at: typing.Callable[[], T_Result], - ) -> T_Result: - if self is UsersRouteListRequestSortBy.CREATED_AT: - return created_at() - if self is UsersRouteListRequestSortBy.UPDATED_AT: - return updated_at() - if self is UsersRouteListRequestSortBy.DELETED_AT: - return deleted_at() +UsersRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/users_route_list_response.py b/sdks/python/julep/api/types/users_route_list_response.py index d2d358a2a..7cb75ac18 100644 --- a/sdks/python/julep/api/types/users_route_list_response.py +++ b/sdks/python/julep/api/types/users_route_list_response.py @@ -4,15 +4,11 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .users_user import UsersUser -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class UsersRouteListResponse(pydantic.BaseModel): +class UsersRouteListResponse(pydantic_v1.BaseModel): results: typing.List[UsersUser] def json(self, **kwargs: typing.Any) -> str: @@ -24,14 +20,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_patch_response.py b/sdks/python/julep/api/types/users_route_patch_response.py index 05a16bb93..a38a240f5 100644 --- a/sdks/python/julep/api/types/users_route_patch_response.py +++ b/sdks/python/julep/api/types/users_route_patch_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class UsersRoutePatchResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class UsersRoutePatchResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_update_response.py b/sdks/python/julep/api/types/users_route_update_response.py index eab11cc37..55a288b3d 100644 --- a/sdks/python/julep/api/types/users_route_update_response.py +++ b/sdks/python/julep/api/types/users_route_update_response.py @@ -4,22 +4,25 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore +class UsersRouteUpdateResponse(pydantic_v1.BaseModel): + id: CommonUuid = pydantic_v1.Field() + """ + ID of updated undefined + """ -class UsersRouteUpdateResponse(pydantic.BaseModel): - id: CommonUuid = pydantic.Field(description="ID of updated undefined") - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - jobs: typing.List[CommonUuid] = pydantic.Field( - description="IDs (if any) of jobs created as part of this request" - ) + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + IDs (if any) of jobs created as part of this request + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -30,14 +33,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_user.py b/sdks/python/julep/api/types/users_user.py index 0d4513399..9b6c519de 100644 --- a/sdks/python/julep/api/types/users_user.py +++ b/sdks/python/julep/api/types/users_user.py @@ -4,26 +4,33 @@ import typing from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_uuid import CommonUuid -try: - import pydantic.v1 as pydantic # type: ignore -except ImportError: - import pydantic # type: ignore - -class UsersUser(pydantic.BaseModel): +class UsersUser(pydantic_v1.BaseModel): id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] - created_at: dt.datetime = pydantic.Field( - description="When this resource was created as UTC date-time" - ) - updated_at: dt.datetime = pydantic.Field( - description="When this resource was updated as UTC date-time" - ) - name: CommonIdentifierSafeUnicode = pydantic.Field(description="Name of the user") - about: str = pydantic.Field(description="About the user") + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the user + """ + + about: str = pydantic_v1.Field() + """ + About the user + """ def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { @@ -34,14 +41,24 @@ def json(self, **kwargs: typing.Any) -> str: return super().json(**kwargs_with_defaults) def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults: typing.Any = { + kwargs_with_defaults_exclude_unset: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs, } - return super().dict(**kwargs_with_defaults) + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) class Config: frozen = True smart_union = True + extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} From d54bca368c62b592d4b8223bb382cdc93ba46e28 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Thu, 18 Jul 2024 18:55:37 -0400 Subject: [PATCH 13/36] feat(typespec): Various changes to the spec Signed-off-by: Diwank Tomer --- typespec/chat/models.tsp | 3 +++ typespec/common/scalars.tsp | 3 +++ typespec/docs/endpoints.tsp | 8 ++++++++ typespec/docs/models.tsp | 10 ++++++++++ typespec/executions/models.tsp | 1 + typespec/main.tsp | 19 ++++++++++++------- typespec/sessions/models.tsp | 26 +++++++++++++++++--------- typespec/tasks/models.tsp | 10 +++++----- typespec/tools/models.tsp | 4 ---- 9 files changed, 59 insertions(+), 25 deletions(-) diff --git a/typespec/chat/models.tsp b/typespec/chat/models.tsp index 69c173164..a90ad47a5 100644 --- a/typespec/chat/models.tsp +++ b/typespec/chat/models.tsp @@ -90,6 +90,9 @@ model CommonChatSettings { /** Response format (set to `json_object` to restrict output to JSON) */ response_format?: CompletionResponseFormat; + + /** Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) */ + agent?: uuid; } model GenerationPresetSettings { diff --git a/typespec/common/scalars.tsp b/typespec/common/scalars.tsp index aeef009c9..b1c710ce2 100644 --- a/typespec/common/scalars.tsp +++ b/typespec/common/scalars.tsp @@ -49,3 +49,6 @@ alias entrySource = "api_request" | "api_response" | "tool_response" | "internal /** Naming convention for tool references. Tools are resolved in order: `step-settings` -> `task` -> `agent` */ @pattern("^(function|integration|system|api_call)\\.(\\w+)$") scalar toolRef extends string; + +/** A simple python expression compatible with SimpleEval. */ +scalar PyExpression extends string; \ No newline at end of file diff --git a/typespec/docs/endpoints.tsp b/typespec/docs/endpoints.tsp index cc15aef27..1ec1f17b1 100644 --- a/typespec/docs/endpoints.tsp +++ b/typespec/docs/endpoints.tsp @@ -41,3 +41,11 @@ interface SearchEndpoints { results: DocReference[]; }; } + +interface EmbedEndpoints { + @doc("Embed a query for search") + @post + embed( + body: EmbedQueryRequest, + ): EmbedQueryResponse; +} diff --git a/typespec/docs/models.tsp b/typespec/docs/models.tsp index 8d75f5776..6795822a4 100644 --- a/typespec/docs/models.tsp +++ b/typespec/docs/models.tsp @@ -50,6 +50,16 @@ model DocReference { snippet?: string; } +model EmbedQueryRequest { + /** Text or texts to embed */ + text: string | string[]; +} + +model EmbedQueryResponse { + /** The embedded vectors */ + vectors: float[][]; +} + @discriminator("mode") model DocSearchRequest { text?: string | string[]; diff --git a/typespec/executions/models.tsp b/typespec/executions/models.tsp index df759b13a..a77ed432d 100644 --- a/typespec/executions/models.tsp +++ b/typespec/executions/models.tsp @@ -47,6 +47,7 @@ model Execution { input: Record; ...HasTimestamps; + ...HasMetadata; ...HasId; } diff --git a/typespec/main.tsp b/typespec/main.tsp index 632b7943d..1163e4434 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -61,13 +61,15 @@ using Versions; namespace Api { model Agent is Agents.Agent; model Doc is Docs.Doc; - model Tool is Tools.Tool; - model User is Users.User; - model Session is Sessions.Session; - model History is Entries.History; model Entry is Entries.Entry; - model Task is Tasks.Task; + model Execution is Executions.Execution; + model History is Entries.History; model JobStatus is Jobs.JobStatus; + model Session is Sessions.Session; + model Task is Tasks.Task; + model Tool is Tools.Tool; + model Transition is Executions.Transition; + model User is Users.User; @route("/agents") interface AgentsRoute extends Agents.Endpoints {} @@ -96,8 +98,11 @@ namespace Api { @route("/sessions/{id}/history") interface HistoryRoute extends Entries.Endpoints {} - @route("/docs/{id}") - interface AgentIndividualDocsRoute extends Docs.IndividualDocEndpoints {} + @route("/embed") + interface EmbedRoute extends Docs.EmbedEndpoints {} + + @route("/docs") + interface IndividualDocsRoute extends Docs.IndividualDocEndpoints {} @route("/tasks") interface TasksRoute extends Tasks.Endpoints {} diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index cfee449a6..b6da20809 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -8,10 +8,18 @@ namespace Sessions; // SESSION MODELS // -@discriminator("__kind") +enum ContextOverflowType { + /** Truncate the context from the top except the system prompt. */ + truncate, + + /** Automatically summarizes, clips and merges messages in the background to compress the context. */ + adaptive, +} + +@discriminator("kind") model Session { @visibility("none") - __kind: ( + kind: ( | "single_agent_no_user" | "single_agent_single_user" | "single_agent_multi_user" @@ -48,7 +56,7 @@ model Session { token_budget: uint16 | null = null; /** Action to start on context window overflow */ - context_overflow: string | null = null; + context_overflow: ContextOverflowType | null = null; ...HasId; ...HasMetadata; @@ -57,7 +65,7 @@ model Session { model SingleAgentNoUserSession extends Session { @visibility("none") - __kind: "single_agent_no_user" = "single_agent_no_user"; + kind: "single_agent_no_user" = "single_agent_no_user"; user?: never; users?: never; @@ -68,7 +76,7 @@ model SingleAgentNoUserSession extends Session { model SingleAgentSingleUserSession extends Session { @visibility("none") - __kind: "single_agent_single_user" = "single_agent_single_user"; + kind: "single_agent_single_user" = "single_agent_single_user"; users?: never; agents?: never; @@ -79,7 +87,7 @@ model SingleAgentSingleUserSession extends Session { model SingleAgentMultiUserSession extends Session { @visibility("none") - __kind: "single_agent_multi_user" = "single_agent_multi_user"; + kind: "single_agent_multi_user" = "single_agent_multi_user"; user?: never; agents?: never; @@ -90,7 +98,7 @@ model SingleAgentMultiUserSession extends Session { model MultiAgentNoUserSession extends Session { @visibility("none") - __kind: "multi_agent_no_user" = "multi_agent_no_user"; + kind: "multi_agent_no_user" = "multi_agent_no_user"; user?: never; users?: never; @@ -101,7 +109,7 @@ model MultiAgentNoUserSession extends Session { model MultiAgentSingleUserSession extends Session { @visibility("none") - __kind: "multi_agent_single_user" = "multi_agent_single_user"; + kind: "multi_agent_single_user" = "multi_agent_single_user"; users?: never; agent?: never; @@ -112,7 +120,7 @@ model MultiAgentSingleUserSession extends Session { model MultiAgentMultiUserSession extends Session { @visibility("none") - __kind: "multi_agent_multi_user" = "multi_agent_multi_user"; + kind: "multi_agent_multi_user" = "multi_agent_multi_user"; user?: never; agent?: never; diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 097dc311f..9201224ad 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -58,8 +58,7 @@ model ToolCallStep extends WorkflowStep { } /** An object where values are strings in the Common Expression Language that get evaluated before being passed downstream */ -scalar CEL extends string; -alias CELObject = Record; +alias ExpressionObject = Record; model YieldStep extends WorkflowStep { @visibility("none") @@ -69,7 +68,7 @@ model YieldStep extends WorkflowStep { workflow: string; /** The input parameters for the subworkflow */ - arguments: CELObject; + arguments: ExpressionObject; } model PromptStep extends WorkflowStep { @@ -88,7 +87,7 @@ model EvaluateStep extends WorkflowStep { __kind: "evaluate" = "evaluate"; /** The expression to evaluate */ - evaluate: CELObject; + evaluate: ExpressionObject; } model IfElseWorkflowStep extends WorkflowStep { @@ -96,7 +95,7 @@ model IfElseWorkflowStep extends WorkflowStep { __kind: "if_else" = "if_else"; /** The condition to evaluate */ - `if`: CEL; + `if`: PyExpression; /** The steps to run if the condition is true */ then: WorkflowStep; @@ -149,6 +148,7 @@ model Task { ...HasId; ...HasTimestamps; + ...HasMetadata; ...Record; } diff --git a/typespec/tools/models.tsp b/typespec/tools/models.tsp index ed83a6d72..626d3ec4c 100644 --- a/typespec/tools/models.tsp +++ b/typespec/tools/models.tsp @@ -49,9 +49,6 @@ model Tool { /** The tool should be run in the background (not supported at the moment) */ background: boolean = false; - /** Whether the tool that can be run interactively (response should contain "stop" boolean field) */ - interactive: boolean = false; - function?: FunctionDef; integration?: unknown; system?: unknown; @@ -64,7 +61,6 @@ model Tool { model FunctionTool extends Tool { type: ToolType.function; background: false = false; - interactive: false = false; /** The function to call */ function: FunctionDef; From b2f58080c5485153f42bca9c7c565a93c0bce5e6 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sat, 20 Jul 2024 14:50:36 -0400 Subject: [PATCH 14/36] fix(typespec): Fix docstrings Signed-off-by: Diwank Tomer --- typespec/agents/endpoints.tsp | 14 +- typespec/common/interfaces.tsp | 160 +++++----- typespec/common/types.tsp | 18 +- typespec/docs/endpoints.tsp | 18 +- typespec/entries/endpoints.tsp | 6 +- typespec/executions/endpoints.tsp | 11 +- typespec/jobs/endpoints.tsp | 6 +- typespec/main.tsp | 6 +- typespec/package-lock.json | 498 ++++++++++++++++++++---------- typespec/package.json | 13 +- typespec/sessions/endpoints.tsp | 14 +- typespec/tasks/endpoints.tsp | 68 ++-- typespec/tools/endpoints.tsp | 10 +- typespec/tspconfig.yaml | 2 +- typespec/users/endpoints.tsp | 14 +- 15 files changed, 529 insertions(+), 329 deletions(-) diff --git a/typespec/agents/endpoints.tsp b/typespec/agents/endpoints.tsp index a3c6353a9..6dc34e5fc 100644 --- a/typespec/agents/endpoints.tsp +++ b/typespec/agents/endpoints.tsp @@ -10,10 +10,10 @@ namespace Agents; // interface Endpoints - extends LimitOffsetPagination, - CreateEndpoint, - CreateOrUpdateEndpoint, - UpdateEndpoint, - PatchEndpoint, - DeleteEndpoint, - GetEndpoint {} \ No newline at end of file + extends LimitOffsetPagination, + CreateEndpoint, + CreateOrUpdateEndpoint, + UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint<"Delete Agent by id">, + GetEndpoint {} \ No newline at end of file diff --git a/typespec/common/interfaces.tsp b/typespec/common/interfaces.tsp index e769c1510..a8ec41483 100644 --- a/typespec/common/interfaces.tsp +++ b/typespec/common/interfaces.tsp @@ -11,180 +11,192 @@ namespace Common; // COMMON INTERFACES // -interface LimitOffsetPagination { +interface LimitOffsetPagination< + Type, + DocString extends valueof string = "List resources (paginated)" +> { @get - @doc("List {TName} items", {TName: TName}) - list( - ...PaginationOptions - ): {results: T[]}; + @doc(DocString) + list(...PaginationOptions): { + results: Type[]; + }; } -interface CreateEndpoint { +interface CreateEndpoint< + CreateType, + DocString extends valueof string = "Create a new resource" +> { @post - @doc("Create new {TName}", {TName: TName}) - create( - @header contentType: yaml | json; - - ...CreateT - ): { + @doc(DocString) + create(@header contentType: yaml | json, ...CreateType): { @statusCode _: "201"; @body - @doc("Details of {TName} resource created along with ID", {TName: TName}) - body: ResourceCreatedResponse; + @doc("Details of the resource created along with ID") + body: ResourceCreatedResponse; }; } -interface CreateOrUpdateEndpoint { +interface CreateOrUpdateEndpoint< + CreateOrUpdateType, + DocString extends valueof string = "Create or update a resource (ID is required in payload; existing resource will be overwritten)" +> { @put - @doc("Create or update {TName} (ID is required in payload; existing resource will be overwritten)", {TName: TName}) - createOrUpdate( - @header contentType: yaml | json; - - ...CreateOrUpdateT - ): { + @doc(DocString) + createOrUpdate(@header contentType: yaml | json, ...CreateOrUpdateType): { @statusCode _: "200"; @body - @doc("Details of {TName} resource updated along with ID", {TName: TName}) - body: ResourceUpdatedResponse; + @doc("Details of the resource updated along with ID") + body: ResourceUpdatedResponse; }; } -interface UpdateEndpoint { +interface UpdateEndpoint< + UpdateType, + DocString extends valueof string = "Update resource by id (overwrite existing values)" +> { @put @route("{id}") - @doc("Update {TName} by id (overwrite)", {TName: TName}) + @doc(DocString) update( - @header contentType: yaml | json; + @header contentType: yaml | json, @path - @doc("ID of the {TName}", {TName: TName}) + @doc("ID of the resource") id: uuid, - ...UpdateT, + ...UpdateType, ): { @statusCode _: "200"; @body - @doc("Details of {TName} resource updated along with ID", {TName: TName}) - body: ResourceUpdatedResponse; + @doc("Details of the resource updated along with ID") + body: ResourceUpdatedResponse; }; } -interface PatchEndpoint { +interface PatchEndpoint< + PatchType, + DocString extends valueof string = "Patch resource by its id (merge changes with existing values)" +> { @patch @route("{id}") - @doc("Patch {TName} by id (merge changes)", {TName: TName}) + @doc(DocString) patch( - @header contentType: yaml | json; + @header contentType: yaml | json, @path - @doc("ID of the {TName}", {TName: TName}) + @doc("ID of the resource") id: uuid, - ...PatchT, + ...PatchType, ): { @statusCode _: "200"; @body - @doc("Details of {TName} resource patched along with ID", {TName: TName}) - body: ResourceUpdatedResponse; + @doc("Details of the resource patched along with ID") + body: ResourceUpdatedResponse; }; } -interface GetEndpoint { +interface GetEndpoint< + Type, + DocString extends valueof string = "Get resource by id" +> { @get @route("{id}") - @doc("Get {TName} by id", {TName: TName}) + @doc(DocString) get( @path - @doc("ID of the {TName}", {TName: TName}) + @doc("ID of the resource") id: uuid, - ): T; + ): Type; } -interface DeleteEndpoint { +interface DeleteEndpoint { @delete @route("{id}") - @doc("Delete {TName} by id", {TName: TName}) + @doc(DocString) delete( @path - @doc("ID of the {TName}", {TName: TName}) + @doc("ID of the resource") id: uuid, ): { @statusCode _: "202"; @body - @doc("Details of {TName} resource deleted along with ID", {TName: TName}) - body: ResourceDeletedResponse; + @doc("Details of the resource deleted along with ID") + body: ResourceDeletedResponse; }; } interface ChildLimitOffsetPagination< T, - TName extends string, - P, - PName extends string + DocString extends valueof string = "List items owned by the given parent" > { @get - @doc("List {TName} items of parent {PName}", {TName: TName, PName: PName}) + @doc(DocString) list( @path - @doc("ID of parent {PName}", {PName: PName}) + @doc("ID of parent") id: uuid, - - ...PaginationOptions - ): {results: T[]}; + + ...PaginationOptions, + ): { + results: T[]; + }; } interface ChildCreateEndpoint< - T, - TName extends string, - P, - PName extends string, - CreateT = T + CreateType, + DocString extends valueof string = "Create a new resource owned by the given parent" > { @post - @doc("Create new {TName}", {TName: TName}) + @doc(DocString) create( - @header contentType: yaml | json; + @header contentType: yaml | json, @path - @doc("ID of parent {PName}", {PName: PName}) + @doc("ID of parent resource") id: uuid, - ...CreateT, + ...CreateType, ): { @statusCode _: "201"; @body - @doc("Details of {TName} resource created along with ID", {TName: TName}) - body: ResourceCreatedResponse; + @doc("Details of the resource created along with ID") + body: ResourceCreatedResponse; }; } interface ChildDeleteEndpoint< - T, - TName extends string, - P, - PName extends string + DocString extends valueof string = "Delete a resource owned by the given parent using its id" > { @post - @doc("Delete {TName} of a {PName} by id", {TName: TName, PName: PName}) + @doc( + DocString + ) delete( @path - @doc("ID of parent {PName}", {PName: PName}) + @doc( + "ID of parent resource", + ) parent_id: uuid, @path - @doc("ID of the {TName}", {TName: TName}) + @doc( + "ID of the resource to be deleted", + ) id: uuid, ): { @statusCode _: "202"; @body - @doc("Details of {TName} resource deleted along with ID", {TName: TName}) - body: ResourceDeletedResponse; + @doc( + "Details of the resource deleted along with ID", + ) + body: ResourceDeletedResponse; }; } diff --git a/typespec/common/types.tsp b/typespec/common/types.tsp index 4be017203..7d954a80e 100644 --- a/typespec/common/types.tsp +++ b/typespec/common/types.tsp @@ -12,34 +12,34 @@ namespace Common; alias Metadata = Record; -model ResourceCreatedResponse { - @doc("ID of created {TName}", {TName: TName}) +model ResourceCreatedResponse { + @doc("ID of created resource") id: uuid; ...HasCreatedAt; ...HasJobs; } -model ResourceUpdatedResponse { - @doc("ID of updated {TName}", {TName: TName}) +model ResourceUpdatedResponse { + @doc("ID of updated resource") id: uuid; ...HasUpdatedAt; ...HasJobs; } -model ResourceDeletedResponse { - @doc("ID of deleted {TName}", {TName: TName}) +model ResourceDeletedResponse { + @doc("ID of deleted resource") id: uuid; ...HasDeletedAt; ...HasJobs; } -model PaginationOptions { +model PaginationOptions { @query - @doc("Limit the number of {TName} items returned", {TName: TName}) + @doc("Limit the number of items returned") limit: limit = 100, @query - @doc("Offset the {TName} items returned", {TName: TName}) + @doc("Offset the items returned") offset: offset = 0, /** Sort by a field */ diff --git a/typespec/docs/endpoints.tsp b/typespec/docs/endpoints.tsp index 1ec1f17b1..940d040b5 100644 --- a/typespec/docs/endpoints.tsp +++ b/typespec/docs/endpoints.tsp @@ -18,24 +18,24 @@ namespace Docs; // interface UserEndpoints - extends ChildLimitOffsetPagination {} + extends ChildLimitOffsetPagination {} interface AgentEndpoints - extends ChildLimitOffsetPagination {} + extends ChildLimitOffsetPagination {} interface IndividualDocEndpoints - extends GetEndpoint, - DeleteEndpoint {} + extends GetEndpoint, + DeleteEndpoint<"Delete an existing Doc by id"> {} -interface SearchEndpoints { - @doc("Search for documents owned by {TName}", {TName: TName}) +interface SearchEndpoints { + @doc(DocString) @post search( @path - @doc("ID of the {TName}", {TName: TName}) - id: User.id | Agent.id, + @doc("ID of the parent") + id: uuid, - ...PaginationOptions<"Doc">, + ...PaginationOptions, body: DocSearchRequest, ): { results: DocReference[]; diff --git a/typespec/entries/endpoints.tsp b/typespec/entries/endpoints.tsp index 306a1c429..5c41984ce 100644 --- a/typespec/entries/endpoints.tsp +++ b/typespec/entries/endpoints.tsp @@ -14,8 +14,6 @@ namespace Entries; interface Endpoints extends ChildLimitOffsetPagination< History, - "History", - Session, - "Session" + "Get history of a Session (paginated)" >, - DeleteEndpoint {} + DeleteEndpoint<"Clear the history of a Session (resets the Session)"> {} diff --git a/typespec/executions/endpoints.tsp b/typespec/executions/endpoints.tsp index c2ff867b9..0fa7b43e5 100644 --- a/typespec/executions/endpoints.tsp +++ b/typespec/executions/endpoints.tsp @@ -10,15 +10,16 @@ namespace Executions; // interface Endpoints - extends UpdateEndpoint, - GetEndpoint {} + extends UpdateEndpoint< + UpdateExecutionRequest, + "Update an existing Execution" + >, + GetEndpoint {} interface TransitionEndpoints extends ChildLimitOffsetPagination< { transitions: Transition[], }, - "Transitions", - Execution, - "Execution" + "List the Transitions of an Execution by id" > {} diff --git a/typespec/jobs/endpoints.tsp b/typespec/jobs/endpoints.tsp index fbc8a210b..64a0adc69 100644 --- a/typespec/jobs/endpoints.tsp +++ b/typespec/jobs/endpoints.tsp @@ -9,4 +9,8 @@ namespace Jobs; // JOB ENDPOINTS // -interface Endpoints extends GetEndpoint {} \ No newline at end of file +interface Endpoints + extends GetEndpoint< + JobStatus, + "Get the status of an existing Job by its id" + > {} diff --git a/typespec/main.tsp b/typespec/main.tsp index 87a7a8ae3..20285c7ba 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -78,7 +78,7 @@ namespace Api { interface AgentDocsRoute extends Docs.AgentEndpoints {} @route("/agents/{id}/search") - interface AgentsDocsSearchRoute extends Docs.SearchEndpoints<"Agent"> {} + interface AgentsDocsSearchRoute extends Docs.SearchEndpoints<"Search Docs owned by an Agent"> {} @route("/agents/{id}/tools") interface AgentToolsRoute extends Tools.AgentEndpoints {} @@ -90,12 +90,12 @@ namespace Api { interface UserDocsRoute extends Docs.UserEndpoints {} @route("/users/{id}/search") - interface UserDocsSearchRoute extends Docs.SearchEndpoints<"User"> {} + interface UserDocsSearchRoute extends Docs.SearchEndpoints<"Search Docs owned by a User"> {} @route("/sessions") interface SessionsRoute extends Sessions.Endpoints {} - @route("/sessions/history") + @route("/sessions/{id}/history") interface HistoryRoute extends Entries.Endpoints {} @route("/embed") diff --git a/typespec/package-lock.json b/typespec/package-lock.json index 69b87555d..f535be674 100644 --- a/typespec/package-lock.json +++ b/typespec/package-lock.json @@ -8,93 +8,19 @@ "name": "julep-typespec", "version": "0.3.0", "dependencies": { - "@azure-tools/typespec-autorest": "^0.43.0", - "@typespec/compiler": "latest", - "@typespec/http": "latest", - "@typespec/openapi": "^0.57.0", - "@typespec/openapi3": "latest", - "@typespec/rest": "latest", - "@typespec/versioning": "^0.57.0", - "autorest": "^3.7.1" - } - }, - "node_modules/@azure-tools/typespec-autorest": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.43.0.tgz", - "integrity": "sha512-tZ9uXXOdxu2y01W9n3mzXf+IEY2MQkP/JaQaKlcOx2+dbklHNQWSDU0Vm6Gmm6l//XiF9QiI8653BiuO97czyw==", - "license": "MIT", - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.43.0", - "@azure-tools/typespec-azure-resource-manager": "~0.43.0", - "@azure-tools/typespec-client-generator-core": "~0.43.0", - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/openapi": "~0.57.0", - "@typespec/rest": "~0.57.0", - "@typespec/versioning": "~0.57.0" - } - }, - "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.43.0.tgz", - "integrity": "sha512-B1r0i3segJ7RuNXxcAMBy8H2t+jTkaf74dkyUWD0HIFPkhETN0uR59nuor+s+LoLU8yI4JypOFSNZt6e1rod8w==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/rest": "~0.57.0" - } - }, - "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.43.0.tgz", - "integrity": "sha512-0GQL+/o1u+PAB63FpYz3sy3ZgZvCtk5T4sDAnICnV23v2YWIONDMUfxxd0x40xJbY6PkcwwHDpBLNMqajf2H6A==", - "license": "MIT", - "peer": true, - "dependencies": { - "change-case": "~5.4.4", - "pluralize": "^8.0.0" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.43.0", - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/openapi": "~0.57.0", - "@typespec/rest": "~0.57.0", - "@typespec/versioning": "~0.57.0" - } - }, - "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.43.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.43.1.tgz", - "integrity": "sha512-NwNN/fIOcjOU/8o6ViCuEAAQl6zmu2X1QKPuXxeSy8ssDwrTiX9Ho2X/7IZM4XmOArKTtgmTkNcSnnmuj5dsGg==", - "license": "MIT", - "peer": true, - "dependencies": { - "change-case": "~5.4.4", - "pluralize": "^8.0.0" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.43.0", - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/rest": "~0.57.0", - "@typespec/versioning": "~0.57.0", - "@typespec/xml": "~0.57.0" - } + "@typespec/compiler": "^0.58.1", + "@typespec/http": "^0.58.0", + "@typespec/openapi": "^0.58.0", + "@typespec/openapi3": "^0.58.0", + "@typespec/rest": "^0.58.0", + "@typespec/versioning": "^0.58.0" + } + }, + "node_modules/@apidevtools/swagger-methods": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", + "license": "MIT" }, "node_modules/@babel/code-frame": { "version": "7.24.7", @@ -133,6 +59,33 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.8.tgz", + "integrity": "sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@humanwhocodes/momoa": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-2.0.4.tgz", + "integrity": "sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==", + "license": "Apache-2.0", + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "license": "MIT" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -168,6 +121,140 @@ "node": ">= 8" } }, + "node_modules/@readme/better-ajv-errors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@readme/better-ajv-errors/-/better-ajv-errors-1.6.0.tgz", + "integrity": "sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==", + "license": "Apache-2.0", + "dependencies": { + "@babel/code-frame": "^7.16.0", + "@babel/runtime": "^7.21.0", + "@humanwhocodes/momoa": "^2.0.3", + "chalk": "^4.1.2", + "json-to-ast": "^2.0.3", + "jsonpointer": "^5.0.0", + "leven": "^3.1.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "ajv": "4.11.8 - 8" + } + }, + "node_modules/@readme/better-ajv-errors/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@readme/better-ajv-errors/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@readme/better-ajv-errors/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@readme/better-ajv-errors/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/@readme/better-ajv-errors/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@readme/better-ajv-errors/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@readme/json-schema-ref-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@readme/json-schema-ref-parser/-/json-schema-ref-parser-1.2.0.tgz", + "integrity": "sha512-Bt3QVovFSua4QmHa65EHUmh2xS0XJ3rgTEUPH998f4OW4VVJke3BuS16f+kM0ZLOGdvIrzrPRqwihuv5BAjtrA==", + "license": "MIT", + "dependencies": { + "@jsdevtools/ono": "^7.1.3", + "@types/json-schema": "^7.0.6", + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0" + } + }, + "node_modules/@readme/openapi-parser": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@readme/openapi-parser/-/openapi-parser-2.6.0.tgz", + "integrity": "sha512-pyFJXezWj9WI1O+gdp95CoxfY+i+Uq3kKk4zXIFuRAZi9YnHpHOpjumWWr67wkmRTw19Hskh9spyY0Iyikf3fA==", + "license": "MIT", + "dependencies": { + "@apidevtools/swagger-methods": "^3.0.2", + "@jsdevtools/ono": "^7.1.3", + "@readme/better-ajv-errors": "^1.6.0", + "@readme/json-schema-ref-parser": "^1.2.0", + "@readme/openapi-schemas": "^3.1.0", + "ajv": "^8.12.0", + "ajv-draft-04": "^1.0.0", + "call-me-maybe": "^1.0.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "openapi-types": ">=7" + } + }, + "node_modules/@readme/openapi-schemas": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@readme/openapi-schemas/-/openapi-schemas-3.1.0.tgz", + "integrity": "sha512-9FC/6ho8uFa8fV50+FPy/ngWN53jaUu4GRXlAjcxIRrzhltJnpKkBG2Tp0IDraFJeWrOpk84RJ9EMEEYzaI1Bw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", @@ -180,24 +267,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "license": "MIT" + }, "node_modules/@typespec/compiler": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.57.0.tgz", - "integrity": "sha512-Z5L7J90Ol21IbzU+rBD2wzKy2vJ2Yg2FIzi+yB5rtb7/c4oBea/CgEByMVHBtT7uw45ZXJpHOiepuGSPVXw2EA==", + "version": "0.58.1", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.58.1.tgz", + "integrity": "sha512-bVxxM35r40OtuL4+/9W/g1EevlnWnW6i151nsZAFOJj1xWHoE2G9zkx5/Feic8OlzArjhGGLJOLH3Ez1Wrw35A==", "license": "MIT", "dependencies": { - "@babel/code-frame": "~7.24.2", - "ajv": "~8.13.0", + "@babel/code-frame": "~7.24.7", + "ajv": "~8.16.0", "change-case": "~5.4.4", - "globby": "~14.0.1", + "globby": "~14.0.2", "mustache": "~4.2.0", "picocolors": "~1.0.1", - "prettier": "~3.2.5", + "prettier": "~3.3.2", "prompts": "~2.4.2", "semver": "^7.6.2", + "temporal-polyfill": "^0.2.5", "vscode-languageserver": "~9.0.1", "vscode-languageserver-textdocument": "~1.0.11", - "yaml": "~2.4.2", + "yaml": "~2.4.5", "yargs": "~17.7.2" }, "bin": { @@ -209,90 +303,81 @@ } }, "node_modules/@typespec/http": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.57.0.tgz", - "integrity": "sha512-k3bWOTPNqlRB3/TmrXVBtObmxj2J20l2FnhGXvs+tjdtbXLxCQWmvQz6xlne9nkLAtWVB/pQRUn+oMJfhWta3w==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.58.0.tgz", + "integrity": "sha512-jQpkugg9AZVrNDMkDIgZRpIoRkkU2b0LtKWqMGg33MItYj9/DYSgDtY7xb7oCBppRtFFZ/h138HyhYl3zQxZRg==", "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0" + "@typespec/compiler": "~0.58.0" } }, "node_modules/@typespec/openapi": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.57.0.tgz", - "integrity": "sha512-35wK/BqjOXSlhWuGMwoYN3FSgIYFOKtw8ot4ErcgmxAGuKaS2GkUhZvtQJXUn2ByU0Fl4jqslPmTz8SEcz7rbw==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.58.0.tgz", + "integrity": "sha512-gu6nXfmpfZrfq8Etpgl1dpMfsXii7EzQyhZgsPhIy7ZwV5bDmFk1/oyhTqIpWrnr4pD3r151T2BQjzJefjf15A==", "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0" + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0" } }, "node_modules/@typespec/openapi3": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-0.57.0.tgz", - "integrity": "sha512-spNLzwCTduPISJBTWhqsMLTjuGC3Tdh/FVI1rTGnRunB7ZXjhRyz031o1bCe2BZeW1w1sacZGfe+ba8sXqgMxA==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-0.58.0.tgz", + "integrity": "sha512-G9t9CWT9cN6ip39dLZaE6JdEDxGsFyOUxA2s6a087rweoTH85XzsFiQL7uiUD8vHhXyEo6tF6sy3LMZVN0BsoQ==", "license": "MIT", "dependencies": { - "yaml": "~2.4.2" + "@readme/openapi-parser": "~2.6.0", + "yaml": "~2.4.5" + }, + "bin": { + "tsp-openapi3": "cmd/tsp-openapi3.js" }, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0", - "@typespec/openapi": "~0.57.0", - "@typespec/versioning": "~0.57.0" + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0", + "@typespec/openapi": "~0.58.0", + "@typespec/versioning": "~0.58.0" } }, "node_modules/@typespec/rest": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.57.0.tgz", - "integrity": "sha512-mZj76Kf+cmH38pYA6LT8Zz7QjuR3fdQo5bc8pXhKMwLq9vRqNLz6Z9InbOeo8zY+xP0GfUwEU9kXczmCc8gyRA==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.58.0.tgz", + "integrity": "sha512-QBxkED0/KQKG22pwzis0n7BY+uLMSZZPSoVe/ESBFika9n5/yyeQ0l58xbFFwwfxAxe4xwuZ5PNwTdEXZbzr5g==", "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0", - "@typespec/http": "~0.57.0" + "@typespec/compiler": "~0.58.0", + "@typespec/http": "~0.58.0" } }, "node_modules/@typespec/versioning": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.57.0.tgz", - "integrity": "sha512-kk6zCNSwcqqYB9isNNagTy+Zv6wEIRA4NkcZ/X1riTj2zhJwKsIFNXQWm1yxpZn+BY4+1QtuaQHuBLo8HbgR/w==", + "version": "0.58.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.58.0.tgz", + "integrity": "sha512-brnQQ3wKWh4AbgqmnVLj+8zyOaDk9VPWg4QBecdQxzz7PrSrlAzIzRfeIyr67+hwi/0SvkTAB6GNH7YYTypKGA==", "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.57.0" - } - }, - "node_modules/@typespec/xml": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.57.0.tgz", - "integrity": "sha512-itsFsahgBRNREoF4FXUgELmNGtOMmzNnhxT+NeAl4f7EXmz/mu1y/k9hWmDXWr+DB0Oq1r0Fc+D0TSl51szzlQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "~0.57.0" + "@typespec/compiler": "~0.58.0" } }, "node_modules/ajv": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", - "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -305,6 +390,20 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "license": "MIT", + "peerDependencies": { + "ajv": "^8.5.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -326,18 +425,11 @@ "node": ">=4" } }, - "node_modules/autorest": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/autorest/-/autorest-3.7.1.tgz", - "integrity": "sha512-6q17NtosQZPqBkIOUnaOPedf3PDIBF7Ha1iEGRhTqZF6TG2Q/1E3ID/D+ePIIzZDKvW01p/2pENq/oiBWH9IGQ==", - "hasInstallScript": true, - "license": "MIT", - "bin": { - "autorest": "entrypoints/app.js" - }, - "engines": { - "node": ">=12.0.0" - } + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" }, "node_modules/braces": { "version": "3.0.3", @@ -351,6 +443,12 @@ "node": ">=8" } }, + "node_modules/call-me-maybe": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", + "license": "MIT" + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -385,6 +483,15 @@ "node": ">=12" } }, + "node_modules/code-error-fragment": { + "version": "0.0.230", + "resolved": "https://registry.npmjs.org/code-error-fragment/-/code-error-fragment-0.0.230.tgz", + "integrity": "sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -508,6 +615,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "license": "MIT" + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -571,12 +684,46 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, + "node_modules/json-to-ast": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json-to-ast/-/json-to-ast-2.1.0.tgz", + "integrity": "sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==", + "license": "MIT", + "dependencies": { + "code-error-fragment": "0.0.230", + "grapheme-splitter": "^1.0.4" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -586,6 +733,15 @@ "node": ">=6" } }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -617,6 +773,13 @@ "mustache": "bin/mustache" } }, + "node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", + "license": "MIT", + "peer": true + }, "node_modules/path-type": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", @@ -647,20 +810,10 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -714,6 +867,12 @@ ], "license": "MIT" }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -833,6 +992,21 @@ "node": ">=4" } }, + "node_modules/temporal-polyfill": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.2.5.tgz", + "integrity": "sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==", + "license": "MIT", + "dependencies": { + "temporal-spec": "^0.2.4" + } + }, + "node_modules/temporal-spec": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.2.4.tgz", + "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==", + "license": "ISC" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/typespec/package.json b/typespec/package.json index bdbf4601f..95c181471 100644 --- a/typespec/package.json +++ b/typespec/package.json @@ -3,13 +3,12 @@ "version": "0.3.0", "type": "module", "dependencies": { - "@typespec/compiler": "latest", - "@typespec/http": "latest", - "@typespec/openapi": "^0.57.0", - "@typespec/openapi3": "latest", - "@typespec/rest": "latest", - "@typespec/versioning": "^0.57.0", - "autorest": "^3.7.1" + "@typespec/compiler": "^0.58.1", + "@typespec/http": "^0.58.0", + "@typespec/openapi": "^0.58.0", + "@typespec/openapi3": "^0.58.0", + "@typespec/rest": "^0.58.0", + "@typespec/versioning": "^0.58.0" }, "private": true } diff --git a/typespec/sessions/endpoints.tsp b/typespec/sessions/endpoints.tsp index 650c6604a..96be2e9a4 100644 --- a/typespec/sessions/endpoints.tsp +++ b/typespec/sessions/endpoints.tsp @@ -10,10 +10,10 @@ namespace Sessions; // interface Endpoints - extends LimitOffsetPagination, - CreateEndpoint, - CreateOrUpdateEndpoint, - UpdateEndpoint, - PatchEndpoint, - DeleteEndpoint, - GetEndpoint {} \ No newline at end of file + extends LimitOffsetPagination, + CreateEndpoint, + CreateOrUpdateEndpoint, + UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint<"Delete a session by its id">, + GetEndpoint {} \ No newline at end of file diff --git a/typespec/tasks/endpoints.tsp b/typespec/tasks/endpoints.tsp index 9246421fe..289dc7c11 100644 --- a/typespec/tasks/endpoints.tsp +++ b/typespec/tasks/endpoints.tsp @@ -16,33 +16,45 @@ namespace Tasks; // interface Endpoints - extends UpdateEndpoint, - PatchEndpoint, - DeleteEndpoint, - LimitOffsetPagination, - CreateOrUpdateEndpoint, - CreateEndpoint {} + extends UpdateEndpoint< + UpdateTaskRequest, + "Update an existing task (overwrite existing values)" + >, + PatchEndpoint< + PatchTaskRequest, + "Update an existing task (merges with existing values)" + >, + DeleteEndpoint<"Delete a task by its id">, + LimitOffsetPagination, + CreateOrUpdateEndpoint< + CreateOrUpdateTaskRequest, + "Create or update a task" + >, + CreateEndpoint {} interface ExecutionEndpoints - extends ChildCreateEndpoint, - ChildLimitOffsetPagination { - @put - @doc("Resume an execution with a task token") - resumeWithTaskToken( - @header contentType: yaml | json; - - @path - @doc("ID of parent Task") - id: uuid, - - @body - @doc("Request to resume an execution with a task token") - body: TaskTokenResumeExecutionRequest; - ): { - @statusCode _: "200"; - - @body - @doc("Response of resuming the execution with the ID found") - body: ResourceUpdatedResponse; - }; - } \ No newline at end of file + extends ChildCreateEndpoint< + CreateExecutionRequest, + "Create an execution for the given task" + >, + ChildLimitOffsetPagination { + @put + @doc("Resume an execution with a task token") + resumeWithTaskToken( + @header contentType: yaml | json, + + @path + @doc("ID of parent Task") + id: uuid, + + @body + @doc("Request to resume an execution with a task token") + body: TaskTokenResumeExecutionRequest, + ): { + @statusCode _: "200"; + + @body + @doc("Response of resuming the execution with the ID found") + body: ResourceUpdatedResponse; + }; +} diff --git a/typespec/tools/endpoints.tsp b/typespec/tools/endpoints.tsp index 186093740..30e03c6d9 100644 --- a/typespec/tools/endpoints.tsp +++ b/typespec/tools/endpoints.tsp @@ -12,10 +12,10 @@ namespace Tools; // interface Endpoints - extends UpdateEndpoint, - PatchEndpoint, - DeleteEndpoint {} + extends UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint<"Delete an existing tool by id"> {} interface AgentEndpoints - extends ChildLimitOffsetPagination, - ChildCreateEndpoint {} + extends ChildLimitOffsetPagination, + ChildCreateEndpoint {} diff --git a/typespec/tspconfig.yaml b/typespec/tspconfig.yaml index c574698ad..c5b3491f6 100644 --- a/typespec/tspconfig.yaml +++ b/typespec/tspconfig.yaml @@ -6,4 +6,4 @@ options: file-type: yaml output-file: "openapi-{version}.yaml" new-line: lf - omit-unreachable-types: true \ No newline at end of file + # omit-unreachable-types: true diff --git a/typespec/users/endpoints.tsp b/typespec/users/endpoints.tsp index 7796c484c..2f2f74a17 100644 --- a/typespec/users/endpoints.tsp +++ b/typespec/users/endpoints.tsp @@ -10,10 +10,10 @@ namespace Users; // interface Endpoints - extends LimitOffsetPagination, - CreateEndpoint, - CreateOrUpdateEndpoint, - UpdateEndpoint, - PatchEndpoint, - DeleteEndpoint, - GetEndpoint {} \ No newline at end of file + extends LimitOffsetPagination, + CreateEndpoint, + CreateOrUpdateEndpoint, + UpdateEndpoint, + PatchEndpoint, + DeleteEndpoint<"Delete a user by id">, + GetEndpoint {} \ No newline at end of file From 2676f6d3e2349f1cb5b049587f12961438c72c39 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sat, 20 Jul 2024 14:56:05 -0400 Subject: [PATCH 15/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Agents.py | 173 +--- agents-api/agents_api/autogen/Chat.py | 28 +- agents-api/agents_api/autogen/Common.py | 36 +- agents-api/agents_api/autogen/Docs.py | 97 +- agents-api/agents_api/autogen/Entries.py | 177 ++-- agents-api/agents_api/autogen/Executions.py | 108 +-- agents-api/agents_api/autogen/Jobs.py | 2 +- agents-api/agents_api/autogen/Sessions.py | 168 +--- agents-api/agents_api/autogen/Tasks.py | 358 +------- agents-api/agents_api/autogen/Tools.py | 183 ++-- agents-api/agents_api/autogen/Users.py | 108 +-- agents-api/agents_api/autogen/__init__.py | 130 ++- .../agents_api/autogen/openapi_model.py | 11 + .../agents_api/common/protocol/entries.py | 4 +- .../agents_api/common/protocol/tasks.py | 16 +- agents-api/poetry.lock | 179 ++-- agents-api/pyproject.toml | 2 +- sdks/python/poetry.lock | 49 +- sdks/ts/src/api/index.ts | 48 +- sdks/ts/src/api/models/Agent.ts | 44 + .../Common_PaginationOptions_direction.ts | 8 + .../models/Common_PaginationOptions_limit.ts | 9 + ...ommon_PaginationOptions_metadata_filter.ts | 8 + .../models/Common_PaginationOptions_offset.ts | 9 + .../Common_PaginationOptions_sort_by.ts | 11 + sdks/ts/src/api/models/Common_PyExpression.ts | 8 + .../models/Common_ResourceCreatedResponse.ts | 19 + .../models/Common_ResourceDeletedResponse.ts | 19 + .../models/Common_ResourceUpdatedResponse.ts | 19 + sdks/ts/src/api/models/Doc.ts | 22 + .../src/api/models/Docs_EmbedQueryRequest.ts | 10 + .../src/api/models/Docs_EmbedQueryResponse.ts | 10 + sdks/ts/src/api/models/Entry.ts | 30 + sdks/ts/src/api/models/Execution.ts | 36 + .../Executions_CreateExecutionRequest.ts | 1 + .../ts/src/api/models/Executions_Execution.ts | 1 + sdks/ts/src/api/models/History.ts | 16 + sdks/ts/src/api/models/JobStatus.ts | 38 + sdks/ts/src/api/models/Session.ts | 52 ++ .../models/Sessions_ContextOverflowType.ts | 5 + .../Sessions_CreateOrUpdateSessionRequest.ts | 3 +- .../models/Sessions_CreateSessionRequest.ts | 3 +- .../models/Sessions_PatchSessionRequest.ts | 3 +- sdks/ts/src/api/models/Sessions_Session.ts | 3 +- .../models/Sessions_UpdateSessionRequest.ts | 3 +- sdks/ts/src/api/models/Task.ts | 9 + sdks/ts/src/api/models/Tasks_CEL.ts | 8 - sdks/ts/src/api/models/Tasks_EvaluateStep.ts | 4 +- .../api/models/Tasks_IfElseWorkflowStep.ts | 4 +- sdks/ts/src/api/models/Tasks_PromptStep.ts | 13 + sdks/ts/src/api/models/Tasks_YieldStep.ts | 4 +- sdks/ts/src/api/models/Tool.ts | 30 + .../src/api/models/Tools_CreateToolRequest.ts | 4 - sdks/ts/src/api/models/Tools_FunctionTool.ts | 1 - .../src/api/models/Tools_PatchToolRequest.ts | 4 - sdks/ts/src/api/models/Tools_Tool.ts | 4 - .../src/api/models/Tools_UpdateToolRequest.ts | 4 - sdks/ts/src/api/models/Transition.ts | 21 + sdks/ts/src/api/models/User.ts | 26 + sdks/ts/src/api/schemas/$Agent.ts | 89 ++ .../$Common_PaginationOptions_direction.ts | 7 + .../$Common_PaginationOptions_limit.ts | 8 + ...ommon_PaginationOptions_metadata_filter.ts | 8 + .../$Common_PaginationOptions_offset.ts | 8 + .../$Common_PaginationOptions_sort_by.ts | 7 + .../src/api/schemas/$Common_PyExpression.ts | 8 + .../$Common_ResourceCreatedResponse.ts | 32 + .../$Common_ResourceDeletedResponse.ts | 32 + .../$Common_ResourceUpdatedResponse.ts | 32 + sdks/ts/src/api/schemas/$Doc.ts | 57 ++ .../api/schemas/$Docs_EmbedQueryRequest.ts | 24 + .../api/schemas/$Docs_EmbedQueryResponse.ts | 18 + sdks/ts/src/api/schemas/$Entry.ts | 62 ++ sdks/ts/src/api/schemas/$Execution.ts | 61 ++ .../$Executions_CreateExecutionRequest.ts | 6 + .../src/api/schemas/$Executions_Execution.ts | 6 + sdks/ts/src/api/schemas/$History.ts | 39 + sdks/ts/src/api/schemas/$JobStatus.ts | 69 ++ sdks/ts/src/api/schemas/$Session.ts | 107 +++ .../schemas/$Sessions_ContextOverflowType.ts | 7 + .../$Sessions_CreateOrUpdateSessionRequest.ts | 7 +- .../schemas/$Sessions_CreateSessionRequest.ts | 7 +- .../schemas/$Sessions_PatchSessionRequest.ts | 7 +- sdks/ts/src/api/schemas/$Sessions_Session.ts | 7 +- .../schemas/$Sessions_UpdateSessionRequest.ts | 7 +- sdks/ts/src/api/schemas/$Task.ts | 13 + sdks/ts/src/api/schemas/$Tasks_CEL.ts | 8 - .../ts/src/api/schemas/$Tasks_EvaluateStep.ts | 2 +- .../api/schemas/$Tasks_IfElseWorkflowStep.ts | 2 +- sdks/ts/src/api/schemas/$Tasks_PromptStep.ts | 27 + sdks/ts/src/api/schemas/$Tasks_YieldStep.ts | 2 +- sdks/ts/src/api/schemas/$Tool.ts | 59 ++ .../api/schemas/$Tools_CreateToolRequest.ts | 5 - .../ts/src/api/schemas/$Tools_FunctionTool.ts | 4 - .../api/schemas/$Tools_PatchToolRequest.ts | 4 - sdks/ts/src/api/schemas/$Tools_Tool.ts | 5 - .../api/schemas/$Tools_UpdateToolRequest.ts | 5 - sdks/ts/src/api/schemas/$Transition.ts | 72 ++ sdks/ts/src/api/schemas/$User.ts | 53 ++ sdks/ts/src/api/services/DefaultService.ts | 831 +++++------------- typespec/common/interfaces.tsp | 4 - 101 files changed, 2297 insertions(+), 1924 deletions(-) create mode 100644 agents-api/agents_api/autogen/openapi_model.py create mode 100644 sdks/ts/src/api/models/Agent.ts create mode 100644 sdks/ts/src/api/models/Common_PaginationOptions_direction.ts create mode 100644 sdks/ts/src/api/models/Common_PaginationOptions_limit.ts create mode 100644 sdks/ts/src/api/models/Common_PaginationOptions_metadata_filter.ts create mode 100644 sdks/ts/src/api/models/Common_PaginationOptions_offset.ts create mode 100644 sdks/ts/src/api/models/Common_PaginationOptions_sort_by.ts create mode 100644 sdks/ts/src/api/models/Common_PyExpression.ts create mode 100644 sdks/ts/src/api/models/Common_ResourceCreatedResponse.ts create mode 100644 sdks/ts/src/api/models/Common_ResourceDeletedResponse.ts create mode 100644 sdks/ts/src/api/models/Common_ResourceUpdatedResponse.ts create mode 100644 sdks/ts/src/api/models/Doc.ts create mode 100644 sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts create mode 100644 sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts create mode 100644 sdks/ts/src/api/models/Entry.ts create mode 100644 sdks/ts/src/api/models/Execution.ts create mode 100644 sdks/ts/src/api/models/History.ts create mode 100644 sdks/ts/src/api/models/JobStatus.ts create mode 100644 sdks/ts/src/api/models/Session.ts create mode 100644 sdks/ts/src/api/models/Sessions_ContextOverflowType.ts create mode 100644 sdks/ts/src/api/models/Task.ts delete mode 100644 sdks/ts/src/api/models/Tasks_CEL.ts create mode 100644 sdks/ts/src/api/models/Tool.ts create mode 100644 sdks/ts/src/api/models/Transition.ts create mode 100644 sdks/ts/src/api/models/User.ts create mode 100644 sdks/ts/src/api/schemas/$Agent.ts create mode 100644 sdks/ts/src/api/schemas/$Common_PaginationOptions_direction.ts create mode 100644 sdks/ts/src/api/schemas/$Common_PaginationOptions_limit.ts create mode 100644 sdks/ts/src/api/schemas/$Common_PaginationOptions_metadata_filter.ts create mode 100644 sdks/ts/src/api/schemas/$Common_PaginationOptions_offset.ts create mode 100644 sdks/ts/src/api/schemas/$Common_PaginationOptions_sort_by.ts create mode 100644 sdks/ts/src/api/schemas/$Common_PyExpression.ts create mode 100644 sdks/ts/src/api/schemas/$Common_ResourceCreatedResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Common_ResourceDeletedResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Common_ResourceUpdatedResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Doc.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Entry.ts create mode 100644 sdks/ts/src/api/schemas/$Execution.ts create mode 100644 sdks/ts/src/api/schemas/$History.ts create mode 100644 sdks/ts/src/api/schemas/$JobStatus.ts create mode 100644 sdks/ts/src/api/schemas/$Session.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts create mode 100644 sdks/ts/src/api/schemas/$Task.ts delete mode 100644 sdks/ts/src/api/schemas/$Tasks_CEL.ts create mode 100644 sdks/ts/src/api/schemas/$Tool.ts create mode 100644 sdks/ts/src/api/schemas/$Transition.ts create mode 100644 sdks/ts/src/api/schemas/$User.ts diff --git a/agents-api/agents_api/autogen/Agents.py b/agents-api/agents_api/autogen/Agents.py index 8aef17747..a958726f0 100644 --- a/agents-api/agents_api/autogen/Agents.py +++ b/agents-api/agents_api/autogen/Agents.py @@ -1,20 +1,22 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations -from typing import Annotated, Any, Dict, List -from uuid import UUID +from typing import Annotated, Any -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from . import Chat +from .Chat import GenerationPresetSettings, OpenAISettings, VLLMSettings +from .Common import IdentifierSafeUnicode, Uuid class Agent(BaseModel): - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] - metadata: Dict[str, Any] | None = None + model_config = ConfigDict( + populate_by_name=True, + ) + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time @@ -23,171 +25,24 @@ class Agent(BaseModel): """ When this resource was updated as UTC date-time """ - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] + name: IdentifierSafeUnicode = "" """ Name of the agent """ - about: str + about: str = "" """ About the agent """ - model: str + model: str = "" """ Model name to use (gpt-4-turbo, gemini-nano etc) """ - instructions: str | List[str] + instructions: str | list[str] = "" """ Instructions for the agent """ default_settings: ( - Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None - ) = None - """ - Default settings for all sessions created by this agent - """ - - -class CreateAgentRequest(BaseModel): - """ - Payload for creating a agent (and associated documents) - """ - - metadata: Dict[str, Any] | None = None - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] - """ - Name of the agent - """ - about: str - """ - About the agent - """ - model: str - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - instructions: str | List[str] - """ - Instructions for the agent - """ - default_settings: ( - Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None - ) = None - """ - Default settings for all sessions created by this agent - """ - docs: Annotated[List, Field(max_length=100)] - """ - Documents to index for this agent. (Max: 100 items) - """ - - -class CreateOrUpdateAgentRequest(BaseModel): - id: UUID - metadata: Dict[str, Any] | None = None - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] - """ - Name of the agent - """ - about: str - """ - About the agent - """ - model: str - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - instructions: str | List[str] - """ - Instructions for the agent - """ - default_settings: ( - Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None - ) = None - """ - Default settings for all sessions created by this agent - """ - - -class PatchAgentRequest(BaseModel): - """ - Payload for patching a agent - """ - - metadata: Dict[str, Any] | None = None - name: Annotated[ - str | None, - Field( - "", - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Name of the agent - """ - about: str | None = "" - """ - About the agent - """ - model: str | None = "" - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - instructions: str | List[str] | None = "" - """ - Instructions for the agent - """ - default_settings: ( - Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None - ) = None - """ - Default settings for all sessions created by this agent - """ - - -class UpdateAgentRequest(BaseModel): - """ - Payload for updating a agent - """ - - metadata: Dict[str, Any] | None = None - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] - """ - Name of the agent - """ - about: str - """ - About the agent - """ - model: str - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - instructions: str | List[str] - """ - Instructions for the agent - """ - default_settings: ( - Chat.GenerationPresetSettings | Chat.OpenAISettings | Chat.VLLMSettings | None + GenerationPresetSettings | OpenAISettings | VLLMSettings | None ) = None """ Default settings for all sessions created by this agent diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index 0f750278d..ef7d24953 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -1,29 +1,12 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations from enum import Enum from typing import Annotated -from pydantic import BaseModel, Field - - -class Type(str, Enum): - """ - The format of the response - """ - - text = "text" - json_object = "json_object" - - -class CompletionResponseFormat(BaseModel): - type: Type - """ - The format of the response - """ +from pydantic import BaseModel, ConfigDict, Field class GenerationPreset(str, Enum): @@ -43,6 +26,9 @@ class GenerationPreset(str, Enum): class GenerationPresetSettings(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) preset: GenerationPreset | None = None """ Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) @@ -50,6 +36,9 @@ class GenerationPresetSettings(BaseModel): class OpenAISettings(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) frequency_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] """ 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. @@ -69,6 +58,9 @@ class OpenAISettings(BaseModel): class VLLMSettings(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) repetition_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] """ 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. diff --git a/agents-api/agents_api/autogen/Common.py b/agents-api/agents_api/autogen/Common.py index 53b5cf635..189aabf27 100644 --- a/agents-api/agents_api/autogen/Common.py +++ b/agents-api/agents_api/autogen/Common.py @@ -1,27 +1,43 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations from typing import Annotated +from uuid import UUID -from pydantic import Field, RootModel +from pydantic import ConfigDict, Field, RootModel -class Limit(RootModel[int]): - root: Annotated[int, Field(ge=1, lt=1000)] +class IdentifierSafeUnicode(RootModel[str]): + model_config = ConfigDict( + populate_by_name=True, + ) + root: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] """ - Limit the number of results + For Unicode character safety + See: https://unicode.org/reports/tr31/ + See: https://www.unicode.org/reports/tr39/#Identifier_Characters """ -class LogitBias(RootModel[float]): - root: Annotated[float, Field(ge=-100.0, le=100.0)] +class Uuid(RootModel[UUID]): + model_config = ConfigDict( + populate_by_name=True, + ) + root: UUID -class Offset(RootModel[int]): - root: Annotated[int, Field(ge=0)] +class ValidPythonIdentifier(RootModel[str]): + model_config = ConfigDict( + populate_by_name=True, + ) + root: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] """ - Offset to apply to the results + Valid python identifier names """ diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py index 1d3211300..791002936 100644 --- a/agents-api/agents_api/autogen/Docs.py +++ b/agents-api/agents_api/autogen/Docs.py @@ -1,58 +1,57 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations from enum import Enum -from typing import Annotated, Any, Dict, List, Literal -from uuid import UUID +from typing import Annotated, Any, Literal -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field + +from .Common import IdentifierSafeUnicode, Uuid class Doc(BaseModel): - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] - metadata: Dict[str, Any] | None = None + model_config = ConfigDict( + populate_by_name=True, + ) + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time """ - title: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] + title: IdentifierSafeUnicode """ Title describing what this document contains """ - content: str | List[str] + content: str | list[str] """ Contents of the document """ -class Role(str, Enum): - user = "user" - agent = "agent" - - class DocOwner(BaseModel): - id: UUID + model_config = ConfigDict( + populate_by_name=True, + ) + id: Uuid role: Role class DocReference(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) owner: DocOwner """ The owner of this document. """ - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] """ ID of the document """ - snippet_index: List[int] + snippet_index: list[int] """ Snippets referred to of the document """ @@ -60,32 +59,25 @@ class DocReference(BaseModel): snippet: str | None = None -class Mode(str, Enum): - """ - The search mode - """ - - vector = "vector" - text = "text" - hybrid = "hybrid" - - class DocSearchRequest(BaseModel): - text: str | List[str] | None = None - vector: List[float] | List[List[float]] | None = None + model_config = ConfigDict( + populate_by_name=True, + ) + text: str | list[str] | None = None + vector: list[float] | list[list[float]] | None = None mode: Mode """ The search mode """ - confidence: Annotated[float, Field(ge=0.0, le=1.0)] + confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)] """ The confidence cutoff level """ - alpha: Annotated[float, Field(ge=0.0, le=1.0)] + alpha: Annotated[float, Field(0.75, ge=0.0, le=1.0)] """ The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; """ - mmr: bool + mmr: bool = False """ Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. """ @@ -95,29 +87,26 @@ class DocSearchRequest(BaseModel): """ -class HybridDocSearchRequest(DocSearchRequest): - text: str | List[str] | None = None - """ - Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. +class EmbedQueryRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + text: str | list[str] """ - vector: List[float] | List[List[float]] | None = None + Text or texts to embed """ - Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. - """ - mode: Literal["hybrid"] = "hybrid" -class TextOnlyDocSearchRequest(DocSearchRequest): - text: str | List[str] +class Mode(str, Enum): """ - Text or texts to use in the search. In `text` search mode, only BM25 is used. + The search mode """ - mode: Literal["text"] = "text" + + vector = "vector" + text = "text" + hybrid = "hybrid" -class VectorDocSearchRequest(DocSearchRequest): - vector: List[float] | List[List[float]] - """ - Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. - """ - mode: Literal["vector"] = "vector" +class Role(str, Enum): + user = "user" + agent = "agent" diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index ed801092a..1ceb17f0f 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -1,69 +1,21 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations from enum import Enum -from typing import Annotated, List, Literal -from uuid import UUID +from typing import Annotated, Literal -from pydantic import AnyUrl, AwareDatetime, BaseModel, Field +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field -from . import Tools - - -class ChatMLRole(str, Enum): - """ - ChatML role (system|assistant|user|function_call|function|function_response|auto) - """ - - user = "user" - agent = "agent" - system = "system" - function = "function" - function_response = "function_response" - function_call = "function_call" - auto = "auto" - - -class Source(str, Enum): - api_request = "api_request" - api_response = "api_response" - tool_response = "tool_response" - internal = "internal" - summarizer = "summarizer" - meta = "meta" - - -class ImageDetail(str, Enum): - """ - Image detail level - """ - - low = "low" - high = "high" - auto = "auto" - - -class ImageURL(BaseModel): - url: AnyUrl - """ - Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) - """ - detail: ImageDetail - """ - The detail level of the image - """ - - -class Relation(BaseModel): - head: UUID - relation: str - tail: UUID +from .Common import Uuid +from .Tools import ChosenToolCall, Tool, ToolResponse class BaseChatMLContentPart(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) type: str """ The type of content part @@ -73,6 +25,9 @@ class BaseChatMLContentPart(BaseModel): class ChatMLImageContentPart(BaseChatMLContentPart): + model_config = ConfigDict( + populate_by_name=True, + ) image_url: ImageURL """ The image URL @@ -83,48 +38,49 @@ class ChatMLImageContentPart(BaseChatMLContentPart): """ -class ChatMLTextContentPart(BaseChatMLContentPart): - text: str - type: Literal["text"] = "text" +class ChatMLRole(str, Enum): """ - The type (fixed to 'text') + ChatML role (system|assistant|user|function_call|function|function_response|auto) """ + user = "user" + agent = "agent" + system = "system" + function = "function" + function_response = "function_response" + function_call = "function_call" + auto = "auto" + -class InputChatMLMessage(BaseModel): - role: ChatMLRole - """ - The role of the message - """ - content: str | List[str] | List[ChatMLTextContentPart | ChatMLImageContentPart] - """ - The content parts of the message - """ - name: str | None = None - """ - Name - """ - continue_: Annotated[bool | None, Field(None, alias="continue")] +class ChatMLTextContentPart(BaseChatMLContentPart): + model_config = ConfigDict( + populate_by_name=True, + ) + text: str + type: Literal["text"] = "text" """ - Whether to continue this message or return a new one + The type (fixed to 'text') """ class Entry(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) role: ChatMLRole - name: str + name: str | None = None content: ( - List[ChatMLTextContentPart | ChatMLImageContentPart] - | Tools.Tool - | Tools.ChosenToolCall + list[ChatMLTextContentPart | ChatMLImageContentPart] + | Tool + | ChosenToolCall | str - | Tools.ToolResponse - | List[ - List[ChatMLTextContentPart | ChatMLImageContentPart] - | Tools.Tool - | Tools.ChosenToolCall + | ToolResponse + | list[ + list[ChatMLTextContentPart | ChatMLImageContentPart] + | Tool + | ChosenToolCall | str - | Tools.ToolResponse + | ToolResponse ] ) source: Source @@ -136,14 +92,59 @@ class Entry(BaseModel): """ When this resource was created as UTC date-time """ - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] class History(BaseModel): - entries: List[Entry] - relations: List[Relation] - session_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + model_config = ConfigDict( + populate_by_name=True, + ) + entries: list[Entry] + relations: list[Relation] + session_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time """ + + +class ImageDetail(str, Enum): + """ + Image detail level + """ + + low = "low" + high = "high" + auto = "auto" + + +class ImageURL(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + url: AnyUrl + """ + Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + """ + detail: ImageDetail = "auto" + """ + The detail level of the image + """ + + +class Relation(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + head: Uuid + relation: str + tail: Uuid + + +class Source(str, Enum): + api_request = "api_request" + api_response = "api_response" + tool_response = "tool_response" + internal = "internal" + summarizer = "summarizer" + meta = "meta" diff --git a/agents-api/agents_api/autogen/Executions.py b/agents-api/agents_api/autogen/Executions.py index 42b775995..7f343120e 100644 --- a/agents-api/agents_api/autogen/Executions.py +++ b/agents-api/agents_api/autogen/Executions.py @@ -1,43 +1,21 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations from enum import Enum -from typing import Annotated, Any, Dict, List, Literal -from uuid import UUID +from typing import Annotated, Any -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field - -class CreateExecutionRequest(BaseModel): - """ - Payload for creating an execution - """ - - input: Dict[str, Any] - """ - The input to the execution - """ - - -class Status(str, Enum): - """ - The status of the execution - """ - - queued = "queued" - starting = "starting" - running = "running" - awaiting_input = "awaiting_input" - succeeded = "succeeded" - failed = "failed" - cancelled = "cancelled" +from .Common import Uuid class Execution(BaseModel): - task_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + model_config = ConfigDict( + populate_by_name=True, + ) + task_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] """ The ID of the task that the execution is running """ @@ -45,7 +23,7 @@ class Execution(BaseModel): """ The status of the execution """ - input: Dict[str, Any] + input: dict[str, Any] """ The input to the execution """ @@ -57,36 +35,34 @@ class Execution(BaseModel): """ When this resource was updated as UTC date-time """ - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + metadata: dict[str, Any] | None = None + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] -class TaskTokenResumeExecutionRequest(BaseModel): - status: Literal["running"] = "running" - task_token: str - """ - A Task Token is a unique identifier for a specific Task Execution. - """ - input: Dict[str, Any] | None = None +class Status(str, Enum): """ - The input to resume the execution with + The status of the execution """ - -class Type(str, Enum): - finish = "finish" - wait = "wait" - error = "error" - step = "step" + queued = "queued" + starting = "starting" + running = "running" + awaiting_input = "awaiting_input" + succeeded = "succeeded" + failed = "failed" cancelled = "cancelled" class Transition(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) type: Annotated[Type, Field(json_schema_extra={"readOnly": True})] - execution_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] - outputs: Annotated[Dict[str, Any], Field(json_schema_extra={"readOnly": True})] - current: Annotated[List, Field(json_schema_extra={"readOnly": True})] - next: Annotated[List, Field(json_schema_extra={"readOnly": True})] - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + execution_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + outputs: Annotated[dict[str, Any], Field(json_schema_extra={"readOnly": True})] + current: Annotated[list, Field(json_schema_extra={"readOnly": True})] + next: Annotated[list | None, Field(json_schema_extra={"readOnly": True})] + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time @@ -97,31 +73,9 @@ class Transition(BaseModel): """ -class StatusModel(str, Enum): - queued = "queued" - starting = "starting" - running = "running" - awaiting_input = "awaiting_input" - succeeded = "succeeded" - failed = "failed" +class Type(str, Enum): + finish = "finish" + wait = "wait" + error = "error" + step = "step" cancelled = "cancelled" - - -class UpdateExecutionRequest(BaseModel): - status: StatusModel - - -class ResumeExecutionRequest(UpdateExecutionRequest): - status: Literal["running"] = "running" - input: Dict[str, Any] | None = None - """ - The input to resume the execution with - """ - - -class StopExecutionRequest(UpdateExecutionRequest): - status: Literal["cancelled"] = "cancelled" - reason: str - """ - The reason for stopping the execution - """ diff --git a/agents-api/agents_api/autogen/Jobs.py b/agents-api/agents_api/autogen/Jobs.py index af323ebbd..97bce5f71 100644 --- a/agents-api/agents_api/autogen/Jobs.py +++ b/agents-api/agents_api/autogen/Jobs.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 +# timestamp: 2024-07-20T01:16:18+00:00 from __future__ import annotations diff --git a/agents-api/agents_api/autogen/Sessions.py b/agents-api/agents_api/autogen/Sessions.py index 89898aac3..31f5b7abb 100644 --- a/agents-api/agents_api/autogen/Sessions.py +++ b/agents-api/agents_api/autogen/Sessions.py @@ -1,129 +1,49 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations -from typing import Annotated, Any, Dict, List -from uuid import UUID +from enum import Enum +from typing import Annotated, Any -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field +from .Common import Uuid -class CreateOrUpdateSessionRequest(BaseModel): - id: UUID - user: UUID | None = None - """ - User ID of user associated with this session - """ - users: List[UUID] | None = None - agent: UUID | None = None - """ - Agent ID of agent associated with this session - """ - agents: List[UUID] | None = None - situation: str - """ - A specific situation that sets the background for this session - """ - render_templates: bool - """ - Render system and assistant message content as jinja templates - """ - token_budget: int - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str - """ - Action to start on context window overflow - """ - metadata: Dict[str, Any] | None = None - - -class CreateSessionRequest(BaseModel): - """ - Payload for creating a session - """ - - user: UUID | None = None - """ - User ID of user associated with this session - """ - users: List[UUID] | None = None - agent: UUID | None = None - """ - Agent ID of agent associated with this session - """ - agents: List[UUID] | None = None - situation: str - """ - A specific situation that sets the background for this session - """ - render_templates: bool - """ - Render system and assistant message content as jinja templates - """ - token_budget: int - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str - """ - Action to start on context window overflow - """ - metadata: Dict[str, Any] | None = None +class ContextOverflowType(str, Enum): + truncate = "truncate" + adaptive = "adaptive" -class PatchSessionRequest(BaseModel): - """ - Payload for patching a session - """ - situation: str | None = ( +class Session(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + situation: str = ( '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' ) """ A specific situation that sets the background for this session """ - render_templates: bool | None = False - """ - Render system and assistant message content as jinja templates - """ - token_budget: int | None = None - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str | None = None - """ - Action to start on context window overflow - """ - metadata: Dict[str, Any] | None = None - - -class Session(BaseModel): - situation: str - """ - A specific situation that sets the background for this session - """ - summary: Annotated[str, Field(json_schema_extra={"readOnly": True})] + summary: Annotated[str | None, Field(None, json_schema_extra={"readOnly": True})] """ Summary (null at the beginning) - generated automatically after every interaction """ - render_templates: bool + render_templates: bool = False """ Render system and assistant message content as jinja templates """ - token_budget: int + token_budget: int | None = None """ Threshold value for the adaptive context functionality """ - context_overflow: str + context_overflow: ContextOverflowType | None = None """ Action to start on context window overflow """ - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] - metadata: Dict[str, Any] | None = None + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time @@ -136,55 +56,3 @@ class Session(BaseModel): """ Discriminator property for Session. """ - - -class SingleAgentMultiUserSession(Session): - agent: UUID - users: List[UUID] - - -class SingleAgentNoUserSession(Session): - agent: UUID - - -class SingleAgentSingleUserSession(Session): - agent: UUID - user: UUID - - -class UpdateSessionRequest(BaseModel): - """ - Payload for updating a session - """ - - situation: str - """ - A specific situation that sets the background for this session - """ - render_templates: bool - """ - Render system and assistant message content as jinja templates - """ - token_budget: int - """ - Threshold value for the adaptive context functionality - """ - context_overflow: str - """ - Action to start on context window overflow - """ - metadata: Dict[str, Any] | None = None - - -class MultiAgentMultiUserSession(Session): - agents: List[UUID] - users: List[UUID] - - -class MultiAgentNoUserSession(Session): - agents: List[UUID] - - -class MultiAgentSingleUserSession(Session): - agents: List[UUID] - user: UUID diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py index 65c299427..1e53355e6 100644 --- a/agents-api/agents_api/autogen/Tasks.py +++ b/agents-api/agents_api/autogen/Tasks.py @@ -1,320 +1,14 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations -from typing import Annotated, Any, Dict, List -from uuid import UUID +from typing import Annotated, Any -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from . import Chat, Common, Entries, Tools - - -class Settings(BaseModel): - """ - Settings for the prompt - """ - - model: Annotated[ - str | None, - Field( - None, - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Identifier of the model to be used - """ - stream: bool - """ - Indicates if the server should stream the response as it's generated - """ - stop: Annotated[List[str] | None, Field(None, max_length=4, min_length=1)] - """ - Up to 4 sequences where the API will stop generating further tokens. - """ - seed: Annotated[int | None, Field(None, ge=-1, le=1000)] - """ - If specified, the system will make a best effort to sample deterministically for that particular seed value - """ - max_tokens: Annotated[int | None, Field(None, ge=1)] - """ - The maximum number of tokens to generate in the chat completion - """ - logit_bias: Dict[str, Common.LogitBias] | None = None - """ - Modify the likelihood of specified tokens appearing in the completion - """ - response_format: Chat.CompletionResponseFormat | None = None - """ - Response format (set to `json_object` to restrict output to JSON) - """ - preset: Chat.GenerationPreset | None = None - """ - Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - """ - - -class SettingsModel(BaseModel): - """ - Settings for the prompt - """ - - model: Annotated[ - str | None, - Field( - None, - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Identifier of the model to be used - """ - stream: bool - """ - Indicates if the server should stream the response as it's generated - """ - stop: Annotated[List[str] | None, Field(None, max_length=4, min_length=1)] - """ - Up to 4 sequences where the API will stop generating further tokens. - """ - seed: Annotated[int | None, Field(None, ge=-1, le=1000)] - """ - If specified, the system will make a best effort to sample deterministically for that particular seed value - """ - max_tokens: Annotated[int | None, Field(None, ge=1)] - """ - The maximum number of tokens to generate in the chat completion - """ - logit_bias: Dict[str, Common.LogitBias] | None = None - """ - Modify the likelihood of specified tokens appearing in the completion - """ - response_format: Chat.CompletionResponseFormat | None = None - """ - Response format (set to `json_object` to restrict output to JSON) - """ - frequency_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] - """ - 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. - """ - presence_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] - """ - 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. - """ - temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] - """ - 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] - """ - 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. - """ - - -class SettingsModel1(BaseModel): - """ - Settings for the prompt - """ - - model: Annotated[ - str | None, - Field( - None, - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Identifier of the model to be used - """ - stream: bool - """ - Indicates if the server should stream the response as it's generated - """ - stop: Annotated[List[str] | None, Field(None, max_length=4, min_length=1)] - """ - Up to 4 sequences where the API will stop generating further tokens. - """ - seed: Annotated[int | None, Field(None, ge=-1, le=1000)] - """ - If specified, the system will make a best effort to sample deterministically for that particular seed value - """ - max_tokens: Annotated[int | None, Field(None, ge=1)] - """ - The maximum number of tokens to generate in the chat completion - """ - logit_bias: Dict[str, Common.LogitBias] | None = None - """ - Modify the likelihood of specified tokens appearing in the completion - """ - response_format: Chat.CompletionResponseFormat | None = None - """ - Response format (set to `json_object` to restrict output to JSON) - """ - repetition_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] - """ - 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. - """ - length_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] - """ - Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - """ - temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] - """ - 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] - """ - 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. - """ - min_p: Annotated[float | None, Field(None, ge=0.0, le=1.0)] - """ - Minimum probability compared to leading token to be considered - """ - - -class WorkflowStep(BaseModel): - kind: str | None = None - """ - Discriminator property for WorkflowStep. - """ - - -class YieldStep(WorkflowStep): - workflow: str - """ - The subworkflow to run - """ - arguments: Dict[str, str] - """ - The input parameters for the subworkflow - """ - - -class ErrorWorkflowStep(WorkflowStep): - error: str - """ - The error message - """ - - -class EvaluateStep(WorkflowStep): - evaluate: Dict[str, str] - """ - The expression to evaluate - """ - - -class IfElseWorkflowStep(WorkflowStep): - if_: Annotated[str, Field(alias="if")] - """ - The condition to evaluate - """ - then: WorkflowStep - """ - The steps to run if the condition is true - """ - else_: Annotated[WorkflowStep, Field(alias="else")] - """ - The steps to run if the condition is false - """ - - -class PromptStep(WorkflowStep): - prompt: str | List[Entries.InputChatMLMessage] - """ - The prompt to run - """ - settings: Settings | SettingsModel | SettingsModel1 - """ - Settings for the prompt - """ - - -class ToolCallStep(WorkflowStep): - tool: Annotated[ - str, Field(pattern="^(function|integration|system|api_call)\\.(\\w+)$") - ] - """ - The tool to run - """ - arguments: Dict[str, Any] - """ - The input parameters for the tool - """ - - -class CreateOrUpdateTaskRequest(BaseModel): - id: UUID - name: str - description: str - main: List[WorkflowStep] - """ - The entrypoint of the task. - """ - input_schema: Dict[str, Any] - """ - The schema for the input to the task. `null` means all inputs are valid. - """ - tools: List[Tools.CreateToolRequest] - """ - Tools defined specifically for this task not included in the Agent itself. - """ - inherit_tools: bool - """ - Whether to inherit tools from the parent agent or not. Defaults to true. - """ - - -class CreateTaskRequest(BaseModel): - """ - Payload for creating a task - """ - - name: str - description: str - main: List[WorkflowStep] - """ - The entrypoint of the task. - """ - input_schema: Dict[str, Any] - """ - The schema for the input to the task. `null` means all inputs are valid. - """ - tools: List[Tools.CreateToolRequest] - """ - Tools defined specifically for this task not included in the Agent itself. - """ - inherit_tools: bool - """ - Whether to inherit tools from the parent agent or not. Defaults to true. - """ - - -class PatchTaskRequest(BaseModel): - """ - Payload for patching a task - """ - - description: str | None = "" - main: List[WorkflowStep] | None = None - """ - The entrypoint of the task. - """ - input_schema: Dict[str, Any] | None = None - """ - The schema for the input to the task. `null` means all inputs are valid. - """ - tools: List[Tools.CreateToolRequest] | None = [] - """ - Tools defined specifically for this task not included in the Agent itself. - """ - inherit_tools: bool | None = True - """ - Whether to inherit tools from the parent agent or not. Defaults to true. - """ +from .Common import Uuid +from .Tools import CreateToolRequest class Task(BaseModel): @@ -322,26 +16,29 @@ class Task(BaseModel): Object describing a Task """ + model_config = ConfigDict( + populate_by_name=True, + ) name: str - description: str - main: List[WorkflowStep] + description: str = "" + main: list[WorkflowStep] """ The entrypoint of the task. """ - input_schema: Dict[str, Any] + input_schema: dict[str, Any] | None = None """ The schema for the input to the task. `null` means all inputs are valid. """ - tools: List[Tools.CreateToolRequest] + tools: list[CreateToolRequest] = [] """ Tools defined specifically for this task not included in the Agent itself. """ - inherit_tools: bool + inherit_tools: bool = True """ Whether to inherit tools from the parent agent or not. Defaults to true. """ - agent_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + agent_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time @@ -350,27 +47,14 @@ class Task(BaseModel): """ When this resource was updated as UTC date-time """ + metadata: dict[str, Any] | None = None -class UpdateTaskRequest(BaseModel): - """ - Payload for updating a task - """ - - description: str - main: List[WorkflowStep] - """ - The entrypoint of the task. - """ - input_schema: Dict[str, Any] - """ - The schema for the input to the task. `null` means all inputs are valid. - """ - tools: List[Tools.CreateToolRequest] - """ - Tools defined specifically for this task not included in the Agent itself. - """ - inherit_tools: bool +class WorkflowStep(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + kind: str | None = None """ - Whether to inherit tools from the parent agent or not. Defaults to true. + Discriminator property for WorkflowStep. """ diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index 88d26954e..3b648c9e4 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -1,109 +1,14 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations from enum import Enum -from typing import Annotated, Any, Dict, Literal -from uuid import UUID +from typing import Annotated, Any -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field - -class FunctionCallOption(BaseModel): - name: str - """ - The name of the function - """ - - -class FunctionDef(BaseModel): - """ - Function definition - """ - - name: Annotated[str | None, Field("overriden", pattern="^[^\\W0-9]\\w*$")] - """ - DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. - """ - parameters: Dict[str, Any] - """ - The parameters the function accepts - """ - description: Annotated[ - str | None, - Field( - None, - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Description of the function - """ - - -class FunctionDefUpdate(BaseModel): - """ - Function definition - """ - - name: Annotated[str | None, Field("overriden", pattern="^[^\\W0-9]\\w*$")] - """ - DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. - """ - parameters: Dict[str, Any] | None = None - """ - The parameters the function accepts - """ - description: Annotated[ - str | None, - Field( - None, - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Description of the function - """ - - -class ToolResponse(BaseModel): - id: UUID - output: Dict[str, Any] - """ - The output of the tool - """ - - -class ToolType(str, Enum): - function = "function" - integration = "integration" - system = "system" - api_call = "api_call" - - -class UpdateToolRequest(BaseModel): - """ - Payload for updating a tool - """ - - type: ToolType - """ - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - """ - background: bool - """ - The tool should be run in the background (not supported at the moment) - """ - interactive: bool - """ - Whether the tool that can be run interactively (response should contain "stop" boolean field) - """ - function: FunctionDef | None = None - integration: Any | None = None - system: Any | None = None - api_call: Any | None = None +from .Common import IdentifierSafeUnicode, Uuid, ValidPythonIdentifier class ChosenToolCall(BaseModel): @@ -111,6 +16,9 @@ class ChosenToolCall(BaseModel): The response tool value generated by the model """ + model_config = ConfigDict( + populate_by_name=True, + ) type: ToolType """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) @@ -119,7 +27,7 @@ class ChosenToolCall(BaseModel): integration: Any | None = None system: Any | None = None api_call: Any | None = None - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] class CreateToolRequest(BaseModel): @@ -127,60 +35,67 @@ class CreateToolRequest(BaseModel): Payload for creating a tool """ + model_config = ConfigDict( + populate_by_name=True, + ) type: ToolType """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - background: bool + background: bool = False """ The tool should be run in the background (not supported at the moment) """ - interactive: bool - """ - Whether the tool that can be run interactively (response should contain "stop" boolean field) - """ function: FunctionDef | None = None integration: Any | None = None system: Any | None = None api_call: Any | None = None -class PatchToolRequest(BaseModel): +class FunctionCallOption(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + name: str """ - Payload for patching a tool + The name of the function """ - type: ToolType | None = None + +class FunctionDef(BaseModel): """ - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + Function definition """ - background: bool | None = False + + model_config = ConfigDict( + populate_by_name=True, + ) + name: Annotated[ValidPythonIdentifier, Field("overriden")] """ - The tool should be run in the background (not supported at the moment) + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. """ - interactive: bool | None = False + parameters: dict[str, Any] """ - Whether the tool that can be run interactively (response should contain "stop" boolean field) + The parameters the function accepts + """ + description: IdentifierSafeUnicode | None = None + """ + Description of the function """ - function: FunctionDefUpdate | None = None - integration: Any | None = None - system: Any | None = None - api_call: Any | None = None class Tool(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) type: ToolType """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - background: bool + background: bool = False """ The tool should be run in the background (not supported at the moment) """ - interactive: bool - """ - Whether the tool that can be run interactively (response should contain "stop" boolean field) - """ function: FunctionDef | None = None integration: Any | None = None system: Any | None = None @@ -193,22 +108,22 @@ class Tool(BaseModel): """ When this resource was updated as UTC date-time """ - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] -class ChosenFunctionCall(ChosenToolCall): - type: Literal["function"] = "function" - function: FunctionCallOption +class ToolResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: Uuid + output: dict[str, Any] """ - The function to call + The output of the tool """ -class FunctionTool(Tool): - type: Literal["function"] = "function" - background: Literal[False] = False - interactive: Literal[False] = False - function: FunctionDef - """ - The function to call - """ +class ToolType(str, Enum): + function = "function" + integration = "integration" + system = "system" + api_call = "api_call" diff --git a/agents-api/agents_api/autogen/Users.py b/agents-api/agents_api/autogen/Users.py index fc1e90745..696858551 100644 --- a/agents-api/agents_api/autogen/Users.py +++ b/agents-api/agents_api/autogen/Users.py @@ -1,104 +1,21 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 from __future__ import annotations -from typing import Annotated, Any, Dict, List -from uuid import UUID +from typing import Annotated, Any -from pydantic import AwareDatetime, BaseModel, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field - -class CreateOrUpdateUserRequest(BaseModel): - id: UUID - metadata: Dict[str, Any] | None = None - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] - """ - Name of the user - """ - about: str - """ - About the user - """ - - -class CreateUserRequest(BaseModel): - """ - Payload for creating a user (and associated documents) - """ - - metadata: Dict[str, Any] | None = None - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] - """ - Name of the user - """ - about: str - """ - About the user - """ - docs: Annotated[List, Field(max_length=100)] - """ - Documents to index for this user. (Max: 100 items) - """ - - -class PatchUserRequest(BaseModel): - """ - Payload for patching a user - """ - - metadata: Dict[str, Any] | None = None - name: Annotated[ - str | None, - Field( - "", - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Name of the user - """ - about: str | None = "" - """ - About the user - """ - - -class UpdateUserRequest(BaseModel): - """ - Payload for updating a user - """ - - metadata: Dict[str, Any] | None = None - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] - """ - Name of the user - """ - about: str - """ - About the user - """ +from .Common import IdentifierSafeUnicode, Uuid class User(BaseModel): - id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] - metadata: Dict[str, Any] | None = None + model_config = ConfigDict( + populate_by_name=True, + ) + id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time @@ -107,16 +24,11 @@ class User(BaseModel): """ When this resource was updated as UTC date-time """ - name: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] + name: IdentifierSafeUnicode = "" """ Name of the user """ - about: str + about: str = "" """ About the user """ diff --git a/agents-api/agents_api/autogen/__init__.py b/agents-api/agents_api/autogen/__init__.py index a58641dd2..6b220661e 100644 --- a/agents-api/agents_api/autogen/__init__.py +++ b/agents-api/agents_api/autogen/__init__.py @@ -1,3 +1,131 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-15T21:17:24+00:00 + +from __future__ import annotations + +from enum import Enum + +from pydantic import BaseModel, ConfigDict + +from .Agents import Agent +from .Docs import Doc, DocReference, DocSearchRequest, EmbedQueryRequest +from .Entries import History +from .Executions import Execution, Transition +from .Sessions import Session +from .Tasks import Task +from .Tools import Tool +from .Users import User + + +class AgentDocsRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[Doc] + + +class AgentToolsRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[Tool] + + +class AgentsDocsSearchRouteSearchRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + body: DocSearchRequest + + +class AgentsDocsSearchRouteSearchResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[DocReference] + + +class AgentsRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[Agent] + + +class Direction(str, Enum): + asc = "asc" + desc = "desc" + + +class EmbedRouteEmbedRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + body: EmbedQueryRequest + + +class ExecutionTransitionsRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[Result] + + +class HistoryRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[History] + + +class Result(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + transitions: list[Transition] + + +class SessionsRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[Session] + + +class SortBy(str, Enum): + created_at = "created_at" + updated_at = "updated_at" + deleted_at = "deleted_at" + + +class TaskExecutionsRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[Execution] + + +class TasksRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[Task] + + +class UserDocsRouteListResponse(AgentDocsRouteListResponse): + pass + + +class UserDocsSearchRouteSearchRequest(AgentsDocsSearchRouteSearchRequest): + pass + + +class UserDocsSearchRouteSearchResponse(AgentsDocsSearchRouteSearchResponse): + pass + + +class UsersRouteListResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + results: list[User] diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py new file mode 100644 index 000000000..7951a420a --- /dev/null +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -0,0 +1,11 @@ +from .Agents import * # noqa: F401, F403 +from .Chat import * # noqa: F401, F403 +from .Common import * # noqa: F401, F403 +from .Docs import * # noqa: F401, F403 +from .Entries import * # noqa: F401, F403 +from .Executions import * # noqa: F401, F403 +from .Jobs import * # noqa: F401, F403 +from .Sessions import * # noqa: F401, F403 +from .Tasks import * # noqa: F401, F403 +from .Tools import * # noqa: F401, F403 +from .Users import * # noqa: F401, F403 diff --git a/agents-api/agents_api/common/protocol/entries.py b/agents-api/agents_api/common/protocol/entries.py index e6ff945fb..8abb062e0 100644 --- a/agents-api/agents_api/common/protocol/entries.py +++ b/agents-api/agents_api/common/protocol/entries.py @@ -7,7 +7,7 @@ Role, ChatMLImageContentPart, ChatMLTextContentPart, - Detail, + ImageDetail, ) from agents_api.common.utils.datetime import utcnow @@ -55,7 +55,7 @@ def token_count(self) -> int: elif isinstance(part, ChatMLImageContentPart): content_length += ( LOW_IMAGE_TOKEN_COUNT - if part.image_url.detail == Detail.low + if part.image_url.detail == ImageDetail.low else HIGH_IMAGE_TOKEN_COUNT ) diff --git a/agents-api/agents_api/common/protocol/tasks.py b/agents-api/agents_api/common/protocol/tasks.py index 991497c00..5fc0f34b1 100644 --- a/agents-api/agents_api/common/protocol/tasks.py +++ b/agents-api/agents_api/common/protocol/tasks.py @@ -9,10 +9,10 @@ Session, Tool, FunctionDef, - PromptWorkflowStep, - EvaluateWorkflowStep, - YieldWorkflowStep, - ToolCallWorkflowStep, + PromptStep, + EvaluateStep, + YieldStep, + ToolCallStep, ErrorWorkflowStep, IfElseWorkflowStep, Task, @@ -23,10 +23,10 @@ from ..utils.cozo import uuid_int_list_to_uuid4 WorkflowStep = ( - PromptWorkflowStep - | EvaluateWorkflowStep - | YieldWorkflowStep - | ToolCallWorkflowStep + PromptStep + | EvaluateStep + | YieldStep + | ToolCallStep | ErrorWorkflowStep | IfElseWorkflowStep ) diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 8b5946446..57607ab9e 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -782,19 +782,19 @@ develop = ["coverage", "invoke", "path.py", "pylint", "pytest (>=3.2)", "pytest- [[package]] name = "dask" -version = "2024.7.0" +version = "2024.7.1" description = "Parallel PyData with Task Scheduling" optional = false python-versions = ">=3.9" files = [ - {file = "dask-2024.7.0-py3-none-any.whl", hash = "sha256:0f30f218a1fe1c8e9a6ba8add1207088ba9ff049098d4ea4ce045fd5ff7ca914"}, - {file = "dask-2024.7.0.tar.gz", hash = "sha256:0060bae9a58b5b3ce7e0d97040e903b4d3db09ba49222101cfc40f9834a8a6bc"}, + {file = "dask-2024.7.1-py3-none-any.whl", hash = "sha256:dd046840050376c317de90629db5c6197adda820176cf3e2df10c3219d11951f"}, + {file = "dask-2024.7.1.tar.gz", hash = "sha256:dbaef2d50efee841a9d981a218cfeb50392fc9a95e0403b6d680450e4f50d531"}, ] [package.dependencies] click = ">=8.1" cloudpickle = ">=1.5.0" -distributed = {version = "2024.7.0", optional = true, markers = "extra == \"distributed\""} +distributed = {version = "2024.7.1", optional = true, markers = "extra == \"distributed\""} fsspec = ">=2021.09.0" importlib-metadata = {version = ">=4.13.0", markers = "python_version < \"3.12\""} packaging = ">=20.0" @@ -807,7 +807,7 @@ array = ["numpy (>=1.21)"] complete = ["dask[array,dataframe,diagnostics,distributed]", "lz4 (>=4.3.2)", "pyarrow (>=7.0)", "pyarrow-hotfix"] dataframe = ["dask-expr (>=1.1,<1.2)", "dask[array]", "pandas (>=2.0)"] diagnostics = ["bokeh (>=2.4.2)", "jinja2 (>=2.10.3)"] -distributed = ["distributed (==2024.7.0)"] +distributed = ["distributed (==2024.7.1)"] test = ["pandas[test]", "pre-commit", "pytest", "pytest-cov", "pytest-rerunfailures", "pytest-timeout", "pytest-xdist"] [[package]] @@ -920,19 +920,19 @@ files = [ [[package]] name = "distributed" -version = "2024.7.0" +version = "2024.7.1" description = "Distributed scheduler for Dask" optional = false python-versions = ">=3.9" files = [ - {file = "distributed-2024.7.0-py3-none-any.whl", hash = "sha256:7c9e84c121bb8cac28d7391857ca6555acbe5edfb707d3fb2f54d2c04a0bf751"}, - {file = "distributed-2024.7.0.tar.gz", hash = "sha256:c8a1a71e14e73b340abee443ece5c8119465f97bdb8a00ff6933b945840a0052"}, + {file = "distributed-2024.7.1-py3-none-any.whl", hash = "sha256:d5ac38d9682c191e6582c86ebf37c10d7adb60bf4a95048a05ae4fb0866119bc"}, + {file = "distributed-2024.7.1.tar.gz", hash = "sha256:7bce7fa745163b55bdd67fd632b3edf57b31827640390b92d0ee3f73436429d3"}, ] [package.dependencies] click = ">=8.0" cloudpickle = ">=1.5.0" -dask = "2024.7.0" +dask = "2024.7.1" jinja2 = ">=2.10.3" locket = ">=1.0.0" msgpack = ">=1.0.0" @@ -1690,61 +1690,61 @@ protobuf = ">=3.20.2,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4 [[package]] name = "grpcio" -version = "1.64.1" +version = "1.65.1" description = "HTTP/2-based RPC framework" optional = false python-versions = ">=3.8" files = [ - {file = "grpcio-1.64.1-cp310-cp310-linux_armv7l.whl", hash = "sha256:55697ecec192bc3f2f3cc13a295ab670f51de29884ca9ae6cd6247df55df2502"}, - {file = "grpcio-1.64.1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:3b64ae304c175671efdaa7ec9ae2cc36996b681eb63ca39c464958396697daff"}, - {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:bac71b4b28bc9af61efcdc7630b166440bbfbaa80940c9a697271b5e1dabbc61"}, - {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c024ffc22d6dc59000faf8ad781696d81e8e38f4078cb0f2630b4a3cf231a90"}, - {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7cd5c1325f6808b8ae31657d281aadb2a51ac11ab081ae335f4f7fc44c1721d"}, - {file = "grpcio-1.64.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:0a2813093ddb27418a4c99f9b1c223fab0b053157176a64cc9db0f4557b69bd9"}, - {file = "grpcio-1.64.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2981c7365a9353f9b5c864595c510c983251b1ab403e05b1ccc70a3d9541a73b"}, - {file = "grpcio-1.64.1-cp310-cp310-win32.whl", hash = "sha256:1262402af5a511c245c3ae918167eca57342c72320dffae5d9b51840c4b2f86d"}, - {file = "grpcio-1.64.1-cp310-cp310-win_amd64.whl", hash = "sha256:19264fc964576ddb065368cae953f8d0514ecc6cb3da8903766d9fb9d4554c33"}, - {file = "grpcio-1.64.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:58b1041e7c870bb30ee41d3090cbd6f0851f30ae4eb68228955d973d3efa2e61"}, - {file = "grpcio-1.64.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bbc5b1d78a7822b0a84c6f8917faa986c1a744e65d762ef6d8be9d75677af2ca"}, - {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:5841dd1f284bd1b3d8a6eca3a7f062b06f1eec09b184397e1d1d43447e89a7ae"}, - {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8caee47e970b92b3dd948371230fcceb80d3f2277b3bf7fbd7c0564e7d39068e"}, - {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73819689c169417a4f978e562d24f2def2be75739c4bed1992435d007819da1b"}, - {file = "grpcio-1.64.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6503b64c8b2dfad299749cad1b595c650c91e5b2c8a1b775380fcf8d2cbba1e9"}, - {file = "grpcio-1.64.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1de403fc1305fd96cfa75e83be3dee8538f2413a6b1685b8452301c7ba33c294"}, - {file = "grpcio-1.64.1-cp311-cp311-win32.whl", hash = "sha256:d4d29cc612e1332237877dfa7fe687157973aab1d63bd0f84cf06692f04c0367"}, - {file = "grpcio-1.64.1-cp311-cp311-win_amd64.whl", hash = "sha256:5e56462b05a6f860b72f0fa50dca06d5b26543a4e88d0396259a07dc30f4e5aa"}, - {file = "grpcio-1.64.1-cp312-cp312-linux_armv7l.whl", hash = "sha256:4657d24c8063e6095f850b68f2d1ba3b39f2b287a38242dcabc166453e950c59"}, - {file = "grpcio-1.64.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:62b4e6eb7bf901719fce0ca83e3ed474ae5022bb3827b0a501e056458c51c0a1"}, - {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:ee73a2f5ca4ba44fa33b4d7d2c71e2c8a9e9f78d53f6507ad68e7d2ad5f64a22"}, - {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:198908f9b22e2672a998870355e226a725aeab327ac4e6ff3a1399792ece4762"}, - {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39b9d0acaa8d835a6566c640f48b50054f422d03e77e49716d4c4e8e279665a1"}, - {file = "grpcio-1.64.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:5e42634a989c3aa6049f132266faf6b949ec2a6f7d302dbb5c15395b77d757eb"}, - {file = "grpcio-1.64.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b1a82e0b9b3022799c336e1fc0f6210adc019ae84efb7321d668129d28ee1efb"}, - {file = "grpcio-1.64.1-cp312-cp312-win32.whl", hash = "sha256:55260032b95c49bee69a423c2f5365baa9369d2f7d233e933564d8a47b893027"}, - {file = "grpcio-1.64.1-cp312-cp312-win_amd64.whl", hash = "sha256:c1a786ac592b47573a5bb7e35665c08064a5d77ab88a076eec11f8ae86b3e3f6"}, - {file = "grpcio-1.64.1-cp38-cp38-linux_armv7l.whl", hash = "sha256:a011ac6c03cfe162ff2b727bcb530567826cec85eb8d4ad2bfb4bd023287a52d"}, - {file = "grpcio-1.64.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:4d6dab6124225496010bd22690f2d9bd35c7cbb267b3f14e7a3eb05c911325d4"}, - {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:a5e771d0252e871ce194d0fdcafd13971f1aae0ddacc5f25615030d5df55c3a2"}, - {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2c3c1b90ab93fed424e454e93c0ed0b9d552bdf1b0929712b094f5ecfe7a23ad"}, - {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20405cb8b13fd779135df23fabadc53b86522d0f1cba8cca0e87968587f50650"}, - {file = "grpcio-1.64.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0cc79c982ccb2feec8aad0e8fb0d168bcbca85bc77b080d0d3c5f2f15c24ea8f"}, - {file = "grpcio-1.64.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a3a035c37ce7565b8f4f35ff683a4db34d24e53dc487e47438e434eb3f701b2a"}, - {file = "grpcio-1.64.1-cp38-cp38-win32.whl", hash = "sha256:1257b76748612aca0f89beec7fa0615727fd6f2a1ad580a9638816a4b2eb18fd"}, - {file = "grpcio-1.64.1-cp38-cp38-win_amd64.whl", hash = "sha256:0a12ddb1678ebc6a84ec6b0487feac020ee2b1659cbe69b80f06dbffdb249122"}, - {file = "grpcio-1.64.1-cp39-cp39-linux_armv7l.whl", hash = "sha256:75dbbf415026d2862192fe1b28d71f209e2fd87079d98470db90bebe57b33179"}, - {file = "grpcio-1.64.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e3d9f8d1221baa0ced7ec7322a981e28deb23749c76eeeb3d33e18b72935ab62"}, - {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:5f8b75f64d5d324c565b263c67dbe4f0af595635bbdd93bb1a88189fc62ed2e5"}, - {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c84ad903d0d94311a2b7eea608da163dace97c5fe9412ea311e72c3684925602"}, - {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:940e3ec884520155f68a3b712d045e077d61c520a195d1a5932c531f11883489"}, - {file = "grpcio-1.64.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f10193c69fc9d3d726e83bbf0f3d316f1847c3071c8c93d8090cf5f326b14309"}, - {file = "grpcio-1.64.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ac15b6c2c80a4d1338b04d42a02d376a53395ddf0ec9ab157cbaf44191f3ffdd"}, - {file = "grpcio-1.64.1-cp39-cp39-win32.whl", hash = "sha256:03b43d0ccf99c557ec671c7dede64f023c7da9bb632ac65dbc57f166e4970040"}, - {file = "grpcio-1.64.1-cp39-cp39-win_amd64.whl", hash = "sha256:ed6091fa0adcc7e4ff944090cf203a52da35c37a130efa564ded02b7aff63bcd"}, - {file = "grpcio-1.64.1.tar.gz", hash = "sha256:8d51dd1c59d5fa0f34266b80a3805ec29a1f26425c2a54736133f6d87fc4968a"}, + {file = "grpcio-1.65.1-cp310-cp310-linux_armv7l.whl", hash = "sha256:3dc5f928815b8972fb83b78d8db5039559f39e004ec93ebac316403fe031a062"}, + {file = "grpcio-1.65.1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:8333ca46053c35484c9f2f7e8d8ec98c1383a8675a449163cea31a2076d93de8"}, + {file = "grpcio-1.65.1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:7af64838b6e615fff0ec711960ed9b6ee83086edfa8c32670eafb736f169d719"}, + {file = "grpcio-1.65.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbb64b4166362d9326f7efbf75b1c72106c1aa87f13a8c8b56a1224fac152f5c"}, + {file = "grpcio-1.65.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8422dc13ad93ec8caa2612b5032a2b9cd6421c13ed87f54db4a3a2c93afaf77"}, + {file = "grpcio-1.65.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:4effc0562b6c65d4add6a873ca132e46ba5e5a46f07c93502c37a9ae7f043857"}, + {file = "grpcio-1.65.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a6c71575a2fedf259724981fd73a18906513d2f306169c46262a5bae956e6364"}, + {file = "grpcio-1.65.1-cp310-cp310-win32.whl", hash = "sha256:34966cf526ef0ea616e008d40d989463e3db157abb213b2f20c6ce0ae7928875"}, + {file = "grpcio-1.65.1-cp310-cp310-win_amd64.whl", hash = "sha256:ca931de5dd6d9eb94ff19a2c9434b23923bce6f767179fef04dfa991f282eaad"}, + {file = "grpcio-1.65.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:bbb46330cc643ecf10bd9bd4ca8e7419a14b6b9dedd05f671c90fb2c813c6037"}, + {file = "grpcio-1.65.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d827a6fb9215b961eb73459ad7977edb9e748b23e3407d21c845d1d8ef6597e5"}, + {file = "grpcio-1.65.1-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:6e71aed8835f8d9fbcb84babc93a9da95955d1685021cceb7089f4f1e717d719"}, + {file = "grpcio-1.65.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9a1c84560b3b2d34695c9ba53ab0264e2802721c530678a8f0a227951f453462"}, + {file = "grpcio-1.65.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27adee2338d697e71143ed147fe286c05810965d5d30ec14dd09c22479bfe48a"}, + {file = "grpcio-1.65.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:f62652ddcadc75d0e7aa629e96bb61658f85a993e748333715b4ab667192e4e8"}, + {file = "grpcio-1.65.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:71a05fd814700dd9cb7d9a507f2f6a1ef85866733ccaf557eedacec32d65e4c2"}, + {file = "grpcio-1.65.1-cp311-cp311-win32.whl", hash = "sha256:b590f1ad056294dfaeac0b7e1b71d3d5ace638d8dd1f1147ce4bd13458783ba8"}, + {file = "grpcio-1.65.1-cp311-cp311-win_amd64.whl", hash = "sha256:12e9bdf3b5fd48e5fbe5b3da382ad8f97c08b47969f3cca81dd9b36b86ed39e2"}, + {file = "grpcio-1.65.1-cp312-cp312-linux_armv7l.whl", hash = "sha256:54cb822e177374b318b233e54b6856c692c24cdbd5a3ba5335f18a47396bac8f"}, + {file = "grpcio-1.65.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:aaf3c54419a28d45bd1681372029f40e5bfb58e5265e3882eaf21e4a5f81a119"}, + {file = "grpcio-1.65.1-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:557de35bdfbe8bafea0a003dbd0f4da6d89223ac6c4c7549d78e20f92ead95d9"}, + {file = "grpcio-1.65.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8bfd95ef3b097f0cc86ade54eafefa1c8ed623aa01a26fbbdcd1a3650494dd11"}, + {file = "grpcio-1.65.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e6a8f3d6c41e6b642870afe6cafbaf7b61c57317f9ec66d0efdaf19db992b90"}, + {file = "grpcio-1.65.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:1faaf7355ceed07ceaef0b9dcefa4c98daf1dd8840ed75c2de128c3f4a4d859d"}, + {file = "grpcio-1.65.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:60f1f38eed830488ad2a1b11579ef0f345ff16fffdad1d24d9fbc97ba31804ff"}, + {file = "grpcio-1.65.1-cp312-cp312-win32.whl", hash = "sha256:e75acfa52daf5ea0712e8aa82f0003bba964de7ae22c26d208cbd7bc08500177"}, + {file = "grpcio-1.65.1-cp312-cp312-win_amd64.whl", hash = "sha256:ff5a84907e51924973aa05ed8759210d8cdae7ffcf9e44fd17646cf4a902df59"}, + {file = "grpcio-1.65.1-cp38-cp38-linux_armv7l.whl", hash = "sha256:1fbd6331f18c3acd7e09d17fd840c096f56eaf0ef830fbd50af45ae9dc8dfd83"}, + {file = "grpcio-1.65.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:de5b6be29116e094c5ef9d9e4252e7eb143e3d5f6bd6d50a78075553ab4930b0"}, + {file = "grpcio-1.65.1-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:e4a3cdba62b2d6aeae6027ae65f350de6dc082b72e6215eccf82628e79efe9ba"}, + {file = "grpcio-1.65.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:941c4869aa229d88706b78187d60d66aca77fe5c32518b79e3c3e03fc26109a2"}, + {file = "grpcio-1.65.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f40cebe5edb518d78b8131e87cb83b3ee688984de38a232024b9b44e74ee53d3"}, + {file = "grpcio-1.65.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:2ca684ba331fb249d8a1ce88db5394e70dbcd96e58d8c4b7e0d7b141a453dce9"}, + {file = "grpcio-1.65.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8558f0083ddaf5de64a59c790bffd7568e353914c0c551eae2955f54ee4b857f"}, + {file = "grpcio-1.65.1-cp38-cp38-win32.whl", hash = "sha256:8d8143a3e3966f85dce6c5cc45387ec36552174ba5712c5dc6fcc0898fb324c0"}, + {file = "grpcio-1.65.1-cp38-cp38-win_amd64.whl", hash = "sha256:76e81a86424d6ca1ce7c16b15bdd6a964a42b40544bf796a48da241fdaf61153"}, + {file = "grpcio-1.65.1-cp39-cp39-linux_armv7l.whl", hash = "sha256:cb5175f45c980ff418998723ea1b3869cce3766d2ab4e4916fbd3cedbc9d0ed3"}, + {file = "grpcio-1.65.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b12c1aa7b95abe73b3e04e052c8b362655b41c7798da69f1eaf8d186c7d204df"}, + {file = "grpcio-1.65.1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:3019fb50128b21a5e018d89569ffaaaa361680e1346c2f261bb84a91082eb3d3"}, + {file = "grpcio-1.65.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ae15275ed98ea267f64ee9ddedf8ecd5306a5b5bb87972a48bfe24af24153e8"}, + {file = "grpcio-1.65.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f096ffb881f37e8d4f958b63c74bfc400c7cebd7a944b027357cd2fb8d91a57"}, + {file = "grpcio-1.65.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2f56b5a68fdcf17a0a1d524bf177218c3c69b3947cb239ea222c6f1867c3ab68"}, + {file = "grpcio-1.65.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:941596d419b9736ab548aa0feb5bbba922f98872668847bf0720b42d1d227b9e"}, + {file = "grpcio-1.65.1-cp39-cp39-win32.whl", hash = "sha256:5fd7337a823b890215f07d429f4f193d24b80d62a5485cf88ee06648591a0c57"}, + {file = "grpcio-1.65.1-cp39-cp39-win_amd64.whl", hash = "sha256:1bceeec568372cbebf554eae1b436b06c2ff24cfaf04afade729fb9035408c6c"}, + {file = "grpcio-1.65.1.tar.gz", hash = "sha256:3c492301988cd720cd145d84e17318d45af342e29ef93141228f9cd73222368b"}, ] [package.extras] -protobuf = ["grpcio-tools (>=1.64.1)"] +protobuf = ["grpcio-tools (>=1.65.1)"] [[package]] name = "grpcio-status" @@ -1820,13 +1820,13 @@ socks = ["socksio (==1.*)"] [[package]] name = "huggingface-hub" -version = "0.23.4" +version = "0.24.0" description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub" optional = false python-versions = ">=3.8.0" files = [ - {file = "huggingface_hub-0.23.4-py3-none-any.whl", hash = "sha256:3a0b957aa87150addf0cc7bd71b4d954b78e749850e1e7fb29ebbd2db64ca037"}, - {file = "huggingface_hub-0.23.4.tar.gz", hash = "sha256:35d99016433900e44ae7efe1c209164a5a81dbbcd53a52f99c281dcd7ce22431"}, + {file = "huggingface_hub-0.24.0-py3-none-any.whl", hash = "sha256:7ad92edefb93d8145c061f6df8d99df2ff85f8379ba5fac8a95aca0642afa5d7"}, + {file = "huggingface_hub-0.24.0.tar.gz", hash = "sha256:6c7092736b577d89d57b3cdfea026f1b0dc2234ae783fa0d59caf1bf7d52dfa7"}, ] [package.dependencies] @@ -1839,17 +1839,17 @@ tqdm = ">=4.42.1" typing-extensions = ">=3.7.4.3" [package.extras] -all = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "fastapi", "gradio", "jedi", "minijinja (>=1.0)", "mypy (==1.5.1)", "numpy", "pytest", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "ruff (>=0.3.0)", "soundfile", "types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3", "typing-extensions (>=4.8.0)", "urllib3 (<2.0)"] +all = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "fastapi", "gradio", "jedi", "minijinja (>=1.0)", "mypy (==1.5.1)", "numpy", "pytest (>=8.1.1,<8.2.2)", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-mock", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "ruff (>=0.5.0)", "soundfile", "types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3", "typing-extensions (>=4.8.0)", "urllib3 (<2.0)"] cli = ["InquirerPy (==0.3.4)"] -dev = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "fastapi", "gradio", "jedi", "minijinja (>=1.0)", "mypy (==1.5.1)", "numpy", "pytest", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "ruff (>=0.3.0)", "soundfile", "types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3", "typing-extensions (>=4.8.0)", "urllib3 (<2.0)"] +dev = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "fastapi", "gradio", "jedi", "minijinja (>=1.0)", "mypy (==1.5.1)", "numpy", "pytest (>=8.1.1,<8.2.2)", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-mock", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "ruff (>=0.5.0)", "soundfile", "types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3", "typing-extensions (>=4.8.0)", "urllib3 (<2.0)"] fastai = ["fastai (>=2.4)", "fastcore (>=1.3.27)", "toml"] hf-transfer = ["hf-transfer (>=0.1.4)"] inference = ["aiohttp", "minijinja (>=1.0)"] -quality = ["mypy (==1.5.1)", "ruff (>=0.3.0)"] +quality = ["mypy (==1.5.1)", "ruff (>=0.5.0)"] tensorflow = ["graphviz", "pydot", "tensorflow"] tensorflow-testing = ["keras (<3.0)", "tensorflow"] -testing = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "fastapi", "gradio", "jedi", "minijinja (>=1.0)", "numpy", "pytest", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "soundfile", "urllib3 (<2.0)"] -torch = ["safetensors", "torch"] +testing = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "fastapi", "gradio", "jedi", "minijinja (>=1.0)", "numpy", "pytest (>=8.1.1,<8.2.2)", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-mock", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "soundfile", "urllib3 (<2.0)"] +torch = ["safetensors[torch]", "torch"] typing = ["types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3", "typing-extensions (>=4.8.0)"] [[package]] @@ -2404,13 +2404,13 @@ test = ["jupyter-server (>=2.0.0)", "pytest (>=7.0)", "pytest-jupyter[server] (> [[package]] name = "jupyterlab" -version = "4.2.3" +version = "4.2.4" description = "JupyterLab computational environment" optional = false python-versions = ">=3.8" files = [ - {file = "jupyterlab-4.2.3-py3-none-any.whl", hash = "sha256:0b59d11808e84bb84105c73364edfa867dd475492429ab34ea388a52f2e2e596"}, - {file = "jupyterlab-4.2.3.tar.gz", hash = "sha256:df6e46969ea51d66815167f23d92f105423b7f1f06fa604d4f44aeb018c82c7b"}, + {file = "jupyterlab-4.2.4-py3-none-any.whl", hash = "sha256:807a7ec73637744f879e112060d4b9d9ebe028033b7a429b2d1f4fc523d00245"}, + {file = "jupyterlab-4.2.4.tar.gz", hash = "sha256:343a979fb9582fd08c8511823e320703281cd072a0049bcdafdc7afeda7f2537"}, ] [package.dependencies] @@ -2434,7 +2434,7 @@ dev = ["build", "bump2version", "coverage", "hatch", "pre-commit", "pytest-cov", docs = ["jsx-lexer", "myst-parser", "pydata-sphinx-theme (>=0.13.0)", "pytest", "pytest-check-links", "pytest-jupyter", "sphinx (>=1.8,<7.3.0)", "sphinx-copybutton"] docs-screenshots = ["altair (==5.3.0)", "ipython (==8.16.1)", "ipywidgets (==8.1.2)", "jupyterlab-geojson (==3.4.0)", "jupyterlab-language-pack-zh-cn (==4.1.post2)", "matplotlib (==3.8.3)", "nbconvert (>=7.0.0)", "pandas (==2.2.1)", "scipy (==1.12.0)", "vega-datasets (==0.9.0)"] test = ["coverage", "pytest (>=7.0)", "pytest-check-links (>=0.7)", "pytest-console-scripts", "pytest-cov", "pytest-jupyter (>=0.5.3)", "pytest-timeout", "pytest-tornasync", "requests", "requests-cache", "virtualenv"] -upgrade-extension = ["copier (>=8,<10)", "jinja2-time (<0.3)", "pydantic (<2.0)", "pyyaml-include (<2.0)", "tomli-w (<2.0)"] +upgrade-extension = ["copier (>=9,<10)", "jinja2-time (<0.3)", "pydantic (<3.0)", "pyyaml-include (<3.0)", "tomli-w (<2.0)"] [[package]] name = "jupyterlab-pygments" @@ -2449,13 +2449,13 @@ files = [ [[package]] name = "jupyterlab-server" -version = "2.27.2" +version = "2.27.3" description = "A set of server components for JupyterLab and JupyterLab like applications." optional = false python-versions = ">=3.8" files = [ - {file = "jupyterlab_server-2.27.2-py3-none-any.whl", hash = "sha256:54aa2d64fd86383b5438d9f0c032f043c4d8c0264b8af9f60bd061157466ea43"}, - {file = "jupyterlab_server-2.27.2.tar.gz", hash = "sha256:15cbb349dc45e954e09bacf81b9f9bcb10815ff660fb2034ecd7417db3a7ea27"}, + {file = "jupyterlab_server-2.27.3-py3-none-any.whl", hash = "sha256:e697488f66c3db49df675158a77b3b017520d772c6e1548c7d9bcc5df7944ee4"}, + {file = "jupyterlab_server-2.27.3.tar.gz", hash = "sha256:eb36caca59e74471988f0ae25c77945610b887f777255aa21f8065def9e51ed4"}, ] [package.dependencies] @@ -2606,13 +2606,13 @@ extended-testing = ["beautifulsoup4 (>=4.12.3,<5.0.0)", "lxml (>=4.9.3,<6.0)"] [[package]] name = "langsmith" -version = "0.1.85" +version = "0.1.93" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = "<4.0,>=3.8.1" files = [ - {file = "langsmith-0.1.85-py3-none-any.whl", hash = "sha256:c1f94384f10cea96f7b4d33fd3db7ec180c03c7468877d50846f881d2017ff94"}, - {file = "langsmith-0.1.85.tar.gz", hash = "sha256:acff31f9e53efa48586cf8e32f65625a335c74d7c4fa306d1655ac18452296f6"}, + {file = "langsmith-0.1.93-py3-none-any.whl", hash = "sha256:811210b9d5f108f36431bd7b997eb9476a9ecf5a2abd7ddbb606c1cdcf0f43ce"}, + {file = "langsmith-0.1.93.tar.gz", hash = "sha256:285b6ad3a54f50fa8eb97b5f600acc57d0e37e139dd8cf2111a117d0435ba9b4"}, ] [package.dependencies] @@ -3288,13 +3288,13 @@ files = [ [[package]] name = "openai" -version = "1.35.13" +version = "1.36.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.35.13-py3-none-any.whl", hash = "sha256:36ec3e93e0d1f243f69be85c89b9221a471c3e450dfd9df16c9829e3cdf63e60"}, - {file = "openai-1.35.13.tar.gz", hash = "sha256:c684f3945608baf7d2dcc0ef3ee6f3e27e4c66f21076df0b47be45d57e6ae6e4"}, + {file = "openai-1.36.0-py3-none-any.whl", hash = "sha256:82b74ded1fe2ea94abb19a007178bc143675f1b6903cebd63e2968d654bb0a6f"}, + {file = "openai-1.36.0.tar.gz", hash = "sha256:a124baf0e1657d6156e12248642f88489cd030be8655b69bc1c13eb50e71a93d"}, ] [package.dependencies] @@ -3919,22 +3919,22 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pydot" -version = "2.0.0" +version = "3.0.1" description = "Python interface to Graphviz's Dot" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pydot-2.0.0-py3-none-any.whl", hash = "sha256:408a47913ea7bd5d2d34b274144880c1310c4aee901f353cf21fe2e526a4ea28"}, - {file = "pydot-2.0.0.tar.gz", hash = "sha256:60246af215123fa062f21cd791be67dda23a6f280df09f68919e637a1e4f3235"}, + {file = "pydot-3.0.1-py3-none-any.whl", hash = "sha256:43f1e878dc1ff7c1c2e3470a6999d4e9e97771c5c862440c2f0af0ba844c231f"}, + {file = "pydot-3.0.1.tar.gz", hash = "sha256:e18cf7f287c497d77b536a3d20a46284568fea390776dface6eabbdf1b1b5efc"}, ] [package.dependencies] -pyparsing = ">=3" +pyparsing = ">=3.0.9" [package.extras] -dev = ["black", "chardet"] +dev = ["chardet", "parameterized", "ruff"] release = ["zest.releaser[recommended]"] -tests = ["black", "chardet", "tox"] +tests = ["chardet", "parameterized", "ruff", "tox", "unittest-parallel"] [[package]] name = "pygments" @@ -4768,18 +4768,19 @@ tornado = ["tornado (>=5)"] [[package]] name = "setuptools" -version = "70.3.0" +version = "71.0.4" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, - {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, + {file = "setuptools-71.0.4-py3-none-any.whl", hash = "sha256:ed2feca703be3bdbd94e6bb17365d91c6935c6b2a8d0bb09b66a2c435ba0b1a5"}, + {file = "setuptools-71.0.4.tar.gz", hash = "sha256:48297e5d393a62b7cb2a10b8f76c63a73af933bd809c9e0d0d6352a1a0135dd8"}, ] [package.extras] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shapely" diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index 29a68c56e..6bb74898a 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -68,4 +68,4 @@ check = [ "typecheck", ] test = "ward" -codegen = "datamodel-codegen --input ../openapi.yaml --input-file-type openapi --output agents_api/autogen/ --use-operation-id-as-name --use-double-quotes --use-schema-description --target-python-version 3.10 --reuse-model --collapse-root-models --use-field-description --field-include-all-keys --use-unique-items-as-set --use-subclass-enum --use-union-operator --use-one-literal-as-default --use-annotated --enum-field-as-literal one --output-model-type pydantic_v2.BaseModel" +codegen = "datamodel-codegen --input ../openapi.yaml --input-file-type openapi --output agents_api/autogen/ --use-operation-id-as-name --use-double-quotes --use-schema-description --target-python-version 3.10 --reuse-model --strict-nullable --openapi-scopes schemas --openapi-scopes paths --use-exact-imports --keep-model-order --disable-timestamp --allow-population-by-field-name --use-field-description --field-include-all-keys --use-unique-items-as-set --use-subclass-enum --use-union-operator --use-one-literal-as-default --use-default --use-annotated --enum-field-as-literal one --output-model-type pydantic_v2.BaseModel --field-constraints --use-standard-collections --use-non-positive-negative-number-constrained-types" diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index d87067268..fb320f6dc 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -1176,13 +1176,13 @@ test = ["jupyter-server (>=2.0.0)", "pytest (>=7.0)", "pytest-jupyter[server] (> [[package]] name = "jupyterlab" -version = "4.2.3" +version = "4.2.4" description = "JupyterLab computational environment" optional = false python-versions = ">=3.8" files = [ - {file = "jupyterlab-4.2.3-py3-none-any.whl", hash = "sha256:0b59d11808e84bb84105c73364edfa867dd475492429ab34ea388a52f2e2e596"}, - {file = "jupyterlab-4.2.3.tar.gz", hash = "sha256:df6e46969ea51d66815167f23d92f105423b7f1f06fa604d4f44aeb018c82c7b"}, + {file = "jupyterlab-4.2.4-py3-none-any.whl", hash = "sha256:807a7ec73637744f879e112060d4b9d9ebe028033b7a429b2d1f4fc523d00245"}, + {file = "jupyterlab-4.2.4.tar.gz", hash = "sha256:343a979fb9582fd08c8511823e320703281cd072a0049bcdafdc7afeda7f2537"}, ] [package.dependencies] @@ -1207,7 +1207,7 @@ dev = ["build", "bump2version", "coverage", "hatch", "pre-commit", "pytest-cov", docs = ["jsx-lexer", "myst-parser", "pydata-sphinx-theme (>=0.13.0)", "pytest", "pytest-check-links", "pytest-jupyter", "sphinx (>=1.8,<7.3.0)", "sphinx-copybutton"] docs-screenshots = ["altair (==5.3.0)", "ipython (==8.16.1)", "ipywidgets (==8.1.2)", "jupyterlab-geojson (==3.4.0)", "jupyterlab-language-pack-zh-cn (==4.1.post2)", "matplotlib (==3.8.3)", "nbconvert (>=7.0.0)", "pandas (==2.2.1)", "scipy (==1.12.0)", "vega-datasets (==0.9.0)"] test = ["coverage", "pytest (>=7.0)", "pytest-check-links (>=0.7)", "pytest-console-scripts", "pytest-cov", "pytest-jupyter (>=0.5.3)", "pytest-timeout", "pytest-tornasync", "requests", "requests-cache", "virtualenv"] -upgrade-extension = ["copier (>=8,<10)", "jinja2-time (<0.3)", "pydantic (<2.0)", "pyyaml-include (<2.0)", "tomli-w (<2.0)"] +upgrade-extension = ["copier (>=9,<10)", "jinja2-time (<0.3)", "pydantic (<3.0)", "pyyaml-include (<3.0)", "tomli-w (<2.0)"] [[package]] name = "jupyterlab-pygments" @@ -1222,13 +1222,13 @@ files = [ [[package]] name = "jupyterlab-server" -version = "2.27.2" +version = "2.27.3" description = "A set of server components for JupyterLab and JupyterLab like applications." optional = false python-versions = ">=3.8" files = [ - {file = "jupyterlab_server-2.27.2-py3-none-any.whl", hash = "sha256:54aa2d64fd86383b5438d9f0c032f043c4d8c0264b8af9f60bd061157466ea43"}, - {file = "jupyterlab_server-2.27.2.tar.gz", hash = "sha256:15cbb349dc45e954e09bacf81b9f9bcb10815ff660fb2034ecd7417db3a7ea27"}, + {file = "jupyterlab_server-2.27.3-py3-none-any.whl", hash = "sha256:e697488f66c3db49df675158a77b3b017520d772c6e1548c7d9bcc5df7944ee4"}, + {file = "jupyterlab_server-2.27.3.tar.gz", hash = "sha256:eb36caca59e74471988f0ae25c77945610b887f777255aa21f8065def9e51ed4"}, ] [package.dependencies] @@ -1666,13 +1666,13 @@ files = [ [[package]] name = "openai" -version = "1.35.13" +version = "1.36.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.35.13-py3-none-any.whl", hash = "sha256:36ec3e93e0d1f243f69be85c89b9221a471c3e450dfd9df16c9829e3cdf63e60"}, - {file = "openai-1.35.13.tar.gz", hash = "sha256:c684f3945608baf7d2dcc0ef3ee6f3e27e4c66f21076df0b47be45d57e6ae6e4"}, + {file = "openai-1.36.0-py3-none-any.whl", hash = "sha256:82b74ded1fe2ea94abb19a007178bc143675f1b6903cebd63e2968d654bb0a6f"}, + {file = "openai-1.36.0.tar.gz", hash = "sha256:a124baf0e1657d6156e12248642f88489cd030be8655b69bc1c13eb50e71a93d"}, ] [package.dependencies] @@ -2176,22 +2176,22 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pydot" -version = "2.0.0" +version = "3.0.1" description = "Python interface to Graphviz's Dot" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pydot-2.0.0-py3-none-any.whl", hash = "sha256:408a47913ea7bd5d2d34b274144880c1310c4aee901f353cf21fe2e526a4ea28"}, - {file = "pydot-2.0.0.tar.gz", hash = "sha256:60246af215123fa062f21cd791be67dda23a6f280df09f68919e637a1e4f3235"}, + {file = "pydot-3.0.1-py3-none-any.whl", hash = "sha256:43f1e878dc1ff7c1c2e3470a6999d4e9e97771c5c862440c2f0af0ba844c231f"}, + {file = "pydot-3.0.1.tar.gz", hash = "sha256:e18cf7f287c497d77b536a3d20a46284568fea390776dface6eabbdf1b1b5efc"}, ] [package.dependencies] -pyparsing = ">=3" +pyparsing = ">=3.0.9" [package.extras] -dev = ["black", "chardet"] +dev = ["chardet", "parameterized", "ruff"] release = ["zest.releaser[recommended]"] -tests = ["black", "chardet", "tox"] +tests = ["chardet", "parameterized", "ruff", "tox", "unittest-parallel"] [[package]] name = "pygments" @@ -2223,13 +2223,13 @@ diagrams = ["jinja2", "railroad-diagrams"] [[package]] name = "pyright" -version = "1.1.371" +version = "1.1.372" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.371-py3-none-any.whl", hash = "sha256:cce52e42ff73943243e7e5e24f2a59dee81b97d99f4e3cf97370b27e8a1858cd"}, - {file = "pyright-1.1.371.tar.gz", hash = "sha256:777b508b92dda2db476214c400ce043aad8d8f3dd0e10d284c96e79f298308b5"}, + {file = "pyright-1.1.372-py3-none-any.whl", hash = "sha256:25b15fb8967740f0949fd35b963777187f0a0404c0bd753cc966ec139f3eaa0b"}, + {file = "pyright-1.1.372.tar.gz", hash = "sha256:a9f5e0daa955daaa17e3d1ef76d3623e75f8afd5e37b437d3ff84d5b38c15420"}, ] [package.dependencies] @@ -2751,18 +2751,19 @@ win32 = ["pywin32"] [[package]] name = "setuptools" -version = "70.3.0" +version = "71.0.4" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, - {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, + {file = "setuptools-71.0.4-py3-none-any.whl", hash = "sha256:ed2feca703be3bdbd94e6bb17365d91c6935c6b2a8d0bb09b66a2c435ba0b1a5"}, + {file = "setuptools-71.0.4.tar.gz", hash = "sha256:48297e5d393a62b7cb2a10b8f76c63a73af933bd809c9e0d0d6352a1a0135dd8"}, ] [package.extras] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shellingham" diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index 6b45b0053..331500b4c 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -10,6 +10,7 @@ export { CancelablePromise, CancelError } from "./core/CancelablePromise"; export { OpenAPI } from "./core/OpenAPI"; export type { OpenAPIConfig } from "./core/OpenAPI"; +export type { Agent } from "./models/Agent"; export type { Agents_Agent } from "./models/Agents_Agent"; export type { Agents_CreateAgentRequest } from "./models/Agents_CreateAgentRequest"; export type { Agents_CreateOrUpdateAgentRequest } from "./models/Agents_CreateOrUpdateAgentRequest"; @@ -24,13 +25,25 @@ export type { Common_identifierSafeUnicode } from "./models/Common_identifierSaf export type { Common_limit } from "./models/Common_limit"; export type { Common_logit_bias } from "./models/Common_logit_bias"; export type { Common_offset } from "./models/Common_offset"; +export type { Common_PaginationOptions_direction } from "./models/Common_PaginationOptions_direction"; +export type { Common_PaginationOptions_limit } from "./models/Common_PaginationOptions_limit"; +export type { Common_PaginationOptions_metadata_filter } from "./models/Common_PaginationOptions_metadata_filter"; +export type { Common_PaginationOptions_offset } from "./models/Common_PaginationOptions_offset"; +export type { Common_PaginationOptions_sort_by } from "./models/Common_PaginationOptions_sort_by"; +export type { Common_PyExpression } from "./models/Common_PyExpression"; +export type { Common_ResourceCreatedResponse } from "./models/Common_ResourceCreatedResponse"; +export type { Common_ResourceDeletedResponse } from "./models/Common_ResourceDeletedResponse"; +export type { Common_ResourceUpdatedResponse } from "./models/Common_ResourceUpdatedResponse"; export type { Common_toolRef } from "./models/Common_toolRef"; export type { Common_uuid } from "./models/Common_uuid"; export type { Common_validPythonIdentifier } from "./models/Common_validPythonIdentifier"; +export type { Doc } from "./models/Doc"; export type { Docs_Doc } from "./models/Docs_Doc"; export type { Docs_DocOwner } from "./models/Docs_DocOwner"; export type { Docs_DocReference } from "./models/Docs_DocReference"; export type { Docs_DocSearchRequest } from "./models/Docs_DocSearchRequest"; +export type { Docs_EmbedQueryRequest } from "./models/Docs_EmbedQueryRequest"; +export type { Docs_EmbedQueryResponse } from "./models/Docs_EmbedQueryResponse"; export type { Docs_HybridDocSearchRequest } from "./models/Docs_HybridDocSearchRequest"; export type { Docs_TextOnlyDocSearchRequest } from "./models/Docs_TextOnlyDocSearchRequest"; export type { Docs_VectorDocSearchRequest } from "./models/Docs_VectorDocSearchRequest"; @@ -44,6 +57,8 @@ export type { Entries_ImageDetail } from "./models/Entries_ImageDetail"; export type { Entries_ImageURL } from "./models/Entries_ImageURL"; export type { Entries_InputChatMLMessage } from "./models/Entries_InputChatMLMessage"; export type { Entries_Relation } from "./models/Entries_Relation"; +export type { Entry } from "./models/Entry"; +export type { Execution } from "./models/Execution"; export type { Executions_CreateExecutionRequest } from "./models/Executions_CreateExecutionRequest"; export type { Executions_Execution } from "./models/Executions_Execution"; export type { Executions_ResumeExecutionRequest } from "./models/Executions_ResumeExecutionRequest"; @@ -51,8 +66,12 @@ export type { Executions_StopExecutionRequest } from "./models/Executions_StopEx export type { Executions_TaskTokenResumeExecutionRequest } from "./models/Executions_TaskTokenResumeExecutionRequest"; export type { Executions_Transition } from "./models/Executions_Transition"; export type { Executions_UpdateExecutionRequest } from "./models/Executions_UpdateExecutionRequest"; +export type { History } from "./models/History"; export type { Jobs_JobState } from "./models/Jobs_JobState"; export type { Jobs_JobStatus } from "./models/Jobs_JobStatus"; +export type { JobStatus } from "./models/JobStatus"; +export type { Session } from "./models/Session"; +export type { Sessions_ContextOverflowType } from "./models/Sessions_ContextOverflowType"; export type { Sessions_CreateOrUpdateSessionRequest } from "./models/Sessions_CreateOrUpdateSessionRequest"; export type { Sessions_CreateSessionRequest } from "./models/Sessions_CreateSessionRequest"; export type { Sessions_MultiAgentMultiUserSession } from "./models/Sessions_MultiAgentMultiUserSession"; @@ -64,7 +83,7 @@ export type { Sessions_SingleAgentMultiUserSession } from "./models/Sessions_Sin export type { Sessions_SingleAgentNoUserSession } from "./models/Sessions_SingleAgentNoUserSession"; export type { Sessions_SingleAgentSingleUserSession } from "./models/Sessions_SingleAgentSingleUserSession"; export type { Sessions_UpdateSessionRequest } from "./models/Sessions_UpdateSessionRequest"; -export type { Tasks_CEL } from "./models/Tasks_CEL"; +export type { Task } from "./models/Task"; export type { Tasks_CreateOrUpdateTaskRequest } from "./models/Tasks_CreateOrUpdateTaskRequest"; export type { Tasks_CreateTaskRequest } from "./models/Tasks_CreateTaskRequest"; export type { Tasks_ErrorWorkflowStep } from "./models/Tasks_ErrorWorkflowStep"; @@ -77,6 +96,7 @@ export type { Tasks_ToolCallStep } from "./models/Tasks_ToolCallStep"; export type { Tasks_UpdateTaskRequest } from "./models/Tasks_UpdateTaskRequest"; export type { Tasks_WorkflowStep } from "./models/Tasks_WorkflowStep"; export type { Tasks_YieldStep } from "./models/Tasks_YieldStep"; +export type { Tool } from "./models/Tool"; export type { Tools_ChosenFunctionCall } from "./models/Tools_ChosenFunctionCall"; export type { Tools_ChosenToolCall } from "./models/Tools_ChosenToolCall"; export type { Tools_CreateToolRequest } from "./models/Tools_CreateToolRequest"; @@ -89,12 +109,15 @@ export type { Tools_Tool } from "./models/Tools_Tool"; export type { Tools_ToolResponse } from "./models/Tools_ToolResponse"; export type { Tools_ToolType } from "./models/Tools_ToolType"; export type { Tools_UpdateToolRequest } from "./models/Tools_UpdateToolRequest"; +export type { Transition } from "./models/Transition"; +export type { User } from "./models/User"; export type { Users_CreateOrUpdateUserRequest } from "./models/Users_CreateOrUpdateUserRequest"; export type { Users_CreateUserRequest } from "./models/Users_CreateUserRequest"; export type { Users_PatchUserRequest } from "./models/Users_PatchUserRequest"; export type { Users_UpdateUserRequest } from "./models/Users_UpdateUserRequest"; export type { Users_User } from "./models/Users_User"; +export { $Agent } from "./schemas/$Agent"; export { $Agents_Agent } from "./schemas/$Agents_Agent"; export { $Agents_CreateAgentRequest } from "./schemas/$Agents_CreateAgentRequest"; export { $Agents_CreateOrUpdateAgentRequest } from "./schemas/$Agents_CreateOrUpdateAgentRequest"; @@ -109,13 +132,25 @@ export { $Common_identifierSafeUnicode } from "./schemas/$Common_identifierSafeU export { $Common_limit } from "./schemas/$Common_limit"; export { $Common_logit_bias } from "./schemas/$Common_logit_bias"; export { $Common_offset } from "./schemas/$Common_offset"; +export { $Common_PaginationOptions_direction } from "./schemas/$Common_PaginationOptions_direction"; +export { $Common_PaginationOptions_limit } from "./schemas/$Common_PaginationOptions_limit"; +export { $Common_PaginationOptions_metadata_filter } from "./schemas/$Common_PaginationOptions_metadata_filter"; +export { $Common_PaginationOptions_offset } from "./schemas/$Common_PaginationOptions_offset"; +export { $Common_PaginationOptions_sort_by } from "./schemas/$Common_PaginationOptions_sort_by"; +export { $Common_PyExpression } from "./schemas/$Common_PyExpression"; +export { $Common_ResourceCreatedResponse } from "./schemas/$Common_ResourceCreatedResponse"; +export { $Common_ResourceDeletedResponse } from "./schemas/$Common_ResourceDeletedResponse"; +export { $Common_ResourceUpdatedResponse } from "./schemas/$Common_ResourceUpdatedResponse"; export { $Common_toolRef } from "./schemas/$Common_toolRef"; export { $Common_uuid } from "./schemas/$Common_uuid"; export { $Common_validPythonIdentifier } from "./schemas/$Common_validPythonIdentifier"; +export { $Doc } from "./schemas/$Doc"; export { $Docs_Doc } from "./schemas/$Docs_Doc"; export { $Docs_DocOwner } from "./schemas/$Docs_DocOwner"; export { $Docs_DocReference } from "./schemas/$Docs_DocReference"; export { $Docs_DocSearchRequest } from "./schemas/$Docs_DocSearchRequest"; +export { $Docs_EmbedQueryRequest } from "./schemas/$Docs_EmbedQueryRequest"; +export { $Docs_EmbedQueryResponse } from "./schemas/$Docs_EmbedQueryResponse"; export { $Docs_HybridDocSearchRequest } from "./schemas/$Docs_HybridDocSearchRequest"; export { $Docs_TextOnlyDocSearchRequest } from "./schemas/$Docs_TextOnlyDocSearchRequest"; export { $Docs_VectorDocSearchRequest } from "./schemas/$Docs_VectorDocSearchRequest"; @@ -129,6 +164,8 @@ export { $Entries_ImageDetail } from "./schemas/$Entries_ImageDetail"; export { $Entries_ImageURL } from "./schemas/$Entries_ImageURL"; export { $Entries_InputChatMLMessage } from "./schemas/$Entries_InputChatMLMessage"; export { $Entries_Relation } from "./schemas/$Entries_Relation"; +export { $Entry } from "./schemas/$Entry"; +export { $Execution } from "./schemas/$Execution"; export { $Executions_CreateExecutionRequest } from "./schemas/$Executions_CreateExecutionRequest"; export { $Executions_Execution } from "./schemas/$Executions_Execution"; export { $Executions_ResumeExecutionRequest } from "./schemas/$Executions_ResumeExecutionRequest"; @@ -136,8 +173,12 @@ export { $Executions_StopExecutionRequest } from "./schemas/$Executions_StopExec export { $Executions_TaskTokenResumeExecutionRequest } from "./schemas/$Executions_TaskTokenResumeExecutionRequest"; export { $Executions_Transition } from "./schemas/$Executions_Transition"; export { $Executions_UpdateExecutionRequest } from "./schemas/$Executions_UpdateExecutionRequest"; +export { $History } from "./schemas/$History"; export { $Jobs_JobState } from "./schemas/$Jobs_JobState"; export { $Jobs_JobStatus } from "./schemas/$Jobs_JobStatus"; +export { $JobStatus } from "./schemas/$JobStatus"; +export { $Session } from "./schemas/$Session"; +export { $Sessions_ContextOverflowType } from "./schemas/$Sessions_ContextOverflowType"; export { $Sessions_CreateOrUpdateSessionRequest } from "./schemas/$Sessions_CreateOrUpdateSessionRequest"; export { $Sessions_CreateSessionRequest } from "./schemas/$Sessions_CreateSessionRequest"; export { $Sessions_MultiAgentMultiUserSession } from "./schemas/$Sessions_MultiAgentMultiUserSession"; @@ -149,7 +190,7 @@ export { $Sessions_SingleAgentMultiUserSession } from "./schemas/$Sessions_Singl export { $Sessions_SingleAgentNoUserSession } from "./schemas/$Sessions_SingleAgentNoUserSession"; export { $Sessions_SingleAgentSingleUserSession } from "./schemas/$Sessions_SingleAgentSingleUserSession"; export { $Sessions_UpdateSessionRequest } from "./schemas/$Sessions_UpdateSessionRequest"; -export { $Tasks_CEL } from "./schemas/$Tasks_CEL"; +export { $Task } from "./schemas/$Task"; export { $Tasks_CreateOrUpdateTaskRequest } from "./schemas/$Tasks_CreateOrUpdateTaskRequest"; export { $Tasks_CreateTaskRequest } from "./schemas/$Tasks_CreateTaskRequest"; export { $Tasks_ErrorWorkflowStep } from "./schemas/$Tasks_ErrorWorkflowStep"; @@ -162,6 +203,7 @@ export { $Tasks_ToolCallStep } from "./schemas/$Tasks_ToolCallStep"; export { $Tasks_UpdateTaskRequest } from "./schemas/$Tasks_UpdateTaskRequest"; export { $Tasks_WorkflowStep } from "./schemas/$Tasks_WorkflowStep"; export { $Tasks_YieldStep } from "./schemas/$Tasks_YieldStep"; +export { $Tool } from "./schemas/$Tool"; export { $Tools_ChosenFunctionCall } from "./schemas/$Tools_ChosenFunctionCall"; export { $Tools_ChosenToolCall } from "./schemas/$Tools_ChosenToolCall"; export { $Tools_CreateToolRequest } from "./schemas/$Tools_CreateToolRequest"; @@ -174,6 +216,8 @@ export { $Tools_Tool } from "./schemas/$Tools_Tool"; export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse"; export { $Tools_ToolType } from "./schemas/$Tools_ToolType"; export { $Tools_UpdateToolRequest } from "./schemas/$Tools_UpdateToolRequest"; +export { $Transition } from "./schemas/$Transition"; +export { $User } from "./schemas/$User"; export { $Users_CreateOrUpdateUserRequest } from "./schemas/$Users_CreateOrUpdateUserRequest"; export { $Users_CreateUserRequest } from "./schemas/$Users_CreateUserRequest"; export { $Users_PatchUserRequest } from "./schemas/$Users_PatchUserRequest"; diff --git a/sdks/ts/src/api/models/Agent.ts b/sdks/ts/src/api/models/Agent.ts new file mode 100644 index 000000000..c7a40c604 --- /dev/null +++ b/sdks/ts/src/api/models/Agent.ts @@ -0,0 +1,44 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Agent = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Common_PaginationOptions_direction.ts b/sdks/ts/src/api/models/Common_PaginationOptions_direction.ts new file mode 100644 index 000000000..f0001cf62 --- /dev/null +++ b/sdks/ts/src/api/models/Common_PaginationOptions_direction.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Sort direction + */ +export type Common_PaginationOptions_direction = "asc" | "desc"; diff --git a/sdks/ts/src/api/models/Common_PaginationOptions_limit.ts b/sdks/ts/src/api/models/Common_PaginationOptions_limit.ts new file mode 100644 index 000000000..27f111e65 --- /dev/null +++ b/sdks/ts/src/api/models/Common_PaginationOptions_limit.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_limit } from "./Common_limit"; +/** + * Limit the number of items returned + */ +export type Common_PaginationOptions_limit = Common_limit; diff --git a/sdks/ts/src/api/models/Common_PaginationOptions_metadata_filter.ts b/sdks/ts/src/api/models/Common_PaginationOptions_metadata_filter.ts new file mode 100644 index 000000000..2834eae15 --- /dev/null +++ b/sdks/ts/src/api/models/Common_PaginationOptions_metadata_filter.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * JSON string of object that should be used to filter objects by metadata + */ +export type Common_PaginationOptions_metadata_filter = string; diff --git a/sdks/ts/src/api/models/Common_PaginationOptions_offset.ts b/sdks/ts/src/api/models/Common_PaginationOptions_offset.ts new file mode 100644 index 000000000..4a28898b3 --- /dev/null +++ b/sdks/ts/src/api/models/Common_PaginationOptions_offset.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_offset } from "./Common_offset"; +/** + * Offset the items returned + */ +export type Common_PaginationOptions_offset = Common_offset; diff --git a/sdks/ts/src/api/models/Common_PaginationOptions_sort_by.ts b/sdks/ts/src/api/models/Common_PaginationOptions_sort_by.ts new file mode 100644 index 000000000..407284e12 --- /dev/null +++ b/sdks/ts/src/api/models/Common_PaginationOptions_sort_by.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Sort by a field + */ +export type Common_PaginationOptions_sort_by = + | "created_at" + | "updated_at" + | "deleted_at"; diff --git a/sdks/ts/src/api/models/Common_PyExpression.ts b/sdks/ts/src/api/models/Common_PyExpression.ts new file mode 100644 index 000000000..e578d1fdd --- /dev/null +++ b/sdks/ts/src/api/models/Common_PyExpression.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * A simple python expression compatible with SimpleEval. + */ +export type Common_PyExpression = string; diff --git a/sdks/ts/src/api/models/Common_ResourceCreatedResponse.ts b/sdks/ts/src/api/models/Common_ResourceCreatedResponse.ts new file mode 100644 index 000000000..1962bdcca --- /dev/null +++ b/sdks/ts/src/api/models/Common_ResourceCreatedResponse.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Common_ResourceCreatedResponse = { + /** + * ID of created resource + */ + id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; +}; diff --git a/sdks/ts/src/api/models/Common_ResourceDeletedResponse.ts b/sdks/ts/src/api/models/Common_ResourceDeletedResponse.ts new file mode 100644 index 000000000..f96cfe5bf --- /dev/null +++ b/sdks/ts/src/api/models/Common_ResourceDeletedResponse.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Common_ResourceDeletedResponse = { + /** + * ID of deleted resource + */ + id: Common_uuid; + /** + * When this resource was deleted as UTC date-time + */ + readonly deleted_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; +}; diff --git a/sdks/ts/src/api/models/Common_ResourceUpdatedResponse.ts b/sdks/ts/src/api/models/Common_ResourceUpdatedResponse.ts new file mode 100644 index 000000000..1bcdc8703 --- /dev/null +++ b/sdks/ts/src/api/models/Common_ResourceUpdatedResponse.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Common_ResourceUpdatedResponse = { + /** + * ID of updated resource + */ + id: Common_uuid; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * IDs (if any) of jobs created as part of this request + */ + jobs: Array; +}; diff --git a/sdks/ts/src/api/models/Doc.ts b/sdks/ts/src/api/models/Doc.ts new file mode 100644 index 000000000..24b808762 --- /dev/null +++ b/sdks/ts/src/api/models/Doc.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Doc = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * Title describing what this document contains + */ + title: Common_identifierSafeUnicode; + /** + * Contents of the document + */ + content: string | Array; +}; diff --git a/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts b/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts new file mode 100644 index 000000000..37b3cfe85 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Docs_EmbedQueryRequest = { + /** + * Text or texts to embed + */ + text: string | Array; +}; diff --git a/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts b/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts new file mode 100644 index 000000000..042d22084 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Docs_EmbedQueryResponse = { + /** + * The embedded vectors + */ + vectors: Array>; +}; diff --git a/sdks/ts/src/api/models/Entry.ts b/sdks/ts/src/api/models/Entry.ts new file mode 100644 index 000000000..0ef8000dd --- /dev/null +++ b/sdks/ts/src/api/models/Entry.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Entries_ChatMLRole } from "./Entries_ChatMLRole"; +import type { Tools_ChosenToolCall } from "./Tools_ChosenToolCall"; +import type { Tools_Tool } from "./Tools_Tool"; +import type { Tools_ToolResponse } from "./Tools_ToolResponse"; +export type Entry = { + role: Entries_ChatMLRole; + name: string | null; + content: Tools_Tool | Tools_ChosenToolCall | string | Tools_ToolResponse; + source: + | "api_request" + | "api_response" + | "tool_response" + | "internal" + | "summarizer" + | "meta"; + /** + * This is the time that this event refers to. + */ + timestamp: number; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Execution.ts b/sdks/ts/src/api/models/Execution.ts new file mode 100644 index 000000000..574f1d792 --- /dev/null +++ b/sdks/ts/src/api/models/Execution.ts @@ -0,0 +1,36 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Execution = { + /** + * The ID of the task that the execution is running + */ + readonly task_id: Common_uuid; + /** + * The status of the execution + */ + readonly status: + | "queued" + | "starting" + | "running" + | "awaiting_input" + | "succeeded" + | "failed" + | "cancelled"; + /** + * The input to the execution + */ + input: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + metadata?: Record; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts b/sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts index 8fa82be64..5a0b33f61 100644 --- a/sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts +++ b/sdks/ts/src/api/models/Executions_CreateExecutionRequest.ts @@ -10,4 +10,5 @@ export type Executions_CreateExecutionRequest = { * The input to the execution */ input: Record; + metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Executions_Execution.ts b/sdks/ts/src/api/models/Executions_Execution.ts index 8c972be99..1e3891c5d 100644 --- a/sdks/ts/src/api/models/Executions_Execution.ts +++ b/sdks/ts/src/api/models/Executions_Execution.ts @@ -31,5 +31,6 @@ export type Executions_Execution = { * When this resource was updated as UTC date-time */ readonly updated_at: string; + metadata?: Record; readonly id: Common_uuid; }; diff --git a/sdks/ts/src/api/models/History.ts b/sdks/ts/src/api/models/History.ts new file mode 100644 index 000000000..22b30c83f --- /dev/null +++ b/sdks/ts/src/api/models/History.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Entries_Entry } from "./Entries_Entry"; +import type { Entries_Relation } from "./Entries_Relation"; +export type History = { + entries: Array; + relations: Array; + readonly session_id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; +}; diff --git a/sdks/ts/src/api/models/JobStatus.ts b/sdks/ts/src/api/models/JobStatus.ts new file mode 100644 index 000000000..1ee910dc3 --- /dev/null +++ b/sdks/ts/src/api/models/JobStatus.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +import type { Jobs_JobState } from "./Jobs_JobState"; +export type JobStatus = { + readonly id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the job + */ + name: Common_identifierSafeUnicode; + /** + * Reason for the current state of the job + */ + reason: string; + /** + * Whether this Job supports progress updates + */ + has_progress: boolean; + /** + * Progress percentage + */ + progress: number; + /** + * Current state of the job + */ + state: Jobs_JobState; +}; diff --git a/sdks/ts/src/api/models/Session.ts b/sdks/ts/src/api/models/Session.ts new file mode 100644 index 000000000..296b931ca --- /dev/null +++ b/sdks/ts/src/api/models/Session.ts @@ -0,0 +1,52 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; +export type Session = { + /** + * User ID of user associated with this session + */ + user?: Common_uuid; + users?: Array; + /** + * Agent ID of agent associated with this session + */ + agent?: Common_uuid; + agents?: Array; + /** + * A specific situation that sets the background for this session + */ + situation: string; + /** + * Summary (null at the beginning) - generated automatically after every interaction + */ + readonly summary: string | null; + /** + * Render system and assistant message content as jinja templates + */ + render_templates: boolean; + /** + * Threshold value for the adaptive context functionality + */ + token_budget: number | null; + /** + * Action to start on context window overflow + */ + context_overflow: Sessions_ContextOverflowType | null; + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Discriminator property for Session. + */ + kind?: string; +}; diff --git a/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts b/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts new file mode 100644 index 000000000..87de87a34 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts @@ -0,0 +1,5 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Sessions_ContextOverflowType = "truncate" | "adaptive"; diff --git a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts index 786fd4620..c5358076f 100644 --- a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts +++ b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts @@ -3,6 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; export type Sessions_CreateOrUpdateSessionRequest = { id: Common_uuid; /** @@ -30,6 +31,6 @@ export type Sessions_CreateOrUpdateSessionRequest = { /** * Action to start on context window overflow */ - context_overflow: string | null; + context_overflow: Sessions_ContextOverflowType | null; metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts index a92ee261c..b2b09c9d3 100644 --- a/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts +++ b/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts @@ -3,6 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; /** * Payload for creating a session */ @@ -32,6 +33,6 @@ export type Sessions_CreateSessionRequest = { /** * Action to start on context window overflow */ - context_overflow: string | null; + context_overflow: Sessions_ContextOverflowType | null; metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts b/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts index 3361c11bd..589c01379 100644 --- a/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts +++ b/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; /** * Payload for patching a session */ @@ -21,6 +22,6 @@ export type Sessions_PatchSessionRequest = { /** * Action to start on context window overflow */ - context_overflow?: string | null; + context_overflow?: Sessions_ContextOverflowType | null; metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Sessions_Session.ts b/sdks/ts/src/api/models/Sessions_Session.ts index 27f997bd3..d8e89604b 100644 --- a/sdks/ts/src/api/models/Sessions_Session.ts +++ b/sdks/ts/src/api/models/Sessions_Session.ts @@ -3,6 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; export type Sessions_Session = { /** * A specific situation that sets the background for this session @@ -23,7 +24,7 @@ export type Sessions_Session = { /** * Action to start on context window overflow */ - context_overflow: string | null; + context_overflow: Sessions_ContextOverflowType | null; readonly id: Common_uuid; metadata?: Record; /** diff --git a/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts index 5a55a5d27..cd28f9783 100644 --- a/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts +++ b/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; /** * Payload for updating a session */ @@ -21,6 +22,6 @@ export type Sessions_UpdateSessionRequest = { /** * Action to start on context window overflow */ - context_overflow: string | null; + context_overflow: Sessions_ContextOverflowType | null; metadata?: Record; }; diff --git a/sdks/ts/src/api/models/Task.ts b/sdks/ts/src/api/models/Task.ts new file mode 100644 index 000000000..bbfd3b429 --- /dev/null +++ b/sdks/ts/src/api/models/Task.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +/** + * Object describing a Task + */ +export type Task = Record>; diff --git a/sdks/ts/src/api/models/Tasks_CEL.ts b/sdks/ts/src/api/models/Tasks_CEL.ts deleted file mode 100644 index 5780c1adb..000000000 --- a/sdks/ts/src/api/models/Tasks_CEL.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * An object where values are strings in the Common Expression Language that get evaluated before being passed downstream - */ -export type Tasks_CEL = string; diff --git a/sdks/ts/src/api/models/Tasks_EvaluateStep.ts b/sdks/ts/src/api/models/Tasks_EvaluateStep.ts index 82fda88c5..0a5331af1 100644 --- a/sdks/ts/src/api/models/Tasks_EvaluateStep.ts +++ b/sdks/ts/src/api/models/Tasks_EvaluateStep.ts @@ -2,11 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_CEL } from "./Tasks_CEL"; +import type { Common_PyExpression } from "./Common_PyExpression"; import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; export type Tasks_EvaluateStep = Tasks_WorkflowStep & { /** * The expression to evaluate */ - evaluate: Record; + evaluate: Record; }; diff --git a/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts index 654200e98..cd83e1760 100644 --- a/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts +++ b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts @@ -2,13 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_CEL } from "./Tasks_CEL"; +import type { Common_PyExpression } from "./Common_PyExpression"; import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; export type Tasks_IfElseWorkflowStep = Tasks_WorkflowStep & { /** * The condition to evaluate */ - if: Tasks_CEL; + if: Common_PyExpression; /** * The steps to run if the condition is true */ diff --git a/sdks/ts/src/api/models/Tasks_PromptStep.ts b/sdks/ts/src/api/models/Tasks_PromptStep.ts index f3fdc6dc3..8256dad50 100644 --- a/sdks/ts/src/api/models/Tasks_PromptStep.ts +++ b/sdks/ts/src/api/models/Tasks_PromptStep.ts @@ -6,6 +6,7 @@ import type { Chat_CompletionResponseFormat } from "./Chat_CompletionResponseFor import type { Chat_GenerationPreset } from "./Chat_GenerationPreset"; import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; import type { Common_logit_bias } from "./Common_logit_bias"; +import type { Common_uuid } from "./Common_uuid"; import type { Entries_InputChatMLMessage } from "./Entries_InputChatMLMessage"; import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; export type Tasks_PromptStep = Tasks_WorkflowStep & { @@ -46,6 +47,10 @@ export type Tasks_PromptStep = Tasks_WorkflowStep & { * Response format (set to `json_object` to restrict output to JSON) */ response_format?: Chat_CompletionResponseFormat; + /** + * Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + */ + agent?: Common_uuid; /** * Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) */ @@ -80,6 +85,10 @@ export type Tasks_PromptStep = Tasks_WorkflowStep & { * Response format (set to `json_object` to restrict output to JSON) */ response_format?: Chat_CompletionResponseFormat; + /** + * Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + */ + agent?: Common_uuid; /** * 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. */ @@ -126,6 +135,10 @@ export type Tasks_PromptStep = Tasks_WorkflowStep & { * Response format (set to `json_object` to restrict output to JSON) */ response_format?: Chat_CompletionResponseFormat; + /** + * Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + */ + agent?: Common_uuid; /** * 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. */ diff --git a/sdks/ts/src/api/models/Tasks_YieldStep.ts b/sdks/ts/src/api/models/Tasks_YieldStep.ts index 20cbc649a..56670a2ef 100644 --- a/sdks/ts/src/api/models/Tasks_YieldStep.ts +++ b/sdks/ts/src/api/models/Tasks_YieldStep.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_CEL } from "./Tasks_CEL"; +import type { Common_PyExpression } from "./Common_PyExpression"; import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; export type Tasks_YieldStep = Tasks_WorkflowStep & { /** @@ -12,5 +12,5 @@ export type Tasks_YieldStep = Tasks_WorkflowStep & { /** * The input parameters for the subworkflow */ - arguments: Record; + arguments: Record; }; diff --git a/sdks/ts/src/api/models/Tool.ts b/sdks/ts/src/api/models/Tool.ts new file mode 100644 index 000000000..0994d643e --- /dev/null +++ b/sdks/ts/src/api/models/Tool.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Tools_FunctionDef } from "./Tools_FunctionDef"; +import type { Tools_ToolType } from "./Tools_ToolType"; +export type Tool = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type: Tools_ToolType; + /** + * The tool should be run in the background (not supported at the moment) + */ + background: boolean; + function?: Tools_FunctionDef; + integration?: any; + system?: any; + api_call?: any; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Tools_CreateToolRequest.ts b/sdks/ts/src/api/models/Tools_CreateToolRequest.ts index 37f621348..27cd8ff42 100644 --- a/sdks/ts/src/api/models/Tools_CreateToolRequest.ts +++ b/sdks/ts/src/api/models/Tools_CreateToolRequest.ts @@ -16,10 +16,6 @@ export type Tools_CreateToolRequest = { * The tool should be run in the background (not supported at the moment) */ background: boolean; - /** - * Whether the tool that can be run interactively (response should contain "stop" boolean field) - */ - interactive: boolean; function?: Tools_FunctionDef; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Tools_FunctionTool.ts b/sdks/ts/src/api/models/Tools_FunctionTool.ts index 00f1b1978..37e2e713f 100644 --- a/sdks/ts/src/api/models/Tools_FunctionTool.ts +++ b/sdks/ts/src/api/models/Tools_FunctionTool.ts @@ -8,7 +8,6 @@ export type Tools_FunctionTool = Tools_Tool & { function: Tools_FunctionDef; type: "function"; background: boolean; - interactive: boolean; /** * The function to call */ diff --git a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts index 336f24563..f4a4d3ec0 100644 --- a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts +++ b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts @@ -16,10 +16,6 @@ export type Tools_PatchToolRequest = { * The tool should be run in the background (not supported at the moment) */ background?: boolean; - /** - * Whether the tool that can be run interactively (response should contain "stop" boolean field) - */ - interactive?: boolean; function?: Tools_FunctionDefUpdate; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Tools_Tool.ts b/sdks/ts/src/api/models/Tools_Tool.ts index 2f5ee90b7..4c89afffa 100644 --- a/sdks/ts/src/api/models/Tools_Tool.ts +++ b/sdks/ts/src/api/models/Tools_Tool.ts @@ -14,10 +14,6 @@ export type Tools_Tool = { * The tool should be run in the background (not supported at the moment) */ background: boolean; - /** - * Whether the tool that can be run interactively (response should contain "stop" boolean field) - */ - interactive: boolean; function?: Tools_FunctionDef; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts index b7608834d..995f524b5 100644 --- a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts +++ b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts @@ -16,10 +16,6 @@ export type Tools_UpdateToolRequest = { * The tool should be run in the background (not supported at the moment) */ background: boolean; - /** - * Whether the tool that can be run interactively (response should contain "stop" boolean field) - */ - interactive: boolean; function?: Tools_FunctionDef; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Transition.ts b/sdks/ts/src/api/models/Transition.ts new file mode 100644 index 000000000..be0e59662 --- /dev/null +++ b/sdks/ts/src/api/models/Transition.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Transition = { + readonly type: "finish" | "wait" | "error" | "step" | "cancelled"; + readonly execution_id: Common_uuid; + readonly outputs: Record; + readonly current: Array; + readonly next: Array | null; + readonly id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; +}; diff --git a/sdks/ts/src/api/models/User.ts b/sdks/ts/src/api/models/User.ts new file mode 100644 index 000000000..63bfcfdcd --- /dev/null +++ b/sdks/ts/src/api/models/User.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type User = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the user + */ + name: Common_identifierSafeUnicode; + /** + * About the user + */ + about: string; +}; diff --git a/sdks/ts/src/api/schemas/$Agent.ts b/sdks/ts/src/api/schemas/$Agent.ts new file mode 100644 index 000000000..fff31498b --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agent.ts @@ -0,0 +1,89 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agent = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the agent`, + isRequired: true, + }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + isRequired: true, + }, + instructions: { + type: "any-of", + description: `Instructions for the agent`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_PaginationOptions_direction.ts b/sdks/ts/src/api/schemas/$Common_PaginationOptions_direction.ts new file mode 100644 index 000000000..3ed6aa848 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_PaginationOptions_direction.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_PaginationOptions_direction = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_PaginationOptions_limit.ts b/sdks/ts/src/api/schemas/$Common_PaginationOptions_limit.ts new file mode 100644 index 000000000..369f8a657 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_PaginationOptions_limit.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_PaginationOptions_limit = { + type: "Common_limit", + description: `Limit the number of items returned`, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_PaginationOptions_metadata_filter.ts b/sdks/ts/src/api/schemas/$Common_PaginationOptions_metadata_filter.ts new file mode 100644 index 000000000..123192ee2 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_PaginationOptions_metadata_filter.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_PaginationOptions_metadata_filter = { + type: "string", + description: `JSON string of object that should be used to filter objects by metadata`, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_PaginationOptions_offset.ts b/sdks/ts/src/api/schemas/$Common_PaginationOptions_offset.ts new file mode 100644 index 000000000..b8935bba0 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_PaginationOptions_offset.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_PaginationOptions_offset = { + type: "Common_offset", + description: `Offset the items returned`, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_PaginationOptions_sort_by.ts b/sdks/ts/src/api/schemas/$Common_PaginationOptions_sort_by.ts new file mode 100644 index 000000000..1e571b3a6 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_PaginationOptions_sort_by.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_PaginationOptions_sort_by = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_PyExpression.ts b/sdks/ts/src/api/schemas/$Common_PyExpression.ts new file mode 100644 index 000000000..399fb95b0 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_PyExpression.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_PyExpression = { + type: "string", + description: `A simple python expression compatible with SimpleEval.`, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_ResourceCreatedResponse.ts b/sdks/ts/src/api/schemas/$Common_ResourceCreatedResponse.ts new file mode 100644 index 000000000..da5fbfb95 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_ResourceCreatedResponse.ts @@ -0,0 +1,32 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_ResourceCreatedResponse = { + properties: { + id: { + type: "all-of", + description: `ID of created resource`, + contains: [ + { + type: "Common_uuid", + }, + ], + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + jobs: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_ResourceDeletedResponse.ts b/sdks/ts/src/api/schemas/$Common_ResourceDeletedResponse.ts new file mode 100644 index 000000000..4496f8c9d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_ResourceDeletedResponse.ts @@ -0,0 +1,32 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_ResourceDeletedResponse = { + properties: { + id: { + type: "all-of", + description: `ID of deleted resource`, + contains: [ + { + type: "Common_uuid", + }, + ], + isRequired: true, + }, + deleted_at: { + type: "string", + description: `When this resource was deleted as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + jobs: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Common_ResourceUpdatedResponse.ts b/sdks/ts/src/api/schemas/$Common_ResourceUpdatedResponse.ts new file mode 100644 index 000000000..b021b9a7a --- /dev/null +++ b/sdks/ts/src/api/schemas/$Common_ResourceUpdatedResponse.ts @@ -0,0 +1,32 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Common_ResourceUpdatedResponse = { + properties: { + id: { + type: "all-of", + description: `ID of updated resource`, + contains: [ + { + type: "Common_uuid", + }, + ], + isRequired: true, + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + jobs: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Doc.ts b/sdks/ts/src/api/schemas/$Doc.ts new file mode 100644 index 000000000..5d581fc4c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Doc.ts @@ -0,0 +1,57 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Doc = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + title: { + type: "all-of", + description: `Title describing what this document contains`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + content: { + type: "any-of", + description: `Contents of the document`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts b/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts new file mode 100644 index 000000000..1cf18ee0e --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_EmbedQueryRequest = { + properties: { + text: { + type: "any-of", + description: `Text or texts to embed`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts b/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts new file mode 100644 index 000000000..381f37709 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts @@ -0,0 +1,18 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_EmbedQueryResponse = { + properties: { + vectors: { + type: "array", + contains: { + type: "array", + contains: { + type: "number", + }, + }, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Entry.ts b/sdks/ts/src/api/schemas/$Entry.ts new file mode 100644 index 000000000..fb77b0be2 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entry.ts @@ -0,0 +1,62 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entry = { + properties: { + role: { + type: "Entries_ChatMLRole", + isRequired: true, + }, + name: { + type: "string", + isRequired: true, + isNullable: true, + }, + content: { + type: "any-of", + contains: [ + { + type: "Tools_Tool", + }, + { + type: "Tools_ChosenToolCall", + }, + { + type: "string", + }, + { + type: "Tools_ToolResponse", + }, + ], + isRequired: true, + }, + source: { + type: "Enum", + isRequired: true, + }, + timestamp: { + type: "number", + description: `This is the time that this event refers to.`, + isRequired: true, + format: "int32", + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Execution.ts b/sdks/ts/src/api/schemas/$Execution.ts new file mode 100644 index 000000000..54c59821f --- /dev/null +++ b/sdks/ts/src/api/schemas/$Execution.ts @@ -0,0 +1,61 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Execution = { + properties: { + task_id: { + type: "all-of", + description: `The ID of the task that the execution is running`, + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + status: { + type: "Enum", + isReadOnly: true, + isRequired: true, + }, + input: { + type: "dictionary", + contains: { + properties: {}, + }, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Executions_CreateExecutionRequest.ts b/sdks/ts/src/api/schemas/$Executions_CreateExecutionRequest.ts index c04b13124..0a3c4919f 100644 --- a/sdks/ts/src/api/schemas/$Executions_CreateExecutionRequest.ts +++ b/sdks/ts/src/api/schemas/$Executions_CreateExecutionRequest.ts @@ -12,5 +12,11 @@ export const $Executions_CreateExecutionRequest = { }, isRequired: true, }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Executions_Execution.ts b/sdks/ts/src/api/schemas/$Executions_Execution.ts index 38dabb425..6f92d9dce 100644 --- a/sdks/ts/src/api/schemas/$Executions_Execution.ts +++ b/sdks/ts/src/api/schemas/$Executions_Execution.ts @@ -41,6 +41,12 @@ export const $Executions_Execution = { isRequired: true, format: "date-time", }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, id: { type: "all-of", contains: [ diff --git a/sdks/ts/src/api/schemas/$History.ts b/sdks/ts/src/api/schemas/$History.ts new file mode 100644 index 000000000..0bcf1e13b --- /dev/null +++ b/sdks/ts/src/api/schemas/$History.ts @@ -0,0 +1,39 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $History = { + properties: { + entries: { + type: "array", + contains: { + type: "Entries_Entry", + }, + isRequired: true, + }, + relations: { + type: "array", + contains: { + type: "Entries_Relation", + }, + isRequired: true, + }, + session_id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$JobStatus.ts b/sdks/ts/src/api/schemas/$JobStatus.ts new file mode 100644 index 000000000..e06a793a7 --- /dev/null +++ b/sdks/ts/src/api/schemas/$JobStatus.ts @@ -0,0 +1,69 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $JobStatus = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the job`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + reason: { + type: "string", + description: `Reason for the current state of the job`, + isRequired: true, + }, + has_progress: { + type: "boolean", + description: `Whether this Job supports progress updates`, + isRequired: true, + }, + progress: { + type: "number", + description: `Progress percentage`, + isRequired: true, + format: "float", + maximum: 100, + }, + state: { + type: "all-of", + description: `Current state of the job`, + contains: [ + { + type: "Jobs_JobState", + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Session.ts b/sdks/ts/src/api/schemas/$Session.ts new file mode 100644 index 000000000..d4ff80a8b --- /dev/null +++ b/sdks/ts/src/api/schemas/$Session.ts @@ -0,0 +1,107 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Session = { + properties: { + user: { + type: "all-of", + description: `User ID of user associated with this session`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + }, + agent: { + type: "all-of", + description: `Agent ID of agent associated with this session`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + }, + situation: { + type: "string", + description: `A specific situation that sets the background for this session`, + isRequired: true, + }, + summary: { + type: "string", + description: `Summary (null at the beginning) - generated automatically after every interaction`, + isReadOnly: true, + isRequired: true, + isNullable: true, + }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, + isRequired: true, + }, + token_budget: { + type: "number", + description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", + }, + context_overflow: { + type: "one-of", + description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], + isRequired: true, + isNullable: true, + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + kind: { + type: "string", + description: `Discriminator property for Session.`, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts b/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts new file mode 100644 index 000000000..1a4cd0f7d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_ContextOverflowType = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts index c9749d218..091dfe6bf 100644 --- a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts +++ b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts @@ -56,8 +56,13 @@ export const $Sessions_CreateOrUpdateSessionRequest = { format: "uint16", }, context_overflow: { - type: "string", + type: "one-of", description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], isRequired: true, isNullable: true, }, diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts index 7fcec21fb..3f21c4996 100644 --- a/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts +++ b/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts @@ -53,8 +53,13 @@ export const $Sessions_CreateSessionRequest = { format: "uint16", }, context_overflow: { - type: "string", + type: "one-of", description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], isRequired: true, isNullable: true, }, diff --git a/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts index 1cd43cf8e..ec0f8ebed 100644 --- a/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts +++ b/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts @@ -20,8 +20,13 @@ export const $Sessions_PatchSessionRequest = { format: "uint16", }, context_overflow: { - type: "string", + type: "one-of", description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], isNullable: true, }, metadata: { diff --git a/sdks/ts/src/api/schemas/$Sessions_Session.ts b/sdks/ts/src/api/schemas/$Sessions_Session.ts index 8357ed5d3..27b368494 100644 --- a/sdks/ts/src/api/schemas/$Sessions_Session.ts +++ b/sdks/ts/src/api/schemas/$Sessions_Session.ts @@ -29,8 +29,13 @@ export const $Sessions_Session = { format: "uint16", }, context_overflow: { - type: "string", + type: "one-of", description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], isRequired: true, isNullable: true, }, diff --git a/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts index fa7f1fe8e..ceada4666 100644 --- a/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts +++ b/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts @@ -23,8 +23,13 @@ export const $Sessions_UpdateSessionRequest = { format: "uint16", }, context_overflow: { - type: "string", + type: "one-of", description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], isRequired: true, isNullable: true, }, diff --git a/sdks/ts/src/api/schemas/$Task.ts b/sdks/ts/src/api/schemas/$Task.ts new file mode 100644 index 000000000..b8bbebc06 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Task.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Task = { + type: "dictionary", + contains: { + type: "array", + contains: { + type: "Tasks_WorkflowStep", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CEL.ts b/sdks/ts/src/api/schemas/$Tasks_CEL.ts deleted file mode 100644 index 3995b701c..000000000 --- a/sdks/ts/src/api/schemas/$Tasks_CEL.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tasks_CEL = { - type: "string", - description: `An object where values are strings in the Common Expression Language that get evaluated before being passed downstream`, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts b/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts index abd8d11ad..90a3e6fe7 100644 --- a/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts @@ -13,7 +13,7 @@ export const $Tasks_EvaluateStep = { evaluate: { type: "dictionary", contains: { - type: "Tasks_CEL", + type: "Common_PyExpression", }, isRequired: true, }, diff --git a/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts index ee1ded4d2..4b3775cf7 100644 --- a/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts @@ -15,7 +15,7 @@ export const $Tasks_IfElseWorkflowStep = { description: `The condition to evaluate`, contains: [ { - type: "Tasks_CEL", + type: "Common_PyExpression", }, ], isRequired: true, diff --git a/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts b/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts index 16f36326a..9defb553e 100644 --- a/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts @@ -80,6 +80,15 @@ export const $Tasks_PromptStep = { }, ], }, + agent: { + type: "all-of", + description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, preset: { type: "all-of", description: `Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)`, @@ -141,6 +150,15 @@ export const $Tasks_PromptStep = { }, ], }, + agent: { + type: "all-of", + description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, frequency_penalty: { type: "number", description: `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.`, @@ -219,6 +237,15 @@ export const $Tasks_PromptStep = { }, ], }, + agent: { + type: "all-of", + description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, repetition_penalty: { type: "number", description: `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.`, diff --git a/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts b/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts index 7c9bd85e0..43bdbba58 100644 --- a/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts @@ -18,7 +18,7 @@ export const $Tasks_YieldStep = { arguments: { type: "dictionary", contains: { - type: "Tasks_CEL", + type: "Common_PyExpression", }, isRequired: true, }, diff --git a/sdks/ts/src/api/schemas/$Tool.ts b/sdks/ts/src/api/schemas/$Tool.ts new file mode 100644 index 000000000..3c9c62e9a --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tool.ts @@ -0,0 +1,59 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tool = { + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + isRequired: true, + }, + background: { + type: "boolean", + description: `The tool should be run in the background (not supported at the moment)`, + isRequired: true, + }, + function: { + type: "Tools_FunctionDef", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts index 5d23a1dbd..a0bcf9ae5 100644 --- a/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts +++ b/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts @@ -20,11 +20,6 @@ export const $Tools_CreateToolRequest = { description: `The tool should be run in the background (not supported at the moment)`, isRequired: true, }, - interactive: { - type: "boolean", - description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, - isRequired: true, - }, function: { type: "Tools_FunctionDef", }, diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionTool.ts b/sdks/ts/src/api/schemas/$Tools_FunctionTool.ts index 2e2fbfd24..382bc923b 100644 --- a/sdks/ts/src/api/schemas/$Tools_FunctionTool.ts +++ b/sdks/ts/src/api/schemas/$Tools_FunctionTool.ts @@ -22,10 +22,6 @@ export const $Tools_FunctionTool = { type: "boolean", isRequired: true, }, - interactive: { - type: "boolean", - isRequired: true, - }, function: { type: "all-of", description: `The function to call`, diff --git a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts index befda0e74..de9d4b773 100644 --- a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts +++ b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts @@ -18,10 +18,6 @@ export const $Tools_PatchToolRequest = { type: "boolean", description: `The tool should be run in the background (not supported at the moment)`, }, - interactive: { - type: "boolean", - description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, - }, function: { type: "Tools_FunctionDefUpdate", }, diff --git a/sdks/ts/src/api/schemas/$Tools_Tool.ts b/sdks/ts/src/api/schemas/$Tools_Tool.ts index 83f98195f..c008d4cbd 100644 --- a/sdks/ts/src/api/schemas/$Tools_Tool.ts +++ b/sdks/ts/src/api/schemas/$Tools_Tool.ts @@ -19,11 +19,6 @@ export const $Tools_Tool = { description: `The tool should be run in the background (not supported at the moment)`, isRequired: true, }, - interactive: { - type: "boolean", - description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, - isRequired: true, - }, function: { type: "Tools_FunctionDef", }, diff --git a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts index 6764f9c5a..97fbb6ac3 100644 --- a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts +++ b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts @@ -20,11 +20,6 @@ export const $Tools_UpdateToolRequest = { description: `The tool should be run in the background (not supported at the moment)`, isRequired: true, }, - interactive: { - type: "boolean", - description: `Whether the tool that can be run interactively (response should contain "stop" boolean field)`, - isRequired: true, - }, function: { type: "Tools_FunctionDef", }, diff --git a/sdks/ts/src/api/schemas/$Transition.ts b/sdks/ts/src/api/schemas/$Transition.ts new file mode 100644 index 000000000..65949ff66 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Transition.ts @@ -0,0 +1,72 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Transition = { + properties: { + type: { + type: "Enum", + isReadOnly: true, + isRequired: true, + }, + execution_id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + outputs: { + type: "dictionary", + contains: { + properties: {}, + }, + isReadOnly: true, + isRequired: true, + }, + current: { + type: "array", + contains: { + properties: {}, + }, + isReadOnly: true, + isRequired: true, + }, + next: { + type: "array", + contains: { + properties: {}, + }, + isReadOnly: true, + isRequired: true, + isNullable: true, + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$User.ts b/sdks/ts/src/api/schemas/$User.ts new file mode 100644 index 000000000..df3838203 --- /dev/null +++ b/sdks/ts/src/api/schemas/$User.ts @@ -0,0 +1,53 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $User = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the user`, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index 667092cac..6c558b1f7 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -9,10 +9,15 @@ import type { Agents_PatchAgentRequest } from "../models/Agents_PatchAgentReques import type { Agents_UpdateAgentRequest } from "../models/Agents_UpdateAgentRequest"; import type { Common_limit } from "../models/Common_limit"; import type { Common_offset } from "../models/Common_offset"; +import type { Common_ResourceCreatedResponse } from "../models/Common_ResourceCreatedResponse"; +import type { Common_ResourceDeletedResponse } from "../models/Common_ResourceDeletedResponse"; +import type { Common_ResourceUpdatedResponse } from "../models/Common_ResourceUpdatedResponse"; import type { Common_uuid } from "../models/Common_uuid"; import type { Docs_Doc } from "../models/Docs_Doc"; import type { Docs_DocReference } from "../models/Docs_DocReference"; import type { Docs_DocSearchRequest } from "../models/Docs_DocSearchRequest"; +import type { Docs_EmbedQueryRequest } from "../models/Docs_EmbedQueryRequest"; +import type { Docs_EmbedQueryResponse } from "../models/Docs_EmbedQueryResponse"; import type { Entries_History } from "../models/Entries_History"; import type { Executions_CreateExecutionRequest } from "../models/Executions_CreateExecutionRequest"; import type { Executions_Execution } from "../models/Executions_Execution"; @@ -43,7 +48,7 @@ import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class DefaultService { constructor(public readonly httpRequest: BaseHttpRequest) {} /** - * List undefined items + * List Agents (paginated) * @returns any The request has succeeded. * @throws ApiError */ @@ -55,11 +60,11 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -90,28 +95,15 @@ export class DefaultService { }); } /** - * Create new undefined - * @returns any The request has succeeded and a new resource has been created as a result. + * Create a new Agent + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. * @throws ApiError */ public agentsRouteCreate({ requestBody, }: { requestBody: Agents_CreateAgentRequest; - }): CancelablePromise<{ - /** - * ID of created undefined - */ - id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/agents", @@ -120,28 +112,15 @@ export class DefaultService { }); } /** - * Create or update undefined (ID is required in payload; existing resource will be overwritten) - * @returns any The request has succeeded. + * Create or update an Agent + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public agentsRouteCreateOrUpdate({ requestBody, }: { requestBody: Agents_CreateOrUpdateAgentRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/agents", @@ -150,8 +129,8 @@ export class DefaultService { }); } /** - * Update undefined by id (overwrite) - * @returns any The request has succeeded. + * Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public agentsRouteUpdate({ @@ -159,24 +138,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Agents_UpdateAgentRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/agents/{id}", @@ -188,8 +154,8 @@ export class DefaultService { }); } /** - * Patch undefined by id (merge changes) - * @returns any The request has succeeded. + * Update an existing Agent by id (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public agentsRoutePatch({ @@ -197,24 +163,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Agents_PatchAgentRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PATCH", url: "/agents/{id}", @@ -226,31 +179,18 @@ export class DefaultService { }); } /** - * Delete undefined by id - * @returns any The request has been accepted for processing, but processing has not yet completed. + * Delete Agent by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ public agentsRouteDelete({ id, }: { /** - * ID of the undefined - */ - id: Common_uuid; - }): CancelablePromise<{ - /** - * ID of deleted undefined + * ID of the resource */ id: Common_uuid; - /** - * When this resource was deleted as UTC date-time - */ - readonly deleted_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "DELETE", url: "/agents/{id}", @@ -260,7 +200,7 @@ export class DefaultService { }); } /** - * Get undefined by id + * Get an Agent by id * @returns Agents_Agent The request has succeeded. * @throws ApiError */ @@ -268,7 +208,7 @@ export class DefaultService { id, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; }): CancelablePromise { @@ -281,7 +221,7 @@ export class DefaultService { }); } /** - * List undefined items of parent undefined + * List Docs owned by an Agent * @returns any The request has succeeded. * @throws ApiError */ @@ -294,15 +234,15 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * ID of parent undefined + * ID of parent */ id: Common_uuid; /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -336,7 +276,7 @@ export class DefaultService { }); } /** - * Search for documents owned by undefined + * Search Docs owned by an Agent * @returns any The request has succeeded. * @throws ApiError */ @@ -350,18 +290,18 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * ID of the undefined + * ID of the parent */ id: Common_uuid; requestBody: { body: Docs_DocSearchRequest; }; /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -397,7 +337,7 @@ export class DefaultService { }); } /** - * List undefined items of parent undefined + * List tools of the given agent * @returns any The request has succeeded. * @throws ApiError */ @@ -410,15 +350,15 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * ID of parent undefined + * ID of parent */ id: Common_uuid; /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -452,8 +392,8 @@ export class DefaultService { }); } /** - * Create new undefined - * @returns any The request has succeeded and a new resource has been created as a result. + * Create a new tool for this agent + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. * @throws ApiError */ public agentToolsRouteCreate({ @@ -461,24 +401,11 @@ export class DefaultService { requestBody, }: { /** - * ID of parent undefined + * ID of parent resource */ id: Common_uuid; requestBody: Agents_CreateAgentRequest; - }): CancelablePromise<{ - /** - * ID of created undefined - */ - id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/agents/{id}/tools", @@ -490,7 +417,7 @@ export class DefaultService { }); } /** - * Get undefined by id + * Get Doc by id * @returns Docs_Doc The request has succeeded. * @throws ApiError */ @@ -498,7 +425,7 @@ export class DefaultService { id, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; }): CancelablePromise { @@ -511,31 +438,18 @@ export class DefaultService { }); } /** - * Delete undefined by id - * @returns any The request has been accepted for processing, but processing has not yet completed. + * Delete an existing Doc by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ public individualDocsRouteDelete({ id, }: { /** - * ID of the undefined - */ - id: Common_uuid; - }): CancelablePromise<{ - /** - * ID of deleted undefined + * ID of the resource */ id: Common_uuid; - /** - * When this resource was deleted as UTC date-time - */ - readonly deleted_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "DELETE", url: "/docs/{id}", @@ -545,8 +459,27 @@ export class DefaultService { }); } /** - * Update undefined by id (overwrite) - * @returns any The request has succeeded. + * Embed a query for search + * @returns Docs_EmbedQueryResponse The request has succeeded. + * @throws ApiError + */ + public embedRouteEmbed({ + requestBody, + }: { + requestBody: { + body: Docs_EmbedQueryRequest; + }; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/embed", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing Execution + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public executionsRouteUpdate({ @@ -554,24 +487,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Executions_UpdateExecutionRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/executions/{id}", @@ -583,7 +503,7 @@ export class DefaultService { }); } /** - * Get undefined by id + * Get an Execution by id * @returns Executions_Execution The request has succeeded. * @throws ApiError */ @@ -591,7 +511,7 @@ export class DefaultService { id, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; }): CancelablePromise { @@ -604,7 +524,7 @@ export class DefaultService { }); } /** - * List undefined items of parent undefined + * List the Transitions of an Execution by id * @returns any The request has succeeded. * @throws ApiError */ @@ -617,15 +537,15 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * ID of parent undefined + * ID of parent */ id: Common_uuid; /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -661,7 +581,7 @@ export class DefaultService { }); } /** - * Get undefined by id + * Get the status of an existing Job by its id * @returns Jobs_JobStatus The request has succeeded. * @throws ApiError */ @@ -669,7 +589,7 @@ export class DefaultService { id, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; }): CancelablePromise { @@ -682,7 +602,7 @@ export class DefaultService { }); } /** - * List undefined items + * List sessions (paginated) * @returns any The request has succeeded. * @throws ApiError */ @@ -694,11 +614,11 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -729,28 +649,15 @@ export class DefaultService { }); } /** - * Create new undefined - * @returns any The request has succeeded and a new resource has been created as a result. + * Create a new session + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. * @throws ApiError */ public sessionsRouteCreate({ requestBody, }: { requestBody: Sessions_CreateSessionRequest; - }): CancelablePromise<{ - /** - * ID of created undefined - */ - id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/sessions", @@ -759,28 +666,15 @@ export class DefaultService { }); } /** - * Create or update undefined (ID is required in payload; existing resource will be overwritten) - * @returns any The request has succeeded. + * Create or update a session + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public sessionsRouteCreateOrUpdate({ requestBody, }: { requestBody: Sessions_CreateOrUpdateSessionRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/sessions", @@ -789,227 +683,175 @@ export class DefaultService { }); } /** - * List undefined items of parent undefined - * @returns any The request has succeeded. + * Update an existing session by its id (overwrites all existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ - public historyRouteList({ + public sessionsRouteUpdate({ id, - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", + requestBody, }: { /** - * ID of parent undefined + * ID of the resource */ id: Common_uuid; - /** - * Limit the number of undefined items returned - */ - limit?: Common_limit; - /** - * Offset the undefined items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { + requestBody: Sessions_UpdateSessionRequest; + }): CancelablePromise { return this.httpRequest.request({ - method: "GET", - url: "/sessions/history/{id}", + method: "PUT", + url: "/sessions/{id}", path: { id: id, }, - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, + body: requestBody, + mediaType: "application/json", }); } /** - * Delete undefined by id - * @returns any The request has been accepted for processing, but processing has not yet completed. + * Update an existing session by its id (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ - public historyRouteDelete({ + public sessionsRoutePatch({ id, + requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; - }): CancelablePromise<{ - /** - * ID of deleted undefined - */ - id: Common_uuid; - /** - * When this resource was deleted as UTC date-time - */ - readonly deleted_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + requestBody: Sessions_PatchSessionRequest; + }): CancelablePromise { return this.httpRequest.request({ - method: "DELETE", - url: "/sessions/history/{id}", + method: "PATCH", + url: "/sessions/{id}", path: { id: id, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Update undefined by id (overwrite) - * @returns any The request has succeeded. + * Delete a session by its id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public sessionsRouteUpdate({ + public sessionsRouteDelete({ id, - requestBody, }: { /** - * ID of the undefined - */ - id: Common_uuid; - requestBody: Sessions_UpdateSessionRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined + * ID of the resource */ id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ - method: "PUT", + method: "DELETE", url: "/sessions/{id}", path: { id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Patch undefined by id (merge changes) - * @returns any The request has succeeded. + * Get a session by id + * @returns Sessions_Session The request has succeeded. * @throws ApiError */ - public sessionsRoutePatch({ + public sessionsRouteGet({ id, - requestBody, }: { /** - * ID of the undefined - */ - id: Common_uuid; - requestBody: Sessions_PatchSessionRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined + * ID of the resource */ id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ - method: "PATCH", + method: "GET", url: "/sessions/{id}", path: { id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Delete undefined by id - * @returns any The request has been accepted for processing, but processing has not yet completed. + * Get history of a Session (paginated) + * @returns any The request has succeeded. * @throws ApiError */ - public sessionsRouteDelete({ + public historyRouteList({ id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { /** - * ID of the undefined + * ID of parent */ id: Common_uuid; - }): CancelablePromise<{ /** - * ID of deleted undefined + * Limit the number of items returned */ - id: Common_uuid; + limit?: Common_limit; /** - * When this resource was deleted as UTC date-time + * Offset the items returned */ - readonly deleted_at: string; + offset: Common_offset; /** - * IDs (if any) of jobs created as part of this request + * Sort by a field */ - jobs: Array; + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; }> { return this.httpRequest.request({ - method: "DELETE", - url: "/sessions/{id}", + method: "GET", + url: "/sessions/{id}/history", path: { id: id, }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, }); } /** - * Get undefined by id - * @returns Sessions_Session The request has succeeded. + * Clear the history of a Session (resets the Session) + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public sessionsRouteGet({ + public historyRouteDelete({ id, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; - }): CancelablePromise { + }): CancelablePromise { return this.httpRequest.request({ - method: "GET", - url: "/sessions/{id}", + method: "DELETE", + url: "/sessions/{id}/history", path: { id: id, }, }); } /** - * List undefined items + * List tasks (paginated) * @returns any The request has succeeded. * @throws ApiError */ @@ -1021,11 +863,11 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -1056,28 +898,15 @@ export class DefaultService { }); } /** - * Create or update undefined (ID is required in payload; existing resource will be overwritten) - * @returns any The request has succeeded. + * Create or update a task + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public tasksRouteCreateOrUpdate({ requestBody, }: { requestBody: Tasks_CreateOrUpdateTaskRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/tasks", @@ -1086,28 +915,15 @@ export class DefaultService { }); } /** - * Create new undefined - * @returns any The request has succeeded and a new resource has been created as a result. + * Create a new task + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. * @throws ApiError */ public tasksRouteCreate({ requestBody, }: { requestBody: Tasks_CreateTaskRequest; - }): CancelablePromise<{ - /** - * ID of created undefined - */ - id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/tasks", @@ -1116,8 +932,8 @@ export class DefaultService { }); } /** - * Update undefined by id (overwrite) - * @returns any The request has succeeded. + * Update an existing task (overwrite existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public tasksRouteUpdate({ @@ -1125,24 +941,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Tasks_UpdateTaskRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/tasks/{id}", @@ -1154,8 +957,8 @@ export class DefaultService { }); } /** - * Patch undefined by id (merge changes) - * @returns any The request has succeeded. + * Update an existing task (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public tasksRoutePatch({ @@ -1163,24 +966,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Tasks_PatchTaskRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PATCH", url: "/tasks/{id}", @@ -1192,31 +982,18 @@ export class DefaultService { }); } /** - * Delete undefined by id - * @returns any The request has been accepted for processing, but processing has not yet completed. + * Delete a task by its id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ public tasksRouteDelete({ id, }: { /** - * ID of the undefined - */ - id: Common_uuid; - }): CancelablePromise<{ - /** - * ID of deleted undefined + * ID of the resource */ id: Common_uuid; - /** - * When this resource was deleted as UTC date-time - */ - readonly deleted_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "DELETE", url: "/tasks/{id}", @@ -1226,8 +1003,8 @@ export class DefaultService { }); } /** - * Create new undefined - * @returns any The request has succeeded and a new resource has been created as a result. + * Create an execution for the given task + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. * @throws ApiError */ public taskExecutionsRouteCreate({ @@ -1235,24 +1012,11 @@ export class DefaultService { requestBody, }: { /** - * ID of parent undefined + * ID of parent resource */ id: Common_uuid; requestBody: Executions_CreateExecutionRequest; - }): CancelablePromise<{ - /** - * ID of created undefined - */ - id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/tasks/{id}/executions", @@ -1264,7 +1028,7 @@ export class DefaultService { }); } /** - * List undefined items of parent undefined + * List executions of the given task * @returns any The request has succeeded. * @throws ApiError */ @@ -1277,15 +1041,15 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * ID of parent undefined + * ID of parent */ id: Common_uuid; /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -1320,7 +1084,7 @@ export class DefaultService { } /** * Resume an execution with a task token - * @returns any The request has succeeded. + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public taskExecutionsRouteResumeWithTaskToken({ @@ -1335,20 +1099,7 @@ export class DefaultService { * Request to resume an execution with a task token */ requestBody: Executions_TaskTokenResumeExecutionRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/tasks/{id}/executions", @@ -1360,8 +1111,8 @@ export class DefaultService { }); } /** - * Update undefined by id (overwrite) - * @returns any The request has succeeded. + * Update an existing tool (overwrite existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public toolRouteUpdate({ @@ -1369,24 +1120,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Tools_UpdateToolRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/tools/{id}", @@ -1398,8 +1136,8 @@ export class DefaultService { }); } /** - * Patch undefined by id (merge changes) - * @returns any The request has succeeded. + * Update an existing tool (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public toolRoutePatch({ @@ -1407,24 +1145,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Tools_PatchToolRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PATCH", url: "/tools/{id}", @@ -1436,31 +1161,18 @@ export class DefaultService { }); } /** - * Delete undefined by id - * @returns any The request has been accepted for processing, but processing has not yet completed. + * Delete an existing tool by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ public toolRouteDelete({ id, }: { /** - * ID of the undefined - */ - id: Common_uuid; - }): CancelablePromise<{ - /** - * ID of deleted undefined + * ID of the resource */ id: Common_uuid; - /** - * When this resource was deleted as UTC date-time - */ - readonly deleted_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "DELETE", url: "/tools/{id}", @@ -1470,7 +1182,7 @@ export class DefaultService { }); } /** - * List undefined items + * List users (paginated) * @returns any The request has succeeded. * @throws ApiError */ @@ -1482,11 +1194,11 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -1517,28 +1229,15 @@ export class DefaultService { }); } /** - * Create new undefined - * @returns any The request has succeeded and a new resource has been created as a result. + * Create a new user + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. * @throws ApiError */ public usersRouteCreate({ requestBody, }: { requestBody: Users_CreateUserRequest; - }): CancelablePromise<{ - /** - * ID of created undefined - */ - id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "POST", url: "/users", @@ -1547,28 +1246,15 @@ export class DefaultService { }); } /** - * Create or update undefined (ID is required in payload; existing resource will be overwritten) - * @returns any The request has succeeded. + * Create or update a user + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public usersRouteCreateOrUpdate({ requestBody, }: { requestBody: Users_CreateOrUpdateUserRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/users", @@ -1577,8 +1263,8 @@ export class DefaultService { }); } /** - * Update undefined by id (overwrite) - * @returns any The request has succeeded. + * Update an existing user by id (overwrite existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public usersRouteUpdate({ @@ -1586,24 +1272,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Users_UpdateUserRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PUT", url: "/users/{id}", @@ -1615,8 +1288,8 @@ export class DefaultService { }); } /** - * Patch undefined by id (merge changes) - * @returns any The request has succeeded. + * Update an existing user by id (merge with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ public usersRoutePatch({ @@ -1624,24 +1297,11 @@ export class DefaultService { requestBody, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; requestBody: Users_PatchUserRequest; - }): CancelablePromise<{ - /** - * ID of updated undefined - */ - id: Common_uuid; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "PATCH", url: "/users/{id}", @@ -1653,31 +1313,18 @@ export class DefaultService { }); } /** - * Delete undefined by id - * @returns any The request has been accepted for processing, but processing has not yet completed. + * Delete a user by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ public usersRouteDelete({ id, }: { /** - * ID of the undefined - */ - id: Common_uuid; - }): CancelablePromise<{ - /** - * ID of deleted undefined + * ID of the resource */ id: Common_uuid; - /** - * When this resource was deleted as UTC date-time - */ - readonly deleted_at: string; - /** - * IDs (if any) of jobs created as part of this request - */ - jobs: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "DELETE", url: "/users/{id}", @@ -1687,7 +1334,7 @@ export class DefaultService { }); } /** - * Get undefined by id + * Get a user by id * @returns Users_User The request has succeeded. * @throws ApiError */ @@ -1695,7 +1342,7 @@ export class DefaultService { id, }: { /** - * ID of the undefined + * ID of the resource */ id: Common_uuid; }): CancelablePromise { @@ -1708,7 +1355,7 @@ export class DefaultService { }); } /** - * List undefined items of parent undefined + * List Docs owned by a User * @returns any The request has succeeded. * @throws ApiError */ @@ -1721,15 +1368,15 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * ID of parent undefined + * ID of parent */ id: Common_uuid; /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** @@ -1763,7 +1410,7 @@ export class DefaultService { }); } /** - * Search for documents owned by undefined + * Search Docs owned by a User * @returns any The request has succeeded. * @throws ApiError */ @@ -1777,18 +1424,18 @@ export class DefaultService { metadataFilter = "{}", }: { /** - * ID of the undefined + * ID of the parent */ id: Common_uuid; requestBody: { body: Docs_DocSearchRequest; }; /** - * Limit the number of undefined items returned + * Limit the number of items returned */ limit?: Common_limit; /** - * Offset the undefined items returned + * Offset the items returned */ offset: Common_offset; /** diff --git a/typespec/common/interfaces.tsp b/typespec/common/interfaces.tsp index a8ec41483..2d2c5fb21 100644 --- a/typespec/common/interfaces.tsp +++ b/typespec/common/interfaces.tsp @@ -57,7 +57,6 @@ interface UpdateEndpoint< DocString extends valueof string = "Update resource by id (overwrite existing values)" > { @put - @route("{id}") @doc(DocString) update( @header contentType: yaml | json, @@ -81,7 +80,6 @@ interface PatchEndpoint< DocString extends valueof string = "Patch resource by its id (merge changes with existing values)" > { @patch - @route("{id}") @doc(DocString) patch( @header contentType: yaml | json, @@ -105,7 +103,6 @@ interface GetEndpoint< DocString extends valueof string = "Get resource by id" > { @get - @route("{id}") @doc(DocString) get( @path @@ -116,7 +113,6 @@ interface GetEndpoint< interface DeleteEndpoint { @delete - @route("{id}") @doc(DocString) delete( @path From 14bee99c1651122bdf05666d61debedcf5840ea5 Mon Sep 17 00:00:00 2001 From: Julep Developers Date: Sat, 20 Jul 2024 19:24:49 +0000 Subject: [PATCH 16/36] wip Signed-off-by: Julep Developers --- agents-api/poetry.lock | 1 + sdks/postman/collection.json | 782 +++++---- sdks/python/julep/api/__init__.py | 124 +- sdks/python/julep/api/client.py | 1443 +++++++++-------- sdks/python/julep/api/reference.md | 550 ++++--- sdks/python/julep/api/types/__init__.py | 132 +- sdks/python/julep/api/types/agent.py | 83 + .../julep/api/types/agent_default_settings.py | 11 + .../julep/api/types/agent_instructions.py | 5 + .../api/types/agents_route_delete_response.py | 56 - .../api/types/agents_route_update_response.py | 56 - .../{tasks_cel.py => common_py_expression.py} | 2 +- ...py => common_resource_created_response.py} | 4 +- ...py => common_resource_deleted_response.py} | 4 +- ...py => common_resource_updated_response.py} | 4 +- ...ssions_route_create_response.py => doc.py} | 18 +- sdks/python/julep/api/types/doc_content.py | 5 + ...esponse.py => docs_embed_query_request.py} | 18 +- .../types/docs_embed_query_request_text.py | 5 + ...sponse.py => docs_embed_query_response.py} | 17 +- ...ools_route_create_response.py => entry.py} | 18 +- sdks/python/julep/api/types/entry_content.py | 17 + .../julep/api/types/entry_content_item.py | 16 + .../api/types/entry_content_item_item.py | 87 + sdks/python/julep/api/types/entry_source.py | 10 + sdks/python/julep/api/types/execution.py | 70 + .../julep/api/types/execution_status.py | 16 + .../julep/api/types/executions_execution.py | 1 + .../types/executions_route_update_response.py | 56 - ...ks_route_create_response.py => history.py} | 17 +- .../individual_docs_route_delete_response.py | 56 - sdks/python/julep/api/types/job_status.py | 79 + sdks/python/julep/api/types/session.py | 98 ++ .../types/sessions_context_overflow_type.py | 7 + ...essions_route_create_or_update_response.py | 56 - .../types/sessions_route_delete_response.py | 56 - .../types/sessions_route_patch_response.py | 56 - .../types/sessions_route_update_response.py | 56 - .../julep/api/types/sessions_session.py | 5 +- sdks/python/julep/api/types/task.py | 85 + .../task_executions_route_create_response.py | 56 - ...s_route_resume_with_task_token_response.py | 56 - .../julep/api/types/tasks_evaluate_step.py | 4 +- .../api/types/tasks_if_else_workflow_step.py | 4 +- .../api/types/tasks_prompt_step_settings.py | 6 +- ...py => tasks_prompt_step_settings_agent.py} | 8 +- ..._prompt_step_settings_frequency_penalty.py | 6 + .../tasks_prompt_step_settings_preset.py | 6 + .../tasks_route_create_or_update_response.py | 56 - .../api/types/tasks_route_delete_response.py | 56 - .../api/types/tasks_route_patch_response.py | 56 - .../api/types/tasks_route_update_response.py | 56 - sdks/python/julep/api/types/tasks_task.py | 2 + .../julep/api/types/tasks_workflow_step.py | 8 +- .../julep/api/types/tasks_yield_step.py | 4 +- sdks/python/julep/api/types/tool.py | 69 + .../api/types/tool_route_update_response.py | 56 - .../api/types/tools_create_tool_request.py | 5 - .../julep/api/types/tools_function_tool.py | 1 - sdks/python/julep/api/types/tools_tool.py | 6 - ...te_or_update_response.py => transition.py} | 18 +- .../python/julep/api/types/transition_type.py | 7 + ...gents_route_create_response.py => user.py} | 22 +- .../users_route_create_or_update_response.py | 56 - .../api/types/users_route_delete_response.py | 56 - .../api/types/users_route_patch_response.py | 56 - .../api/types/users_route_update_response.py | 56 - sdks/python/poetry.lock | 1 + 68 files changed, 2424 insertions(+), 2551 deletions(-) create mode 100644 sdks/python/julep/api/types/agent.py create mode 100644 sdks/python/julep/api/types/agent_default_settings.py create mode 100644 sdks/python/julep/api/types/agent_instructions.py delete mode 100644 sdks/python/julep/api/types/agents_route_delete_response.py delete mode 100644 sdks/python/julep/api/types/agents_route_update_response.py rename sdks/python/julep/api/types/{tasks_cel.py => common_py_expression.py} (72%) rename sdks/python/julep/api/types/{users_route_create_response.py => common_resource_created_response.py} (94%) rename sdks/python/julep/api/types/{history_route_delete_response.py => common_resource_deleted_response.py} (94%) rename sdks/python/julep/api/types/{agents_route_patch_response.py => common_resource_updated_response.py} (94%) rename sdks/python/julep/api/types/{sessions_route_create_response.py => doc.py} (77%) create mode 100644 sdks/python/julep/api/types/doc_content.py rename sdks/python/julep/api/types/{tool_route_patch_response.py => docs_embed_query_request.py} (75%) create mode 100644 sdks/python/julep/api/types/docs_embed_query_request_text.py rename sdks/python/julep/api/types/{tool_route_delete_response.py => docs_embed_query_response.py} (75%) rename sdks/python/julep/api/types/{agent_tools_route_create_response.py => entry.py} (77%) create mode 100644 sdks/python/julep/api/types/entry_content.py create mode 100644 sdks/python/julep/api/types/entry_content_item.py create mode 100644 sdks/python/julep/api/types/entry_content_item_item.py create mode 100644 sdks/python/julep/api/types/entry_source.py create mode 100644 sdks/python/julep/api/types/execution.py create mode 100644 sdks/python/julep/api/types/execution_status.py delete mode 100644 sdks/python/julep/api/types/executions_route_update_response.py rename sdks/python/julep/api/types/{tasks_route_create_response.py => history.py} (83%) delete mode 100644 sdks/python/julep/api/types/individual_docs_route_delete_response.py create mode 100644 sdks/python/julep/api/types/job_status.py create mode 100644 sdks/python/julep/api/types/session.py create mode 100644 sdks/python/julep/api/types/sessions_context_overflow_type.py delete mode 100644 sdks/python/julep/api/types/sessions_route_create_or_update_response.py delete mode 100644 sdks/python/julep/api/types/sessions_route_delete_response.py delete mode 100644 sdks/python/julep/api/types/sessions_route_patch_response.py delete mode 100644 sdks/python/julep/api/types/sessions_route_update_response.py create mode 100644 sdks/python/julep/api/types/task.py delete mode 100644 sdks/python/julep/api/types/task_executions_route_create_response.py delete mode 100644 sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py rename sdks/python/julep/api/types/{tasks_prompt_step_settings_length_penalty.py => tasks_prompt_step_settings_agent.py} (93%) delete mode 100644 sdks/python/julep/api/types/tasks_route_create_or_update_response.py delete mode 100644 sdks/python/julep/api/types/tasks_route_delete_response.py delete mode 100644 sdks/python/julep/api/types/tasks_route_patch_response.py delete mode 100644 sdks/python/julep/api/types/tasks_route_update_response.py create mode 100644 sdks/python/julep/api/types/tool.py delete mode 100644 sdks/python/julep/api/types/tool_route_update_response.py rename sdks/python/julep/api/types/{agents_route_create_or_update_response.py => transition.py} (77%) create mode 100644 sdks/python/julep/api/types/transition_type.py rename sdks/python/julep/api/types/{agents_route_create_response.py => user.py} (75%) delete mode 100644 sdks/python/julep/api/types/users_route_create_or_update_response.py delete mode 100644 sdks/python/julep/api/types/users_route_delete_response.py delete mode 100644 sdks/python/julep/api/types/users_route_patch_response.py delete mode 100644 sdks/python/julep/api/types/users_route_update_response.py diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 57607ab9e..73d3c64eb 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -4131,6 +4131,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/sdks/postman/collection.json b/sdks/postman/collection.json index a2a1e7f55..4c0bbfbf0 100644 --- a/sdks/postman/collection.json +++ b/sdks/postman/collection.json @@ -41,7 +41,7 @@ "_type": "endpoint", "name": "Agents Route List", "request": { - "description": "List undefined items", + "description": "List Agents (paginated)", "url": { "raw": "{{baseUrl}}/agents?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -53,12 +53,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -102,7 +102,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items", + "description": "List Agents (paginated)", "url": { "raw": "{{baseUrl}}/agents?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -114,12 +114,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -167,7 +167,7 @@ "_type": "endpoint", "name": "Agents Route Create", "request": { - "description": "Create new undefined", + "description": "Create a new Agent", "url": { "raw": "{{baseUrl}}/agents", "host": [ @@ -210,7 +210,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create new undefined", + "description": "Create a new Agent", "url": { "raw": "{{baseUrl}}/agents", "host": [ @@ -257,7 +257,7 @@ "_type": "endpoint", "name": "Agents Route Create Or Update", "request": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update an Agent", "url": { "raw": "{{baseUrl}}/agents", "host": [ @@ -300,7 +300,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update an Agent", "url": { "raw": "{{baseUrl}}/agents", "host": [ @@ -347,7 +347,7 @@ "_type": "endpoint", "name": "Agents Route Get", "request": { - "description": "Get undefined by id", + "description": "Get an Agent by id", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -361,7 +361,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -389,7 +389,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get undefined by id", + "description": "Get an Agent by id", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -403,7 +403,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -435,7 +435,7 @@ "_type": "endpoint", "name": "Agents Route Update", "request": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing Agent by id (overwrites existing values; use PATCH for merging instead)", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -449,7 +449,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -485,7 +485,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing Agent by id (overwrites existing values; use PATCH for merging instead)", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -499,7 +499,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -539,7 +539,7 @@ "_type": "endpoint", "name": "Agents Route Delete", "request": { - "description": "Delete undefined by id", + "description": "Delete Agent by id", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -553,7 +553,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -581,7 +581,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete undefined by id", + "description": "Delete Agent by id", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -595,7 +595,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -627,7 +627,7 @@ "_type": "endpoint", "name": "Agents Route Patch", "request": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing Agent by id (merges with existing values)", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -641,7 +641,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -677,7 +677,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing Agent by id (merges with existing values)", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -691,7 +691,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -731,7 +731,7 @@ "_type": "endpoint", "name": "Agent Docs Route List", "request": { - "description": "List undefined items of parent undefined", + "description": "List Docs owned by an Agent", "url": { "raw": "{{baseUrl}}/agents/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -745,12 +745,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -772,7 +772,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -800,7 +800,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items of parent undefined", + "description": "List Docs owned by an Agent", "url": { "raw": "{{baseUrl}}/agents/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -814,12 +814,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -841,7 +841,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -873,7 +873,7 @@ "_type": "endpoint", "name": "Agents Docs Search Route Search", "request": { - "description": "Search for documents owned by undefined", + "description": "Search Docs owned by an Agent", "url": { "raw": "{{baseUrl}}/agents/:id/search?limit=&offset=&sort_by=&direction=&metadata_filter=", "host": [ @@ -888,12 +888,12 @@ { "key": "limit", "value": "", - "description": "Limit the number of undefined items returned" + "description": "Limit the number of items returned" }, { "key": "offset", "value": "", - "description": "Offset the undefined items returned" + "description": "Offset the items returned" }, { "key": "sort_by", @@ -915,7 +915,7 @@ { "key": "id", "value": "", - "description": "ID of the undefined" + "description": "ID of the parent" } ] }, @@ -945,7 +945,7 @@ "_type": "endpoint", "name": "Agent Tools Route List", "request": { - "description": "List undefined items of parent undefined", + "description": "List tools of the given agent", "url": { "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -959,12 +959,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -986,7 +986,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -1014,7 +1014,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items of parent undefined", + "description": "List tools of the given agent", "url": { "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -1028,12 +1028,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -1055,7 +1055,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -1087,7 +1087,7 @@ "_type": "endpoint", "name": "Agent Tools Route Create", "request": { - "description": "Create new undefined", + "description": "Create a new tool for this agent", "url": { "raw": "{{baseUrl}}/agents/:id/tools", "host": [ @@ -1102,7 +1102,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent resource", "value": "id" } ] @@ -1138,7 +1138,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create new undefined", + "description": "Create a new tool for this agent", "url": { "raw": "{{baseUrl}}/agents/:id/tools", "host": [ @@ -1153,7 +1153,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent resource", "value": "id" } ] @@ -1193,7 +1193,7 @@ "_type": "endpoint", "name": "Individual Docs Route Get", "request": { - "description": "Get undefined by id", + "description": "Get Doc by id", "url": { "raw": "{{baseUrl}}/docs/:id", "host": [ @@ -1207,7 +1207,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1235,7 +1235,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get undefined by id", + "description": "Get Doc by id", "url": { "raw": "{{baseUrl}}/docs/:id", "host": [ @@ -1249,7 +1249,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1281,7 +1281,7 @@ "_type": "endpoint", "name": "Individual Docs Route Delete", "request": { - "description": "Delete undefined by id", + "description": "Delete an existing Doc by id", "url": { "raw": "{{baseUrl}}/docs/:id", "host": [ @@ -1295,7 +1295,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1323,7 +1323,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete undefined by id", + "description": "Delete an existing Doc by id", "url": { "raw": "{{baseUrl}}/docs/:id", "host": [ @@ -1337,7 +1337,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1365,11 +1365,101 @@ } ] }, + { + "_type": "endpoint", + "name": "Embed Route Embed", + "request": { + "description": "Embed a query for search", + "url": { + "raw": "{{baseUrl}}/embed", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "embed" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "auth": null, + "body": { + "mode": "raw", + "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Success", + "status": "OK", + "code": 200, + "originalRequest": { + "description": "Embed a query for search", + "url": { + "raw": "{{baseUrl}}/embed", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "embed" + ], + "query": [], + "variable": [] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "POST", + "auth": null, + "body": { + "mode": "raw", + "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "description": "The request has succeeded.", + "body": "{\n \"vectors\": [\n [\n 1.1\n ]\n ]\n}", + "_postman_previewlanguage": "json" + } + ] + }, { "_type": "endpoint", "name": "Executions Route Get", "request": { - "description": "Get undefined by id", + "description": "Get an Execution by id", "url": { "raw": "{{baseUrl}}/executions/:id", "host": [ @@ -1383,7 +1473,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1411,7 +1501,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get undefined by id", + "description": "Get an Execution by id", "url": { "raw": "{{baseUrl}}/executions/:id", "host": [ @@ -1425,7 +1515,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1448,7 +1538,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"input\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n}", + "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"input\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"id\"\n}", "_postman_previewlanguage": "json" } ] @@ -1457,7 +1547,7 @@ "_type": "endpoint", "name": "Executions Route Update", "request": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing Execution", "url": { "raw": "{{baseUrl}}/executions/:id", "host": [ @@ -1472,7 +1562,7 @@ { "key": "id", "value": "", - "description": "ID of the undefined" + "description": "ID of the resource" } ] }, @@ -1502,7 +1592,7 @@ "_type": "endpoint", "name": "Execution Transitions Route List", "request": { - "description": "List undefined items of parent undefined", + "description": "List the Transitions of an Execution by id", "url": { "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -1516,12 +1606,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -1543,7 +1633,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -1571,7 +1661,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items of parent undefined", + "description": "List the Transitions of an Execution by id", "url": { "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -1585,12 +1675,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -1612,7 +1702,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -1644,7 +1734,7 @@ "_type": "endpoint", "name": "Job Route Get", "request": { - "description": "Get undefined by id", + "description": "Get the status of an existing Job by its id", "url": { "raw": "{{baseUrl}}/jobs/:id", "host": [ @@ -1658,7 +1748,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1686,7 +1776,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get undefined by id", + "description": "Get the status of an existing Job by its id", "url": { "raw": "{{baseUrl}}/jobs/:id", "host": [ @@ -1700,7 +1790,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -1732,7 +1822,7 @@ "_type": "endpoint", "name": "Sessions Route List", "request": { - "description": "List undefined items", + "description": "List sessions (paginated)", "url": { "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -1744,12 +1834,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -1793,7 +1883,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items", + "description": "List sessions (paginated)", "url": { "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -1805,12 +1895,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -1858,7 +1948,7 @@ "_type": "endpoint", "name": "Sessions Route Create", "request": { - "description": "Create new undefined", + "description": "Create a new session", "url": { "raw": "{{baseUrl}}/sessions", "host": [ @@ -1901,7 +1991,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create new undefined", + "description": "Create a new session", "url": { "raw": "{{baseUrl}}/sessions", "host": [ @@ -1948,7 +2038,7 @@ "_type": "endpoint", "name": "Sessions Route Create Or Update", "request": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update a session", "url": { "raw": "{{baseUrl}}/sessions", "host": [ @@ -1991,7 +2081,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update a session", "url": { "raw": "{{baseUrl}}/sessions", "host": [ @@ -2036,50 +2126,60 @@ }, { "_type": "endpoint", - "name": "History Route List", + "name": "Sessions Route Get", "request": { - "description": "List undefined items of parent undefined", + "description": "Get a session by id", "url": { - "raw": "{{baseUrl}}/sessions/history/:id?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - "history", ":id" ], - "query": [ - { - "key": "limit", - "description": "Limit the number of undefined items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the undefined items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, + "query": [], + "variable": [ { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" + "key": "id", + "value": "", + "description": "ID of the resource" } + ] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + } + ], + "method": "GET", + "auth": null, + "body": null + }, + "response": [] + }, + { + "_type": "endpoint", + "name": "Sessions Route Update", + "request": { + "description": "Update an existing session by its id (overwrites all existing values)", + "url": { + "raw": "{{baseUrl}}/sessions/:id", + "host": [ + "{{baseUrl}}" ], + "path": [ + "sessions", + ":id" + ], + "query": [], "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2097,9 +2197,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -2107,48 +2215,21 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items of parent undefined", + "description": "Update an existing session by its id (overwrites all existing values)", "url": { - "raw": "{{baseUrl}}/sessions/history/:id?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - "history", ":id" ], - "query": [ - { - "key": "limit", - "description": "Limit the number of undefined items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the undefined items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], + "query": [], "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2166,36 +2247,43 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"entries\": [\n {\n \"role\": \"user\",\n \"content\": [],\n \"source\": \"api_request\",\n \"timestamp\": 1,\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ],\n \"relations\": [\n {\n \"head\": \"head\",\n \"relation\": \"relation\",\n \"tail\": \"tail\"\n }\n ],\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "History Route Delete", + "name": "Sessions Route Delete", "request": { - "description": "Delete undefined by id", + "description": "Delete a session by its id", "url": { - "raw": "{{baseUrl}}/sessions/history/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - "history", ":id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2223,22 +2311,21 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete undefined by id", + "description": "Delete a session by its id", "url": { - "raw": "{{baseUrl}}/sessions/history/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - "history", ":id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2268,46 +2355,9 @@ }, { "_type": "endpoint", - "name": "Sessions Route Get", - "request": { - "description": "Get undefined by id", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "value": "", - "description": "ID of the undefined" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [] - }, - { - "_type": "endpoint", - "name": "Sessions Route Update", + "name": "Sessions Route Patch", "request": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing session by its id (merges with existing values)", "url": { "raw": "{{baseUrl}}/sessions/:id", "host": [ @@ -2321,7 +2371,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2339,11 +2389,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -2357,7 +2407,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing session by its id (merges with existing values)", "url": { "raw": "{{baseUrl}}/sessions/:id", "host": [ @@ -2371,7 +2421,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2389,11 +2439,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -2409,23 +2459,50 @@ }, { "_type": "endpoint", - "name": "Sessions Route Delete", + "name": "History Route List", "request": { - "description": "Delete undefined by id", + "description": "Get history of a Session (paginated)", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - ":id" + ":id", + "history" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of parent", "value": "id" } ] @@ -2443,7 +2520,7 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, @@ -2453,21 +2530,48 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete undefined by id", + "description": "Get history of a Session (paginated)", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - ":id" + ":id", + "history" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of parent", "value": "id" } ] @@ -2485,35 +2589,36 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"results\": [\n {\n \"entries\": [\n {\n \"role\": \"user\",\n \"content\": [],\n \"source\": \"api_request\",\n \"timestamp\": 1,\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ],\n \"relations\": [\n {\n \"head\": \"head\",\n \"relation\": \"relation\",\n \"tail\": \"tail\"\n }\n ],\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Sessions Route Patch", + "name": "History Route Delete", "request": { - "description": "Patch undefined by id (merge changes)", + "description": "Clear the history of a Session (resets the Session)", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/sessions/:id/history", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - ":id" + ":id", + "history" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2531,17 +2636,9 @@ "value": "application/json" } ], - "method": "PATCH", + "method": "DELETE", "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -2549,21 +2646,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Patch undefined by id (merge changes)", + "description": "Clear the history of a Session (resets the Session)", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/sessions/:id/history", "host": [ "{{baseUrl}}" ], "path": [ "sessions", - ":id" + ":id", + "history" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2581,20 +2679,12 @@ "value": "application/json" } ], - "method": "PATCH", + "method": "DELETE", "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -2603,7 +2693,7 @@ "_type": "endpoint", "name": "Tasks Route List", "request": { - "description": "List undefined items", + "description": "List tasks (paginated)", "url": { "raw": "{{baseUrl}}/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -2615,12 +2705,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -2664,7 +2754,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items", + "description": "List tasks (paginated)", "url": { "raw": "{{baseUrl}}/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -2676,12 +2766,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -2720,7 +2810,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -2729,7 +2819,7 @@ "_type": "endpoint", "name": "Tasks Route Create", "request": { - "description": "Create new undefined", + "description": "Create a new task", "url": { "raw": "{{baseUrl}}/tasks", "host": [ @@ -2758,7 +2848,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2772,7 +2862,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create new undefined", + "description": "Create a new task", "url": { "raw": "{{baseUrl}}/tasks", "host": [ @@ -2801,7 +2891,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2819,7 +2909,7 @@ "_type": "endpoint", "name": "Tasks Route Create Or Update", "request": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update a task", "url": { "raw": "{{baseUrl}}/tasks", "host": [ @@ -2848,7 +2938,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2862,7 +2952,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update a task", "url": { "raw": "{{baseUrl}}/tasks", "host": [ @@ -2891,7 +2981,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2909,7 +2999,7 @@ "_type": "endpoint", "name": "Tasks Route Update", "request": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing task (overwrite existing values)", "url": { "raw": "{{baseUrl}}/tasks/:id", "host": [ @@ -2923,7 +3013,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2945,7 +3035,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2959,7 +3049,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing task (overwrite existing values)", "url": { "raw": "{{baseUrl}}/tasks/:id", "host": [ @@ -2973,7 +3063,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -2995,7 +3085,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -3013,7 +3103,7 @@ "_type": "endpoint", "name": "Tasks Route Delete", "request": { - "description": "Delete undefined by id", + "description": "Delete a task by its id", "url": { "raw": "{{baseUrl}}/tasks/:id", "host": [ @@ -3027,7 +3117,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3055,7 +3145,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete undefined by id", + "description": "Delete a task by its id", "url": { "raw": "{{baseUrl}}/tasks/:id", "host": [ @@ -3069,7 +3159,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3101,7 +3191,7 @@ "_type": "endpoint", "name": "Tasks Route Patch", "request": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing task (merges with existing values)", "url": { "raw": "{{baseUrl}}/tasks/:id", "host": [ @@ -3115,7 +3205,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3151,7 +3241,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing task (merges with existing values)", "url": { "raw": "{{baseUrl}}/tasks/:id", "host": [ @@ -3165,7 +3255,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3205,7 +3295,7 @@ "_type": "endpoint", "name": "Task Executions Route List", "request": { - "description": "List undefined items of parent undefined", + "description": "List executions of the given task", "url": { "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -3219,12 +3309,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -3246,7 +3336,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -3274,7 +3364,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items of parent undefined", + "description": "List executions of the given task", "url": { "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -3288,12 +3378,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -3315,7 +3405,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -3347,7 +3437,7 @@ "_type": "endpoint", "name": "Task Executions Route Create", "request": { - "description": "Create new undefined", + "description": "Create an execution for the given task", "url": { "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ @@ -3362,7 +3452,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent resource", "value": "id" } ] @@ -3398,7 +3488,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create new undefined", + "description": "Create an execution for the given task", "url": { "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ @@ -3413,7 +3503,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent resource", "value": "id" } ] @@ -3559,7 +3649,7 @@ "_type": "endpoint", "name": "Tool Route Update", "request": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing tool (overwrite existing values)", "url": { "raw": "{{baseUrl}}/tools/:id", "host": [ @@ -3573,7 +3663,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3595,7 +3685,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n}", + "raw": "{\n \"type\": \"function\",\n \"background\": true\n}", "options": { "raw": { "language": "json" @@ -3609,7 +3699,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing tool (overwrite existing values)", "url": { "raw": "{{baseUrl}}/tools/:id", "host": [ @@ -3623,7 +3713,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3645,7 +3735,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"background\": true,\n \"interactive\": true\n}", + "raw": "{\n \"type\": \"function\",\n \"background\": true\n}", "options": { "raw": { "language": "json" @@ -3663,7 +3753,7 @@ "_type": "endpoint", "name": "Tool Route Delete", "request": { - "description": "Delete undefined by id", + "description": "Delete an existing tool by id", "url": { "raw": "{{baseUrl}}/tools/:id", "host": [ @@ -3677,7 +3767,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3705,7 +3795,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete undefined by id", + "description": "Delete an existing tool by id", "url": { "raw": "{{baseUrl}}/tools/:id", "host": [ @@ -3719,7 +3809,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3751,7 +3841,7 @@ "_type": "endpoint", "name": "Tool Route Patch", "request": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing tool (merges with existing values)", "url": { "raw": "{{baseUrl}}/tools/:id", "host": [ @@ -3765,7 +3855,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3801,7 +3891,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing tool (merges with existing values)", "url": { "raw": "{{baseUrl}}/tools/:id", "host": [ @@ -3815,7 +3905,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -3855,7 +3945,7 @@ "_type": "endpoint", "name": "Users Route List", "request": { - "description": "List undefined items", + "description": "List users (paginated)", "url": { "raw": "{{baseUrl}}/users?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -3867,12 +3957,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -3916,7 +4006,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items", + "description": "List users (paginated)", "url": { "raw": "{{baseUrl}}/users?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -3928,12 +4018,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -3981,7 +4071,7 @@ "_type": "endpoint", "name": "Users Route Create", "request": { - "description": "Create new undefined", + "description": "Create a new user", "url": { "raw": "{{baseUrl}}/users", "host": [ @@ -4024,7 +4114,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create new undefined", + "description": "Create a new user", "url": { "raw": "{{baseUrl}}/users", "host": [ @@ -4071,7 +4161,7 @@ "_type": "endpoint", "name": "Users Route Create Or Update", "request": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update a user", "url": { "raw": "{{baseUrl}}/users", "host": [ @@ -4114,7 +4204,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update undefined (ID is required in payload; existing resource will be overwritten)", + "description": "Create or update a user", "url": { "raw": "{{baseUrl}}/users", "host": [ @@ -4161,7 +4251,7 @@ "_type": "endpoint", "name": "Users Route Get", "request": { - "description": "Get undefined by id", + "description": "Get a user by id", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4175,7 +4265,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4203,7 +4293,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get undefined by id", + "description": "Get a user by id", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4217,7 +4307,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4249,7 +4339,7 @@ "_type": "endpoint", "name": "Users Route Update", "request": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing user by id (overwrite existing values)", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4263,7 +4353,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4299,7 +4389,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update undefined by id (overwrite)", + "description": "Update an existing user by id (overwrite existing values)", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4313,7 +4403,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4353,7 +4443,7 @@ "_type": "endpoint", "name": "Users Route Delete", "request": { - "description": "Delete undefined by id", + "description": "Delete a user by id", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4367,7 +4457,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4395,7 +4485,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete undefined by id", + "description": "Delete a user by id", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4409,7 +4499,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4441,7 +4531,7 @@ "_type": "endpoint", "name": "Users Route Patch", "request": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing user by id (merge with existing values)", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4455,7 +4545,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4491,7 +4581,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Patch undefined by id (merge changes)", + "description": "Update an existing user by id (merge with existing values)", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4505,7 +4595,7 @@ "variable": [ { "key": "id", - "description": "ID of the undefined", + "description": "ID of the resource", "value": "id" } ] @@ -4545,7 +4635,7 @@ "_type": "endpoint", "name": "User Docs Route List", "request": { - "description": "List undefined items of parent undefined", + "description": "List Docs owned by a User", "url": { "raw": "{{baseUrl}}/users/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -4559,12 +4649,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -4586,7 +4676,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -4614,7 +4704,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List undefined items of parent undefined", + "description": "List Docs owned by a User", "url": { "raw": "{{baseUrl}}/users/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ @@ -4628,12 +4718,12 @@ "query": [ { "key": "limit", - "description": "Limit the number of undefined items returned", + "description": "Limit the number of items returned", "value": "1" }, { "key": "offset", - "description": "Offset the undefined items returned", + "description": "Offset the items returned", "value": "1" }, { @@ -4655,7 +4745,7 @@ "variable": [ { "key": "id", - "description": "ID of parent undefined", + "description": "ID of parent", "value": "id" } ] @@ -4687,7 +4777,7 @@ "_type": "endpoint", "name": "User Docs Search Route Search", "request": { - "description": "Search for documents owned by undefined", + "description": "Search Docs owned by a User", "url": { "raw": "{{baseUrl}}/users/:id/search?limit=&offset=&sort_by=&direction=&metadata_filter=", "host": [ @@ -4702,12 +4792,12 @@ { "key": "limit", "value": "", - "description": "Limit the number of undefined items returned" + "description": "Limit the number of items returned" }, { "key": "offset", "value": "", - "description": "Offset the undefined items returned" + "description": "Offset the items returned" }, { "key": "sort_by", @@ -4729,7 +4819,7 @@ { "key": "id", "value": "", - "description": "ID of the undefined" + "description": "ID of the parent" } ] }, diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 93fbde930..c66dd159f 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. from .types import ( + Agent, + AgentDefaultSettings, AgentDocsRouteListRequestDirection, AgentDocsRouteListRequestSortBy, AgentDocsRouteListResponse, - AgentToolsRouteCreateResponse, + AgentInstructions, AgentToolsRouteListRequestDirection, AgentToolsRouteListRequestSortBy, AgentToolsRouteListResponse, @@ -21,14 +23,9 @@ AgentsDocsSearchRouteSearchResponse, AgentsPatchAgentRequestDefaultSettings, AgentsPatchAgentRequestInstructions, - AgentsRouteCreateOrUpdateResponse, - AgentsRouteCreateResponse, - AgentsRouteDeleteResponse, AgentsRouteListRequestDirection, AgentsRouteListRequestSortBy, AgentsRouteListResponse, - AgentsRoutePatchResponse, - AgentsRouteUpdateResponse, AgentsUpdateAgentRequestDefaultSettings, AgentsUpdateAgentRequestInstructions, ChatCompletionResponseFormat, @@ -41,9 +38,15 @@ CommonLimit, CommonLogitBias, CommonOffset, + CommonPyExpression, + CommonResourceCreatedResponse, + CommonResourceDeletedResponse, + CommonResourceUpdatedResponse, CommonToolRef, CommonUuid, CommonValidPythonIdentifier, + Doc, + DocContent, DocsDoc, DocsDocContent, DocsDocOwner, @@ -55,6 +58,9 @@ DocsDocSearchRequest_Hybrid, DocsDocSearchRequest_Text, DocsDocSearchRequest_Vector, + DocsEmbedQueryRequest, + DocsEmbedQueryRequestText, + DocsEmbedQueryResponse, DocsHybridDocSearchRequest, DocsHybridDocSearchRequestText, DocsHybridDocSearchRequestVector, @@ -83,6 +89,15 @@ EntriesInputChatMlMessageContentItem_ImageUrl, EntriesInputChatMlMessageContentItem_Text, EntriesRelation, + Entry, + EntryContent, + EntryContentItem, + EntryContentItemItem, + EntryContentItemItem_ImageUrl, + EntryContentItemItem_Text, + EntrySource, + Execution, + ExecutionStatus, ExecutionTransitionsRouteListRequestDirection, ExecutionTransitionsRouteListRequestSortBy, ExecutionTransitionsRouteListResponse, @@ -90,31 +105,27 @@ ExecutionsExecution, ExecutionsExecutionStatus, ExecutionsResumeExecutionRequest, - ExecutionsRouteUpdateResponse, ExecutionsStopExecutionRequest, ExecutionsTransition, ExecutionsTransitionType, ExecutionsUpdateExecutionRequest, ExecutionsUpdateExecutionRequest_Cancelled, ExecutionsUpdateExecutionRequest_Running, - HistoryRouteDeleteResponse, + History, HistoryRouteListRequestDirection, HistoryRouteListRequestSortBy, HistoryRouteListResponse, - IndividualDocsRouteDeleteResponse, + JobStatus, JobsJobState, JobsJobStatus, + Session, + SessionsContextOverflowType, SessionsMultiAgentMultiUserSession, SessionsMultiAgentNoUserSession, SessionsMultiAgentSingleUserSession, - SessionsRouteCreateOrUpdateResponse, - SessionsRouteCreateResponse, - SessionsRouteDeleteResponse, SessionsRouteListRequestDirection, SessionsRouteListRequestSortBy, SessionsRouteListResponse, - SessionsRoutePatchResponse, - SessionsRouteUpdateResponse, SessionsSession, SessionsSession_MultiAgentMultiUser, SessionsSession_MultiAgentNoUser, @@ -125,29 +136,22 @@ SessionsSingleAgentMultiUserSession, SessionsSingleAgentNoUserSession, SessionsSingleAgentSingleUserSession, - TaskExecutionsRouteCreateResponse, + Task, TaskExecutionsRouteListRequestDirection, TaskExecutionsRouteListRequestSortBy, TaskExecutionsRouteListResponse, - TaskExecutionsRouteResumeWithTaskTokenResponse, - TasksCel, TasksErrorWorkflowStep, TasksEvaluateStep, TasksIfElseWorkflowStep, TasksPromptStep, TasksPromptStepPrompt, TasksPromptStepSettings, + TasksPromptStepSettingsAgent, TasksPromptStepSettingsFrequencyPenalty, - TasksPromptStepSettingsLengthPenalty, TasksPromptStepSettingsPreset, - TasksRouteCreateOrUpdateResponse, - TasksRouteCreateResponse, - TasksRouteDeleteResponse, TasksRouteListRequestDirection, TasksRouteListRequestSortBy, TasksRouteListResponse, - TasksRoutePatchResponse, - TasksRouteUpdateResponse, TasksTask, TasksToolCallStep, TasksWorkflowStep, @@ -158,9 +162,7 @@ TasksWorkflowStep_ToolCall, TasksWorkflowStep_Yield, TasksYieldStep, - ToolRouteDeleteResponse, - ToolRoutePatchResponse, - ToolRouteUpdateResponse, + Tool, ToolsChosenFunctionCall, ToolsChosenToolCall, ToolsChosenToolCall_Function, @@ -173,29 +175,29 @@ ToolsToolResponse, ToolsToolType, ToolsTool_Function, + Transition, + TransitionType, + User, UserDocsRouteListRequestDirection, UserDocsRouteListRequestSortBy, UserDocsRouteListResponse, UserDocsSearchRouteSearchRequestDirection, UserDocsSearchRouteSearchRequestSortBy, UserDocsSearchRouteSearchResponse, - UsersRouteCreateOrUpdateResponse, - UsersRouteCreateResponse, - UsersRouteDeleteResponse, UsersRouteListRequestDirection, UsersRouteListRequestSortBy, UsersRouteListResponse, - UsersRoutePatchResponse, - UsersRouteUpdateResponse, UsersUser, ) from .environment import JulepApiEnvironment __all__ = [ + "Agent", + "AgentDefaultSettings", "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", - "AgentToolsRouteCreateResponse", + "AgentInstructions", "AgentToolsRouteListRequestDirection", "AgentToolsRouteListRequestSortBy", "AgentToolsRouteListResponse", @@ -212,14 +214,9 @@ "AgentsDocsSearchRouteSearchResponse", "AgentsPatchAgentRequestDefaultSettings", "AgentsPatchAgentRequestInstructions", - "AgentsRouteCreateOrUpdateResponse", - "AgentsRouteCreateResponse", - "AgentsRouteDeleteResponse", "AgentsRouteListRequestDirection", "AgentsRouteListRequestSortBy", "AgentsRouteListResponse", - "AgentsRoutePatchResponse", - "AgentsRouteUpdateResponse", "AgentsUpdateAgentRequestDefaultSettings", "AgentsUpdateAgentRequestInstructions", "ChatCompletionResponseFormat", @@ -232,9 +229,15 @@ "CommonLimit", "CommonLogitBias", "CommonOffset", + "CommonPyExpression", + "CommonResourceCreatedResponse", + "CommonResourceDeletedResponse", + "CommonResourceUpdatedResponse", "CommonToolRef", "CommonUuid", "CommonValidPythonIdentifier", + "Doc", + "DocContent", "DocsDoc", "DocsDocContent", "DocsDocOwner", @@ -246,6 +249,9 @@ "DocsDocSearchRequest_Hybrid", "DocsDocSearchRequest_Text", "DocsDocSearchRequest_Vector", + "DocsEmbedQueryRequest", + "DocsEmbedQueryRequestText", + "DocsEmbedQueryResponse", "DocsHybridDocSearchRequest", "DocsHybridDocSearchRequestText", "DocsHybridDocSearchRequestVector", @@ -274,6 +280,15 @@ "EntriesInputChatMlMessageContentItem_ImageUrl", "EntriesInputChatMlMessageContentItem_Text", "EntriesRelation", + "Entry", + "EntryContent", + "EntryContentItem", + "EntryContentItemItem", + "EntryContentItemItem_ImageUrl", + "EntryContentItemItem_Text", + "EntrySource", + "Execution", + "ExecutionStatus", "ExecutionTransitionsRouteListRequestDirection", "ExecutionTransitionsRouteListRequestSortBy", "ExecutionTransitionsRouteListResponse", @@ -281,32 +296,28 @@ "ExecutionsExecution", "ExecutionsExecutionStatus", "ExecutionsResumeExecutionRequest", - "ExecutionsRouteUpdateResponse", "ExecutionsStopExecutionRequest", "ExecutionsTransition", "ExecutionsTransitionType", "ExecutionsUpdateExecutionRequest", "ExecutionsUpdateExecutionRequest_Cancelled", "ExecutionsUpdateExecutionRequest_Running", - "HistoryRouteDeleteResponse", + "History", "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", - "IndividualDocsRouteDeleteResponse", + "JobStatus", "JobsJobState", "JobsJobStatus", "JulepApiEnvironment", + "Session", + "SessionsContextOverflowType", "SessionsMultiAgentMultiUserSession", "SessionsMultiAgentNoUserSession", "SessionsMultiAgentSingleUserSession", - "SessionsRouteCreateOrUpdateResponse", - "SessionsRouteCreateResponse", - "SessionsRouteDeleteResponse", "SessionsRouteListRequestDirection", "SessionsRouteListRequestSortBy", "SessionsRouteListResponse", - "SessionsRoutePatchResponse", - "SessionsRouteUpdateResponse", "SessionsSession", "SessionsSession_MultiAgentMultiUser", "SessionsSession_MultiAgentNoUser", @@ -317,29 +328,22 @@ "SessionsSingleAgentMultiUserSession", "SessionsSingleAgentNoUserSession", "SessionsSingleAgentSingleUserSession", - "TaskExecutionsRouteCreateResponse", + "Task", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", - "TaskExecutionsRouteResumeWithTaskTokenResponse", - "TasksCel", "TasksErrorWorkflowStep", "TasksEvaluateStep", "TasksIfElseWorkflowStep", "TasksPromptStep", "TasksPromptStepPrompt", "TasksPromptStepSettings", + "TasksPromptStepSettingsAgent", "TasksPromptStepSettingsFrequencyPenalty", - "TasksPromptStepSettingsLengthPenalty", "TasksPromptStepSettingsPreset", - "TasksRouteCreateOrUpdateResponse", - "TasksRouteCreateResponse", - "TasksRouteDeleteResponse", "TasksRouteListRequestDirection", "TasksRouteListRequestSortBy", "TasksRouteListResponse", - "TasksRoutePatchResponse", - "TasksRouteUpdateResponse", "TasksTask", "TasksToolCallStep", "TasksWorkflowStep", @@ -350,9 +354,7 @@ "TasksWorkflowStep_ToolCall", "TasksWorkflowStep_Yield", "TasksYieldStep", - "ToolRouteDeleteResponse", - "ToolRoutePatchResponse", - "ToolRouteUpdateResponse", + "Tool", "ToolsChosenFunctionCall", "ToolsChosenToolCall", "ToolsChosenToolCall_Function", @@ -365,19 +367,17 @@ "ToolsToolResponse", "ToolsToolType", "ToolsTool_Function", + "Transition", + "TransitionType", + "User", "UserDocsRouteListRequestDirection", "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", "UserDocsSearchRouteSearchRequestDirection", "UserDocsSearchRouteSearchRequestSortBy", "UserDocsSearchRouteSearchResponse", - "UsersRouteCreateOrUpdateResponse", - "UsersRouteCreateResponse", - "UsersRouteDeleteResponse", "UsersRouteListRequestDirection", "UsersRouteListRequestSortBy", "UsersRouteListResponse", - "UsersRoutePatchResponse", - "UsersRouteUpdateResponse", "UsersUser", ] diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index 1fd1fda02..cde175633 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -16,7 +16,6 @@ ) from .types.agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy from .types.agent_docs_route_list_response import AgentDocsRouteListResponse -from .types.agent_tools_route_create_response import AgentToolsRouteCreateResponse from .types.agent_tools_route_list_request_direction import ( AgentToolsRouteListRequestDirection, ) @@ -52,16 +51,9 @@ from .types.agents_patch_agent_request_instructions import ( AgentsPatchAgentRequestInstructions, ) -from .types.agents_route_create_or_update_response import ( - AgentsRouteCreateOrUpdateResponse, -) -from .types.agents_route_create_response import AgentsRouteCreateResponse -from .types.agents_route_delete_response import AgentsRouteDeleteResponse from .types.agents_route_list_request_direction import AgentsRouteListRequestDirection from .types.agents_route_list_request_sort_by import AgentsRouteListRequestSortBy from .types.agents_route_list_response import AgentsRouteListResponse -from .types.agents_route_patch_response import AgentsRoutePatchResponse -from .types.agents_route_update_response import AgentsRouteUpdateResponse from .types.agents_update_agent_request_default_settings import ( AgentsUpdateAgentRequestDefaultSettings, ) @@ -71,9 +63,14 @@ from .types.common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .types.common_limit import CommonLimit from .types.common_offset import CommonOffset +from .types.common_resource_created_response import CommonResourceCreatedResponse +from .types.common_resource_deleted_response import CommonResourceDeletedResponse +from .types.common_resource_updated_response import CommonResourceUpdatedResponse from .types.common_uuid import CommonUuid from .types.docs_doc import DocsDoc from .types.docs_doc_search_request import DocsDocSearchRequest +from .types.docs_embed_query_request import DocsEmbedQueryRequest +from .types.docs_embed_query_response import DocsEmbedQueryResponse from .types.execution_transitions_route_list_request_direction import ( ExecutionTransitionsRouteListRequestDirection, ) @@ -84,32 +81,18 @@ ExecutionTransitionsRouteListResponse, ) from .types.executions_execution import ExecutionsExecution -from .types.executions_route_update_response import ExecutionsRouteUpdateResponse from .types.executions_update_execution_request import ExecutionsUpdateExecutionRequest -from .types.history_route_delete_response import HistoryRouteDeleteResponse from .types.history_route_list_request_direction import HistoryRouteListRequestDirection from .types.history_route_list_request_sort_by import HistoryRouteListRequestSortBy from .types.history_route_list_response import HistoryRouteListResponse -from .types.individual_docs_route_delete_response import ( - IndividualDocsRouteDeleteResponse, -) from .types.jobs_job_status import JobsJobStatus -from .types.sessions_route_create_or_update_response import ( - SessionsRouteCreateOrUpdateResponse, -) -from .types.sessions_route_create_response import SessionsRouteCreateResponse -from .types.sessions_route_delete_response import SessionsRouteDeleteResponse +from .types.sessions_context_overflow_type import SessionsContextOverflowType from .types.sessions_route_list_request_direction import ( SessionsRouteListRequestDirection, ) from .types.sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy from .types.sessions_route_list_response import SessionsRouteListResponse -from .types.sessions_route_patch_response import SessionsRoutePatchResponse -from .types.sessions_route_update_response import SessionsRouteUpdateResponse from .types.sessions_session import SessionsSession -from .types.task_executions_route_create_response import ( - TaskExecutionsRouteCreateResponse, -) from .types.task_executions_route_list_request_direction import ( TaskExecutionsRouteListRequestDirection, ) @@ -117,23 +100,10 @@ TaskExecutionsRouteListRequestSortBy, ) from .types.task_executions_route_list_response import TaskExecutionsRouteListResponse -from .types.task_executions_route_resume_with_task_token_response import ( - TaskExecutionsRouteResumeWithTaskTokenResponse, -) -from .types.tasks_route_create_or_update_response import ( - TasksRouteCreateOrUpdateResponse, -) -from .types.tasks_route_create_response import TasksRouteCreateResponse -from .types.tasks_route_delete_response import TasksRouteDeleteResponse from .types.tasks_route_list_request_direction import TasksRouteListRequestDirection from .types.tasks_route_list_request_sort_by import TasksRouteListRequestSortBy from .types.tasks_route_list_response import TasksRouteListResponse -from .types.tasks_route_patch_response import TasksRoutePatchResponse -from .types.tasks_route_update_response import TasksRouteUpdateResponse from .types.tasks_workflow_step import TasksWorkflowStep -from .types.tool_route_delete_response import ToolRouteDeleteResponse -from .types.tool_route_patch_response import ToolRoutePatchResponse -from .types.tool_route_update_response import ToolRouteUpdateResponse from .types.tools_create_tool_request import ToolsCreateToolRequest from .types.tools_function_def import ToolsFunctionDef from .types.tools_function_def_update import ToolsFunctionDefUpdate @@ -152,16 +122,9 @@ from .types.user_docs_search_route_search_response import ( UserDocsSearchRouteSearchResponse, ) -from .types.users_route_create_or_update_response import ( - UsersRouteCreateOrUpdateResponse, -) -from .types.users_route_create_response import UsersRouteCreateResponse -from .types.users_route_delete_response import UsersRouteDeleteResponse from .types.users_route_list_request_direction import UsersRouteListRequestDirection from .types.users_route_list_request_sort_by import UsersRouteListRequestSortBy from .types.users_route_list_response import UsersRouteListResponse -from .types.users_route_patch_response import UsersRoutePatchResponse -from .types.users_route_update_response import UsersRouteUpdateResponse from .types.users_user import UsersUser # this is used as the default value for optional parameters @@ -250,15 +213,15 @@ def agents_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteListResponse: """ - List undefined items + List Agents (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentsRouteListRequestSortBy Sort by a field @@ -326,9 +289,9 @@ def agents_route_create( AgentsCreateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new Agent Parameters ---------- @@ -357,7 +320,7 @@ def agents_route_create( Returns ------- - AgentsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -393,7 +356,7 @@ def agents_route_create( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -412,9 +375,9 @@ def agents_route_create_or_update( AgentsCreateOrUpdateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update an Agent Parameters ---------- @@ -442,7 +405,7 @@ def agents_route_create_or_update( Returns ------- - AgentsRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -478,7 +441,7 @@ def agents_route_create_or_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -488,12 +451,12 @@ def agents_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> AgentsAgent: """ - Get undefined by id + Get an Agent by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -541,14 +504,14 @@ def agents_route_update( AgentsUpdateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource name : CommonIdentifierSafeUnicode Name of the agent @@ -572,7 +535,7 @@ def agents_route_update( Returns ------- - AgentsRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -607,7 +570,7 @@ def agents_route_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -615,21 +578,21 @@ def agents_route_update( def agents_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> AgentsRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete Agent by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -651,7 +614,7 @@ def agents_route_delete( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -670,14 +633,14 @@ def agents_route_patch( AgentsPatchAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing Agent by id (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -701,7 +664,7 @@ def agents_route_patch( Returns ------- - AgentsRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -732,7 +695,7 @@ def agents_route_patch( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -750,18 +713,18 @@ def agent_docs_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> AgentDocsRouteListResponse: """ - List undefined items of parent undefined + List Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentDocsRouteListRequestSortBy Sort by a field @@ -830,18 +793,18 @@ def agents_docs_search_route_search( request_options: typing.Optional[RequestOptions] = None, ) -> AgentsDocsSearchRouteSearchResponse: """ - Search for documents owned by undefined + Search Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of the undefined + ID of the parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentsDocsSearchRouteSearchRequestSortBy Sort by a field @@ -922,18 +885,18 @@ def agent_tools_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> AgentToolsRouteListResponse: """ - List undefined items of parent undefined + List tools of the given agent Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentToolsRouteListRequestSortBy Sort by a field @@ -1003,14 +966,14 @@ def agent_tools_route_create( AgentsCreateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentToolsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new tool for this agent Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent resource name : CommonIdentifierSafeUnicode Name of the agent @@ -1037,7 +1000,7 @@ def agent_tools_route_create( Returns ------- - AgentToolsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -1074,7 +1037,7 @@ def agent_tools_route_create( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1084,12 +1047,12 @@ def individual_docs_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> DocsDoc: """ - Get undefined by id + Get Doc by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1126,21 +1089,21 @@ def individual_docs_route_get( def individual_docs_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> IndividualDocsRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete an existing Doc by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - IndividualDocsRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -1162,7 +1125,58 @@ def individual_docs_route_delete( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def embed_route_embed( + self, + *, + body: DocsEmbedQueryRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> DocsEmbedQueryResponse: + """ + Embed a query for search + + Parameters + ---------- + body : DocsEmbedQueryRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DocsEmbedQueryResponse + The request has succeeded. + + Examples + -------- + from julep import DocsEmbedQueryRequest + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "embed", + method="POST", + json={"body": body}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1172,12 +1186,12 @@ def executions_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> ExecutionsExecution: """ - Get undefined by id + Get an Execution by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1218,14 +1232,14 @@ def executions_route_update( *, request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionsRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing Execution Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request : ExecutionsUpdateExecutionRequest @@ -1234,7 +1248,7 @@ def executions_route_update( Returns ------- - ExecutionsRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -1262,7 +1276,7 @@ def executions_route_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1280,18 +1294,18 @@ def execution_transitions_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> ExecutionTransitionsRouteListResponse: """ - List undefined items of parent undefined + List the Transitions of an Execution by id Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : ExecutionTransitionsRouteListRequestSortBy Sort by a field @@ -1351,12 +1365,12 @@ def job_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> JobsJobStatus: """ - Get undefined by id + Get the status of an existing Job by its id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1402,15 +1416,15 @@ def sessions_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteListResponse: """ - List undefined items + List sessions (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : SessionsRouteListRequestSortBy Sort by a field @@ -1475,12 +1489,12 @@ def sessions_route_create( agent: typing.Optional[CommonUuid] = OMIT, agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new session Parameters ---------- @@ -1503,7 +1517,7 @@ def sessions_route_create( token_budget : typing.Optional[int] Threshold value for the adaptive context functionality - context_overflow : typing.Optional[str] + context_overflow : typing.Optional[SessionsContextOverflowType] Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -1513,7 +1527,7 @@ def sessions_route_create( Returns ------- - SessionsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -1548,7 +1562,7 @@ def sessions_route_create( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -1565,12 +1579,12 @@ def sessions_route_create_or_update( agent: typing.Optional[CommonUuid] = OMIT, agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update a session Parameters ---------- @@ -1595,7 +1609,7 @@ def sessions_route_create_or_update( token_budget : typing.Optional[int] Threshold value for the adaptive context functionality - context_overflow : typing.Optional[str] + context_overflow : typing.Optional[SessionsContextOverflowType] Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -1605,7 +1619,7 @@ def sessions_route_create_or_update( Returns ------- - SessionsRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -1642,52 +1656,29 @@ def sessions_route_create_or_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + def sessions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsSession: """ - List undefined items of parent undefined + Get a session by id Parameters ---------- id : CommonUuid - ID of parent undefined - - limit : CommonLimit - Limit the number of undefined items returned - - offset : CommonOffset - Offset the undefined items returned - - sort_by : HistoryRouteListRequestSortBy - Sort by a field - - direction : HistoryRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteListResponse + SessionsSession The request has succeeded. Examples @@ -1698,53 +1689,63 @@ def history_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + client.sessions_route_get( + id="string", ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/history/{jsonable_encoder(id)}", + f"sessions/{jsonable_encoder(id)}", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> HistoryRouteDeleteResponse: + def sessions_route_update( + self, + id: CommonUuid, + *, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: """ - Delete undefined by id + Update an existing session by its id (overwrites all existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource + + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteDeleteResponse - The request has been accepted for processing, but processing has not yet completed. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- @@ -1754,41 +1755,51 @@ def history_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.history_route_delete( + client.sessions_route_update( id="id", + situation="situation", + render_templates=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/history/{jsonable_encoder(id)}", - method="DELETE", + f"sessions/{jsonable_encoder(id)}", + method="PUT", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_get( + def sessions_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsSession: + ) -> CommonResourceDeletedResponse: """ - Get undefined by id + Delete a session by its id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsSession - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -1798,52 +1809,52 @@ def sessions_route_get( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_get( - id="string", + client.sessions_route_delete( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}", - method="GET", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_update( + def sessions_route_patch( self, id: CommonUuid, *, - situation: str, - render_templates: bool, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing session by its id (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource - situation : str + situation : typing.Optional[str] A specific situation that sets the background for this session - render_templates : bool + render_templates : typing.Optional[bool] Render system and assistant message content as jinja templates token_budget : typing.Optional[int] Threshold value for the adaptive context functionality - context_overflow : typing.Optional[str] + context_overflow : typing.Optional[SessionsContextOverflowType] Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -1853,7 +1864,7 @@ def sessions_route_update( Returns ------- - SessionsRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -1864,15 +1875,13 @@ def sessions_route_update( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_update( + client.sessions_route_patch( id="id", - situation="situation", - render_templates=True, ) """ _response = self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}", - method="PUT", + method="PATCH", json={ "situation": situation, "render_templates": render_templates, @@ -1885,30 +1894,53 @@ def sessions_route_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsRouteDeleteResponse: + def history_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> HistoryRouteListResponse: """ - Delete undefined by id + Get history of a Session (paginated) Parameters ---------- id : CommonUuid - ID of the undefined + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : HistoryRouteListRequestSortBy + Sort by a field + + direction : HistoryRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsRouteDeleteResponse - The request has been accepted for processing, but processing has not yet completed. + HistoryRouteListResponse + The request has succeeded. Examples -------- @@ -1918,63 +1950,53 @@ def sessions_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_delete( + client.history_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="DELETE", + f"sessions/{jsonable_encoder(id)}/history", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_patch( - self, - id: CommonUuid, - *, - situation: typing.Optional[str] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRoutePatchResponse: + def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Patch undefined by id (merge changes) + Clear the history of a Session (resets the Session) Parameters ---------- id : CommonUuid - ID of the undefined - - situation : typing.Optional[str] - A specific situation that sets the background for this session - - render_templates : typing.Optional[bool] - Render system and assistant message content as jinja templates - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[str] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsRoutePatchResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -1984,26 +2006,18 @@ def sessions_route_patch( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_patch( + client.history_route_delete( id="id", ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PATCH", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, + f"sessions/{jsonable_encoder(id)}/history", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2020,15 +2034,15 @@ def tasks_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteListResponse: """ - List undefined items + List tasks (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : TasksRouteListRequestSortBy Sort by a field @@ -2092,10 +2106,11 @@ def tasks_route_create( tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new task Parameters ---------- @@ -2115,12 +2130,14 @@ def tasks_route_create( input_schema : typing.Optional[typing.Dict[str, typing.Any]] The schema for the input to the task. `null` means all inputs are valid. + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -2140,7 +2157,6 @@ def tasks_route_create( ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -2156,13 +2172,14 @@ def tasks_route_create( "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2178,10 +2195,11 @@ def tasks_route_create_or_update( tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update a task Parameters ---------- @@ -2203,12 +2221,14 @@ def tasks_route_create_or_update( input_schema : typing.Optional[typing.Dict[str, typing.Any]] The schema for the input to the task. `null` means all inputs are valid. - request_options : typing.Optional[RequestOptions] + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -2229,7 +2249,6 @@ def tasks_route_create_or_update( ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -2246,13 +2265,14 @@ def tasks_route_create_or_update( "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2267,15 +2287,16 @@ def tasks_route_update( tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing task (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource description : str @@ -2291,12 +2312,14 @@ def tasks_route_update( input_schema : typing.Optional[typing.Dict[str, typing.Any]] The schema for the input to the task. `null` means all inputs are valid. + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -2316,7 +2339,6 @@ def tasks_route_update( ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -2331,13 +2353,14 @@ def tasks_route_update( "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2345,21 +2368,21 @@ def tasks_route_update( def tasks_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> TasksRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete a task by its id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -2381,7 +2404,7 @@ def tasks_route_delete( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2396,15 +2419,16 @@ def tasks_route_patch( input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, inherit_tools: typing.Optional[bool] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing task (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource description : typing.Optional[str] @@ -2420,12 +2444,14 @@ def tasks_route_patch( inherit_tools : typing.Optional[bool] Whether to inherit tools from the parent agent or not. Defaults to true. + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -2449,13 +2475,14 @@ def tasks_route_patch( "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2473,18 +2500,18 @@ def task_executions_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteListResponse: """ - List undefined items of parent undefined + List executions of the given task Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : TaskExecutionsRouteListRequestSortBy Sort by a field @@ -2545,25 +2572,28 @@ def task_executions_route_create( id: CommonUuid, *, input: typing.Dict[str, typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create an execution for the given task Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent resource input : typing.Dict[str, typing.Any] The input to the execution + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TaskExecutionsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -2582,13 +2612,13 @@ def task_executions_route_create( _response = self._client_wrapper.httpx_client.request( f"tasks/{jsonable_encoder(id)}/executions", method="POST", - json={"input": input}, + json={"input": input, "metadata": metadata}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2601,7 +2631,7 @@ def task_executions_route_resume_with_task_token( task_token: str, input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteResumeWithTaskTokenResponse: + ) -> CommonResourceUpdatedResponse: """ Resume an execution with a task token @@ -2621,7 +2651,7 @@ def task_executions_route_resume_with_task_token( Returns ------- - TaskExecutionsRouteResumeWithTaskTokenResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -2646,7 +2676,7 @@ def task_executions_route_resume_with_task_token( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2658,20 +2688,19 @@ def tool_route_update( *, type: ToolsToolType, background: bool, - interactive: bool, function: typing.Optional[ToolsFunctionDef] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ToolRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing tool (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource type : ToolsToolType Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) @@ -2679,9 +2708,6 @@ def tool_route_update( background : bool The tool should be run in the background (not supported at the moment) - interactive : bool - Whether the tool that can be run interactively (response should contain "stop" boolean field) - function : typing.Optional[ToolsFunctionDef] integration : typing.Optional[typing.Any] @@ -2695,7 +2721,7 @@ def tool_route_update( Returns ------- - ToolRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -2710,7 +2736,6 @@ def tool_route_update( id="id", type="function", background=True, - interactive=True, ) """ _response = self._client_wrapper.httpx_client.request( @@ -2719,7 +2744,6 @@ def tool_route_update( json={ "type": type, "background": background, - "interactive": interactive, "function": function, "integration": integration, "system": system, @@ -2730,7 +2754,7 @@ def tool_route_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2738,21 +2762,21 @@ def tool_route_update( def tool_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ToolRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete an existing tool by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ToolRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -2774,7 +2798,7 @@ def tool_route_delete( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2786,20 +2810,19 @@ def tool_route_patch( *, type: typing.Optional[ToolsToolType] = OMIT, background: typing.Optional[bool] = OMIT, - interactive: typing.Optional[bool] = OMIT, function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ToolRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing tool (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource type : typing.Optional[ToolsToolType] Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) @@ -2807,9 +2830,6 @@ def tool_route_patch( background : typing.Optional[bool] The tool should be run in the background (not supported at the moment) - interactive : typing.Optional[bool] - Whether the tool that can be run interactively (response should contain "stop" boolean field) - function : typing.Optional[ToolsFunctionDefUpdate] integration : typing.Optional[typing.Any] @@ -2823,7 +2843,7 @@ def tool_route_patch( Returns ------- - ToolRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -2844,7 +2864,6 @@ def tool_route_patch( json={ "type": type, "background": background, - "interactive": interactive, "function": function, "integration": integration, "system": system, @@ -2855,7 +2874,7 @@ def tool_route_patch( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -2872,15 +2891,15 @@ def users_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteListResponse: """ - List undefined items + List users (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : UsersRouteListRequestSortBy Sort by a field @@ -2943,9 +2962,9 @@ def users_route_create( docs: typing.Sequence[typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new user Parameters ---------- @@ -2965,7 +2984,7 @@ def users_route_create( Returns ------- - UsersRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -2991,7 +3010,7 @@ def users_route_create( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3005,9 +3024,9 @@ def users_route_create_or_update( about: str, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update a user Parameters ---------- @@ -3026,7 +3045,7 @@ def users_route_create_or_update( Returns ------- - UsersRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -3052,7 +3071,7 @@ def users_route_create_or_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3062,12 +3081,12 @@ def users_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> UsersUser: """ - Get undefined by id + Get a user by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3110,14 +3129,14 @@ def users_route_update( about: str, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing user by id (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource name : CommonIdentifierSafeUnicode Name of the user @@ -3132,7 +3151,7 @@ def users_route_update( Returns ------- - UsersRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -3158,7 +3177,7 @@ def users_route_update( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3166,21 +3185,21 @@ def users_route_update( def users_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> UsersRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete a user by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - UsersRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -3202,7 +3221,7 @@ def users_route_delete( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3216,14 +3235,14 @@ def users_route_patch( name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, about: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing user by id (merge with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -3238,7 +3257,7 @@ def users_route_patch( Returns ------- - UsersRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -3262,7 +3281,7 @@ def users_route_patch( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3280,18 +3299,18 @@ def user_docs_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsRouteListResponse: """ - List undefined items of parent undefined + List Docs owned by a User Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : UserDocsRouteListRequestSortBy Sort by a field @@ -3360,18 +3379,18 @@ def user_docs_search_route_search( request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsSearchRouteSearchResponse: """ - Search for documents owned by undefined + Search Docs owned by a User Parameters ---------- id : CommonUuid - ID of the undefined + ID of the parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : UserDocsSearchRouteSearchRequestSortBy Sort by a field @@ -3523,15 +3542,15 @@ async def agents_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> AgentsRouteListResponse: """ - List undefined items + List Agents (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentsRouteListRequestSortBy Sort by a field @@ -3607,9 +3626,9 @@ async def agents_route_create( AgentsCreateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new Agent Parameters ---------- @@ -3638,7 +3657,7 @@ async def agents_route_create( Returns ------- - AgentsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -3682,7 +3701,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3701,9 +3720,9 @@ async def agents_route_create_or_update( AgentsCreateOrUpdateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update an Agent Parameters ---------- @@ -3731,7 +3750,7 @@ async def agents_route_create_or_update( Returns ------- - AgentsRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -3775,7 +3794,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3785,12 +3804,12 @@ async def agents_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> AgentsAgent: """ - Get undefined by id + Get an Agent by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3846,14 +3865,14 @@ async def agents_route_update( AgentsUpdateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource name : CommonIdentifierSafeUnicode Name of the agent @@ -3877,7 +3896,7 @@ async def agents_route_update( Returns ------- - AgentsRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -3920,7 +3939,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3928,21 +3947,21 @@ async def main() -> None: async def agents_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> AgentsRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete Agent by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -3972,7 +3991,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3991,14 +4010,14 @@ async def agents_route_patch( AgentsPatchAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing Agent by id (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -4022,7 +4041,7 @@ async def agents_route_patch( Returns ------- - AgentsRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -4061,7 +4080,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4079,18 +4098,18 @@ async def agent_docs_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> AgentDocsRouteListResponse: """ - List undefined items of parent undefined + List Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentDocsRouteListRequestSortBy Sort by a field @@ -4167,18 +4186,18 @@ async def agents_docs_search_route_search( request_options: typing.Optional[RequestOptions] = None, ) -> AgentsDocsSearchRouteSearchResponse: """ - Search for documents owned by undefined + Search Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of the undefined + ID of the parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentsDocsSearchRouteSearchRequestSortBy Sort by a field @@ -4267,18 +4286,18 @@ async def agent_tools_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> AgentToolsRouteListResponse: """ - List undefined items of parent undefined + List tools of the given agent Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : AgentToolsRouteListRequestSortBy Sort by a field @@ -4356,14 +4375,14 @@ async def agent_tools_route_create( AgentsCreateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentToolsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new tool for this agent Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent resource name : CommonIdentifierSafeUnicode Name of the agent @@ -4390,7 +4409,7 @@ async def agent_tools_route_create( Returns ------- - AgentToolsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -4435,7 +4454,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentToolsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4445,12 +4464,12 @@ async def individual_docs_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> DocsDoc: """ - Get undefined by id + Get Doc by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4495,21 +4514,21 @@ async def main() -> None: async def individual_docs_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> IndividualDocsRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete an existing Doc by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - IndividualDocsRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -4539,7 +4558,66 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(IndividualDocsRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def embed_route_embed( + self, + *, + body: DocsEmbedQueryRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> DocsEmbedQueryResponse: + """ + Embed a query for search + + Parameters + ---------- + body : DocsEmbedQueryRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DocsEmbedQueryResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import DocsEmbedQueryRequest + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "embed", + method="POST", + json={"body": body}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4549,12 +4627,12 @@ async def executions_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> ExecutionsExecution: """ - Get undefined by id + Get an Execution by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4603,14 +4681,14 @@ async def executions_route_update( *, request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionsRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing Execution Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request : ExecutionsUpdateExecutionRequest @@ -4619,7 +4697,7 @@ async def executions_route_update( Returns ------- - ExecutionsRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -4655,7 +4733,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4673,18 +4751,18 @@ async def execution_transitions_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> ExecutionTransitionsRouteListResponse: """ - List undefined items of parent undefined + List the Transitions of an Execution by id Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : ExecutionTransitionsRouteListRequestSortBy Sort by a field @@ -4752,12 +4830,12 @@ async def job_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> JobsJobStatus: """ - Get undefined by id + Get the status of an existing Job by its id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4811,15 +4889,15 @@ async def sessions_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> SessionsRouteListResponse: """ - List undefined items + List sessions (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : SessionsRouteListRequestSortBy Sort by a field @@ -4892,12 +4970,12 @@ async def sessions_route_create( agent: typing.Optional[CommonUuid] = OMIT, agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new session Parameters ---------- @@ -4920,7 +4998,7 @@ async def sessions_route_create( token_budget : typing.Optional[int] Threshold value for the adaptive context functionality - context_overflow : typing.Optional[str] + context_overflow : typing.Optional[SessionsContextOverflowType] Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -4930,7 +5008,7 @@ async def sessions_route_create( Returns ------- - SessionsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -4973,7 +5051,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4990,12 +5068,12 @@ async def sessions_route_create_or_update( agent: typing.Optional[CommonUuid] = OMIT, agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update a session Parameters ---------- @@ -5020,7 +5098,7 @@ async def sessions_route_create_or_update( token_budget : typing.Optional[int] Threshold value for the adaptive context functionality - context_overflow : typing.Optional[str] + context_overflow : typing.Optional[SessionsContextOverflowType] Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -5030,7 +5108,7 @@ async def sessions_route_create_or_update( Returns ------- - SessionsRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -5075,52 +5153,29 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + async def sessions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsSession: """ - List undefined items of parent undefined + Get a session by id Parameters ---------- id : CommonUuid - ID of parent undefined - - limit : CommonLimit - Limit the number of undefined items returned - - offset : CommonOffset - Offset the undefined items returned - - sort_by : HistoryRouteListRequestSortBy - Sort by a field - - direction : HistoryRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteListResponse + SessionsSession The request has succeeded. Examples @@ -5136,56 +5191,66 @@ async def history_route_list( async def main() -> None: - await client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + await client.sessions_route_get( + id="string", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/history/{jsonable_encoder(id)}", + f"sessions/{jsonable_encoder(id)}", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> HistoryRouteDeleteResponse: + async def sessions_route_update( + self, + id: CommonUuid, + *, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: """ - Delete undefined by id + Update an existing session by its id (overwrites all existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource + + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteDeleteResponse - The request has been accepted for processing, but processing has not yet completed. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- @@ -5200,44 +5265,54 @@ async def history_route_delete( async def main() -> None: - await client.history_route_delete( + await client.sessions_route_update( id="id", + situation="situation", + render_templates=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/history/{jsonable_encoder(id)}", - method="DELETE", + f"sessions/{jsonable_encoder(id)}", + method="PUT", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_get( + async def sessions_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsSession: + ) -> CommonResourceDeletedResponse: """ - Get undefined by id + Delete a session by its id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsSession - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -5252,8 +5327,8 @@ async def sessions_route_get( async def main() -> None: - await client.sessions_route_get( - id="string", + await client.sessions_route_delete( + id="id", ) @@ -5261,46 +5336,46 @@ async def main() -> None: """ _response = await self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}", - method="GET", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_update( + async def sessions_route_patch( self, id: CommonUuid, *, - situation: str, - render_templates: bool, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing session by its id (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource - situation : str + situation : typing.Optional[str] A specific situation that sets the background for this session - render_templates : bool + render_templates : typing.Optional[bool] Render system and assistant message content as jinja templates token_budget : typing.Optional[int] Threshold value for the adaptive context functionality - context_overflow : typing.Optional[str] + context_overflow : typing.Optional[SessionsContextOverflowType] Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -5310,7 +5385,7 @@ async def sessions_route_update( Returns ------- - SessionsRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -5326,10 +5401,8 @@ async def sessions_route_update( async def main() -> None: - await client.sessions_route_update( + await client.sessions_route_patch( id="id", - situation="situation", - render_templates=True, ) @@ -5337,7 +5410,7 @@ async def main() -> None: """ _response = await self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}", - method="PUT", + method="PATCH", json={ "situation": situation, "render_templates": render_templates, @@ -5350,30 +5423,53 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsRouteDeleteResponse: + async def history_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> HistoryRouteListResponse: """ - Delete undefined by id + Get history of a Session (paginated) Parameters ---------- id : CommonUuid - ID of the undefined + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : HistoryRouteListRequestSortBy + Sort by a field + + direction : HistoryRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsRouteDeleteResponse - The request has been accepted for processing, but processing has not yet completed. + HistoryRouteListResponse + The request has succeeded. Examples -------- @@ -5388,66 +5484,56 @@ async def sessions_route_delete( async def main() -> None: - await client.sessions_route_delete( + await client.history_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="DELETE", + f"sessions/{jsonable_encoder(id)}/history", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_patch( - self, - id: CommonUuid, - *, - situation: typing.Optional[str] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[str] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRoutePatchResponse: + async def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Patch undefined by id (merge changes) + Clear the history of a Session (resets the Session) Parameters ---------- id : CommonUuid - ID of the undefined - - situation : typing.Optional[str] - A specific situation that sets the background for this session - - render_templates : typing.Optional[bool] - Render system and assistant message content as jinja templates - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[str] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsRoutePatchResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -5462,7 +5548,7 @@ async def sessions_route_patch( async def main() -> None: - await client.sessions_route_patch( + await client.history_route_delete( id="id", ) @@ -5470,21 +5556,13 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PATCH", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, + f"sessions/{jsonable_encoder(id)}/history", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5501,15 +5579,15 @@ async def tasks_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> TasksRouteListResponse: """ - List undefined items + List tasks (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : TasksRouteListRequestSortBy Sort by a field @@ -5581,10 +5659,11 @@ async def tasks_route_create( tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new task Parameters ---------- @@ -5604,12 +5683,14 @@ async def tasks_route_create( input_schema : typing.Optional[typing.Dict[str, typing.Any]] The schema for the input to the task. `null` means all inputs are valid. + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -5634,7 +5715,6 @@ async def main() -> None: ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -5653,13 +5733,14 @@ async def main() -> None: "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5675,10 +5756,11 @@ async def tasks_route_create_or_update( tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update a task Parameters ---------- @@ -5700,12 +5782,14 @@ async def tasks_route_create_or_update( input_schema : typing.Optional[typing.Dict[str, typing.Any]] The schema for the input to the task. `null` means all inputs are valid. + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -5731,7 +5815,6 @@ async def main() -> None: ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -5751,13 +5834,14 @@ async def main() -> None: "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5772,15 +5856,16 @@ async def tasks_route_update( tools: typing.Sequence[ToolsCreateToolRequest], inherit_tools: bool, input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing task (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource description : str @@ -5796,12 +5881,14 @@ async def tasks_route_update( input_schema : typing.Optional[typing.Dict[str, typing.Any]] The schema for the input to the task. `null` means all inputs are valid. + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -5826,7 +5913,6 @@ async def main() -> None: ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -5844,13 +5930,14 @@ async def main() -> None: "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5858,21 +5945,21 @@ async def main() -> None: async def tasks_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> TasksRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete a task by its id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -5902,7 +5989,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -5917,15 +6004,16 @@ async def tasks_route_patch( input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, inherit_tools: typing.Optional[bool] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing task (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource description : typing.Optional[str] @@ -5941,12 +6029,14 @@ async def tasks_route_patch( inherit_tools : typing.Optional[bool] Whether to inherit tools from the parent agent or not. Defaults to true. + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -5978,13 +6068,14 @@ async def main() -> None: "input_schema": input_schema, "tools": tools, "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6002,18 +6093,18 @@ async def task_executions_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> TaskExecutionsRouteListResponse: """ - List undefined items of parent undefined + List executions of the given task Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : TaskExecutionsRouteListRequestSortBy Sort by a field @@ -6082,25 +6173,28 @@ async def task_executions_route_create( id: CommonUuid, *, input: typing.Dict[str, typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create an execution for the given task Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent resource input : typing.Dict[str, typing.Any] The input to the execution + metadata : typing.Optional[typing.Dict[str, typing.Any]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TaskExecutionsRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -6127,13 +6221,13 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( f"tasks/{jsonable_encoder(id)}/executions", method="POST", - json={"input": input}, + json={"input": input, "metadata": metadata}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6146,7 +6240,7 @@ async def task_executions_route_resume_with_task_token( task_token: str, input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteResumeWithTaskTokenResponse: + ) -> CommonResourceUpdatedResponse: """ Resume an execution with a task token @@ -6166,7 +6260,7 @@ async def task_executions_route_resume_with_task_token( Returns ------- - TaskExecutionsRouteResumeWithTaskTokenResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6199,7 +6293,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteResumeWithTaskTokenResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6211,20 +6305,19 @@ async def tool_route_update( *, type: ToolsToolType, background: bool, - interactive: bool, function: typing.Optional[ToolsFunctionDef] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ToolRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing tool (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource type : ToolsToolType Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) @@ -6232,9 +6325,6 @@ async def tool_route_update( background : bool The tool should be run in the background (not supported at the moment) - interactive : bool - Whether the tool that can be run interactively (response should contain "stop" boolean field) - function : typing.Optional[ToolsFunctionDef] integration : typing.Optional[typing.Any] @@ -6248,7 +6338,7 @@ async def tool_route_update( Returns ------- - ToolRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6268,7 +6358,6 @@ async def main() -> None: id="id", type="function", background=True, - interactive=True, ) @@ -6280,7 +6369,6 @@ async def main() -> None: json={ "type": type, "background": background, - "interactive": interactive, "function": function, "integration": integration, "system": system, @@ -6291,7 +6379,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ToolRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6299,21 +6387,21 @@ async def main() -> None: async def tool_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ToolRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete an existing tool by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ToolRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -6343,7 +6431,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ToolRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6355,20 +6443,19 @@ async def tool_route_patch( *, type: typing.Optional[ToolsToolType] = OMIT, background: typing.Optional[bool] = OMIT, - interactive: typing.Optional[bool] = OMIT, function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ToolRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing tool (merges with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource type : typing.Optional[ToolsToolType] Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) @@ -6376,9 +6463,6 @@ async def tool_route_patch( background : typing.Optional[bool] The tool should be run in the background (not supported at the moment) - interactive : typing.Optional[bool] - Whether the tool that can be run interactively (response should contain "stop" boolean field) - function : typing.Optional[ToolsFunctionDefUpdate] integration : typing.Optional[typing.Any] @@ -6392,7 +6476,7 @@ async def tool_route_patch( Returns ------- - ToolRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6421,7 +6505,6 @@ async def main() -> None: json={ "type": type, "background": background, - "interactive": interactive, "function": function, "integration": integration, "system": system, @@ -6432,7 +6515,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ToolRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6449,15 +6532,15 @@ async def users_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> UsersRouteListResponse: """ - List undefined items + List users (paginated) Parameters ---------- limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : UsersRouteListRequestSortBy Sort by a field @@ -6528,9 +6611,9 @@ async def users_route_create( docs: typing.Sequence[typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteCreateResponse: + ) -> CommonResourceCreatedResponse: """ - Create new undefined + Create a new user Parameters ---------- @@ -6550,7 +6633,7 @@ async def users_route_create( Returns ------- - UsersRouteCreateResponse + CommonResourceCreatedResponse The request has succeeded and a new resource has been created as a result. Examples @@ -6584,7 +6667,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteCreateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6598,9 +6681,9 @@ async def users_route_create_or_update( about: str, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteCreateOrUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Create or update undefined (ID is required in payload; existing resource will be overwritten) + Create or update a user Parameters ---------- @@ -6619,7 +6702,7 @@ async def users_route_create_or_update( Returns ------- - UsersRouteCreateOrUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6653,7 +6736,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteCreateOrUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6663,12 +6746,12 @@ async def users_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> UsersUser: """ - Get undefined by id + Get a user by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6719,14 +6802,14 @@ async def users_route_update( about: str, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteUpdateResponse: + ) -> CommonResourceUpdatedResponse: """ - Update undefined by id (overwrite) + Update an existing user by id (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource name : CommonIdentifierSafeUnicode Name of the user @@ -6741,7 +6824,7 @@ async def users_route_update( Returns ------- - UsersRouteUpdateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6775,7 +6858,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteUpdateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6783,21 +6866,21 @@ async def main() -> None: async def users_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> UsersRouteDeleteResponse: + ) -> CommonResourceDeletedResponse: """ - Delete undefined by id + Delete a user by id Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - UsersRouteDeleteResponse + CommonResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. Examples @@ -6827,7 +6910,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteDeleteResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6841,14 +6924,14 @@ async def users_route_patch( name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, about: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRoutePatchResponse: + ) -> CommonResourceUpdatedResponse: """ - Patch undefined by id (merge changes) + Update an existing user by id (merge with existing values) Parameters ---------- id : CommonUuid - ID of the undefined + ID of the resource metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -6863,7 +6946,7 @@ async def users_route_patch( Returns ------- - UsersRoutePatchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6895,7 +6978,7 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRoutePatchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6913,18 +6996,18 @@ async def user_docs_route_list( request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsRouteListResponse: """ - List undefined items of parent undefined + List Docs owned by a User Parameters ---------- id : CommonUuid - ID of parent undefined + ID of parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : UserDocsRouteListRequestSortBy Sort by a field @@ -7001,18 +7084,18 @@ async def user_docs_search_route_search( request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsSearchRouteSearchResponse: """ - Search for documents owned by undefined + Search Docs owned by a User Parameters ---------- id : CommonUuid - ID of the undefined + ID of the parent limit : CommonLimit - Limit the number of undefined items returned + Limit the number of items returned offset : CommonOffset - Offset the undefined items returned + Offset the items returned sort_by : UserDocsSearchRouteSearchRequestSortBy Sort by a field diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index dafee3783..346cc49dd 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -11,7 +11,7 @@
-List undefined items +List Agents (paginated)
@@ -54,7 +54,7 @@ client.agents_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -62,7 +62,7 @@ client.agents_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -118,7 +118,7 @@ client.agents_route_list(
-Create new undefined +Create a new Agent
@@ -241,7 +241,7 @@ client.agents_route_create(
-Create or update undefined (ID is required in payload; existing resource will be overwritten) +Create or update an Agent
@@ -364,7 +364,7 @@ client.agents_route_create_or_update(
-Get undefined by id +Get an Agent by id
@@ -403,7 +403,7 @@ client.agents_route_get(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -435,7 +435,7 @@ client.agents_route_get(
-Update undefined by id (overwrite) +Update an existing Agent by id (overwrites existing values; use PATCH for merging instead)
@@ -478,7 +478,7 @@ client.agents_route_update(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -558,7 +558,7 @@ client.agents_route_update(
-Delete undefined by id +Delete Agent by id
@@ -597,7 +597,7 @@ client.agents_route_delete(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -629,7 +629,7 @@ client.agents_route_delete(
-Patch undefined by id (merge changes) +Update an existing Agent by id (merges with existing values)
@@ -668,7 +668,7 @@ client.agents_route_patch(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -748,7 +748,7 @@ client.agents_route_patch(
-List undefined items of parent undefined +List Docs owned by an Agent
@@ -792,7 +792,7 @@ client.agent_docs_route_list(
-**id:** `CommonUuid` — ID of parent undefined +**id:** `CommonUuid` — ID of parent
@@ -800,7 +800,7 @@ client.agent_docs_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -808,7 +808,7 @@ client.agent_docs_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -864,7 +864,7 @@ client.agent_docs_route_list(
-Search for documents owned by undefined +Search Docs owned by an Agent
@@ -917,7 +917,7 @@ client.agents_docs_search_route_search(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the parent
@@ -925,7 +925,7 @@ client.agents_docs_search_route_search(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -933,7 +933,7 @@ client.agents_docs_search_route_search(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -997,7 +997,7 @@ client.agents_docs_search_route_search(
-List undefined items of parent undefined +List tools of the given agent
@@ -1041,7 +1041,7 @@ client.agent_tools_route_list(
-**id:** `CommonUuid` — ID of parent undefined +**id:** `CommonUuid` — ID of parent
@@ -1049,7 +1049,7 @@ client.agent_tools_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -1057,7 +1057,7 @@ client.agent_tools_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -1113,7 +1113,7 @@ client.agent_tools_route_list(
-Create new undefined +Create a new tool for this agent
@@ -1157,7 +1157,7 @@ client.agent_tools_route_create(
-**id:** `CommonUuid` — ID of parent undefined +**id:** `CommonUuid` — ID of parent resource
@@ -1245,7 +1245,7 @@ client.agent_tools_route_create(
-Get undefined by id +Get Doc by id
@@ -1284,7 +1284,7 @@ client.individual_docs_route_get(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -1316,7 +1316,7 @@ client.individual_docs_route_get(
-Delete undefined by id +Delete an existing Doc by id
@@ -1355,7 +1355,81 @@ client.individual_docs_route_delete(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ + + + + + + + +
client.embed_route_embed(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Embed a query for search +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import DocsEmbedQueryRequest +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**body:** `DocsEmbedQueryRequest`
@@ -1387,7 +1461,7 @@ client.individual_docs_route_delete(
-Get undefined by id +Get an Execution by id
@@ -1426,7 +1500,7 @@ client.executions_route_get(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -1458,7 +1532,7 @@ client.executions_route_get(
-Update undefined by id (overwrite) +Update an existing Execution
@@ -1501,7 +1575,7 @@ client.executions_route_update(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -1541,7 +1615,7 @@ client.executions_route_update(
-List undefined items of parent undefined +List the Transitions of an Execution by id
@@ -1585,7 +1659,7 @@ client.execution_transitions_route_list(
-**id:** `CommonUuid` — ID of parent undefined +**id:** `CommonUuid` — ID of parent
@@ -1593,7 +1667,7 @@ client.execution_transitions_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -1601,7 +1675,7 @@ client.execution_transitions_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -1657,7 +1731,7 @@ client.execution_transitions_route_list(
-Get undefined by id +Get the status of an existing Job by its id
@@ -1696,7 +1770,7 @@ client.job_route_get(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -1728,7 +1802,7 @@ client.job_route_get(
-List undefined items +List sessions (paginated)
@@ -1771,7 +1845,7 @@ client.sessions_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -1779,7 +1853,7 @@ client.sessions_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -1835,7 +1909,7 @@ client.sessions_route_list(
-Create new undefined +Create a new session
@@ -1931,7 +2005,7 @@ client.sessions_route_create(
-**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow
@@ -1971,7 +2045,7 @@ client.sessions_route_create(
-Create or update undefined (ID is required in payload; existing resource will be overwritten) +Create or update a session
@@ -2076,7 +2150,7 @@ client.sessions_route_create_or_update(
-**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow
@@ -2104,7 +2178,7 @@ client.sessions_route_create_or_update(
-
client.history_route_list(...) +
client.sessions_route_get(...)
@@ -2116,7 +2190,7 @@ client.sessions_route_create_or_update(
-List undefined items of parent undefined +Get a session by id
@@ -2137,13 +2211,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", +client.sessions_route_get( + id="string", ) ``` @@ -2160,47 +2229,7 @@ client.history_route_list(
-**id:** `CommonUuid` — ID of parent undefined - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of undefined items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the undefined items returned - -
-
- -
-
- -**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `HistoryRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**id:** `CommonUuid` — ID of the resource
@@ -2220,7 +2249,7 @@ client.history_route_list(
-
client.history_route_delete(...) +
client.sessions_route_update(...)
@@ -2232,7 +2261,7 @@ client.history_route_list(
-Delete undefined by id +Update an existing session by its id (overwrites all existing values)
@@ -2253,8 +2282,10 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.history_route_delete( +client.sessions_route_update( id="id", + situation="situation", + render_templates=True, ) ``` @@ -2271,7 +2302,47 @@ client.history_route_delete(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**situation:** `str` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `bool` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -2291,7 +2362,7 @@ client.history_route_delete(
-
client.sessions_route_get(...) +
client.sessions_route_delete(...)
@@ -2303,7 +2374,7 @@ client.history_route_delete(
-Get undefined by id +Delete a session by its id
@@ -2324,8 +2395,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_get( - id="string", +client.sessions_route_delete( + id="id", ) ``` @@ -2342,7 +2413,7 @@ client.sessions_route_get(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -2362,7 +2433,7 @@ client.sessions_route_get(
-
client.sessions_route_update(...) +
client.sessions_route_patch(...)
@@ -2374,7 +2445,7 @@ client.sessions_route_get(
-Update undefined by id (overwrite) +Update an existing session by its id (merges with existing values)
@@ -2395,10 +2466,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_update( +client.sessions_route_patch( id="id", - situation="situation", - render_templates=True, ) ``` @@ -2415,7 +2484,7 @@ client.sessions_route_update(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -2423,7 +2492,7 @@ client.sessions_route_update(
-**situation:** `str` — A specific situation that sets the background for this session +**situation:** `typing.Optional[str]` — A specific situation that sets the background for this session
@@ -2431,7 +2500,7 @@ client.sessions_route_update(
-**render_templates:** `bool` — Render system and assistant message content as jinja templates +**render_templates:** `typing.Optional[bool]` — Render system and assistant message content as jinja templates
@@ -2447,7 +2516,7 @@ client.sessions_route_update(
-**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow
@@ -2475,7 +2544,7 @@ client.sessions_route_update(
-
client.sessions_route_delete(...) +
client.history_route_list(...)
@@ -2487,7 +2556,7 @@ client.sessions_route_update(
-Delete undefined by id +Get history of a Session (paginated)
@@ -2508,8 +2577,13 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_delete( +client.history_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -2526,7 +2600,47 @@ client.sessions_route_delete(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `HistoryRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -2546,7 +2660,7 @@ client.sessions_route_delete(
-
client.sessions_route_patch(...) +
client.history_route_delete(...)
@@ -2558,7 +2672,7 @@ client.sessions_route_delete(
-Patch undefined by id (merge changes) +Clear the history of a Session (resets the Session)
@@ -2579,7 +2693,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_patch( +client.history_route_delete( id="id", ) @@ -2597,47 +2711,7 @@ client.sessions_route_patch(
-**id:** `CommonUuid` — ID of the undefined - -
-
- -
-
- -**situation:** `typing.Optional[str]` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `typing.Optional[bool]` — Render system and assistant message content as jinja templates - -
-
- -
-
- -**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality - -
-
- -
-
- -**context_overflow:** `typing.Optional[str]` — Action to start on context window overflow - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**id:** `CommonUuid` — ID of the resource
@@ -2669,7 +2743,7 @@ client.sessions_route_patch(
-List undefined items +List tasks (paginated)
@@ -2712,7 +2786,7 @@ client.tasks_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -2720,7 +2794,7 @@ client.tasks_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -2776,7 +2850,7 @@ client.tasks_route_list(
-Create new undefined +Create a new task
@@ -2806,7 +2880,6 @@ client.tasks_route_create( ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -2874,6 +2947,14 @@ client.tasks_route_create(
+**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -2898,7 +2979,7 @@ client.tasks_route_create(
-Create or update undefined (ID is required in payload; existing resource will be overwritten) +Create or update a task
@@ -2929,7 +3010,6 @@ client.tasks_route_create_or_update( ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -3005,6 +3085,14 @@ client.tasks_route_create_or_update(
+**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -3029,7 +3117,7 @@ client.tasks_route_create_or_update(
-Update undefined by id (overwrite) +Update an existing task (overwrite existing values)
@@ -3059,7 +3147,6 @@ client.tasks_route_update( ToolsCreateToolRequest( type="function", background=True, - interactive=True, ) ], inherit_tools=True, @@ -3079,7 +3166,7 @@ client.tasks_route_update(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -3127,6 +3214,14 @@ client.tasks_route_update(
+**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -3151,7 +3246,7 @@ client.tasks_route_update(
-Delete undefined by id +Delete a task by its id
@@ -3190,7 +3285,7 @@ client.tasks_route_delete(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -3222,7 +3317,7 @@ client.tasks_route_delete(
-Patch undefined by id (merge changes) +Update an existing task (merges with existing values)
@@ -3261,7 +3356,7 @@ client.tasks_route_patch(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -3309,6 +3404,14 @@ client.tasks_route_patch(
+**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -3333,7 +3436,7 @@ client.tasks_route_patch(
-List undefined items of parent undefined +List executions of the given task
@@ -3377,7 +3480,7 @@ client.task_executions_route_list(
-**id:** `CommonUuid` — ID of parent undefined +**id:** `CommonUuid` — ID of parent
@@ -3385,7 +3488,7 @@ client.task_executions_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -3393,7 +3496,7 @@ client.task_executions_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -3449,7 +3552,7 @@ client.task_executions_route_list(
-Create new undefined +Create an execution for the given task
@@ -3489,7 +3592,7 @@ client.task_executions_route_create(
-**id:** `CommonUuid` — ID of parent undefined +**id:** `CommonUuid` — ID of parent resource
@@ -3505,6 +3608,14 @@ client.task_executions_route_create(
+**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -3617,7 +3728,7 @@ client.task_executions_route_resume_with_task_token(
-Update undefined by id (overwrite) +Update an existing tool (overwrite existing values)
@@ -3642,7 +3753,6 @@ client.tool_route_update( id="id", type="function", background=True, - interactive=True, ) ``` @@ -3659,7 +3769,7 @@ client.tool_route_update(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -3683,14 +3793,6 @@ client.tool_route_update(
-**interactive:** `bool` — Whether the tool that can be run interactively (response should contain "stop" boolean field) - -
-
- -
-
- **function:** `typing.Optional[ToolsFunctionDef]`
@@ -3747,7 +3849,7 @@ client.tool_route_update(
-Delete undefined by id +Delete an existing tool by id
@@ -3786,7 +3888,7 @@ client.tool_route_delete(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -3818,7 +3920,7 @@ client.tool_route_delete(
-Patch undefined by id (merge changes) +Update an existing tool (merges with existing values)
@@ -3857,7 +3959,7 @@ client.tool_route_patch(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -3881,14 +3983,6 @@ client.tool_route_patch(
-**interactive:** `typing.Optional[bool]` — Whether the tool that can be run interactively (response should contain "stop" boolean field) - -
-
- -
-
- **function:** `typing.Optional[ToolsFunctionDefUpdate]`
@@ -3945,7 +4039,7 @@ client.tool_route_patch(
-List undefined items +List users (paginated)
@@ -3988,7 +4082,7 @@ client.users_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -3996,7 +4090,7 @@ client.users_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -4052,7 +4146,7 @@ client.users_route_list(
-Create new undefined +Create a new user
@@ -4149,7 +4243,7 @@ client.users_route_create(
-Create or update undefined (ID is required in payload; existing resource will be overwritten) +Create or update a user
@@ -4246,7 +4340,7 @@ client.users_route_create_or_update(
-Get undefined by id +Get a user by id
@@ -4285,7 +4379,7 @@ client.users_route_get(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -4317,7 +4411,7 @@ client.users_route_get(
-Update undefined by id (overwrite) +Update an existing user by id (overwrite existing values)
@@ -4358,7 +4452,7 @@ client.users_route_update(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -4414,7 +4508,7 @@ client.users_route_update(
-Delete undefined by id +Delete a user by id
@@ -4453,7 +4547,7 @@ client.users_route_delete(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -4485,7 +4579,7 @@ client.users_route_delete(
-Patch undefined by id (merge changes) +Update an existing user by id (merge with existing values)
@@ -4524,7 +4618,7 @@ client.users_route_patch(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the resource
@@ -4580,7 +4674,7 @@ client.users_route_patch(
-List undefined items of parent undefined +List Docs owned by a User
@@ -4624,7 +4718,7 @@ client.user_docs_route_list(
-**id:** `CommonUuid` — ID of parent undefined +**id:** `CommonUuid` — ID of parent
@@ -4632,7 +4726,7 @@ client.user_docs_route_list(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -4640,7 +4734,7 @@ client.user_docs_route_list(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
@@ -4696,7 +4790,7 @@ client.user_docs_route_list(
-Search for documents owned by undefined +Search Docs owned by a User
@@ -4749,7 +4843,7 @@ client.user_docs_search_route_search(
-**id:** `CommonUuid` — ID of the undefined +**id:** `CommonUuid` — ID of the parent
@@ -4757,7 +4851,7 @@ client.user_docs_search_route_search(
-**limit:** `CommonLimit` — Limit the number of undefined items returned +**limit:** `CommonLimit` — Limit the number of items returned
@@ -4765,7 +4859,7 @@ client.user_docs_search_route_search(
-**offset:** `CommonOffset` — Offset the undefined items returned +**offset:** `CommonOffset` — Offset the items returned
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 28c974209..b569db7c8 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from .agent import Agent +from .agent_default_settings import AgentDefaultSettings from .agent_docs_route_list_request_direction import AgentDocsRouteListRequestDirection from .agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy from .agent_docs_route_list_response import AgentDocsRouteListResponse -from .agent_tools_route_create_response import AgentToolsRouteCreateResponse +from .agent_instructions import AgentInstructions from .agent_tools_route_list_request_direction import ( AgentToolsRouteListRequestDirection, ) @@ -38,14 +40,9 @@ AgentsPatchAgentRequestDefaultSettings, ) from .agents_patch_agent_request_instructions import AgentsPatchAgentRequestInstructions -from .agents_route_create_or_update_response import AgentsRouteCreateOrUpdateResponse -from .agents_route_create_response import AgentsRouteCreateResponse -from .agents_route_delete_response import AgentsRouteDeleteResponse from .agents_route_list_request_direction import AgentsRouteListRequestDirection from .agents_route_list_request_sort_by import AgentsRouteListRequestSortBy from .agents_route_list_response import AgentsRouteListResponse -from .agents_route_patch_response import AgentsRoutePatchResponse -from .agents_route_update_response import AgentsRouteUpdateResponse from .agents_update_agent_request_default_settings import ( AgentsUpdateAgentRequestDefaultSettings, ) @@ -62,9 +59,15 @@ from .common_limit import CommonLimit from .common_logit_bias import CommonLogitBias from .common_offset import CommonOffset +from .common_py_expression import CommonPyExpression +from .common_resource_created_response import CommonResourceCreatedResponse +from .common_resource_deleted_response import CommonResourceDeletedResponse +from .common_resource_updated_response import CommonResourceUpdatedResponse from .common_tool_ref import CommonToolRef from .common_uuid import CommonUuid from .common_valid_python_identifier import CommonValidPythonIdentifier +from .doc import Doc +from .doc_content import DocContent from .docs_doc import DocsDoc from .docs_doc_content import DocsDocContent from .docs_doc_owner import DocsDocOwner @@ -78,6 +81,9 @@ ) from .docs_doc_search_request_text import DocsDocSearchRequestText from .docs_doc_search_request_vector import DocsDocSearchRequestVector +from .docs_embed_query_request import DocsEmbedQueryRequest +from .docs_embed_query_request_text import DocsEmbedQueryRequestText +from .docs_embed_query_response import DocsEmbedQueryResponse from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector @@ -112,6 +118,17 @@ EntriesInputChatMlMessageContentItem_Text, ) from .entries_relation import EntriesRelation +from .entry import Entry +from .entry_content import EntryContent +from .entry_content_item import EntryContentItem +from .entry_content_item_item import ( + EntryContentItemItem, + EntryContentItemItem_ImageUrl, + EntryContentItemItem_Text, +) +from .entry_source import EntrySource +from .execution import Execution +from .execution_status import ExecutionStatus from .execution_transitions_route_list_request_direction import ( ExecutionTransitionsRouteListRequestDirection, ) @@ -127,7 +144,6 @@ from .executions_execution import ExecutionsExecution from .executions_execution_status import ExecutionsExecutionStatus from .executions_resume_execution_request import ExecutionsResumeExecutionRequest -from .executions_route_update_response import ExecutionsRouteUpdateResponse from .executions_stop_execution_request import ExecutionsStopExecutionRequest from .executions_transition import ExecutionsTransition from .executions_transition_type import ExecutionsTransitionType @@ -136,28 +152,23 @@ ExecutionsUpdateExecutionRequest_Cancelled, ExecutionsUpdateExecutionRequest_Running, ) -from .history_route_delete_response import HistoryRouteDeleteResponse +from .history import History from .history_route_list_request_direction import HistoryRouteListRequestDirection from .history_route_list_request_sort_by import HistoryRouteListRequestSortBy from .history_route_list_response import HistoryRouteListResponse -from .individual_docs_route_delete_response import IndividualDocsRouteDeleteResponse +from .job_status import JobStatus from .jobs_job_state import JobsJobState from .jobs_job_status import JobsJobStatus +from .session import Session +from .sessions_context_overflow_type import SessionsContextOverflowType from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession from .sessions_multi_agent_single_user_session import ( SessionsMultiAgentSingleUserSession, ) -from .sessions_route_create_or_update_response import ( - SessionsRouteCreateOrUpdateResponse, -) -from .sessions_route_create_response import SessionsRouteCreateResponse -from .sessions_route_delete_response import SessionsRouteDeleteResponse from .sessions_route_list_request_direction import SessionsRouteListRequestDirection from .sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy from .sessions_route_list_response import SessionsRouteListResponse -from .sessions_route_patch_response import SessionsRoutePatchResponse -from .sessions_route_update_response import SessionsRouteUpdateResponse from .sessions_session import ( SessionsSession, SessionsSession_MultiAgentMultiUser, @@ -174,7 +185,7 @@ from .sessions_single_agent_single_user_session import ( SessionsSingleAgentSingleUserSession, ) -from .task_executions_route_create_response import TaskExecutionsRouteCreateResponse +from .task import Task from .task_executions_route_list_request_direction import ( TaskExecutionsRouteListRequestDirection, ) @@ -182,31 +193,20 @@ TaskExecutionsRouteListRequestSortBy, ) from .task_executions_route_list_response import TaskExecutionsRouteListResponse -from .task_executions_route_resume_with_task_token_response import ( - TaskExecutionsRouteResumeWithTaskTokenResponse, -) -from .tasks_cel import TasksCel from .tasks_error_workflow_step import TasksErrorWorkflowStep from .tasks_evaluate_step import TasksEvaluateStep from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep from .tasks_prompt_step import TasksPromptStep from .tasks_prompt_step_prompt import TasksPromptStepPrompt from .tasks_prompt_step_settings import TasksPromptStepSettings +from .tasks_prompt_step_settings_agent import TasksPromptStepSettingsAgent from .tasks_prompt_step_settings_frequency_penalty import ( TasksPromptStepSettingsFrequencyPenalty, ) -from .tasks_prompt_step_settings_length_penalty import ( - TasksPromptStepSettingsLengthPenalty, -) from .tasks_prompt_step_settings_preset import TasksPromptStepSettingsPreset -from .tasks_route_create_or_update_response import TasksRouteCreateOrUpdateResponse -from .tasks_route_create_response import TasksRouteCreateResponse -from .tasks_route_delete_response import TasksRouteDeleteResponse from .tasks_route_list_request_direction import TasksRouteListRequestDirection from .tasks_route_list_request_sort_by import TasksRouteListRequestSortBy from .tasks_route_list_response import TasksRouteListResponse -from .tasks_route_patch_response import TasksRoutePatchResponse -from .tasks_route_update_response import TasksRouteUpdateResponse from .tasks_task import TasksTask from .tasks_tool_call_step import TasksToolCallStep from .tasks_workflow_step import ( @@ -219,9 +219,7 @@ TasksWorkflowStep_Yield, ) from .tasks_yield_step import TasksYieldStep -from .tool_route_delete_response import ToolRouteDeleteResponse -from .tool_route_patch_response import ToolRoutePatchResponse -from .tool_route_update_response import ToolRouteUpdateResponse +from .tool import Tool from .tools_chosen_function_call import ToolsChosenFunctionCall from .tools_chosen_tool_call import ToolsChosenToolCall, ToolsChosenToolCall_Function from .tools_create_tool_request import ToolsCreateToolRequest @@ -232,6 +230,9 @@ from .tools_tool import ToolsTool, ToolsTool_Function from .tools_tool_response import ToolsToolResponse from .tools_tool_type import ToolsToolType +from .transition import Transition +from .transition_type import TransitionType +from .user import User from .user_docs_route_list_request_direction import UserDocsRouteListRequestDirection from .user_docs_route_list_request_sort_by import UserDocsRouteListRequestSortBy from .user_docs_route_list_response import UserDocsRouteListResponse @@ -242,21 +243,18 @@ UserDocsSearchRouteSearchRequestSortBy, ) from .user_docs_search_route_search_response import UserDocsSearchRouteSearchResponse -from .users_route_create_or_update_response import UsersRouteCreateOrUpdateResponse -from .users_route_create_response import UsersRouteCreateResponse -from .users_route_delete_response import UsersRouteDeleteResponse from .users_route_list_request_direction import UsersRouteListRequestDirection from .users_route_list_request_sort_by import UsersRouteListRequestSortBy from .users_route_list_response import UsersRouteListResponse -from .users_route_patch_response import UsersRoutePatchResponse -from .users_route_update_response import UsersRouteUpdateResponse from .users_user import UsersUser __all__ = [ + "Agent", + "AgentDefaultSettings", "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", - "AgentToolsRouteCreateResponse", + "AgentInstructions", "AgentToolsRouteListRequestDirection", "AgentToolsRouteListRequestSortBy", "AgentToolsRouteListResponse", @@ -273,14 +271,9 @@ "AgentsDocsSearchRouteSearchResponse", "AgentsPatchAgentRequestDefaultSettings", "AgentsPatchAgentRequestInstructions", - "AgentsRouteCreateOrUpdateResponse", - "AgentsRouteCreateResponse", - "AgentsRouteDeleteResponse", "AgentsRouteListRequestDirection", "AgentsRouteListRequestSortBy", "AgentsRouteListResponse", - "AgentsRoutePatchResponse", - "AgentsRouteUpdateResponse", "AgentsUpdateAgentRequestDefaultSettings", "AgentsUpdateAgentRequestInstructions", "ChatCompletionResponseFormat", @@ -293,9 +286,15 @@ "CommonLimit", "CommonLogitBias", "CommonOffset", + "CommonPyExpression", + "CommonResourceCreatedResponse", + "CommonResourceDeletedResponse", + "CommonResourceUpdatedResponse", "CommonToolRef", "CommonUuid", "CommonValidPythonIdentifier", + "Doc", + "DocContent", "DocsDoc", "DocsDocContent", "DocsDocOwner", @@ -307,6 +306,9 @@ "DocsDocSearchRequest_Hybrid", "DocsDocSearchRequest_Text", "DocsDocSearchRequest_Vector", + "DocsEmbedQueryRequest", + "DocsEmbedQueryRequestText", + "DocsEmbedQueryResponse", "DocsHybridDocSearchRequest", "DocsHybridDocSearchRequestText", "DocsHybridDocSearchRequestVector", @@ -335,6 +337,15 @@ "EntriesInputChatMlMessageContentItem_ImageUrl", "EntriesInputChatMlMessageContentItem_Text", "EntriesRelation", + "Entry", + "EntryContent", + "EntryContentItem", + "EntryContentItemItem", + "EntryContentItemItem_ImageUrl", + "EntryContentItemItem_Text", + "EntrySource", + "Execution", + "ExecutionStatus", "ExecutionTransitionsRouteListRequestDirection", "ExecutionTransitionsRouteListRequestSortBy", "ExecutionTransitionsRouteListResponse", @@ -342,31 +353,27 @@ "ExecutionsExecution", "ExecutionsExecutionStatus", "ExecutionsResumeExecutionRequest", - "ExecutionsRouteUpdateResponse", "ExecutionsStopExecutionRequest", "ExecutionsTransition", "ExecutionsTransitionType", "ExecutionsUpdateExecutionRequest", "ExecutionsUpdateExecutionRequest_Cancelled", "ExecutionsUpdateExecutionRequest_Running", - "HistoryRouteDeleteResponse", + "History", "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", - "IndividualDocsRouteDeleteResponse", + "JobStatus", "JobsJobState", "JobsJobStatus", + "Session", + "SessionsContextOverflowType", "SessionsMultiAgentMultiUserSession", "SessionsMultiAgentNoUserSession", "SessionsMultiAgentSingleUserSession", - "SessionsRouteCreateOrUpdateResponse", - "SessionsRouteCreateResponse", - "SessionsRouteDeleteResponse", "SessionsRouteListRequestDirection", "SessionsRouteListRequestSortBy", "SessionsRouteListResponse", - "SessionsRoutePatchResponse", - "SessionsRouteUpdateResponse", "SessionsSession", "SessionsSession_MultiAgentMultiUser", "SessionsSession_MultiAgentNoUser", @@ -377,29 +384,22 @@ "SessionsSingleAgentMultiUserSession", "SessionsSingleAgentNoUserSession", "SessionsSingleAgentSingleUserSession", - "TaskExecutionsRouteCreateResponse", + "Task", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", - "TaskExecutionsRouteResumeWithTaskTokenResponse", - "TasksCel", "TasksErrorWorkflowStep", "TasksEvaluateStep", "TasksIfElseWorkflowStep", "TasksPromptStep", "TasksPromptStepPrompt", "TasksPromptStepSettings", + "TasksPromptStepSettingsAgent", "TasksPromptStepSettingsFrequencyPenalty", - "TasksPromptStepSettingsLengthPenalty", "TasksPromptStepSettingsPreset", - "TasksRouteCreateOrUpdateResponse", - "TasksRouteCreateResponse", - "TasksRouteDeleteResponse", "TasksRouteListRequestDirection", "TasksRouteListRequestSortBy", "TasksRouteListResponse", - "TasksRoutePatchResponse", - "TasksRouteUpdateResponse", "TasksTask", "TasksToolCallStep", "TasksWorkflowStep", @@ -410,9 +410,7 @@ "TasksWorkflowStep_ToolCall", "TasksWorkflowStep_Yield", "TasksYieldStep", - "ToolRouteDeleteResponse", - "ToolRoutePatchResponse", - "ToolRouteUpdateResponse", + "Tool", "ToolsChosenFunctionCall", "ToolsChosenToolCall", "ToolsChosenToolCall_Function", @@ -425,19 +423,17 @@ "ToolsToolResponse", "ToolsToolType", "ToolsTool_Function", + "Transition", + "TransitionType", + "User", "UserDocsRouteListRequestDirection", "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", "UserDocsSearchRouteSearchRequestDirection", "UserDocsSearchRouteSearchRequestSortBy", "UserDocsSearchRouteSearchResponse", - "UsersRouteCreateOrUpdateResponse", - "UsersRouteCreateResponse", - "UsersRouteDeleteResponse", "UsersRouteListRequestDirection", "UsersRouteListRequestSortBy", "UsersRouteListResponse", - "UsersRoutePatchResponse", - "UsersRouteUpdateResponse", "UsersUser", ] diff --git a/sdks/python/julep/api/types/agent.py b/sdks/python/julep/api/types/agent.py new file mode 100644 index 000000000..b580b8dcd --- /dev/null +++ b/sdks/python/julep/api/types/agent.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .agent_default_settings import AgentDefaultSettings +from .agent_instructions import AgentInstructions +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid + + +class Agent(pydantic_v1.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the agent + """ + + about: str = pydantic_v1.Field() + """ + About the agent + """ + + model: str = pydantic_v1.Field() + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + + instructions: AgentInstructions = pydantic_v1.Field() + """ + Instructions for the agent + """ + + default_settings: typing.Optional[AgentDefaultSettings] = pydantic_v1.Field( + default=None + ) + """ + Default settings for all sessions created by this agent + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agent_default_settings.py b/sdks/python/julep/api/types/agent_default_settings.py new file mode 100644 index 000000000..33145518a --- /dev/null +++ b/sdks/python/julep/api/types/agent_default_settings.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agent_instructions.py b/sdks/python/julep/api/types/agent_instructions.py new file mode 100644 index 000000000..d792498bd --- /dev/null +++ b/sdks/python/julep/api/types/agent_instructions.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_route_delete_response.py b/sdks/python/julep/api/types/agents_route_delete_response.py deleted file mode 100644 index 0efc11c4a..000000000 --- a/sdks/python/julep/api/types/agents_route_delete_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class AgentsRouteDeleteResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of deleted undefined - """ - - deleted_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was deleted as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_route_update_response.py b/sdks/python/julep/api/types/agents_route_update_response.py deleted file mode 100644 index 5ad80c1fc..000000000 --- a/sdks/python/julep/api/types/agents_route_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class AgentsRouteUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_cel.py b/sdks/python/julep/api/types/common_py_expression.py similarity index 72% rename from sdks/python/julep/api/types/tasks_cel.py rename to sdks/python/julep/api/types/common_py_expression.py index acf516d8c..cfb6a3924 100644 --- a/sdks/python/julep/api/types/tasks_cel.py +++ b/sdks/python/julep/api/types/common_py_expression.py @@ -1,3 +1,3 @@ # This file was auto-generated by Fern from our API Definition. -TasksCel = str +CommonPyExpression = str diff --git a/sdks/python/julep/api/types/users_route_create_response.py b/sdks/python/julep/api/types/common_resource_created_response.py similarity index 94% rename from sdks/python/julep/api/types/users_route_create_response.py rename to sdks/python/julep/api/types/common_resource_created_response.py index f8d878dcd..5cc890804 100644 --- a/sdks/python/julep/api/types/users_route_create_response.py +++ b/sdks/python/julep/api/types/common_resource_created_response.py @@ -8,10 +8,10 @@ from .common_uuid import CommonUuid -class UsersRouteCreateResponse(pydantic_v1.BaseModel): +class CommonResourceCreatedResponse(pydantic_v1.BaseModel): id: CommonUuid = pydantic_v1.Field() """ - ID of created undefined + ID of created resource """ created_at: dt.datetime = pydantic_v1.Field() diff --git a/sdks/python/julep/api/types/history_route_delete_response.py b/sdks/python/julep/api/types/common_resource_deleted_response.py similarity index 94% rename from sdks/python/julep/api/types/history_route_delete_response.py rename to sdks/python/julep/api/types/common_resource_deleted_response.py index 4e070a537..ee5c066f7 100644 --- a/sdks/python/julep/api/types/history_route_delete_response.py +++ b/sdks/python/julep/api/types/common_resource_deleted_response.py @@ -8,10 +8,10 @@ from .common_uuid import CommonUuid -class HistoryRouteDeleteResponse(pydantic_v1.BaseModel): +class CommonResourceDeletedResponse(pydantic_v1.BaseModel): id: CommonUuid = pydantic_v1.Field() """ - ID of deleted undefined + ID of deleted resource """ deleted_at: dt.datetime = pydantic_v1.Field() diff --git a/sdks/python/julep/api/types/agents_route_patch_response.py b/sdks/python/julep/api/types/common_resource_updated_response.py similarity index 94% rename from sdks/python/julep/api/types/agents_route_patch_response.py rename to sdks/python/julep/api/types/common_resource_updated_response.py index 58788fe66..02a5e2045 100644 --- a/sdks/python/julep/api/types/agents_route_patch_response.py +++ b/sdks/python/julep/api/types/common_resource_updated_response.py @@ -8,10 +8,10 @@ from .common_uuid import CommonUuid -class AgentsRoutePatchResponse(pydantic_v1.BaseModel): +class CommonResourceUpdatedResponse(pydantic_v1.BaseModel): id: CommonUuid = pydantic_v1.Field() """ - ID of updated undefined + ID of updated resource """ updated_at: dt.datetime = pydantic_v1.Field() diff --git a/sdks/python/julep/api/types/sessions_route_create_response.py b/sdks/python/julep/api/types/doc.py similarity index 77% rename from sdks/python/julep/api/types/sessions_route_create_response.py rename to sdks/python/julep/api/types/doc.py index 183fac1bb..c882ac772 100644 --- a/sdks/python/julep/api/types/sessions_route_create_response.py +++ b/sdks/python/julep/api/types/doc.py @@ -5,23 +5,27 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_uuid import CommonUuid +from .doc_content import DocContent -class SessionsRouteCreateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() +class Doc(pydantic_v1.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() """ - ID of created undefined + When this resource was created as UTC date-time """ - created_at: dt.datetime = pydantic_v1.Field() + title: CommonIdentifierSafeUnicode = pydantic_v1.Field() """ - When this resource was created as UTC date-time + Title describing what this document contains """ - jobs: typing.List[CommonUuid] = pydantic_v1.Field() + content: DocContent = pydantic_v1.Field() """ - IDs (if any) of jobs created as part of this request + Contents of the document """ def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/doc_content.py b/sdks/python/julep/api/types/doc_content.py new file mode 100644 index 000000000..104d07d52 --- /dev/null +++ b/sdks/python/julep/api/types/doc_content.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocContent = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/tool_route_patch_response.py b/sdks/python/julep/api/types/docs_embed_query_request.py similarity index 75% rename from sdks/python/julep/api/types/tool_route_patch_response.py rename to sdks/python/julep/api/types/docs_embed_query_request.py index 6ad7439a9..21d49b706 100644 --- a/sdks/python/julep/api/types/tool_route_patch_response.py +++ b/sdks/python/julep/api/types/docs_embed_query_request.py @@ -5,23 +5,13 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid +from .docs_embed_query_request_text import DocsEmbedQueryRequestText -class ToolRoutePatchResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() +class DocsEmbedQueryRequest(pydantic_v1.BaseModel): + text: DocsEmbedQueryRequestText = pydantic_v1.Field() """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request + Text or texts to embed """ def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/docs_embed_query_request_text.py b/sdks/python/julep/api/types/docs_embed_query_request_text.py new file mode 100644 index 000000000..6462dd057 --- /dev/null +++ b/sdks/python/julep/api/types/docs_embed_query_request_text.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocsEmbedQueryRequestText = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/tool_route_delete_response.py b/sdks/python/julep/api/types/docs_embed_query_response.py similarity index 75% rename from sdks/python/julep/api/types/tool_route_delete_response.py rename to sdks/python/julep/api/types/docs_embed_query_response.py index 39e54da62..acf7907ae 100644 --- a/sdks/python/julep/api/types/tool_route_delete_response.py +++ b/sdks/python/julep/api/types/docs_embed_query_response.py @@ -5,23 +5,12 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -class ToolRouteDeleteResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() +class DocsEmbedQueryResponse(pydantic_v1.BaseModel): + vectors: typing.List[typing.List[float]] = pydantic_v1.Field() """ - ID of deleted undefined - """ - - deleted_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was deleted as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request + The embedded vectors """ def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/agent_tools_route_create_response.py b/sdks/python/julep/api/types/entry.py similarity index 77% rename from sdks/python/julep/api/types/agent_tools_route_create_response.py rename to sdks/python/julep/api/types/entry.py index ba3b9eb58..641e47753 100644 --- a/sdks/python/julep/api/types/agent_tools_route_create_response.py +++ b/sdks/python/julep/api/types/entry.py @@ -6,12 +6,19 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid +from .entries_chat_ml_role import EntriesChatMlRole +from .entry_content import EntryContent +from .entry_source import EntrySource -class AgentToolsRouteCreateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() +class Entry(pydantic_v1.BaseModel): + role: EntriesChatMlRole + name: typing.Optional[str] = None + content: EntryContent + source: EntrySource + timestamp: int = pydantic_v1.Field() """ - ID of created undefined + This is the time that this event refers to. """ created_at: dt.datetime = pydantic_v1.Field() @@ -19,10 +26,7 @@ class AgentToolsRouteCreateResponse(pydantic_v1.BaseModel): When this resource was created as UTC date-time """ - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ + id: CommonUuid def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { diff --git a/sdks/python/julep/api/types/entry_content.py b/sdks/python/julep/api/types/entry_content.py new file mode 100644 index 000000000..6356ac700 --- /dev/null +++ b/sdks/python/julep/api/types/entry_content.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .entry_content_item import EntryContentItem +from .tools_chosen_tool_call import ToolsChosenToolCall +from .tools_tool import ToolsTool +from .tools_tool_response import ToolsToolResponse + +EntryContent = typing.Union[ + typing.List[EntryContentItem], + ToolsTool, + ToolsChosenToolCall, + str, + ToolsToolResponse, + typing.List[EntryContentItem], +] diff --git a/sdks/python/julep/api/types/entry_content_item.py b/sdks/python/julep/api/types/entry_content_item.py new file mode 100644 index 000000000..86aa2c26e --- /dev/null +++ b/sdks/python/julep/api/types/entry_content_item.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .entry_content_item_item import EntryContentItemItem +from .tools_chosen_tool_call import ToolsChosenToolCall +from .tools_tool import ToolsTool +from .tools_tool_response import ToolsToolResponse + +EntryContentItem = typing.Union[ + typing.List[EntryContentItemItem], + ToolsTool, + ToolsChosenToolCall, + str, + ToolsToolResponse, +] diff --git a/sdks/python/julep/api/types/entry_content_item_item.py b/sdks/python/julep/api/types/entry_content_item_item.py new file mode 100644 index 000000000..ea0afd988 --- /dev/null +++ b/sdks/python/julep/api/types/entry_content_item_item.py @@ -0,0 +1,87 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .entries_image_url import EntriesImageUrl + + +class EntryContentItemItem_Text(pydantic_v1.BaseModel): + text: str + type: typing.Literal["text"] = "text" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class EntryContentItemItem_ImageUrl(pydantic_v1.BaseModel): + image_url: EntriesImageUrl + type: typing.Literal["image_url"] = "image_url" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +EntryContentItemItem = typing.Union[ + EntryContentItemItem_Text, EntryContentItemItem_ImageUrl +] diff --git a/sdks/python/julep/api/types/entry_source.py b/sdks/python/julep/api/types/entry_source.py new file mode 100644 index 000000000..b787447cc --- /dev/null +++ b/sdks/python/julep/api/types/entry_source.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +EntrySource = typing.Union[ + typing.Literal[ + "api_request", "api_response", "tool_response", "internal", "summarizer", "meta" + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/execution.py b/sdks/python/julep/api/types/execution.py new file mode 100644 index 000000000..0aea0bc9d --- /dev/null +++ b/sdks/python/julep/api/types/execution.py @@ -0,0 +1,70 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .execution_status import ExecutionStatus + + +class Execution(pydantic_v1.BaseModel): + task_id: CommonUuid = pydantic_v1.Field() + """ + The ID of the task that the execution is running + """ + + status: ExecutionStatus = pydantic_v1.Field() + """ + The status of the execution + """ + + input: typing.Dict[str, typing.Any] = pydantic_v1.Field() + """ + The input to the execution + """ + + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + id: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/execution_status.py b/sdks/python/julep/api/types/execution_status.py new file mode 100644 index 000000000..ef2640dc9 --- /dev/null +++ b/sdks/python/julep/api/types/execution_status.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ExecutionStatus = typing.Union[ + typing.Literal[ + "queued", + "starting", + "running", + "awaiting_input", + "succeeded", + "failed", + "cancelled", + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/executions_execution.py b/sdks/python/julep/api/types/executions_execution.py index 975a78e0a..7359cab45 100644 --- a/sdks/python/julep/api/types/executions_execution.py +++ b/sdks/python/julep/api/types/executions_execution.py @@ -35,6 +35,7 @@ class ExecutionsExecution(pydantic_v1.BaseModel): When this resource was updated as UTC date-time """ + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None id: CommonUuid def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/executions_route_update_response.py b/sdks/python/julep/api/types/executions_route_update_response.py deleted file mode 100644 index acc4a0cd1..000000000 --- a/sdks/python/julep/api/types/executions_route_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class ExecutionsRouteUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_create_response.py b/sdks/python/julep/api/types/history.py similarity index 83% rename from sdks/python/julep/api/types/tasks_route_create_response.py rename to sdks/python/julep/api/types/history.py index 395c6619b..b3cc6499c 100644 --- a/sdks/python/julep/api/types/tasks_route_create_response.py +++ b/sdks/python/julep/api/types/history.py @@ -6,24 +6,19 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid +from .entries_entry import EntriesEntry +from .entries_relation import EntriesRelation -class TasksRouteCreateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of created undefined - """ - +class History(pydantic_v1.BaseModel): + entries: typing.List[EntriesEntry] + relations: typing.List[EntriesRelation] + session_id: CommonUuid created_at: dt.datetime = pydantic_v1.Field() """ When this resource was created as UTC date-time """ - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { "by_alias": True, diff --git a/sdks/python/julep/api/types/individual_docs_route_delete_response.py b/sdks/python/julep/api/types/individual_docs_route_delete_response.py deleted file mode 100644 index 8489bf115..000000000 --- a/sdks/python/julep/api/types/individual_docs_route_delete_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class IndividualDocsRouteDeleteResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of deleted undefined - """ - - deleted_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was deleted as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/job_status.py b/sdks/python/julep/api/types/job_status.py new file mode 100644 index 000000000..2badb9fc7 --- /dev/null +++ b/sdks/python/julep/api/types/job_status.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid +from .jobs_job_state import JobsJobState + + +class JobStatus(pydantic_v1.BaseModel): + id: CommonUuid + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the job + """ + + reason: str = pydantic_v1.Field() + """ + Reason for the current state of the job + """ + + has_progress: bool = pydantic_v1.Field() + """ + Whether this Job supports progress updates + """ + + progress: float = pydantic_v1.Field() + """ + Progress percentage + """ + + state: JobsJobState = pydantic_v1.Field() + """ + Current state of the job + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/session.py b/sdks/python/julep/api/types/session.py new file mode 100644 index 000000000..6bff48943 --- /dev/null +++ b/sdks/python/julep/api/types/session.py @@ -0,0 +1,98 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .sessions_context_overflow_type import SessionsContextOverflowType + + +class Session(pydantic_v1.BaseModel): + user: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + User ID of user associated with this session + """ + + users: typing.Optional[typing.List[CommonUuid]] = None + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of agent associated with this session + """ + + agents: typing.Optional[typing.List[CommonUuid]] = None + situation: str = pydantic_v1.Field() + """ + A specific situation that sets the background for this session + """ + + summary: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Summary (null at the beginning) - generated automatically after every interaction + """ + + render_templates: bool = pydantic_v1.Field() + """ + Render system and assistant message content as jinja templates + """ + + token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + Threshold value for the adaptive context functionality + """ + + context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( + default=None + ) + """ + Action to start on context window overflow + """ + + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + kind: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Discriminator property for Session. + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_context_overflow_type.py b/sdks/python/julep/api/types/sessions_context_overflow_type.py new file mode 100644 index 000000000..85006c98b --- /dev/null +++ b/sdks/python/julep/api/types/sessions_context_overflow_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SessionsContextOverflowType = typing.Union[ + typing.Literal["truncate", "adaptive"], typing.Any +] diff --git a/sdks/python/julep/api/types/sessions_route_create_or_update_response.py b/sdks/python/julep/api/types/sessions_route_create_or_update_response.py deleted file mode 100644 index 06b2b1c6b..000000000 --- a/sdks/python/julep/api/types/sessions_route_create_or_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_delete_response.py b/sdks/python/julep/api/types/sessions_route_delete_response.py deleted file mode 100644 index 077994096..000000000 --- a/sdks/python/julep/api/types/sessions_route_delete_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsRouteDeleteResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of deleted undefined - """ - - deleted_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was deleted as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_patch_response.py b/sdks/python/julep/api/types/sessions_route_patch_response.py deleted file mode 100644 index 657193f75..000000000 --- a/sdks/python/julep/api/types/sessions_route_patch_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsRoutePatchResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_update_response.py b/sdks/python/julep/api/types/sessions_route_update_response.py deleted file mode 100644 index e5de2b7bc..000000000 --- a/sdks/python/julep/api/types/sessions_route_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsRouteUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_session.py b/sdks/python/julep/api/types/sessions_session.py index a78ed68ed..d610040c0 100644 --- a/sdks/python/julep/api/types/sessions_session.py +++ b/sdks/python/julep/api/types/sessions_session.py @@ -8,6 +8,7 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid +from .sessions_context_overflow_type import SessionsContextOverflowType class Base(pydantic_v1.BaseModel): @@ -31,7 +32,9 @@ class Base(pydantic_v1.BaseModel): Threshold value for the adaptive context functionality """ - context_overflow: typing.Optional[str] = pydantic_v1.Field(default=None) + context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( + default=None + ) """ Action to start on context window overflow """ diff --git a/sdks/python/julep/api/types/task.py b/sdks/python/julep/api/types/task.py new file mode 100644 index 000000000..f897c2f8d --- /dev/null +++ b/sdks/python/julep/api/types/task.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .tasks_workflow_step import TasksWorkflowStep +from .tools_create_tool_request import ToolsCreateToolRequest + + +class Task(pydantic_v1.BaseModel): + """ + Object describing a Task + """ + + name: str + description: str + main: typing.List[TasksWorkflowStep] = pydantic_v1.Field() + """ + The entrypoint of the task. + """ + + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + default=None + ) + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + + tools: typing.List[ToolsCreateToolRequest] = pydantic_v1.Field() + """ + Tools defined specifically for this task not included in the Agent itself. + """ + + inherit_tools: bool = pydantic_v1.Field() + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + + agent_id: CommonUuid + id: CommonUuid + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task_executions_route_create_response.py b/sdks/python/julep/api/types/task_executions_route_create_response.py deleted file mode 100644 index cc1c0fa69..000000000 --- a/sdks/python/julep/api/types/task_executions_route_create_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class TaskExecutionsRouteCreateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of created undefined - """ - - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py b/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py deleted file mode 100644 index a363844ab..000000000 --- a/sdks/python/julep/api/types/task_executions_route_resume_with_task_token_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class TaskExecutionsRouteResumeWithTaskTokenResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_evaluate_step.py b/sdks/python/julep/api/types/tasks_evaluate_step.py index 114b84349..b16e9d1f5 100644 --- a/sdks/python/julep/api/types/tasks_evaluate_step.py +++ b/sdks/python/julep/api/types/tasks_evaluate_step.py @@ -5,11 +5,11 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .tasks_cel import TasksCel +from .common_py_expression import CommonPyExpression class TasksEvaluateStep(pydantic_v1.BaseModel): - evaluate: typing.Dict[str, TasksCel] = pydantic_v1.Field() + evaluate: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field() """ The expression to evaluate """ diff --git a/sdks/python/julep/api/types/tasks_if_else_workflow_step.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py index da0400ac4..1059cce69 100644 --- a/sdks/python/julep/api/types/tasks_if_else_workflow_step.py +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py @@ -7,11 +7,11 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .tasks_cel import TasksCel +from .common_py_expression import CommonPyExpression class TasksIfElseWorkflowStep(pydantic_v1.BaseModel): - if_: TasksCel = pydantic_v1.Field(alias="if") + if_: CommonPyExpression = pydantic_v1.Field(alias="if") """ The condition to evaluate """ diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings.py b/sdks/python/julep/api/types/tasks_prompt_step_settings.py index 86e3f63cb..da86b2ad2 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings.py @@ -2,16 +2,14 @@ import typing +from .tasks_prompt_step_settings_agent import TasksPromptStepSettingsAgent from .tasks_prompt_step_settings_frequency_penalty import ( TasksPromptStepSettingsFrequencyPenalty, ) -from .tasks_prompt_step_settings_length_penalty import ( - TasksPromptStepSettingsLengthPenalty, -) from .tasks_prompt_step_settings_preset import TasksPromptStepSettingsPreset TasksPromptStepSettings = typing.Union[ TasksPromptStepSettingsPreset, TasksPromptStepSettingsFrequencyPenalty, - TasksPromptStepSettingsLengthPenalty, + TasksPromptStepSettingsAgent, ] diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_agent.py similarity index 93% rename from sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py rename to sdks/python/julep/api/types/tasks_prompt_step_settings_agent.py index c2cf0f30e..4f05effd6 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings_length_penalty.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_agent.py @@ -8,9 +8,10 @@ from .chat_completion_response_format import ChatCompletionResponseFormat from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_logit_bias import CommonLogitBias +from .common_uuid import CommonUuid -class TasksPromptStepSettingsLengthPenalty(pydantic_v1.BaseModel): +class TasksPromptStepSettingsAgent(pydantic_v1.BaseModel): model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( default=None ) @@ -52,6 +53,11 @@ class TasksPromptStepSettingsLengthPenalty(pydantic_v1.BaseModel): Response format (set to `json_object` to restrict output to JSON) """ + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + repetition_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) """ 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. diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py index 38d311acf..aaefaff25 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_frequency_penalty.py @@ -8,6 +8,7 @@ from .chat_completion_response_format import ChatCompletionResponseFormat from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_logit_bias import CommonLogitBias +from .common_uuid import CommonUuid class TasksPromptStepSettingsFrequencyPenalty(pydantic_v1.BaseModel): @@ -52,6 +53,11 @@ class TasksPromptStepSettingsFrequencyPenalty(pydantic_v1.BaseModel): Response format (set to `json_object` to restrict output to JSON) """ + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + frequency_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) """ 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. diff --git a/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py b/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py index c9ef75698..699611201 100644 --- a/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py +++ b/sdks/python/julep/api/types/tasks_prompt_step_settings_preset.py @@ -9,6 +9,7 @@ from .chat_generation_preset import ChatGenerationPreset from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_logit_bias import CommonLogitBias +from .common_uuid import CommonUuid class TasksPromptStepSettingsPreset(pydantic_v1.BaseModel): @@ -53,6 +54,11 @@ class TasksPromptStepSettingsPreset(pydantic_v1.BaseModel): Response format (set to `json_object` to restrict output to JSON) """ + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + preset: typing.Optional[ChatGenerationPreset] = pydantic_v1.Field(default=None) """ Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) diff --git a/sdks/python/julep/api/types/tasks_route_create_or_update_response.py b/sdks/python/julep/api/types/tasks_route_create_or_update_response.py deleted file mode 100644 index 22be59ce9..000000000 --- a/sdks/python/julep/api/types/tasks_route_create_or_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class TasksRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_delete_response.py b/sdks/python/julep/api/types/tasks_route_delete_response.py deleted file mode 100644 index 07a5a7519..000000000 --- a/sdks/python/julep/api/types/tasks_route_delete_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class TasksRouteDeleteResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of deleted undefined - """ - - deleted_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was deleted as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_patch_response.py b/sdks/python/julep/api/types/tasks_route_patch_response.py deleted file mode 100644 index bf6170ca1..000000000 --- a/sdks/python/julep/api/types/tasks_route_patch_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class TasksRoutePatchResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_route_update_response.py b/sdks/python/julep/api/types/tasks_route_update_response.py deleted file mode 100644 index 7d7d3e34a..000000000 --- a/sdks/python/julep/api/types/tasks_route_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class TasksRouteUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_task.py b/sdks/python/julep/api/types/tasks_task.py index 30961f3c4..af4b36adb 100644 --- a/sdks/python/julep/api/types/tasks_task.py +++ b/sdks/python/julep/api/types/tasks_task.py @@ -51,6 +51,8 @@ class TasksTask(pydantic_v1.BaseModel): When this resource was updated as UTC date-time """ + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { "by_alias": True, diff --git a/sdks/python/julep/api/types/tasks_workflow_step.py b/sdks/python/julep/api/types/tasks_workflow_step.py index 588a761c8..eea9d5660 100644 --- a/sdks/python/julep/api/types/tasks_workflow_step.py +++ b/sdks/python/julep/api/types/tasks_workflow_step.py @@ -7,8 +7,8 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_py_expression import CommonPyExpression from .common_tool_ref import CommonToolRef -from .tasks_cel import TasksCel from .tasks_prompt_step_prompt import TasksPromptStepPrompt from .tasks_prompt_step_settings import TasksPromptStepSettings @@ -52,7 +52,7 @@ class Config: class TasksWorkflowStep_Yield(pydantic_v1.BaseModel): workflow: str - arguments: typing.Dict[str, TasksCel] + arguments: typing.Dict[str, CommonPyExpression] kind: typing.Literal["yield"] = "yield" def json(self, **kwargs: typing.Any) -> str: @@ -125,7 +125,7 @@ class Config: class TasksWorkflowStep_Evaluate(pydantic_v1.BaseModel): - evaluate: typing.Dict[str, TasksCel] + evaluate: typing.Dict[str, CommonPyExpression] kind: typing.Literal["evaluate"] = "evaluate" def json(self, **kwargs: typing.Any) -> str: @@ -161,7 +161,7 @@ class Config: class TasksWorkflowStep_IfElse(pydantic_v1.BaseModel): - if_: TasksCel = pydantic_v1.Field(alias="if") + if_: CommonPyExpression = pydantic_v1.Field(alias="if") then: TasksWorkflowStep else_: TasksWorkflowStep = pydantic_v1.Field(alias="else") kind: typing.Literal["if_else"] = "if_else" diff --git a/sdks/python/julep/api/types/tasks_yield_step.py b/sdks/python/julep/api/types/tasks_yield_step.py index d1e1ed585..e2632183f 100644 --- a/sdks/python/julep/api/types/tasks_yield_step.py +++ b/sdks/python/julep/api/types/tasks_yield_step.py @@ -5,7 +5,7 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .tasks_cel import TasksCel +from .common_py_expression import CommonPyExpression class TasksYieldStep(pydantic_v1.BaseModel): @@ -14,7 +14,7 @@ class TasksYieldStep(pydantic_v1.BaseModel): The subworkflow to run """ - arguments: typing.Dict[str, TasksCel] = pydantic_v1.Field() + arguments: typing.Dict[str, CommonPyExpression] = pydantic_v1.Field() """ The input parameters for the subworkflow """ diff --git a/sdks/python/julep/api/types/tool.py b/sdks/python/julep/api/types/tool.py new file mode 100644 index 000000000..67b956eb5 --- /dev/null +++ b/sdks/python/julep/api/types/tool.py @@ -0,0 +1,69 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .tools_function_def import ToolsFunctionDef +from .tools_tool_type import ToolsToolType + + +class Tool(pydantic_v1.BaseModel): + type: ToolsToolType = pydantic_v1.Field() + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + + background: bool = pydantic_v1.Field() + """ + The tool should be run in the background (not supported at the moment) + """ + + function: typing.Optional[ToolsFunctionDef] = None + integration: typing.Optional[typing.Any] = None + system: typing.Optional[typing.Any] = None + api_call: typing.Optional[typing.Any] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + id: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool_route_update_response.py b/sdks/python/julep/api/types/tool_route_update_response.py deleted file mode 100644 index ad6a36cd0..000000000 --- a/sdks/python/julep/api/types/tool_route_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class ToolRouteUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_create_tool_request.py b/sdks/python/julep/api/types/tools_create_tool_request.py index fb051faeb..3a62c63a0 100644 --- a/sdks/python/julep/api/types/tools_create_tool_request.py +++ b/sdks/python/julep/api/types/tools_create_tool_request.py @@ -24,11 +24,6 @@ class ToolsCreateToolRequest(pydantic_v1.BaseModel): The tool should be run in the background (not supported at the moment) """ - interactive: bool = pydantic_v1.Field() - """ - Whether the tool that can be run interactively (response should contain "stop" boolean field) - """ - function: typing.Optional[ToolsFunctionDef] = None integration: typing.Optional[typing.Any] = None system: typing.Optional[typing.Any] = None diff --git a/sdks/python/julep/api/types/tools_function_tool.py b/sdks/python/julep/api/types/tools_function_tool.py index 1feccdd6e..ee172a73d 100644 --- a/sdks/python/julep/api/types/tools_function_tool.py +++ b/sdks/python/julep/api/types/tools_function_tool.py @@ -10,7 +10,6 @@ class ToolsFunctionTool(pydantic_v1.BaseModel): background: bool - interactive: bool function: ToolsFunctionDef = pydantic_v1.Field() """ The function to call diff --git a/sdks/python/julep/api/types/tools_tool.py b/sdks/python/julep/api/types/tools_tool.py index 3ab88d890..d5025e231 100644 --- a/sdks/python/julep/api/types/tools_tool.py +++ b/sdks/python/julep/api/types/tools_tool.py @@ -19,11 +19,6 @@ class Base(pydantic_v1.BaseModel): The tool should be run in the background (not supported at the moment) """ - interactive: bool = pydantic_v1.Field() - """ - Whether the tool that can be run interactively (response should contain "stop" boolean field) - """ - function: typing.Optional[ToolsFunctionDef] = None integration: typing.Any system: typing.Any @@ -74,7 +69,6 @@ class Config: class ToolsTool_Function(Base): background: bool - interactive: bool function: ToolsFunctionDef type: typing.Literal["function"] = "function" diff --git a/sdks/python/julep/api/types/agents_route_create_or_update_response.py b/sdks/python/julep/api/types/transition.py similarity index 77% rename from sdks/python/julep/api/types/agents_route_create_or_update_response.py rename to sdks/python/julep/api/types/transition.py index 303003714..009ea6f8b 100644 --- a/sdks/python/julep/api/types/agents_route_create_or_update_response.py +++ b/sdks/python/julep/api/types/transition.py @@ -6,12 +6,19 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid +from .transition_type import TransitionType -class AgentsRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() +class Transition(pydantic_v1.BaseModel): + type: TransitionType + execution_id: CommonUuid + outputs: typing.Dict[str, typing.Any] + current: typing.List[typing.Any] + next: typing.Optional[typing.List[typing.Any]] = None + id: CommonUuid + created_at: dt.datetime = pydantic_v1.Field() """ - ID of updated undefined + When this resource was created as UTC date-time """ updated_at: dt.datetime = pydantic_v1.Field() @@ -19,11 +26,6 @@ class AgentsRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): When this resource was updated as UTC date-time """ - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { "by_alias": True, diff --git a/sdks/python/julep/api/types/transition_type.py b/sdks/python/julep/api/types/transition_type.py new file mode 100644 index 000000000..2958b0a51 --- /dev/null +++ b/sdks/python/julep/api/types/transition_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TransitionType = typing.Union[ + typing.Literal["finish", "wait", "error", "step", "cancelled"], typing.Any +] diff --git a/sdks/python/julep/api/types/agents_route_create_response.py b/sdks/python/julep/api/types/user.py similarity index 75% rename from sdks/python/julep/api/types/agents_route_create_response.py rename to sdks/python/julep/api/types/user.py index ee367369b..f75f9b26c 100644 --- a/sdks/python/julep/api/types/agents_route_create_response.py +++ b/sdks/python/julep/api/types/user.py @@ -5,23 +5,31 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_uuid import CommonUuid -class AgentsRouteCreateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() +class User(pydantic_v1.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() """ - ID of created undefined + When this resource was created as UTC date-time """ - created_at: dt.datetime = pydantic_v1.Field() + updated_at: dt.datetime = pydantic_v1.Field() """ - When this resource was created as UTC date-time + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the user """ - jobs: typing.List[CommonUuid] = pydantic_v1.Field() + about: str = pydantic_v1.Field() """ - IDs (if any) of jobs created as part of this request + About the user """ def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/users_route_create_or_update_response.py b/sdks/python/julep/api/types/users_route_create_or_update_response.py deleted file mode 100644 index e8f8f6b24..000000000 --- a/sdks/python/julep/api/types/users_route_create_or_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class UsersRouteCreateOrUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_delete_response.py b/sdks/python/julep/api/types/users_route_delete_response.py deleted file mode 100644 index 75e51a63d..000000000 --- a/sdks/python/julep/api/types/users_route_delete_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class UsersRouteDeleteResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of deleted undefined - """ - - deleted_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was deleted as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_patch_response.py b/sdks/python/julep/api/types/users_route_patch_response.py deleted file mode 100644 index a38a240f5..000000000 --- a/sdks/python/julep/api/types/users_route_patch_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class UsersRoutePatchResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_update_response.py b/sdks/python/julep/api/types/users_route_update_response.py deleted file mode 100644 index 55a288b3d..000000000 --- a/sdks/python/julep/api/types/users_route_update_response.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class UsersRouteUpdateResponse(pydantic_v1.BaseModel): - id: CommonUuid = pydantic_v1.Field() - """ - ID of updated undefined - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - jobs: typing.List[CommonUuid] = pydantic_v1.Field() - """ - IDs (if any) of jobs created as part of this request - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index fb320f6dc..f1302f21e 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -2386,6 +2386,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From b652995d8dbb05f53ff0c94a5915133d6888217a Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sat, 20 Jul 2024 16:46:07 -0400 Subject: [PATCH 17/36] fix(agents-api): Fix datamodel-codegen options Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Agents.py | 169 ++++++++- agents-api/agents_api/autogen/Chat.py | 36 +- agents-api/agents_api/autogen/Common.py | 79 +++- agents-api/agents_api/autogen/Docs.py | 69 +++- agents-api/agents_api/autogen/Entries.py | 93 +++-- agents-api/agents_api/autogen/Executions.py | 107 ++++-- agents-api/agents_api/autogen/Jobs.py | 42 +- agents-api/agents_api/autogen/Sessions.py | 188 ++++++++- agents-api/agents_api/autogen/Tasks.py | 401 +++++++++++++++++++- agents-api/agents_api/autogen/Tools.py | 126 +++++- agents-api/agents_api/autogen/Users.py | 112 +++++- agents-api/agents_api/autogen/__init__.py | 129 ------- agents-api/poetry.lock | 3 +- agents-api/pyproject.toml | 7 +- fern/fern.config.json | 2 +- typespec/main.tsp | 12 - 16 files changed, 1254 insertions(+), 321 deletions(-) diff --git a/agents-api/agents_api/autogen/Agents.py b/agents-api/agents_api/autogen/Agents.py index a958726f0..8241d2ab7 100644 --- a/agents-api/agents_api/autogen/Agents.py +++ b/agents-api/agents_api/autogen/Agents.py @@ -4,18 +4,18 @@ from __future__ import annotations from typing import Annotated, Any +from uuid import UUID from pydantic import AwareDatetime, BaseModel, ConfigDict, Field from .Chat import GenerationPresetSettings, OpenAISettings, VLLMSettings -from .Common import IdentifierSafeUnicode, Uuid class Agent(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ @@ -25,7 +25,170 @@ class Agent(BaseModel): """ When this resource was updated as UTC date-time """ - name: IdentifierSafeUnicode = "" + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the agent + """ + about: str = "" + """ + About the agent + """ + model: str = "" + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | list[str] = "" + """ + Instructions for the agent + """ + default_settings: ( + GenerationPresetSettings | OpenAISettings | VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + + +class CreateAgentRequest(BaseModel): + """ + Payload for creating a agent (and associated documents) + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the agent + """ + about: str = "" + """ + About the agent + """ + model: str = "" + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | list[str] = "" + """ + Instructions for the agent + """ + default_settings: ( + GenerationPresetSettings | OpenAISettings | VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + docs: Annotated[list, Field([], max_length=100)] + """ + Documents to index for this agent. (Max: 100 items) + """ + + +class CreateOrUpdateAgentRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: UUID + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the agent + """ + about: str = "" + """ + About the agent + """ + model: str = "" + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | list[str] = "" + """ + Instructions for the agent + """ + default_settings: ( + GenerationPresetSettings | OpenAISettings | VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + + +class PatchAgentRequest(BaseModel): + """ + Payload for patching a agent + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the agent + """ + about: str = "" + """ + About the agent + """ + model: str = "" + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + instructions: str | list[str] = "" + """ + Instructions for the agent + """ + default_settings: ( + GenerationPresetSettings | OpenAISettings | VLLMSettings | None + ) = None + """ + Default settings for all sessions created by this agent + """ + + +class UpdateAgentRequest(BaseModel): + """ + Payload for updating a agent + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] """ Name of the agent """ diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index ef7d24953..4350dc15a 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -3,33 +3,39 @@ from __future__ import annotations -from enum import Enum -from typing import Annotated +from typing import Annotated, Literal from pydantic import BaseModel, ConfigDict, Field -class GenerationPreset(str, Enum): +class CompletionResponseFormat(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["text", "json_object"] = "text" """ - Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + The format of the response """ - problem_solving = "problem_solving" - conversational = "conversational" - fun = "fun" - prose = "prose" - creative = "creative" - business = "business" - deterministic = "deterministic" - code = "code" - multilingual = "multilingual" - class GenerationPresetSettings(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - preset: GenerationPreset | None = None + preset: ( + Literal[ + "problem_solving", + "conversational", + "fun", + "prose", + "creative", + "business", + "deterministic", + "code", + "multilingual", + ] + | None + ) = None """ Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) """ diff --git a/agents-api/agents_api/autogen/Common.py b/agents-api/agents_api/autogen/Common.py index 189aabf27..aab88621d 100644 --- a/agents-api/agents_api/autogen/Common.py +++ b/agents-api/agents_api/autogen/Common.py @@ -6,38 +6,85 @@ from typing import Annotated from uuid import UUID -from pydantic import ConfigDict, Field, RootModel +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel -class IdentifierSafeUnicode(RootModel[str]): +class Limit(RootModel[int]): model_config = ConfigDict( populate_by_name=True, ) - root: Annotated[ - str, - Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" - ), - ] + root: Annotated[int, Field(ge=1, lt=1000)] """ - For Unicode character safety - See: https://unicode.org/reports/tr31/ - See: https://www.unicode.org/reports/tr39/#Identifier_Characters + Limit the number of results """ -class Uuid(RootModel[UUID]): +class LogitBias(RootModel[float]): model_config = ConfigDict( populate_by_name=True, ) - root: UUID + root: Annotated[float, Field(ge=-100.0, le=100.0)] -class ValidPythonIdentifier(RootModel[str]): +class Offset(RootModel[int]): model_config = ConfigDict( populate_by_name=True, ) - root: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] + root: Annotated[int, Field(ge=0)] """ - Valid python identifier names + Offset to apply to the results + """ + + +class ResourceCreatedResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: UUID + """ + ID of created resource + """ + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + jobs: list[UUID] + """ + IDs (if any) of jobs created as part of this request + """ + + +class ResourceDeletedResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: UUID + """ + ID of deleted resource + """ + deleted_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was deleted as UTC date-time + """ + jobs: list[UUID] + """ + IDs (if any) of jobs created as part of this request + """ + + +class ResourceUpdatedResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: UUID + """ + ID of updated resource + """ + updated_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was updated as UTC date-time + """ + jobs: list[UUID] + """ + IDs (if any) of jobs created as part of this request """ diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py index 791002936..2f625f14b 100644 --- a/agents-api/agents_api/autogen/Docs.py +++ b/agents-api/agents_api/autogen/Docs.py @@ -3,25 +3,28 @@ from __future__ import annotations -from enum import Enum from typing import Annotated, Any, Literal +from uuid import UUID from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from .Common import IdentifierSafeUnicode, Uuid - class Doc(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time """ - title: IdentifierSafeUnicode + title: Annotated[ + str, + Field( + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + ), + ] """ Title describing what this document contains """ @@ -35,8 +38,8 @@ class DocOwner(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - id: Uuid - role: Role + id: UUID + role: Literal["user", "agent"] class DocReference(BaseModel): @@ -47,7 +50,7 @@ class DocReference(BaseModel): """ The owner of this document. """ - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] """ ID of the document """ @@ -65,7 +68,7 @@ class DocSearchRequest(BaseModel): ) text: str | list[str] | None = None vector: list[float] | list[list[float]] | None = None - mode: Mode + mode: Literal["vector", "text", "hybrid"] """ The search mode """ @@ -97,16 +100,48 @@ class EmbedQueryRequest(BaseModel): """ -class Mode(str, Enum): +class EmbedQueryResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + vectors: list[list[float]] """ - The search mode + The embedded vectors + """ + + +class HybridDocSearchRequest(DocSearchRequest): + model_config = ConfigDict( + populate_by_name=True, + ) + text: str | list[str] | None = None + """ + Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. + """ + vector: list[float] | list[list[float]] | None = None + """ + Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. """ + mode: Literal["hybrid"] = "hybrid" - vector = "vector" - text = "text" - hybrid = "hybrid" + +class TextOnlyDocSearchRequest(DocSearchRequest): + model_config = ConfigDict( + populate_by_name=True, + ) + text: str | list[str] + """ + Text or texts to use in the search. In `text` search mode, only BM25 is used. + """ + mode: Literal["text"] = "text" -class Role(str, Enum): - user = "user" - agent = "agent" +class VectorDocSearchRequest(DocSearchRequest): + model_config = ConfigDict( + populate_by_name=True, + ) + vector: list[float] | list[list[float]] + """ + Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + """ + mode: Literal["vector"] = "vector" diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index 1ceb17f0f..a82dbc6a6 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -3,12 +3,11 @@ from __future__ import annotations -from enum import Enum from typing import Annotated, Literal +from uuid import UUID from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field -from .Common import Uuid from .Tools import ChosenToolCall, Tool, ToolResponse @@ -38,20 +37,6 @@ class ChatMLImageContentPart(BaseChatMLContentPart): """ -class ChatMLRole(str, Enum): - """ - ChatML role (system|assistant|user|function_call|function|function_response|auto) - """ - - user = "user" - agent = "agent" - system = "system" - function = "function" - function_response = "function_response" - function_call = "function_call" - auto = "auto" - - class ChatMLTextContentPart(BaseChatMLContentPart): model_config = ConfigDict( populate_by_name=True, @@ -67,7 +52,18 @@ class Entry(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - role: ChatMLRole + role: Literal[ + "user", + "agent", + "system", + "function", + "function_response", + "function_call", + "auto", + ] + """ + ChatML role (system|assistant|user|function_call|function|function_response|auto) + """ name: str | None = None content: ( list[ChatMLTextContentPart | ChatMLImageContentPart] @@ -83,7 +79,9 @@ class Entry(BaseModel): | ToolResponse ] ) - source: Source + source: Literal[ + "api_request", "api_response", "tool_response", "internal", "summarizer", "meta" + ] timestamp: int """ This is the time that this event refers to. @@ -92,7 +90,7 @@ class Entry(BaseModel): """ When this resource was created as UTC date-time """ - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] class History(BaseModel): @@ -101,23 +99,13 @@ class History(BaseModel): ) entries: list[Entry] relations: list[Relation] - session_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + session_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time """ -class ImageDetail(str, Enum): - """ - Image detail level - """ - - low = "low" - high = "high" - auto = "auto" - - class ImageURL(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -126,25 +114,46 @@ class ImageURL(BaseModel): """ Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) """ - detail: ImageDetail = "auto" + detail: Literal["low", "high", "auto"] = "auto" """ The detail level of the image """ -class Relation(BaseModel): +class InputChatMLMessage(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - head: Uuid - relation: str - tail: Uuid + role: Literal[ + "user", + "agent", + "system", + "function", + "function_response", + "function_call", + "auto", + ] + """ + The role of the message + """ + content: str | list[str] | list[ChatMLTextContentPart | ChatMLImageContentPart] + """ + The content parts of the message + """ + name: str | None = None + """ + Name + """ + continue_: Annotated[bool | None, Field(None, alias="continue")] + """ + Whether to continue this message or return a new one + """ -class Source(str, Enum): - api_request = "api_request" - api_response = "api_response" - tool_response = "tool_response" - internal = "internal" - summarizer = "summarizer" - meta = "meta" +class Relation(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + head: UUID + relation: str + tail: UUID diff --git a/agents-api/agents_api/autogen/Executions.py b/agents-api/agents_api/autogen/Executions.py index 7f343120e..6cfec05f5 100644 --- a/agents-api/agents_api/autogen/Executions.py +++ b/agents-api/agents_api/autogen/Executions.py @@ -3,23 +3,47 @@ from __future__ import annotations -from enum import Enum -from typing import Annotated, Any +from typing import Annotated, Any, Literal +from uuid import UUID from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from .Common import Uuid + +class CreateExecutionRequest(BaseModel): + """ + Payload for creating an execution + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + input: dict[str, Any] + """ + The input to the execution + """ + metadata: dict[str, Any] | None = None class Execution(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - task_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + task_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] """ The ID of the task that the execution is running """ - status: Annotated[Status, Field(json_schema_extra={"readOnly": True})] + status: Annotated[ + Literal[ + "queued", + "starting", + "running", + "awaiting_input", + "succeeded", + "failed", + "cancelled", + ], + Field(json_schema_extra={"readOnly": True}), + ] """ The status of the execution """ @@ -36,33 +60,37 @@ class Execution(BaseModel): When this resource was updated as UTC date-time """ metadata: dict[str, Any] | None = None - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] -class Status(str, Enum): +class TaskTokenResumeExecutionRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + status: Literal["running"] = "running" + task_token: str """ - The status of the execution + A Task Token is a unique identifier for a specific Task Execution. + """ + input: dict[str, Any] | None = None + """ + The input to resume the execution with """ - - queued = "queued" - starting = "starting" - running = "running" - awaiting_input = "awaiting_input" - succeeded = "succeeded" - failed = "failed" - cancelled = "cancelled" class Transition(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - type: Annotated[Type, Field(json_schema_extra={"readOnly": True})] - execution_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + type: Annotated[ + Literal["finish", "wait", "error", "step", "cancelled"], + Field(json_schema_extra={"readOnly": True}), + ] + execution_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] outputs: Annotated[dict[str, Any], Field(json_schema_extra={"readOnly": True})] current: Annotated[list, Field(json_schema_extra={"readOnly": True})] next: Annotated[list | None, Field(json_schema_extra={"readOnly": True})] - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time @@ -73,9 +101,38 @@ class Transition(BaseModel): """ -class Type(str, Enum): - finish = "finish" - wait = "wait" - error = "error" - step = "step" - cancelled = "cancelled" +class UpdateExecutionRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + status: Literal[ + "queued", + "starting", + "running", + "awaiting_input", + "succeeded", + "failed", + "cancelled", + ] + + +class ResumeExecutionRequest(UpdateExecutionRequest): + model_config = ConfigDict( + populate_by_name=True, + ) + status: Literal["running"] = "running" + input: dict[str, Any] | None = None + """ + The input to resume the execution with + """ + + +class StopExecutionRequest(UpdateExecutionRequest): + model_config = ConfigDict( + populate_by_name=True, + ) + status: Literal["cancelled"] = "cancelled" + reason: str | None = None + """ + The reason for stopping the execution + """ diff --git a/agents-api/agents_api/autogen/Jobs.py b/agents-api/agents_api/autogen/Jobs.py index 97bce5f71..92acce9ad 100644 --- a/agents-api/agents_api/autogen/Jobs.py +++ b/agents-api/agents_api/autogen/Jobs.py @@ -1,31 +1,18 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml -# timestamp: 2024-07-20T01:16:18+00:00 from __future__ import annotations -from enum import Enum -from typing import Annotated +from typing import Annotated, Literal from uuid import UUID -from pydantic import AwareDatetime, BaseModel, Field - - -class JobState(str, Enum): - """ - Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) - """ - - pending = "pending" - in_progress = "in_progress" - retrying = "retrying" - succeeded = "succeeded" - aborted = "aborted" - failed = "failed" - unknown = "unknown" +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field class JobStatus(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ @@ -38,25 +25,34 @@ class JobStatus(BaseModel): name: Annotated[ str, Field( - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$" + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", ), ] """ Name of the job """ - reason: str + reason: str = "" """ Reason for the current state of the job """ - has_progress: bool + has_progress: bool = False """ Whether this Job supports progress updates """ - progress: Annotated[float, Field(ge=0.0, le=100.0)] + progress: Annotated[float, Field(0, ge=0.0, le=100.0)] """ Progress percentage """ - state: JobState + state: Literal[ + "pending", + "in_progress", + "retrying", + "succeeded", + "aborted", + "failed", + "unknown", + ] = "pending" """ Current state of the job """ diff --git a/agents-api/agents_api/autogen/Sessions.py b/agents-api/agents_api/autogen/Sessions.py index 31f5b7abb..e098d7e5e 100644 --- a/agents-api/agents_api/autogen/Sessions.py +++ b/agents-api/agents_api/autogen/Sessions.py @@ -3,17 +3,114 @@ from __future__ import annotations -from enum import Enum -from typing import Annotated, Any +from typing import Annotated, Any, Literal +from uuid import UUID from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from .Common import Uuid + +class CreateOrUpdateSessionRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: UUID + user: UUID | None = None + """ + User ID of user associated with this session + """ + users: list[UUID] | None = None + agent: UUID | None = None + """ + Agent ID of agent associated with this session + """ + agents: list[UUID] | None = None + situation: str = ( + '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' + ) + """ + A specific situation that sets the background for this session + """ + render_templates: bool = False + """ + Render system and assistant message content as jinja templates + """ + token_budget: int | None = None + """ + Threshold value for the adaptive context functionality + """ + context_overflow: Literal["truncate", "adaptive"] | None = None + """ + Action to start on context window overflow + """ + metadata: dict[str, Any] | None = None + + +class CreateSessionRequest(BaseModel): + """ + Payload for creating a session + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + user: UUID | None = None + """ + User ID of user associated with this session + """ + users: list[UUID] | None = None + agent: UUID | None = None + """ + Agent ID of agent associated with this session + """ + agents: list[UUID] | None = None + situation: str = ( + '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' + ) + """ + A specific situation that sets the background for this session + """ + render_templates: bool = False + """ + Render system and assistant message content as jinja templates + """ + token_budget: int | None = None + """ + Threshold value for the adaptive context functionality + """ + context_overflow: Literal["truncate", "adaptive"] | None = None + """ + Action to start on context window overflow + """ + metadata: dict[str, Any] | None = None -class ContextOverflowType(str, Enum): - truncate = "truncate" - adaptive = "adaptive" +class PatchSessionRequest(BaseModel): + """ + Payload for patching a session + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + situation: str = ( + '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' + ) + """ + A specific situation that sets the background for this session + """ + render_templates: bool = False + """ + Render system and assistant message content as jinja templates + """ + token_budget: int | None = None + """ + Threshold value for the adaptive context functionality + """ + context_overflow: Literal["truncate", "adaptive"] | None = None + """ + Action to start on context window overflow + """ + metadata: dict[str, Any] | None = None class Session(BaseModel): @@ -38,11 +135,11 @@ class Session(BaseModel): """ Threshold value for the adaptive context functionality """ - context_overflow: ContextOverflowType | None = None + context_overflow: Literal["truncate", "adaptive"] | None = None """ Action to start on context window overflow """ - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ @@ -56,3 +153,78 @@ class Session(BaseModel): """ Discriminator property for Session. """ + + +class SingleAgentMultiUserSession(Session): + model_config = ConfigDict( + populate_by_name=True, + ) + agent: UUID + users: list[UUID] + + +class SingleAgentNoUserSession(Session): + model_config = ConfigDict( + populate_by_name=True, + ) + agent: UUID + + +class SingleAgentSingleUserSession(Session): + model_config = ConfigDict( + populate_by_name=True, + ) + agent: UUID + user: UUID + + +class UpdateSessionRequest(BaseModel): + """ + Payload for updating a session + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + situation: str = ( + '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' + ) + """ + A specific situation that sets the background for this session + """ + render_templates: bool = False + """ + Render system and assistant message content as jinja templates + """ + token_budget: int | None = None + """ + Threshold value for the adaptive context functionality + """ + context_overflow: Literal["truncate", "adaptive"] | None = None + """ + Action to start on context window overflow + """ + metadata: dict[str, Any] | None = None + + +class MultiAgentMultiUserSession(Session): + model_config = ConfigDict( + populate_by_name=True, + ) + agents: list[UUID] + users: list[UUID] + + +class MultiAgentNoUserSession(Session): + model_config = ConfigDict( + populate_by_name=True, + ) + agents: list[UUID] + + +class MultiAgentSingleUserSession(Session): + model_config = ConfigDict( + populate_by_name=True, + ) + agents: list[UUID] + user: UUID diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py index 1e53355e6..be36b7663 100644 --- a/agents-api/agents_api/autogen/Tasks.py +++ b/agents-api/agents_api/autogen/Tasks.py @@ -3,14 +3,297 @@ from __future__ import annotations -from typing import Annotated, Any +from typing import Annotated, Any, Literal +from uuid import UUID from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from .Common import Uuid +from .Chat import CompletionResponseFormat +from .Common import LogitBias +from .Entries import InputChatMLMessage from .Tools import CreateToolRequest +class CreateOrUpdateTaskRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: UUID + name: str + description: str = "" + main: list[WorkflowStep] + """ + The entrypoint of the task. + """ + input_schema: dict[str, Any] | None = None + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: list[CreateToolRequest] = [] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool = True + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + metadata: dict[str, Any] | None = None + + +class CreateTaskRequest(BaseModel): + """ + Payload for creating a task + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + name: str + description: str = "" + main: list[WorkflowStep] + """ + The entrypoint of the task. + """ + input_schema: dict[str, Any] | None = None + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: list[CreateToolRequest] = [] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool = True + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + metadata: dict[str, Any] | None = None + + +class PatchTaskRequest(BaseModel): + """ + Payload for patching a task + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + description: str = "" + main: list[WorkflowStep] | None = None + """ + The entrypoint of the task. + """ + input_schema: dict[str, Any] | None = None + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: list[CreateToolRequest] = [] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool = True + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + metadata: dict[str, Any] | None = None + + +class Settings(BaseModel): + """ + Settings for the prompt + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + model: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Identifier of the model to be used + """ + stream: bool = False + """ + Indicates if the server should stream the response as it's generated + """ + stop: Annotated[list[str] | None, Field(None, max_length=4, min_length=1)] + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + seed: Annotated[int | None, Field(None, ge=-1, le=1000)] + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + max_tokens: Annotated[int | None, Field(None, ge=1)] + """ + The maximum number of tokens to generate in the chat completion + """ + logit_bias: dict[str, LogitBias] | None = None + """ + Modify the likelihood of specified tokens appearing in the completion + """ + response_format: CompletionResponseFormat | None = None + """ + Response format (set to `json_object` to restrict output to JSON) + """ + agent: UUID | None = None + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + preset: ( + Literal[ + "problem_solving", + "conversational", + "fun", + "prose", + "creative", + "business", + "deterministic", + "code", + "multilingual", + ] + | None + ) = None + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ + + +class SettingsModel(BaseModel): + """ + Settings for the prompt + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + model: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Identifier of the model to be used + """ + stream: bool = False + """ + Indicates if the server should stream the response as it's generated + """ + stop: Annotated[list[str] | None, Field(None, max_length=4, min_length=1)] + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + seed: Annotated[int | None, Field(None, ge=-1, le=1000)] + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + max_tokens: Annotated[int | None, Field(None, ge=1)] + """ + The maximum number of tokens to generate in the chat completion + """ + logit_bias: dict[str, LogitBias] | None = None + """ + Modify the likelihood of specified tokens appearing in the completion + """ + response_format: CompletionResponseFormat | None = None + """ + Response format (set to `json_object` to restrict output to JSON) + """ + agent: UUID | None = None + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + frequency_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + presence_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + + +class SettingsModel1(BaseModel): + """ + Settings for the prompt + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + model: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Identifier of the model to be used + """ + stream: bool = False + """ + Indicates if the server should stream the response as it's generated + """ + stop: Annotated[list[str] | None, Field(None, max_length=4, min_length=1)] + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + seed: Annotated[int | None, Field(None, ge=-1, le=1000)] + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + max_tokens: Annotated[int | None, Field(None, ge=1)] + """ + The maximum number of tokens to generate in the chat completion + """ + logit_bias: dict[str, LogitBias] | None = None + """ + Modify the likelihood of specified tokens appearing in the completion + """ + response_format: CompletionResponseFormat | None = None + """ + Response format (set to `json_object` to restrict output to JSON) + """ + agent: UUID | None = None + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + repetition_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + 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. + """ + length_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + min_p: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + Minimum probability compared to leading token to be considered + """ + + class Task(BaseModel): """ Object describing a Task @@ -37,8 +320,8 @@ class Task(BaseModel): """ Whether to inherit tools from the parent agent or not. Defaults to true. """ - agent_id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + agent_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time @@ -50,6 +333,34 @@ class Task(BaseModel): metadata: dict[str, Any] | None = None +class UpdateTaskRequest(BaseModel): + """ + Payload for updating a task + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + description: str = "" + main: list[WorkflowStep] + """ + The entrypoint of the task. + """ + input_schema: dict[str, Any] | None = None + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + tools: list[CreateToolRequest] = [] + """ + Tools defined specifically for this task not included in the Agent itself. + """ + inherit_tools: bool = True + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + metadata: dict[str, Any] | None = None + + class WorkflowStep(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -58,3 +369,85 @@ class WorkflowStep(BaseModel): """ Discriminator property for WorkflowStep. """ + + +class YieldStep(WorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + workflow: str + """ + The subworkflow to run + """ + arguments: dict[str, str] + """ + The input parameters for the subworkflow + """ + + +class ErrorWorkflowStep(WorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + error: str + """ + The error message + """ + + +class EvaluateStep(WorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + evaluate: dict[str, str] + """ + The expression to evaluate + """ + + +class IfElseWorkflowStep(WorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + if_: Annotated[str, Field(alias="if")] + """ + The condition to evaluate + """ + then: WorkflowStep + """ + The steps to run if the condition is true + """ + else_: Annotated[WorkflowStep, Field(alias="else")] + """ + The steps to run if the condition is false + """ + + +class PromptStep(WorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + prompt: str | list[InputChatMLMessage] + """ + The prompt to run + """ + settings: Settings | SettingsModel | SettingsModel1 + """ + Settings for the prompt + """ + + +class ToolCallStep(WorkflowStep): + model_config = ConfigDict( + populate_by_name=True, + ) + tool: Annotated[ + str, Field(pattern="^(function|integration|system|api_call)\\.(\\w+)$") + ] + """ + The tool to run + """ + arguments: dict[str, Any] + """ + The input parameters for the tool + """ diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index 3b648c9e4..4cab6b25b 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -3,13 +3,11 @@ from __future__ import annotations -from enum import Enum -from typing import Annotated, Any +from typing import Annotated, Any, Literal +from uuid import UUID from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from .Common import IdentifierSafeUnicode, Uuid, ValidPythonIdentifier - class ChosenToolCall(BaseModel): """ @@ -19,7 +17,7 @@ class ChosenToolCall(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - type: ToolType + type: Literal["function", "integration", "system", "api_call"] """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ @@ -27,7 +25,7 @@ class ChosenToolCall(BaseModel): integration: Any | None = None system: Any | None = None api_call: Any | None = None - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] class CreateToolRequest(BaseModel): @@ -38,7 +36,7 @@ class CreateToolRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - type: ToolType + type: Literal["function", "integration", "system", "api_call"] """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ @@ -70,7 +68,7 @@ class FunctionDef(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - name: Annotated[ValidPythonIdentifier, Field("overriden")] + name: Annotated[str, Field("overriden", pattern="^[^\\W0-9]\\w*$")] """ DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. """ @@ -78,17 +76,73 @@ class FunctionDef(BaseModel): """ The parameters the function accepts """ - description: IdentifierSafeUnicode | None = None + description: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Description of the function + """ + + +class FunctionDefUpdate(BaseModel): + """ + Function definition + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + name: Annotated[str, Field("overriden", pattern="^[^\\W0-9]\\w*$")] + """ + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + """ + parameters: dict[str, Any] | None = None + """ + The parameters the function accepts + """ + description: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] """ Description of the function """ +class PatchToolRequest(BaseModel): + """ + Payload for patching a tool + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function", "integration", "system", "api_call"] | None = None + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + background: bool = False + """ + The tool should be run in the background (not supported at the moment) + """ + function: FunctionDefUpdate | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + class Tool(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - type: ToolType + type: Literal["function", "integration", "system", "api_call"] """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ @@ -108,22 +162,60 @@ class Tool(BaseModel): """ When this resource was updated as UTC date-time """ - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] class ToolResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - id: Uuid + id: UUID output: dict[str, Any] """ The output of the tool """ -class ToolType(str, Enum): - function = "function" - integration = "integration" - system = "system" - api_call = "api_call" +class UpdateToolRequest(BaseModel): + """ + Payload for updating a tool + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function", "integration", "system", "api_call"] + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + background: bool = False + """ + The tool should be run in the background (not supported at the moment) + """ + function: FunctionDef | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + +class ChosenFunctionCall(ChosenToolCall): + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function"] = "function" + function: FunctionCallOption + """ + The function to call + """ + + +class FunctionTool(Tool): + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function"] = "function" + background: Literal[False] = False + function: FunctionDef + """ + The function to call + """ diff --git a/agents-api/agents_api/autogen/Users.py b/agents-api/agents_api/autogen/Users.py index 696858551..c815afb4e 100644 --- a/agents-api/agents_api/autogen/Users.py +++ b/agents-api/agents_api/autogen/Users.py @@ -4,17 +4,117 @@ from __future__ import annotations from typing import Annotated, Any +from uuid import UUID from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -from .Common import IdentifierSafeUnicode, Uuid + +class CreateOrUpdateUserRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + id: UUID + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the user + """ + about: str = "" + """ + About the user + """ + + +class CreateUserRequest(BaseModel): + """ + Payload for creating a user (and associated documents) + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the user + """ + about: str = "" + """ + About the user + """ + docs: Annotated[list, Field([], max_length=100)] + """ + Documents to index for this user. (Max: 100 items) + """ + + +class PatchUserRequest(BaseModel): + """ + Payload for patching a user + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the user + """ + about: str = "" + """ + About the user + """ + + +class UpdateUserRequest(BaseModel): + """ + Payload for updating a user + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + metadata: dict[str, Any] | None = None + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Name of the user + """ + about: str = "" + """ + About the user + """ class User(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - id: Annotated[Uuid, Field(json_schema_extra={"readOnly": True})] + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ @@ -24,7 +124,13 @@ class User(BaseModel): """ When this resource was updated as UTC date-time """ - name: IdentifierSafeUnicode = "" + name: Annotated[ + str, + Field( + "", + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] """ Name of the user """ diff --git a/agents-api/agents_api/autogen/__init__.py b/agents-api/agents_api/autogen/__init__.py index 6b220661e..93bca4729 100644 --- a/agents-api/agents_api/autogen/__init__.py +++ b/agents-api/agents_api/autogen/__init__.py @@ -1,131 +1,2 @@ # generated by datamodel-codegen: # filename: openapi-0.4.0.yaml - -from __future__ import annotations - -from enum import Enum - -from pydantic import BaseModel, ConfigDict - -from .Agents import Agent -from .Docs import Doc, DocReference, DocSearchRequest, EmbedQueryRequest -from .Entries import History -from .Executions import Execution, Transition -from .Sessions import Session -from .Tasks import Task -from .Tools import Tool -from .Users import User - - -class AgentDocsRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[Doc] - - -class AgentToolsRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[Tool] - - -class AgentsDocsSearchRouteSearchRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - body: DocSearchRequest - - -class AgentsDocsSearchRouteSearchResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[DocReference] - - -class AgentsRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[Agent] - - -class Direction(str, Enum): - asc = "asc" - desc = "desc" - - -class EmbedRouteEmbedRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - body: EmbedQueryRequest - - -class ExecutionTransitionsRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[Result] - - -class HistoryRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[History] - - -class Result(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - transitions: list[Transition] - - -class SessionsRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[Session] - - -class SortBy(str, Enum): - created_at = "created_at" - updated_at = "updated_at" - deleted_at = "deleted_at" - - -class TaskExecutionsRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[Execution] - - -class TasksRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[Task] - - -class UserDocsRouteListResponse(AgentDocsRouteListResponse): - pass - - -class UserDocsSearchRouteSearchRequest(AgentsDocsSearchRouteSearchRequest): - pass - - -class UserDocsSearchRouteSearchResponse(AgentsDocsSearchRouteSearchResponse): - pass - - -class UsersRouteListResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - results: list[User] diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 73d3c64eb..0dfd79b13 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -4131,7 +4131,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -5916,4 +5915,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.11" -content-hash = "a90aa6e665c0bdd8cfca719a93ff27adbb86f66ed14b81a554e1aa6629fba86d" +content-hash = "e83adfdfc54731617a5b93b7e85e2551cfe1bad244cd18a3f8f60fe037d8c8fa" diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index 6bb74898a..a7fc79989 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -31,15 +31,14 @@ transformers = "^4.40.1" tiktoken = "^0.6.0" xxhash = "^3.4.1" tenacity = "^8.3.0" - - beartype = "^0.18.5" cel-python = "^0.1.5" + [tool.poetry.group.dev.dependencies] ipython = "^8.18.1" black = "^24.4.0" ruff = "^0.1.9" -datamodel-code-generator = "^0.25.3" +datamodel-code-generator = "^0.25.8" cozo-migrate = "^0.2.0" poethepoet = "^0.25.1" pytype = ">=2024.4.11" @@ -68,4 +67,4 @@ check = [ "typecheck", ] test = "ward" -codegen = "datamodel-codegen --input ../openapi.yaml --input-file-type openapi --output agents_api/autogen/ --use-operation-id-as-name --use-double-quotes --use-schema-description --target-python-version 3.10 --reuse-model --strict-nullable --openapi-scopes schemas --openapi-scopes paths --use-exact-imports --keep-model-order --disable-timestamp --allow-population-by-field-name --use-field-description --field-include-all-keys --use-unique-items-as-set --use-subclass-enum --use-union-operator --use-one-literal-as-default --use-default --use-annotated --enum-field-as-literal one --output-model-type pydantic_v2.BaseModel --field-constraints --use-standard-collections --use-non-positive-negative-number-constrained-types" +codegen = "datamodel-codegen --input ../openapi.yaml --input-file-type openapi --output agents_api/autogen/ --use-operation-id-as-name --use-double-quotes --use-schema-description --target-python-version 3.10 --reuse-model --strict-nullable --openapi-scopes schemas --use-exact-imports --keep-model-order --disable-timestamp --allow-population-by-field-name --use-field-description --field-include-all-keys --use-unique-items-as-set --use-subclass-enum --use-union-operator --use-one-literal-as-default --use-default --use-annotated --enum-field-as-literal all --output-model-type pydantic_v2.BaseModel --field-constraints --use-standard-collections --use-non-positive-negative-number-constrained-types --use-pendulum --collapse-root-models" diff --git a/fern/fern.config.json b/fern/fern.config.json index 80bdcfd1e..0a2289fc0 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "julep", - "version": "0.31.24" + "version": "0.33.2" } \ No newline at end of file diff --git a/typespec/main.tsp b/typespec/main.tsp index 20285c7ba..6698fac76 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -59,18 +59,6 @@ using Versions; > ) namespace Api { - model Agent is Agents.Agent; - model Doc is Docs.Doc; - model Entry is Entries.Entry; - model Execution is Executions.Execution; - model History is Entries.History; - model JobStatus is Jobs.JobStatus; - model Session is Sessions.Session; - model Task is Tasks.Task; - model Tool is Tools.Tool; - model Transition is Executions.Transition; - model User is Users.User; - @route("/agents") interface AgentsRoute extends Agents.Endpoints {} From 2406fe859073383a466fdcde8e942e8608b8460b Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 21 Jul 2024 21:15:41 -0400 Subject: [PATCH 18/36] fix(typespec): Misc fixes Signed-off-by: Diwank Tomer --- typespec/executions/models.tsp | 4 ++-- typespec/sessions/models.tsp | 4 ++-- typespec/tasks/models.tsp | 10 +++++----- typespec/tools/models.tsp | 14 ++++++-------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/typespec/executions/models.tsp b/typespec/executions/models.tsp index a77ed432d..5dba37513 100644 --- a/typespec/executions/models.tsp +++ b/typespec/executions/models.tsp @@ -112,7 +112,7 @@ model Transition { execution_id: Execution.id; @visibility("read") - outputs: Record; + output: Record; @visibility("read") current: TransitionTarget; @@ -122,4 +122,4 @@ model Transition { ...HasId; ...HasTimestamps; -} \ No newline at end of file +} diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index b6da20809..f19ec1d99 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -54,7 +54,7 @@ model Session { /** Threshold value for the adaptive context functionality */ token_budget: uint16 | null = null; - + /** Action to start on context window overflow */ context_overflow: ContextOverflowType | null = null; @@ -150,4 +150,4 @@ model CreateOrUpdateSessionRequest { id: uuid; ...CreateSessionRequest; -} \ No newline at end of file +} diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 7aa35d656..0135da392 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -130,19 +130,19 @@ model Task { name: string; description: string = ""; - + /** The entrypoint of the task. */ main: WorkflowStep[]; - + /** The schema for the input to the task. `null` means all inputs are valid. */ input_schema: Record | null = null; - + /** Tools defined specifically for this task not included in the Agent itself. */ tools: CreateToolRequest[] = #[]; /** Whether to inherit tools from the parent agent or not. Defaults to true. */ inherit_tools: boolean = true; - + @visibility("read") agent_id: Agent.id; @@ -170,4 +170,4 @@ model CreateTaskRequest { model CreateOrUpdateTaskRequest { id: uuid; ...CreateTaskRequest; -} \ No newline at end of file +} diff --git a/typespec/tools/models.tsp b/typespec/tools/models.tsp index 626d3ec4c..509520304 100644 --- a/typespec/tools/models.tsp +++ b/typespec/tools/models.tsp @@ -34,11 +34,12 @@ model FunctionDef { /** DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. */ name?: validPythonIdentifier = "overriden"; + /** Description of the function */ + description?: identifierSafeUnicode; + /** The parameters the function accepts */ parameters: FunctionParameters; - /** Description of the function */ - description?: identifierSafeUnicode; } @discriminator("type") @@ -46,8 +47,8 @@ model Tool { /** Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) */ type: ToolType; - /** The tool should be run in the background (not supported at the moment) */ - background: boolean = false; + /** Name of the tool (must be unique for this agent and a valid python identifier string )*/ + name: validPythonIdentifier; function?: FunctionDef; integration?: unknown; @@ -76,9 +77,6 @@ model NamedToolChoice { /** Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) */ type: ToolType; - /** The name of the tool/function */ - name: validPythonIdentifier; - function?: FunctionCallOption; integration?: unknown; system?: unknown; @@ -133,4 +131,4 @@ model ChosenFunctionCall extends ChosenToolCall { /** The function to call */ function: FunctionCallOption; -} \ No newline at end of file +} From c3bc32ce5dcbe7674193f8908015d18a90d954da Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 21 Jul 2024 21:16:10 -0400 Subject: [PATCH 19/36] feat(agents-api): Add migrations for updated typespec models Signed-off-by: Diwank Tomer --- ...rate_1721576813_extended_tool_relations.py | 90 +++++++++++++++ ...igrate_1721609661_task_tool_ref_by_name.py | 109 ++++++++++++++++++ ...21609675_multi_agent_multi_user_session.py | 79 +++++++++++++ 3 files changed, 278 insertions(+) create mode 100644 agents-api/migrations/migrate_1721576813_extended_tool_relations.py create mode 100644 agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py create mode 100644 agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py diff --git a/agents-api/migrations/migrate_1721576813_extended_tool_relations.py b/agents-api/migrations/migrate_1721576813_extended_tool_relations.py new file mode 100644 index 000000000..1798b598c --- /dev/null +++ b/agents-api/migrations/migrate_1721576813_extended_tool_relations.py @@ -0,0 +1,90 @@ +#/usr/bin/env python3 + +MIGRATION_ID = "extended_tool_relations" +CREATED_AT = 1721576813.383905 + + +drop_agent_functions_hnsw_index = dict( + up=""" + ::hnsw drop agent_functions:embedding_space + """, + down=""" + ::hnsw create agent_functions:embedding_space { + fields: [embedding], + filter: !is_null(embedding), + dim: 768, + distance: Cosine, + m: 64, + ef_construction: 256, + extend_candidates: false, + keep_pruned_connections: false, + } + """, +) + +create_tools_relation = dict( + up=""" + ?[agent_id, tool_id, tool_type, name, spec, updated_at, created_at] := *agent_functions{ + agent_id, tool_id, name, description, parameters, updated_at, created_at + }, tool_type = "function", + spec = {"description": description, "parameters": parameters} + + :create tools { + agent_id: Uuid, + tool_id: Uuid, + => + tool_type: String, + name: String, + spec: Json, + + updated_at: Float default now(), + created_at: Float default now(), + } + """, + down=""" + ::remove tools + """, +) + +drop_agent_functions_table = dict( + up=""" + ::remove agent_functions + """, + down=""" + :create agent_functions { + agent_id: Uuid, + tool_id: Uuid, + => + name: String, + description: String, + parameters: Json, + embed_instruction: String default 'Transform this tool description for retrieval: ', + embedding: ? default null, + updated_at: Float default now(), + created_at: Float default now(), + } + """, +) + + +queries_to_run = [ + drop_agent_functions_hnsw_index, + create_tools_relation, + drop_agent_functions_table, +] + + +def run(client, *queries): + joiner = "}\n\n{" + + query = joiner.join(queries) + query = f"{{\n{query}\n}}" + client.run(query) + + +def up(client): + run(client, *[q["up"] for q in queries_to_run]) + + +def down(client): + run(client, *[q["down"] for q in reversed(queries_to_run)]) diff --git a/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py b/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py new file mode 100644 index 000000000..466ad511c --- /dev/null +++ b/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py @@ -0,0 +1,109 @@ +#/usr/bin/env python3 + +MIGRATION_ID = "task_tool_ref_by_name" +CREATED_AT = 1721609661.768934 + + + +# - add metadata +# - add inherit_tools bool +# - rename tools_available to tools +update_tasks_relation = dict( + up=""" + ?[ + agent_id, + task_id, + updated_at_ms, + name, + description, + input_schema, + tools, + inherit_tools, + workflows, + created_at, + metadata, + ] := *tasks { + agent_id, + task_id, + updated_at_ms, + name, + description, + input_schema, + tools_available: tools, + workflows, + created_at, + }, metadata = {}, + inherit_tools = true + + :replace tasks { + agent_id: Uuid, + task_id: Uuid, + updated_at_ms: Validity default [floor(now() * 1000), true], + => + name: String, + description: String? default null, + input_schema: Json, + tools: [Uuid] default [], + inherit_tools: Bool default true, + workflows: [Json], + created_at: Float default now(), + metadata: Json default {}, + } + """, + down=""" + ?[ + agent_id, + task_id, + updated_at_ms, + name, + description, + input_schema, + tools_available, + workflows, + created_at, + ] := *tasks { + agent_id, + task_id, + updated_at_ms, + name, + description, + input_schema, + tools: tools_available, + workflows, + created_at, + } + + :replace tasks { + agent_id: Uuid, + task_id: Uuid, + updated_at_ms: Validity default [floor(now() * 1000), true], + => + name: String, + description: String? default null, + input_schema: Json, + tools_available: [Uuid] default [], + workflows: [Json], + created_at: Float default now(), + } + """, +) + +queries_to_run = [ + update_tasks_relation, +] + + +def run(client, *queries): + joiner = "}\n\n{" + + query = joiner.join(queries) + query = f"{{\n{query}\n}}" + client.run(query) + + +def up(client): + run(client, *[q["up"] for q in queries_to_run]) + + +def down(client): + run(client, *[q["down"] for q in reversed(queries_to_run)]) diff --git a/agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py b/agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py new file mode 100644 index 000000000..e6a02b45c --- /dev/null +++ b/agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py @@ -0,0 +1,79 @@ +#/usr/bin/env python3 + +MIGRATION_ID = "multi_agent_multi_user_session" +CREATED_AT = 1721609675.213755 + +add_multiple_participants_in_session = dict( + up=""" + ?[session_id, participant_id, participant_type] := + *session_lookup { + agent_id: participant_id, + user_id: null, + session_id, + }, participant_type = 'agent' + + ?[session_id, participant_id, participant_type] := + *session_lookup { + agent_id, + user_id: participant_id, + session_id, + }, participant_type = 'user', + participant_id != null + + :replace session_lookup { + session_id: Uuid, + participant_type: String, + participant_id: Uuid, + } + """, + down=""" + users[user_id, session_id] := + *session_lookup { + session_id, + participant_type: "user", + participant_id: user_id, + } + + agents[agent_id, session_id] := + *session_lookup { + session_id, + participant_type: "agent", + participant_id: agent_id, + } + + ?[agent_id, user_id, session_id] := + agents[agent_id, session_id], + users[user_id, session_id] + + ?[agent_id, user_id, session_id] := + agents[agent_id, session_id], + not users[_, session_id], + user_id = null + + :replace session_lookup { + agent_id: Uuid, + user_id: Uuid? default null, + session_id: Uuid, + } + """, +) + +queries_to_run = [ + add_multiple_participants_in_session, +] + + +def run(client, *queries): + joiner = "}\n\n{" + + query = joiner.join(queries) + query = f"{{\n{query}\n}}" + client.run(query) + + +def up(client): + run(client, *[q["up"] for q in queries_to_run]) + + +def down(client): + run(client, *[q["down"] for q in reversed(queries_to_run)]) From 059f94b8676ebcfa28a0f049c4bd8450671cb838 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 22 Jul 2024 11:13:56 -0400 Subject: [PATCH 20/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Entries.py | 2 +- agents-api/agents_api/autogen/Executions.py | 2 +- agents-api/agents_api/autogen/Tools.py | 32 ++--- ...rate_1721576813_extended_tool_relations.py | 2 +- ...igrate_1721609661_task_tool_ref_by_name.py | 3 +- ...21609675_multi_agent_multi_user_session.py | 2 +- agents-api/poetry.lock | 20 ++-- sdks/python/poetry.lock | 113 +++++++++--------- sdks/ts/src/api/index.ts | 22 ---- sdks/ts/src/api/models/Agent.ts | 44 ------- sdks/ts/src/api/models/Doc.ts | 22 ---- sdks/ts/src/api/models/Entry.ts | 30 ----- sdks/ts/src/api/models/Execution.ts | 36 ------ .../src/api/models/Executions_Transition.ts | 2 +- sdks/ts/src/api/models/History.ts | 16 --- sdks/ts/src/api/models/JobStatus.ts | 38 ------ sdks/ts/src/api/models/Session.ts | 52 -------- sdks/ts/src/api/models/Task.ts | 9 -- sdks/ts/src/api/models/Tool.ts | 30 ----- .../src/api/models/Tools_CreateToolRequest.ts | 5 +- sdks/ts/src/api/models/Tools_FunctionDef.ts | 8 +- .../src/api/models/Tools_FunctionDefUpdate.ts | 8 +- .../src/api/models/Tools_PatchToolRequest.ts | 5 +- sdks/ts/src/api/models/Tools_Tool.ts | 5 +- .../src/api/models/Tools_UpdateToolRequest.ts | 5 +- sdks/ts/src/api/models/Transition.ts | 21 ---- sdks/ts/src/api/models/User.ts | 26 ---- sdks/ts/src/api/schemas/$Agent.ts | 89 -------------- sdks/ts/src/api/schemas/$Doc.ts | 57 --------- sdks/ts/src/api/schemas/$Entry.ts | 62 ---------- sdks/ts/src/api/schemas/$Execution.ts | 61 ---------- .../src/api/schemas/$Executions_Transition.ts | 2 +- sdks/ts/src/api/schemas/$History.ts | 39 ------ sdks/ts/src/api/schemas/$JobStatus.ts | 69 ----------- sdks/ts/src/api/schemas/$Session.ts | 107 ----------------- sdks/ts/src/api/schemas/$Task.ts | 13 -- sdks/ts/src/api/schemas/$Tool.ts | 59 --------- .../api/schemas/$Tools_CreateToolRequest.ts | 11 +- sdks/ts/src/api/schemas/$Tools_FunctionDef.ts | 14 +-- .../api/schemas/$Tools_FunctionDefUpdate.ts | 12 +- .../api/schemas/$Tools_PatchToolRequest.ts | 11 +- sdks/ts/src/api/schemas/$Tools_Tool.ts | 11 +- .../api/schemas/$Tools_UpdateToolRequest.ts | 11 +- sdks/ts/src/api/schemas/$Transition.ts | 72 ----------- sdks/ts/src/api/schemas/$User.ts | 53 -------- 45 files changed, 154 insertions(+), 1159 deletions(-) delete mode 100644 sdks/ts/src/api/models/Agent.ts delete mode 100644 sdks/ts/src/api/models/Doc.ts delete mode 100644 sdks/ts/src/api/models/Entry.ts delete mode 100644 sdks/ts/src/api/models/Execution.ts delete mode 100644 sdks/ts/src/api/models/History.ts delete mode 100644 sdks/ts/src/api/models/JobStatus.ts delete mode 100644 sdks/ts/src/api/models/Session.ts delete mode 100644 sdks/ts/src/api/models/Task.ts delete mode 100644 sdks/ts/src/api/models/Tool.ts delete mode 100644 sdks/ts/src/api/models/Transition.ts delete mode 100644 sdks/ts/src/api/models/User.ts delete mode 100644 sdks/ts/src/api/schemas/$Agent.ts delete mode 100644 sdks/ts/src/api/schemas/$Doc.ts delete mode 100644 sdks/ts/src/api/schemas/$Entry.ts delete mode 100644 sdks/ts/src/api/schemas/$Execution.ts delete mode 100644 sdks/ts/src/api/schemas/$History.ts delete mode 100644 sdks/ts/src/api/schemas/$JobStatus.ts delete mode 100644 sdks/ts/src/api/schemas/$Session.ts delete mode 100644 sdks/ts/src/api/schemas/$Task.ts delete mode 100644 sdks/ts/src/api/schemas/$Tool.ts delete mode 100644 sdks/ts/src/api/schemas/$Transition.ts delete mode 100644 sdks/ts/src/api/schemas/$User.ts diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index a82dbc6a6..36d0132c7 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel from .Tools import ChosenToolCall, Tool, ToolResponse diff --git a/agents-api/agents_api/autogen/Executions.py b/agents-api/agents_api/autogen/Executions.py index 6cfec05f5..151cd7cde 100644 --- a/agents-api/agents_api/autogen/Executions.py +++ b/agents-api/agents_api/autogen/Executions.py @@ -87,7 +87,7 @@ class Transition(BaseModel): Field(json_schema_extra={"readOnly": True}), ] execution_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] - outputs: Annotated[dict[str, Any], Field(json_schema_extra={"readOnly": True})] + output: Annotated[dict[str, Any], Field(json_schema_extra={"readOnly": True})] current: Annotated[list, Field(json_schema_extra={"readOnly": True})] next: Annotated[list | None, Field(json_schema_extra={"readOnly": True})] id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index 4cab6b25b..b7b4aa6b4 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -40,9 +40,9 @@ class CreateToolRequest(BaseModel): """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - background: bool = False + name: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] """ - The tool should be run in the background (not supported at the moment) + Name of the tool (must be unique for this agent and a valid python identifier string ) """ function: FunctionDef | None = None integration: Any | None = None @@ -72,10 +72,6 @@ class FunctionDef(BaseModel): """ DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. """ - parameters: dict[str, Any] - """ - The parameters the function accepts - """ description: Annotated[ str | None, Field( @@ -86,6 +82,10 @@ class FunctionDef(BaseModel): """ Description of the function """ + parameters: dict[str, Any] + """ + The parameters the function accepts + """ class FunctionDefUpdate(BaseModel): @@ -100,10 +100,6 @@ class FunctionDefUpdate(BaseModel): """ DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. """ - parameters: dict[str, Any] | None = None - """ - The parameters the function accepts - """ description: Annotated[ str | None, Field( @@ -114,6 +110,10 @@ class FunctionDefUpdate(BaseModel): """ Description of the function """ + parameters: dict[str, Any] | None = None + """ + The parameters the function accepts + """ class PatchToolRequest(BaseModel): @@ -128,9 +128,9 @@ class PatchToolRequest(BaseModel): """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - background: bool = False + name: Annotated[str | None, Field(None, pattern="^[^\\W0-9]\\w*$")] """ - The tool should be run in the background (not supported at the moment) + Name of the tool (must be unique for this agent and a valid python identifier string ) """ function: FunctionDefUpdate | None = None integration: Any | None = None @@ -146,9 +146,9 @@ class Tool(BaseModel): """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - background: bool = False + name: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] """ - The tool should be run in the background (not supported at the moment) + Name of the tool (must be unique for this agent and a valid python identifier string ) """ function: FunctionDef | None = None integration: Any | None = None @@ -188,9 +188,9 @@ class UpdateToolRequest(BaseModel): """ Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - background: bool = False + name: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] """ - The tool should be run in the background (not supported at the moment) + Name of the tool (must be unique for this agent and a valid python identifier string ) """ function: FunctionDef | None = None integration: Any | None = None diff --git a/agents-api/migrations/migrate_1721576813_extended_tool_relations.py b/agents-api/migrations/migrate_1721576813_extended_tool_relations.py index 1798b598c..ad7315ea5 100644 --- a/agents-api/migrations/migrate_1721576813_extended_tool_relations.py +++ b/agents-api/migrations/migrate_1721576813_extended_tool_relations.py @@ -1,4 +1,4 @@ -#/usr/bin/env python3 +# /usr/bin/env python3 MIGRATION_ID = "extended_tool_relations" CREATED_AT = 1721576813.383905 diff --git a/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py b/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py index 466ad511c..9e19d81d3 100644 --- a/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py +++ b/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py @@ -1,10 +1,9 @@ -#/usr/bin/env python3 +# /usr/bin/env python3 MIGRATION_ID = "task_tool_ref_by_name" CREATED_AT = 1721609661.768934 - # - add metadata # - add inherit_tools bool # - rename tools_available to tools diff --git a/agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py b/agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py index e6a02b45c..6b144fca3 100644 --- a/agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py +++ b/agents-api/migrations/migrate_1721609675_multi_agent_multi_user_session.py @@ -1,4 +1,4 @@ -#/usr/bin/env python3 +# /usr/bin/env python3 MIGRATION_ID = "multi_agent_multi_user_session" CREATED_AT = 1721609675.213755 diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 0dfd79b13..552e8f6ec 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -3288,13 +3288,13 @@ files = [ [[package]] name = "openai" -version = "1.36.0" +version = "1.36.1" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.36.0-py3-none-any.whl", hash = "sha256:82b74ded1fe2ea94abb19a007178bc143675f1b6903cebd63e2968d654bb0a6f"}, - {file = "openai-1.36.0.tar.gz", hash = "sha256:a124baf0e1657d6156e12248642f88489cd030be8655b69bc1c13eb50e71a93d"}, + {file = "openai-1.36.1-py3-none-any.whl", hash = "sha256:d399b9d476dbbc167aceaac6bc6ed0b2e2bb6c9e189c7f7047f822743ae62e64"}, + {file = "openai-1.36.1.tar.gz", hash = "sha256:41be9e0302e95dba8a9374b885c5cb1cec2202816a70b98736fee25a2cadd1f2"}, ] [package.dependencies] @@ -3718,13 +3718,13 @@ files = [ [[package]] name = "pure-eval" -version = "0.2.2" +version = "0.2.3" description = "Safely evaluate AST nodes without side effects" optional = false python-versions = "*" files = [ - {file = "pure_eval-0.2.2-py3-none-any.whl", hash = "sha256:01eaab343580944bc56080ebe0a674b39ec44a945e6d09ba7db3cb8cec289350"}, - {file = "pure_eval-0.2.2.tar.gz", hash = "sha256:2b45320af6dfaa1750f543d714b6d1c520a1688dec6fd24d339063ce0aaa9ac3"}, + {file = "pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0"}, + {file = "pure_eval-0.2.3.tar.gz", hash = "sha256:5f4e983f40564c576c7c8635ae88db5956bb2229d7e9237d03b3c0b0190eaf42"}, ] [package.extras] @@ -4768,19 +4768,19 @@ tornado = ["tornado (>=5)"] [[package]] name = "setuptools" -version = "71.0.4" +version = "71.1.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-71.0.4-py3-none-any.whl", hash = "sha256:ed2feca703be3bdbd94e6bb17365d91c6935c6b2a8d0bb09b66a2c435ba0b1a5"}, - {file = "setuptools-71.0.4.tar.gz", hash = "sha256:48297e5d393a62b7cb2a10b8f76c63a73af933bd809c9e0d0d6352a1a0135dd8"}, + {file = "setuptools-71.1.0-py3-none-any.whl", hash = "sha256:33874fdc59b3188304b2e7c80d9029097ea31627180896fb549c578ceb8a0855"}, + {file = "setuptools-71.1.0.tar.gz", hash = "sha256:032d42ee9fb536e33087fb66cac5f840eb9391ed05637b3f2a76a7c8fb477936"}, ] [package.extras] core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shapely" diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index f1302f21e..e78f954ed 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -1612,67 +1612,67 @@ test = ["pytest", "pytest-console-scripts", "pytest-jupyter", "pytest-tornasync" [[package]] name = "numpy" -version = "2.0.0" +version = "2.0.1" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.9" files = [ - {file = "numpy-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:04494f6ec467ccb5369d1808570ae55f6ed9b5809d7f035059000a37b8d7e86f"}, - {file = "numpy-2.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2635dbd200c2d6faf2ef9a0d04f0ecc6b13b3cad54f7c67c61155138835515d2"}, - {file = "numpy-2.0.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:0a43f0974d501842866cc83471bdb0116ba0dffdbaac33ec05e6afed5b615238"}, - {file = "numpy-2.0.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:8d83bb187fb647643bd56e1ae43f273c7f4dbcdf94550d7938cfc32566756514"}, - {file = "numpy-2.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79e843d186c8fb1b102bef3e2bc35ef81160ffef3194646a7fdd6a73c6b97196"}, - {file = "numpy-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d7696c615765091cc5093f76fd1fa069870304beaccfd58b5dcc69e55ef49c1"}, - {file = "numpy-2.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b4c76e3d4c56f145d41b7b6751255feefae92edbc9a61e1758a98204200f30fc"}, - {file = "numpy-2.0.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:acd3a644e4807e73b4e1867b769fbf1ce8c5d80e7caaef0d90dcdc640dfc9787"}, - {file = "numpy-2.0.0-cp310-cp310-win32.whl", hash = "sha256:cee6cc0584f71adefe2c908856ccc98702baf95ff80092e4ca46061538a2ba98"}, - {file = "numpy-2.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:ed08d2703b5972ec736451b818c2eb9da80d66c3e84aed1deeb0c345fefe461b"}, - {file = "numpy-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ad0c86f3455fbd0de6c31a3056eb822fc939f81b1618f10ff3406971893b62a5"}, - {file = "numpy-2.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e7f387600d424f91576af20518334df3d97bc76a300a755f9a8d6e4f5cadd289"}, - {file = "numpy-2.0.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:34f003cb88b1ba38cb9a9a4a3161c1604973d7f9d5552c38bc2f04f829536609"}, - {file = "numpy-2.0.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:b6f6a8f45d0313db07d6d1d37bd0b112f887e1369758a5419c0370ba915b3871"}, - {file = "numpy-2.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f64641b42b2429f56ee08b4f427a4d2daf916ec59686061de751a55aafa22e4"}, - {file = "numpy-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a7039a136017eaa92c1848152827e1424701532ca8e8967fe480fe1569dae581"}, - {file = "numpy-2.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:46e161722e0f619749d1cd892167039015b2c2817296104487cd03ed4a955995"}, - {file = "numpy-2.0.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0e50842b2295ba8414c8c1d9d957083d5dfe9e16828b37de883f51fc53c4016f"}, - {file = "numpy-2.0.0-cp311-cp311-win32.whl", hash = "sha256:2ce46fd0b8a0c947ae047d222f7136fc4d55538741373107574271bc00e20e8f"}, - {file = "numpy-2.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:fbd6acc766814ea6443628f4e6751d0da6593dae29c08c0b2606164db026970c"}, - {file = "numpy-2.0.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:354f373279768fa5a584bac997de6a6c9bc535c482592d7a813bb0c09be6c76f"}, - {file = "numpy-2.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4d2f62e55a4cd9c58c1d9a1c9edaedcd857a73cb6fda875bf79093f9d9086f85"}, - {file = "numpy-2.0.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:1e72728e7501a450288fc8e1f9ebc73d90cfd4671ebbd631f3e7857c39bd16f2"}, - {file = "numpy-2.0.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:84554fc53daa8f6abf8e8a66e076aff6ece62de68523d9f665f32d2fc50fd66e"}, - {file = "numpy-2.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c73aafd1afca80afecb22718f8700b40ac7cab927b8abab3c3e337d70e10e5a2"}, - {file = "numpy-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49d9f7d256fbc804391a7f72d4a617302b1afac1112fac19b6c6cec63fe7fe8a"}, - {file = "numpy-2.0.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0ec84b9ba0654f3b962802edc91424331f423dcf5d5f926676e0150789cb3d95"}, - {file = "numpy-2.0.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:feff59f27338135776f6d4e2ec7aeeac5d5f7a08a83e80869121ef8164b74af9"}, - {file = "numpy-2.0.0-cp312-cp312-win32.whl", hash = "sha256:c5a59996dc61835133b56a32ebe4ef3740ea5bc19b3983ac60cc32be5a665d54"}, - {file = "numpy-2.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:a356364941fb0593bb899a1076b92dfa2029f6f5b8ba88a14fd0984aaf76d0df"}, - {file = "numpy-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e61155fae27570692ad1d327e81c6cf27d535a5d7ef97648a17d922224b216de"}, - {file = "numpy-2.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4554eb96f0fd263041baf16cf0881b3f5dafae7a59b1049acb9540c4d57bc8cb"}, - {file = "numpy-2.0.0-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:903703372d46bce88b6920a0cd86c3ad82dae2dbef157b5fc01b70ea1cfc430f"}, - {file = "numpy-2.0.0-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:3e8e01233d57639b2e30966c63d36fcea099d17c53bf424d77f088b0f4babd86"}, - {file = "numpy-2.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1cde1753efe513705a0c6d28f5884e22bdc30438bf0085c5c486cdaff40cd67a"}, - {file = "numpy-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:821eedb7165ead9eebdb569986968b541f9908979c2da8a4967ecac4439bae3d"}, - {file = "numpy-2.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9a1712c015831da583b21c5bfe15e8684137097969c6d22e8316ba66b5baabe4"}, - {file = "numpy-2.0.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9c27f0946a3536403efb0e1c28def1ae6730a72cd0d5878db38824855e3afc44"}, - {file = "numpy-2.0.0-cp39-cp39-win32.whl", hash = "sha256:63b92c512d9dbcc37f9d81b123dec99fdb318ba38c8059afc78086fe73820275"}, - {file = "numpy-2.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:3f6bed7f840d44c08ebdb73b1825282b801799e325bcbdfa6bc5c370e5aecc65"}, - {file = "numpy-2.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9416a5c2e92ace094e9f0082c5fd473502c91651fb896bc17690d6fc475128d6"}, - {file = "numpy-2.0.0-pp39-pypy39_pp73-macosx_14_0_x86_64.whl", hash = "sha256:17067d097ed036636fa79f6a869ac26df7db1ba22039d962422506640314933a"}, - {file = "numpy-2.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38ecb5b0582cd125f67a629072fed6f83562d9dd04d7e03256c9829bdec027ad"}, - {file = "numpy-2.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:cef04d068f5fb0518a77857953193b6bb94809a806bd0a14983a8f12ada060c9"}, - {file = "numpy-2.0.0.tar.gz", hash = "sha256:cf5d1c9e6837f8af9f92b6bd3e86d513cdc11f60fd62185cc49ec7d1aba34864"}, + {file = "numpy-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0fbb536eac80e27a2793ffd787895242b7f18ef792563d742c2d673bfcb75134"}, + {file = "numpy-2.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:69ff563d43c69b1baba77af455dd0a839df8d25e8590e79c90fcbe1499ebde42"}, + {file = "numpy-2.0.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:1b902ce0e0a5bb7704556a217c4f63a7974f8f43e090aff03fcf262e0b135e02"}, + {file = "numpy-2.0.1-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:f1659887361a7151f89e79b276ed8dff3d75877df906328f14d8bb40bb4f5101"}, + {file = "numpy-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4658c398d65d1b25e1760de3157011a80375da861709abd7cef3bad65d6543f9"}, + {file = "numpy-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4127d4303b9ac9f94ca0441138acead39928938660ca58329fe156f84b9f3015"}, + {file = "numpy-2.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e5eeca8067ad04bc8a2a8731183d51d7cbaac66d86085d5f4766ee6bf19c7f87"}, + {file = "numpy-2.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9adbd9bb520c866e1bfd7e10e1880a1f7749f1f6e5017686a5fbb9b72cf69f82"}, + {file = "numpy-2.0.1-cp310-cp310-win32.whl", hash = "sha256:7b9853803278db3bdcc6cd5beca37815b133e9e77ff3d4733c247414e78eb8d1"}, + {file = "numpy-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:81b0893a39bc5b865b8bf89e9ad7807e16717f19868e9d234bdaf9b1f1393868"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:75b4e316c5902d8163ef9d423b1c3f2f6252226d1aa5cd8a0a03a7d01ffc6268"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6e4eeb6eb2fced786e32e6d8df9e755ce5be920d17f7ce00bc38fcde8ccdbf9e"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:a1e01dcaab205fbece13c1410253a9eea1b1c9b61d237b6fa59bcc46e8e89343"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:a8fc2de81ad835d999113ddf87d1ea2b0f4704cbd947c948d2f5513deafe5a7b"}, + {file = "numpy-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a3d94942c331dd4e0e1147f7a8699a4aa47dffc11bf8a1523c12af8b2e91bbe"}, + {file = "numpy-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15eb4eca47d36ec3f78cde0a3a2ee24cf05ca7396ef808dda2c0ddad7c2bde67"}, + {file = "numpy-2.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b83e16a5511d1b1f8a88cbabb1a6f6a499f82c062a4251892d9ad5d609863fb7"}, + {file = "numpy-2.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1f87fec1f9bc1efd23f4227becff04bd0e979e23ca50cc92ec88b38489db3b55"}, + {file = "numpy-2.0.1-cp311-cp311-win32.whl", hash = "sha256:36d3a9405fd7c511804dc56fc32974fa5533bdeb3cd1604d6b8ff1d292b819c4"}, + {file = "numpy-2.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:08458fbf403bff5e2b45f08eda195d4b0c9b35682311da5a5a0a0925b11b9bd8"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6bf4e6f4a2a2e26655717a1983ef6324f2664d7011f6ef7482e8c0b3d51e82ac"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6fddc5fe258d3328cd8e3d7d3e02234c5d70e01ebe377a6ab92adb14039cb4"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:5daab361be6ddeb299a918a7c0864fa8618af66019138263247af405018b04e1"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:ea2326a4dca88e4a274ba3a4405eb6c6467d3ffbd8c7d38632502eaae3820587"}, + {file = "numpy-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:529af13c5f4b7a932fb0e1911d3a75da204eff023ee5e0e79c1751564221a5c8"}, + {file = "numpy-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6790654cb13eab303d8402354fabd47472b24635700f631f041bd0b65e37298a"}, + {file = "numpy-2.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cbab9fc9c391700e3e1287666dfd82d8666d10e69a6c4a09ab97574c0b7ee0a7"}, + {file = "numpy-2.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:99d0d92a5e3613c33a5f01db206a33f8fdf3d71f2912b0de1739894668b7a93b"}, + {file = "numpy-2.0.1-cp312-cp312-win32.whl", hash = "sha256:173a00b9995f73b79eb0191129f2455f1e34c203f559dd118636858cc452a1bf"}, + {file = "numpy-2.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:bb2124fdc6e62baae159ebcfa368708867eb56806804d005860b6007388df171"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bfc085b28d62ff4009364e7ca34b80a9a080cbd97c2c0630bb5f7f770dae9414"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8fae4ebbf95a179c1156fab0b142b74e4ba4204c87bde8d3d8b6f9c34c5825ef"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:72dc22e9ec8f6eaa206deb1b1355eb2e253899d7347f5e2fae5f0af613741d06"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:ec87f5f8aca726117a1c9b7083e7656a9d0d606eec7299cc067bb83d26f16e0c"}, + {file = "numpy-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f682ea61a88479d9498bf2091fdcd722b090724b08b31d63e022adc063bad59"}, + {file = "numpy-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8efc84f01c1cd7e34b3fb310183e72fcdf55293ee736d679b6d35b35d80bba26"}, + {file = "numpy-2.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3fdabe3e2a52bc4eff8dc7a5044342f8bd9f11ef0934fcd3289a788c0eb10018"}, + {file = "numpy-2.0.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:24a0e1befbfa14615b49ba9659d3d8818a0f4d8a1c5822af8696706fbda7310c"}, + {file = "numpy-2.0.1-cp39-cp39-win32.whl", hash = "sha256:f9cf5ea551aec449206954b075db819f52adc1638d46a6738253a712d553c7b4"}, + {file = "numpy-2.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:e9e81fa9017eaa416c056e5d9e71be93d05e2c3c2ab308d23307a8bc4443c368"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:61728fba1e464f789b11deb78a57805c70b2ed02343560456190d0501ba37b0f"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-macosx_14_0_x86_64.whl", hash = "sha256:12f5d865d60fb9734e60a60f1d5afa6d962d8d4467c120a1c0cda6eb2964437d"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eacf3291e263d5a67d8c1a581a8ebbcfd6447204ef58828caf69a5e3e8c75990"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2c3a346ae20cfd80b6cfd3e60dc179963ef2ea58da5ec074fd3d9e7a1e7ba97f"}, + {file = "numpy-2.0.1.tar.gz", hash = "sha256:485b87235796410c3519a699cfe1faab097e509e90ebb05dcd098db2ae87e7b3"}, ] [[package]] name = "openai" -version = "1.36.0" +version = "1.36.1" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.36.0-py3-none-any.whl", hash = "sha256:82b74ded1fe2ea94abb19a007178bc143675f1b6903cebd63e2968d654bb0a6f"}, - {file = "openai-1.36.0.tar.gz", hash = "sha256:a124baf0e1657d6156e12248642f88489cd030be8655b69bc1c13eb50e71a93d"}, + {file = "openai-1.36.1-py3-none-any.whl", hash = "sha256:d399b9d476dbbc167aceaac6bc6ed0b2e2bb6c9e189c7f7047f822743ae62e64"}, + {file = "openai-1.36.1.tar.gz", hash = "sha256:41be9e0302e95dba8a9374b885c5cb1cec2202816a70b98736fee25a2cadd1f2"}, ] [package.dependencies] @@ -1996,13 +1996,13 @@ files = [ [[package]] name = "pure-eval" -version = "0.2.2" +version = "0.2.3" description = "Safely evaluate AST nodes without side effects" optional = false python-versions = "*" files = [ - {file = "pure_eval-0.2.2-py3-none-any.whl", hash = "sha256:01eaab343580944bc56080ebe0a674b39ec44a945e6d09ba7db3cb8cec289350"}, - {file = "pure_eval-0.2.2.tar.gz", hash = "sha256:2b45320af6dfaa1750f543d714b6d1c520a1688dec6fd24d339063ce0aaa9ac3"}, + {file = "pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0"}, + {file = "pure_eval-0.2.3.tar.gz", hash = "sha256:5f4e983f40564c576c7c8635ae88db5956bb2229d7e9237d03b3c0b0190eaf42"}, ] [package.extras] @@ -2386,7 +2386,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -2752,19 +2751,19 @@ win32 = ["pywin32"] [[package]] name = "setuptools" -version = "71.0.4" +version = "71.1.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-71.0.4-py3-none-any.whl", hash = "sha256:ed2feca703be3bdbd94e6bb17365d91c6935c6b2a8d0bb09b66a2c435ba0b1a5"}, - {file = "setuptools-71.0.4.tar.gz", hash = "sha256:48297e5d393a62b7cb2a10b8f76c63a73af933bd809c9e0d0d6352a1a0135dd8"}, + {file = "setuptools-71.1.0-py3-none-any.whl", hash = "sha256:33874fdc59b3188304b2e7c80d9029097ea31627180896fb549c578ceb8a0855"}, + {file = "setuptools-71.1.0.tar.gz", hash = "sha256:032d42ee9fb536e33087fb66cac5f840eb9391ed05637b3f2a76a7c8fb477936"}, ] [package.extras] core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shellingham" diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index 331500b4c..05bdd33a7 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -10,7 +10,6 @@ export { CancelablePromise, CancelError } from "./core/CancelablePromise"; export { OpenAPI } from "./core/OpenAPI"; export type { OpenAPIConfig } from "./core/OpenAPI"; -export type { Agent } from "./models/Agent"; export type { Agents_Agent } from "./models/Agents_Agent"; export type { Agents_CreateAgentRequest } from "./models/Agents_CreateAgentRequest"; export type { Agents_CreateOrUpdateAgentRequest } from "./models/Agents_CreateOrUpdateAgentRequest"; @@ -37,7 +36,6 @@ export type { Common_ResourceUpdatedResponse } from "./models/Common_ResourceUpd export type { Common_toolRef } from "./models/Common_toolRef"; export type { Common_uuid } from "./models/Common_uuid"; export type { Common_validPythonIdentifier } from "./models/Common_validPythonIdentifier"; -export type { Doc } from "./models/Doc"; export type { Docs_Doc } from "./models/Docs_Doc"; export type { Docs_DocOwner } from "./models/Docs_DocOwner"; export type { Docs_DocReference } from "./models/Docs_DocReference"; @@ -57,8 +55,6 @@ export type { Entries_ImageDetail } from "./models/Entries_ImageDetail"; export type { Entries_ImageURL } from "./models/Entries_ImageURL"; export type { Entries_InputChatMLMessage } from "./models/Entries_InputChatMLMessage"; export type { Entries_Relation } from "./models/Entries_Relation"; -export type { Entry } from "./models/Entry"; -export type { Execution } from "./models/Execution"; export type { Executions_CreateExecutionRequest } from "./models/Executions_CreateExecutionRequest"; export type { Executions_Execution } from "./models/Executions_Execution"; export type { Executions_ResumeExecutionRequest } from "./models/Executions_ResumeExecutionRequest"; @@ -66,11 +62,8 @@ export type { Executions_StopExecutionRequest } from "./models/Executions_StopEx export type { Executions_TaskTokenResumeExecutionRequest } from "./models/Executions_TaskTokenResumeExecutionRequest"; export type { Executions_Transition } from "./models/Executions_Transition"; export type { Executions_UpdateExecutionRequest } from "./models/Executions_UpdateExecutionRequest"; -export type { History } from "./models/History"; export type { Jobs_JobState } from "./models/Jobs_JobState"; export type { Jobs_JobStatus } from "./models/Jobs_JobStatus"; -export type { JobStatus } from "./models/JobStatus"; -export type { Session } from "./models/Session"; export type { Sessions_ContextOverflowType } from "./models/Sessions_ContextOverflowType"; export type { Sessions_CreateOrUpdateSessionRequest } from "./models/Sessions_CreateOrUpdateSessionRequest"; export type { Sessions_CreateSessionRequest } from "./models/Sessions_CreateSessionRequest"; @@ -83,7 +76,6 @@ export type { Sessions_SingleAgentMultiUserSession } from "./models/Sessions_Sin export type { Sessions_SingleAgentNoUserSession } from "./models/Sessions_SingleAgentNoUserSession"; export type { Sessions_SingleAgentSingleUserSession } from "./models/Sessions_SingleAgentSingleUserSession"; export type { Sessions_UpdateSessionRequest } from "./models/Sessions_UpdateSessionRequest"; -export type { Task } from "./models/Task"; export type { Tasks_CreateOrUpdateTaskRequest } from "./models/Tasks_CreateOrUpdateTaskRequest"; export type { Tasks_CreateTaskRequest } from "./models/Tasks_CreateTaskRequest"; export type { Tasks_ErrorWorkflowStep } from "./models/Tasks_ErrorWorkflowStep"; @@ -96,7 +88,6 @@ export type { Tasks_ToolCallStep } from "./models/Tasks_ToolCallStep"; export type { Tasks_UpdateTaskRequest } from "./models/Tasks_UpdateTaskRequest"; export type { Tasks_WorkflowStep } from "./models/Tasks_WorkflowStep"; export type { Tasks_YieldStep } from "./models/Tasks_YieldStep"; -export type { Tool } from "./models/Tool"; export type { Tools_ChosenFunctionCall } from "./models/Tools_ChosenFunctionCall"; export type { Tools_ChosenToolCall } from "./models/Tools_ChosenToolCall"; export type { Tools_CreateToolRequest } from "./models/Tools_CreateToolRequest"; @@ -109,15 +100,12 @@ export type { Tools_Tool } from "./models/Tools_Tool"; export type { Tools_ToolResponse } from "./models/Tools_ToolResponse"; export type { Tools_ToolType } from "./models/Tools_ToolType"; export type { Tools_UpdateToolRequest } from "./models/Tools_UpdateToolRequest"; -export type { Transition } from "./models/Transition"; -export type { User } from "./models/User"; export type { Users_CreateOrUpdateUserRequest } from "./models/Users_CreateOrUpdateUserRequest"; export type { Users_CreateUserRequest } from "./models/Users_CreateUserRequest"; export type { Users_PatchUserRequest } from "./models/Users_PatchUserRequest"; export type { Users_UpdateUserRequest } from "./models/Users_UpdateUserRequest"; export type { Users_User } from "./models/Users_User"; -export { $Agent } from "./schemas/$Agent"; export { $Agents_Agent } from "./schemas/$Agents_Agent"; export { $Agents_CreateAgentRequest } from "./schemas/$Agents_CreateAgentRequest"; export { $Agents_CreateOrUpdateAgentRequest } from "./schemas/$Agents_CreateOrUpdateAgentRequest"; @@ -144,7 +132,6 @@ export { $Common_ResourceUpdatedResponse } from "./schemas/$Common_ResourceUpdat export { $Common_toolRef } from "./schemas/$Common_toolRef"; export { $Common_uuid } from "./schemas/$Common_uuid"; export { $Common_validPythonIdentifier } from "./schemas/$Common_validPythonIdentifier"; -export { $Doc } from "./schemas/$Doc"; export { $Docs_Doc } from "./schemas/$Docs_Doc"; export { $Docs_DocOwner } from "./schemas/$Docs_DocOwner"; export { $Docs_DocReference } from "./schemas/$Docs_DocReference"; @@ -164,8 +151,6 @@ export { $Entries_ImageDetail } from "./schemas/$Entries_ImageDetail"; export { $Entries_ImageURL } from "./schemas/$Entries_ImageURL"; export { $Entries_InputChatMLMessage } from "./schemas/$Entries_InputChatMLMessage"; export { $Entries_Relation } from "./schemas/$Entries_Relation"; -export { $Entry } from "./schemas/$Entry"; -export { $Execution } from "./schemas/$Execution"; export { $Executions_CreateExecutionRequest } from "./schemas/$Executions_CreateExecutionRequest"; export { $Executions_Execution } from "./schemas/$Executions_Execution"; export { $Executions_ResumeExecutionRequest } from "./schemas/$Executions_ResumeExecutionRequest"; @@ -173,11 +158,8 @@ export { $Executions_StopExecutionRequest } from "./schemas/$Executions_StopExec export { $Executions_TaskTokenResumeExecutionRequest } from "./schemas/$Executions_TaskTokenResumeExecutionRequest"; export { $Executions_Transition } from "./schemas/$Executions_Transition"; export { $Executions_UpdateExecutionRequest } from "./schemas/$Executions_UpdateExecutionRequest"; -export { $History } from "./schemas/$History"; export { $Jobs_JobState } from "./schemas/$Jobs_JobState"; export { $Jobs_JobStatus } from "./schemas/$Jobs_JobStatus"; -export { $JobStatus } from "./schemas/$JobStatus"; -export { $Session } from "./schemas/$Session"; export { $Sessions_ContextOverflowType } from "./schemas/$Sessions_ContextOverflowType"; export { $Sessions_CreateOrUpdateSessionRequest } from "./schemas/$Sessions_CreateOrUpdateSessionRequest"; export { $Sessions_CreateSessionRequest } from "./schemas/$Sessions_CreateSessionRequest"; @@ -190,7 +172,6 @@ export { $Sessions_SingleAgentMultiUserSession } from "./schemas/$Sessions_Singl export { $Sessions_SingleAgentNoUserSession } from "./schemas/$Sessions_SingleAgentNoUserSession"; export { $Sessions_SingleAgentSingleUserSession } from "./schemas/$Sessions_SingleAgentSingleUserSession"; export { $Sessions_UpdateSessionRequest } from "./schemas/$Sessions_UpdateSessionRequest"; -export { $Task } from "./schemas/$Task"; export { $Tasks_CreateOrUpdateTaskRequest } from "./schemas/$Tasks_CreateOrUpdateTaskRequest"; export { $Tasks_CreateTaskRequest } from "./schemas/$Tasks_CreateTaskRequest"; export { $Tasks_ErrorWorkflowStep } from "./schemas/$Tasks_ErrorWorkflowStep"; @@ -203,7 +184,6 @@ export { $Tasks_ToolCallStep } from "./schemas/$Tasks_ToolCallStep"; export { $Tasks_UpdateTaskRequest } from "./schemas/$Tasks_UpdateTaskRequest"; export { $Tasks_WorkflowStep } from "./schemas/$Tasks_WorkflowStep"; export { $Tasks_YieldStep } from "./schemas/$Tasks_YieldStep"; -export { $Tool } from "./schemas/$Tool"; export { $Tools_ChosenFunctionCall } from "./schemas/$Tools_ChosenFunctionCall"; export { $Tools_ChosenToolCall } from "./schemas/$Tools_ChosenToolCall"; export { $Tools_CreateToolRequest } from "./schemas/$Tools_CreateToolRequest"; @@ -216,8 +196,6 @@ export { $Tools_Tool } from "./schemas/$Tools_Tool"; export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse"; export { $Tools_ToolType } from "./schemas/$Tools_ToolType"; export { $Tools_UpdateToolRequest } from "./schemas/$Tools_UpdateToolRequest"; -export { $Transition } from "./schemas/$Transition"; -export { $User } from "./schemas/$User"; export { $Users_CreateOrUpdateUserRequest } from "./schemas/$Users_CreateOrUpdateUserRequest"; export { $Users_CreateUserRequest } from "./schemas/$Users_CreateUserRequest"; export { $Users_PatchUserRequest } from "./schemas/$Users_PatchUserRequest"; diff --git a/sdks/ts/src/api/models/Agent.ts b/sdks/ts/src/api/models/Agent.ts deleted file mode 100644 index c7a40c604..000000000 --- a/sdks/ts/src/api/models/Agent.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; -import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; -import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -export type Agent = { - readonly id: Common_uuid; - metadata?: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Name of the agent - */ - name: Common_identifierSafeUnicode; - /** - * About the agent - */ - about: string; - /** - * Model name to use (gpt-4-turbo, gemini-nano etc) - */ - model: string; - /** - * Instructions for the agent - */ - instructions: string | Array; - /** - * Default settings for all sessions created by this agent - */ - default_settings?: - | Chat_GenerationPresetSettings - | Chat_OpenAISettings - | Chat_vLLMSettings; -}; diff --git a/sdks/ts/src/api/models/Doc.ts b/sdks/ts/src/api/models/Doc.ts deleted file mode 100644 index 24b808762..000000000 --- a/sdks/ts/src/api/models/Doc.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -export type Doc = { - readonly id: Common_uuid; - metadata?: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * Title describing what this document contains - */ - title: Common_identifierSafeUnicode; - /** - * Contents of the document - */ - content: string | Array; -}; diff --git a/sdks/ts/src/api/models/Entry.ts b/sdks/ts/src/api/models/Entry.ts deleted file mode 100644 index 0ef8000dd..000000000 --- a/sdks/ts/src/api/models/Entry.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Entries_ChatMLRole } from "./Entries_ChatMLRole"; -import type { Tools_ChosenToolCall } from "./Tools_ChosenToolCall"; -import type { Tools_Tool } from "./Tools_Tool"; -import type { Tools_ToolResponse } from "./Tools_ToolResponse"; -export type Entry = { - role: Entries_ChatMLRole; - name: string | null; - content: Tools_Tool | Tools_ChosenToolCall | string | Tools_ToolResponse; - source: - | "api_request" - | "api_response" - | "tool_response" - | "internal" - | "summarizer" - | "meta"; - /** - * This is the time that this event refers to. - */ - timestamp: number; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - readonly id: Common_uuid; -}; diff --git a/sdks/ts/src/api/models/Execution.ts b/sdks/ts/src/api/models/Execution.ts deleted file mode 100644 index 574f1d792..000000000 --- a/sdks/ts/src/api/models/Execution.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -export type Execution = { - /** - * The ID of the task that the execution is running - */ - readonly task_id: Common_uuid; - /** - * The status of the execution - */ - readonly status: - | "queued" - | "starting" - | "running" - | "awaiting_input" - | "succeeded" - | "failed" - | "cancelled"; - /** - * The input to the execution - */ - input: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - metadata?: Record; - readonly id: Common_uuid; -}; diff --git a/sdks/ts/src/api/models/Executions_Transition.ts b/sdks/ts/src/api/models/Executions_Transition.ts index 68a47cf57..36a3d6dbe 100644 --- a/sdks/ts/src/api/models/Executions_Transition.ts +++ b/sdks/ts/src/api/models/Executions_Transition.ts @@ -6,7 +6,7 @@ import type { Common_uuid } from "./Common_uuid"; export type Executions_Transition = { readonly type: "finish" | "wait" | "error" | "step" | "cancelled"; readonly execution_id: Common_uuid; - readonly outputs: Record; + readonly output: Record; readonly current: Array; readonly next: Array | null; readonly id: Common_uuid; diff --git a/sdks/ts/src/api/models/History.ts b/sdks/ts/src/api/models/History.ts deleted file mode 100644 index 22b30c83f..000000000 --- a/sdks/ts/src/api/models/History.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Entries_Entry } from "./Entries_Entry"; -import type { Entries_Relation } from "./Entries_Relation"; -export type History = { - entries: Array; - relations: Array; - readonly session_id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; -}; diff --git a/sdks/ts/src/api/models/JobStatus.ts b/sdks/ts/src/api/models/JobStatus.ts deleted file mode 100644 index 1ee910dc3..000000000 --- a/sdks/ts/src/api/models/JobStatus.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -import type { Jobs_JobState } from "./Jobs_JobState"; -export type JobStatus = { - readonly id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Name of the job - */ - name: Common_identifierSafeUnicode; - /** - * Reason for the current state of the job - */ - reason: string; - /** - * Whether this Job supports progress updates - */ - has_progress: boolean; - /** - * Progress percentage - */ - progress: number; - /** - * Current state of the job - */ - state: Jobs_JobState; -}; diff --git a/sdks/ts/src/api/models/Session.ts b/sdks/ts/src/api/models/Session.ts deleted file mode 100644 index 296b931ca..000000000 --- a/sdks/ts/src/api/models/Session.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; -export type Session = { - /** - * User ID of user associated with this session - */ - user?: Common_uuid; - users?: Array; - /** - * Agent ID of agent associated with this session - */ - agent?: Common_uuid; - agents?: Array; - /** - * A specific situation that sets the background for this session - */ - situation: string; - /** - * Summary (null at the beginning) - generated automatically after every interaction - */ - readonly summary: string | null; - /** - * Render system and assistant message content as jinja templates - */ - render_templates: boolean; - /** - * Threshold value for the adaptive context functionality - */ - token_budget: number | null; - /** - * Action to start on context window overflow - */ - context_overflow: Sessions_ContextOverflowType | null; - readonly id: Common_uuid; - metadata?: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Discriminator property for Session. - */ - kind?: string; -}; diff --git a/sdks/ts/src/api/models/Task.ts b/sdks/ts/src/api/models/Task.ts deleted file mode 100644 index bbfd3b429..000000000 --- a/sdks/ts/src/api/models/Task.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -/** - * Object describing a Task - */ -export type Task = Record>; diff --git a/sdks/ts/src/api/models/Tool.ts b/sdks/ts/src/api/models/Tool.ts deleted file mode 100644 index 0994d643e..000000000 --- a/sdks/ts/src/api/models/Tool.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Tools_FunctionDef } from "./Tools_FunctionDef"; -import type { Tools_ToolType } from "./Tools_ToolType"; -export type Tool = { - /** - * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - */ - type: Tools_ToolType; - /** - * The tool should be run in the background (not supported at the moment) - */ - background: boolean; - function?: Tools_FunctionDef; - integration?: any; - system?: any; - api_call?: any; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - readonly id: Common_uuid; -}; diff --git a/sdks/ts/src/api/models/Tools_CreateToolRequest.ts b/sdks/ts/src/api/models/Tools_CreateToolRequest.ts index 27cd8ff42..51024282c 100644 --- a/sdks/ts/src/api/models/Tools_CreateToolRequest.ts +++ b/sdks/ts/src/api/models/Tools_CreateToolRequest.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; import type { Tools_FunctionDef } from "./Tools_FunctionDef"; import type { Tools_ToolType } from "./Tools_ToolType"; /** @@ -13,9 +14,9 @@ export type Tools_CreateToolRequest = { */ type: Tools_ToolType; /** - * The tool should be run in the background (not supported at the moment) + * Name of the tool (must be unique for this agent and a valid python identifier string ) */ - background: boolean; + name: Common_validPythonIdentifier; function?: Tools_FunctionDef; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Tools_FunctionDef.ts b/sdks/ts/src/api/models/Tools_FunctionDef.ts index 10d1bdef2..777aa3155 100644 --- a/sdks/ts/src/api/models/Tools_FunctionDef.ts +++ b/sdks/ts/src/api/models/Tools_FunctionDef.ts @@ -12,12 +12,12 @@ export type Tools_FunctionDef = { * DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. */ name?: Common_validPythonIdentifier; - /** - * The parameters the function accepts - */ - parameters: Record; /** * Description of the function */ description?: Common_identifierSafeUnicode; + /** + * The parameters the function accepts + */ + parameters: Record; }; diff --git a/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts index 7a67121a0..7f4417abd 100644 --- a/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts +++ b/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts @@ -12,12 +12,12 @@ export type Tools_FunctionDefUpdate = { * DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. */ name?: Common_validPythonIdentifier; - /** - * The parameters the function accepts - */ - parameters?: Record; /** * Description of the function */ description?: Common_identifierSafeUnicode; + /** + * The parameters the function accepts + */ + parameters?: Record; }; diff --git a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts index f4a4d3ec0..0957c8db2 100644 --- a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts +++ b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; import type { Tools_FunctionDefUpdate } from "./Tools_FunctionDefUpdate"; import type { Tools_ToolType } from "./Tools_ToolType"; /** @@ -13,9 +14,9 @@ export type Tools_PatchToolRequest = { */ type?: Tools_ToolType; /** - * The tool should be run in the background (not supported at the moment) + * Name of the tool (must be unique for this agent and a valid python identifier string ) */ - background?: boolean; + name?: Common_validPythonIdentifier; function?: Tools_FunctionDefUpdate; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Tools_Tool.ts b/sdks/ts/src/api/models/Tools_Tool.ts index 4c89afffa..d2b4e9dba 100644 --- a/sdks/ts/src/api/models/Tools_Tool.ts +++ b/sdks/ts/src/api/models/Tools_Tool.ts @@ -3,6 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_uuid } from "./Common_uuid"; +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; import type { Tools_FunctionDef } from "./Tools_FunctionDef"; import type { Tools_ToolType } from "./Tools_ToolType"; export type Tools_Tool = { @@ -11,9 +12,9 @@ export type Tools_Tool = { */ type: Tools_ToolType; /** - * The tool should be run in the background (not supported at the moment) + * Name of the tool (must be unique for this agent and a valid python identifier string ) */ - background: boolean; + name: Common_validPythonIdentifier; function?: Tools_FunctionDef; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts index 995f524b5..6a964fc8c 100644 --- a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts +++ b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; import type { Tools_FunctionDef } from "./Tools_FunctionDef"; import type { Tools_ToolType } from "./Tools_ToolType"; /** @@ -13,9 +14,9 @@ export type Tools_UpdateToolRequest = { */ type: Tools_ToolType; /** - * The tool should be run in the background (not supported at the moment) + * Name of the tool (must be unique for this agent and a valid python identifier string ) */ - background: boolean; + name: Common_validPythonIdentifier; function?: Tools_FunctionDef; integration?: any; system?: any; diff --git a/sdks/ts/src/api/models/Transition.ts b/sdks/ts/src/api/models/Transition.ts deleted file mode 100644 index be0e59662..000000000 --- a/sdks/ts/src/api/models/Transition.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -export type Transition = { - readonly type: "finish" | "wait" | "error" | "step" | "cancelled"; - readonly execution_id: Common_uuid; - readonly outputs: Record; - readonly current: Array; - readonly next: Array | null; - readonly id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; -}; diff --git a/sdks/ts/src/api/models/User.ts b/sdks/ts/src/api/models/User.ts deleted file mode 100644 index 63bfcfdcd..000000000 --- a/sdks/ts/src/api/models/User.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -export type User = { - readonly id: Common_uuid; - metadata?: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Name of the user - */ - name: Common_identifierSafeUnicode; - /** - * About the user - */ - about: string; -}; diff --git a/sdks/ts/src/api/schemas/$Agent.ts b/sdks/ts/src/api/schemas/$Agent.ts deleted file mode 100644 index fff31498b..000000000 --- a/sdks/ts/src/api/schemas/$Agent.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Agent = { - properties: { - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - name: { - type: "all-of", - description: `Name of the agent`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the agent`, - isRequired: true, - }, - model: { - type: "string", - description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, - isRequired: true, - }, - instructions: { - type: "any-of", - description: `Instructions for the agent`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - default_settings: { - type: "any-of", - description: `Default settings for all sessions created by this agent`, - contains: [ - { - type: "Chat_GenerationPresetSettings", - }, - { - type: "Chat_OpenAISettings", - }, - { - type: "Chat_vLLMSettings", - }, - ], - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Doc.ts b/sdks/ts/src/api/schemas/$Doc.ts deleted file mode 100644 index 5d581fc4c..000000000 --- a/sdks/ts/src/api/schemas/$Doc.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Doc = { - properties: { - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - title: { - type: "all-of", - description: `Title describing what this document contains`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - content: { - type: "any-of", - description: `Contents of the document`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Entry.ts b/sdks/ts/src/api/schemas/$Entry.ts deleted file mode 100644 index fb77b0be2..000000000 --- a/sdks/ts/src/api/schemas/$Entry.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Entry = { - properties: { - role: { - type: "Entries_ChatMLRole", - isRequired: true, - }, - name: { - type: "string", - isRequired: true, - isNullable: true, - }, - content: { - type: "any-of", - contains: [ - { - type: "Tools_Tool", - }, - { - type: "Tools_ChosenToolCall", - }, - { - type: "string", - }, - { - type: "Tools_ToolResponse", - }, - ], - isRequired: true, - }, - source: { - type: "Enum", - isRequired: true, - }, - timestamp: { - type: "number", - description: `This is the time that this event refers to.`, - isRequired: true, - format: "int32", - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Execution.ts b/sdks/ts/src/api/schemas/$Execution.ts deleted file mode 100644 index 54c59821f..000000000 --- a/sdks/ts/src/api/schemas/$Execution.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Execution = { - properties: { - task_id: { - type: "all-of", - description: `The ID of the task that the execution is running`, - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - status: { - type: "Enum", - isReadOnly: true, - isRequired: true, - }, - input: { - type: "dictionary", - contains: { - properties: {}, - }, - isRequired: true, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Executions_Transition.ts b/sdks/ts/src/api/schemas/$Executions_Transition.ts index 7d426c5f1..47c1bce66 100644 --- a/sdks/ts/src/api/schemas/$Executions_Transition.ts +++ b/sdks/ts/src/api/schemas/$Executions_Transition.ts @@ -19,7 +19,7 @@ export const $Executions_Transition = { isReadOnly: true, isRequired: true, }, - outputs: { + output: { type: "dictionary", contains: { properties: {}, diff --git a/sdks/ts/src/api/schemas/$History.ts b/sdks/ts/src/api/schemas/$History.ts deleted file mode 100644 index 0bcf1e13b..000000000 --- a/sdks/ts/src/api/schemas/$History.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $History = { - properties: { - entries: { - type: "array", - contains: { - type: "Entries_Entry", - }, - isRequired: true, - }, - relations: { - type: "array", - contains: { - type: "Entries_Relation", - }, - isRequired: true, - }, - session_id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$JobStatus.ts b/sdks/ts/src/api/schemas/$JobStatus.ts deleted file mode 100644 index e06a793a7..000000000 --- a/sdks/ts/src/api/schemas/$JobStatus.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $JobStatus = { - properties: { - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - name: { - type: "all-of", - description: `Name of the job`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - reason: { - type: "string", - description: `Reason for the current state of the job`, - isRequired: true, - }, - has_progress: { - type: "boolean", - description: `Whether this Job supports progress updates`, - isRequired: true, - }, - progress: { - type: "number", - description: `Progress percentage`, - isRequired: true, - format: "float", - maximum: 100, - }, - state: { - type: "all-of", - description: `Current state of the job`, - contains: [ - { - type: "Jobs_JobState", - }, - ], - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Session.ts b/sdks/ts/src/api/schemas/$Session.ts deleted file mode 100644 index d4ff80a8b..000000000 --- a/sdks/ts/src/api/schemas/$Session.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Session = { - properties: { - user: { - type: "all-of", - description: `User ID of user associated with this session`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - users: { - type: "array", - contains: { - type: "Common_uuid", - }, - }, - agent: { - type: "all-of", - description: `Agent ID of agent associated with this session`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - agents: { - type: "array", - contains: { - type: "Common_uuid", - }, - }, - situation: { - type: "string", - description: `A specific situation that sets the background for this session`, - isRequired: true, - }, - summary: { - type: "string", - description: `Summary (null at the beginning) - generated automatically after every interaction`, - isReadOnly: true, - isRequired: true, - isNullable: true, - }, - render_templates: { - type: "boolean", - description: `Render system and assistant message content as jinja templates`, - isRequired: true, - }, - token_budget: { - type: "number", - description: `Threshold value for the adaptive context functionality`, - isRequired: true, - isNullable: true, - format: "uint16", - }, - context_overflow: { - type: "one-of", - description: `Action to start on context window overflow`, - contains: [ - { - type: "Sessions_ContextOverflowType", - }, - ], - isRequired: true, - isNullable: true, - }, - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - kind: { - type: "string", - description: `Discriminator property for Session.`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Task.ts b/sdks/ts/src/api/schemas/$Task.ts deleted file mode 100644 index b8bbebc06..000000000 --- a/sdks/ts/src/api/schemas/$Task.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Task = { - type: "dictionary", - contains: { - type: "array", - contains: { - type: "Tasks_WorkflowStep", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tool.ts b/sdks/ts/src/api/schemas/$Tool.ts deleted file mode 100644 index 3c9c62e9a..000000000 --- a/sdks/ts/src/api/schemas/$Tool.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tool = { - properties: { - type: { - type: "all-of", - description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, - contains: [ - { - type: "Tools_ToolType", - }, - ], - isRequired: true, - }, - background: { - type: "boolean", - description: `The tool should be run in the background (not supported at the moment)`, - isRequired: true, - }, - function: { - type: "Tools_FunctionDef", - }, - integration: { - properties: {}, - }, - system: { - properties: {}, - }, - api_call: { - properties: {}, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts index a0bcf9ae5..bea3b4740 100644 --- a/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts +++ b/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts @@ -15,9 +15,14 @@ export const $Tools_CreateToolRequest = { ], isRequired: true, }, - background: { - type: "boolean", - description: `The tool should be run in the background (not supported at the moment)`, + name: { + type: "all-of", + description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], isRequired: true, }, function: { diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionDef.ts b/sdks/ts/src/api/schemas/$Tools_FunctionDef.ts index 8646379bc..0d9e5f2b3 100644 --- a/sdks/ts/src/api/schemas/$Tools_FunctionDef.ts +++ b/sdks/ts/src/api/schemas/$Tools_FunctionDef.ts @@ -14,13 +14,6 @@ export const $Tools_FunctionDef = { }, ], }, - parameters: { - type: "dictionary", - contains: { - properties: {}, - }, - isRequired: true, - }, description: { type: "all-of", description: `Description of the function`, @@ -30,5 +23,12 @@ export const $Tools_FunctionDef = { }, ], }, + parameters: { + type: "dictionary", + contains: { + properties: {}, + }, + isRequired: true, + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts index 90605f5ee..c79a3478e 100644 --- a/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts +++ b/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts @@ -14,12 +14,6 @@ export const $Tools_FunctionDefUpdate = { }, ], }, - parameters: { - type: "dictionary", - contains: { - properties: {}, - }, - }, description: { type: "all-of", description: `Description of the function`, @@ -29,5 +23,11 @@ export const $Tools_FunctionDefUpdate = { }, ], }, + parameters: { + type: "dictionary", + contains: { + properties: {}, + }, + }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts index de9d4b773..4170be793 100644 --- a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts +++ b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts @@ -14,9 +14,14 @@ export const $Tools_PatchToolRequest = { }, ], }, - background: { - type: "boolean", - description: `The tool should be run in the background (not supported at the moment)`, + name: { + type: "all-of", + description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], }, function: { type: "Tools_FunctionDefUpdate", diff --git a/sdks/ts/src/api/schemas/$Tools_Tool.ts b/sdks/ts/src/api/schemas/$Tools_Tool.ts index c008d4cbd..2785b6a28 100644 --- a/sdks/ts/src/api/schemas/$Tools_Tool.ts +++ b/sdks/ts/src/api/schemas/$Tools_Tool.ts @@ -14,9 +14,14 @@ export const $Tools_Tool = { ], isRequired: true, }, - background: { - type: "boolean", - description: `The tool should be run in the background (not supported at the moment)`, + name: { + type: "all-of", + description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], isRequired: true, }, function: { diff --git a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts index 97fbb6ac3..4e8373fbf 100644 --- a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts +++ b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts @@ -15,9 +15,14 @@ export const $Tools_UpdateToolRequest = { ], isRequired: true, }, - background: { - type: "boolean", - description: `The tool should be run in the background (not supported at the moment)`, + name: { + type: "all-of", + description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], isRequired: true, }, function: { diff --git a/sdks/ts/src/api/schemas/$Transition.ts b/sdks/ts/src/api/schemas/$Transition.ts deleted file mode 100644 index 65949ff66..000000000 --- a/sdks/ts/src/api/schemas/$Transition.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Transition = { - properties: { - type: { - type: "Enum", - isReadOnly: true, - isRequired: true, - }, - execution_id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - outputs: { - type: "dictionary", - contains: { - properties: {}, - }, - isReadOnly: true, - isRequired: true, - }, - current: { - type: "array", - contains: { - properties: {}, - }, - isReadOnly: true, - isRequired: true, - }, - next: { - type: "array", - contains: { - properties: {}, - }, - isReadOnly: true, - isRequired: true, - isNullable: true, - }, - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$User.ts b/sdks/ts/src/api/schemas/$User.ts deleted file mode 100644 index df3838203..000000000 --- a/sdks/ts/src/api/schemas/$User.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $User = { - properties: { - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - name: { - type: "all-of", - description: `Name of the user`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the user`, - isRequired: true, - }, - }, -} as const; From b9c6a8253bcc7b365804fc402a6300526059bc4e Mon Sep 17 00:00:00 2001 From: Julep Developers Date: Mon, 22 Jul 2024 15:25:10 +0000 Subject: [PATCH 21/36] wip Signed-off-by: Julep Developers --- agents-api/poetry.lock | 1 + sdks/postman/collection.json | 42 ++++---- sdks/python/julep/api/__init__.py | 44 --------- sdks/python/julep/api/client.py | 53 +++++----- sdks/python/julep/api/reference.md | 14 +-- sdks/python/julep/api/types/__init__.py | 46 --------- sdks/python/julep/api/types/agent.py | 83 ---------------- .../julep/api/types/agent_default_settings.py | 11 --- .../julep/api/types/agent_instructions.py | 5 - sdks/python/julep/api/types/doc.py | 60 ------------ sdks/python/julep/api/types/doc_content.py | 5 - sdks/python/julep/api/types/entry.py | 60 ------------ sdks/python/julep/api/types/entry_content.py | 17 ---- .../julep/api/types/entry_content_item.py | 16 --- .../api/types/entry_content_item_item.py | 87 ---------------- sdks/python/julep/api/types/entry_source.py | 10 -- sdks/python/julep/api/types/execution.py | 70 ------------- .../julep/api/types/execution_status.py | 16 --- .../julep/api/types/executions_transition.py | 2 +- sdks/python/julep/api/types/history.py | 51 ---------- sdks/python/julep/api/types/job_status.py | 79 --------------- sdks/python/julep/api/types/session.py | 98 ------------------- sdks/python/julep/api/types/task.py | 85 ---------------- sdks/python/julep/api/types/tool.py | 69 ------------- .../api/types/tools_create_tool_request.py | 5 +- .../julep/api/types/tools_function_def.py | 10 +- .../api/types/tools_function_def_update.py | 8 +- sdks/python/julep/api/types/tools_tool.py | 4 +- sdks/python/julep/api/types/transition.py | 58 ----------- .../python/julep/api/types/transition_type.py | 7 -- sdks/python/julep/api/types/user.py | 64 ------------ sdks/python/poetry.lock | 1 + 32 files changed, 72 insertions(+), 1109 deletions(-) delete mode 100644 sdks/python/julep/api/types/agent.py delete mode 100644 sdks/python/julep/api/types/agent_default_settings.py delete mode 100644 sdks/python/julep/api/types/agent_instructions.py delete mode 100644 sdks/python/julep/api/types/doc.py delete mode 100644 sdks/python/julep/api/types/doc_content.py delete mode 100644 sdks/python/julep/api/types/entry.py delete mode 100644 sdks/python/julep/api/types/entry_content.py delete mode 100644 sdks/python/julep/api/types/entry_content_item.py delete mode 100644 sdks/python/julep/api/types/entry_content_item_item.py delete mode 100644 sdks/python/julep/api/types/entry_source.py delete mode 100644 sdks/python/julep/api/types/execution.py delete mode 100644 sdks/python/julep/api/types/execution_status.py delete mode 100644 sdks/python/julep/api/types/history.py delete mode 100644 sdks/python/julep/api/types/job_status.py delete mode 100644 sdks/python/julep/api/types/session.py delete mode 100644 sdks/python/julep/api/types/task.py delete mode 100644 sdks/python/julep/api/types/tool.py delete mode 100644 sdks/python/julep/api/types/transition.py delete mode 100644 sdks/python/julep/api/types/transition_type.py delete mode 100644 sdks/python/julep/api/types/user.py diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 552e8f6ec..758d4d6a1 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -4131,6 +4131,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/sdks/postman/collection.json b/sdks/postman/collection.json index 4c0bbfbf0..919017115 100644 --- a/sdks/postman/collection.json +++ b/sdks/postman/collection.json @@ -158,7 +158,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -426,7 +426,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"default_settings\": {\n \"preset\": \"problem_solving\"\n }\n}", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"default_settings\": {\n \"preset\": \"problem_solving\"\n }\n}", "_postman_previewlanguage": "json" } ] @@ -864,7 +864,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -1272,7 +1272,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n}", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n}", "_postman_previewlanguage": "json" } ] @@ -1538,7 +1538,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"input\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"id\": \"id\"\n}", + "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n}", "_postman_previewlanguage": "json" } ] @@ -1725,7 +1725,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"transitions\": [\n {\n \"type\": \"finish\",\n \"execution_id\": \"execution_id\",\n \"outputs\": {},\n \"current\": [],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"transitions\": [\n {\n \"type\": \"finish\",\n \"execution_id\": \"execution_id\",\n \"output\": {\n \"key\": \"value\"\n },\n \"current\": [],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n }\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -2810,7 +2810,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"input_schema\": {\n \"key\": \"value\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n }\n }\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -2848,7 +2848,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2891,7 +2891,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2938,7 +2938,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2981,7 +2981,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -3035,7 +3035,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -3085,7 +3085,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"background\": true\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -3428,7 +3428,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {},\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -3474,7 +3474,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"input\": {}\n}", + "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", "options": { "raw": { "language": "json" @@ -3525,7 +3525,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"input\": {}\n}", + "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", "options": { "raw": { "language": "json" @@ -3685,7 +3685,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"background\": true\n}", + "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", "options": { "raw": { "language": "json" @@ -3735,7 +3735,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"background\": true\n}", + "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", "options": { "raw": { "language": "json" @@ -4062,7 +4062,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -4330,7 +4330,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"metadata\": {\n \"key\": \"value\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", "_postman_previewlanguage": "json" } ] @@ -4768,7 +4768,7 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index c66dd159f..74de16b6e 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -1,12 +1,9 @@ # This file was auto-generated by Fern from our API Definition. from .types import ( - Agent, - AgentDefaultSettings, AgentDocsRouteListRequestDirection, AgentDocsRouteListRequestSortBy, AgentDocsRouteListResponse, - AgentInstructions, AgentToolsRouteListRequestDirection, AgentToolsRouteListRequestSortBy, AgentToolsRouteListResponse, @@ -45,8 +42,6 @@ CommonToolRef, CommonUuid, CommonValidPythonIdentifier, - Doc, - DocContent, DocsDoc, DocsDocContent, DocsDocOwner, @@ -89,15 +84,6 @@ EntriesInputChatMlMessageContentItem_ImageUrl, EntriesInputChatMlMessageContentItem_Text, EntriesRelation, - Entry, - EntryContent, - EntryContentItem, - EntryContentItemItem, - EntryContentItemItem_ImageUrl, - EntryContentItemItem_Text, - EntrySource, - Execution, - ExecutionStatus, ExecutionTransitionsRouteListRequestDirection, ExecutionTransitionsRouteListRequestSortBy, ExecutionTransitionsRouteListResponse, @@ -111,14 +97,11 @@ ExecutionsUpdateExecutionRequest, ExecutionsUpdateExecutionRequest_Cancelled, ExecutionsUpdateExecutionRequest_Running, - History, HistoryRouteListRequestDirection, HistoryRouteListRequestSortBy, HistoryRouteListResponse, - JobStatus, JobsJobState, JobsJobStatus, - Session, SessionsContextOverflowType, SessionsMultiAgentMultiUserSession, SessionsMultiAgentNoUserSession, @@ -136,7 +119,6 @@ SessionsSingleAgentMultiUserSession, SessionsSingleAgentNoUserSession, SessionsSingleAgentSingleUserSession, - Task, TaskExecutionsRouteListRequestDirection, TaskExecutionsRouteListRequestSortBy, TaskExecutionsRouteListResponse, @@ -162,7 +144,6 @@ TasksWorkflowStep_ToolCall, TasksWorkflowStep_Yield, TasksYieldStep, - Tool, ToolsChosenFunctionCall, ToolsChosenToolCall, ToolsChosenToolCall_Function, @@ -175,9 +156,6 @@ ToolsToolResponse, ToolsToolType, ToolsTool_Function, - Transition, - TransitionType, - User, UserDocsRouteListRequestDirection, UserDocsRouteListRequestSortBy, UserDocsRouteListResponse, @@ -192,12 +170,9 @@ from .environment import JulepApiEnvironment __all__ = [ - "Agent", - "AgentDefaultSettings", "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", - "AgentInstructions", "AgentToolsRouteListRequestDirection", "AgentToolsRouteListRequestSortBy", "AgentToolsRouteListResponse", @@ -236,8 +211,6 @@ "CommonToolRef", "CommonUuid", "CommonValidPythonIdentifier", - "Doc", - "DocContent", "DocsDoc", "DocsDocContent", "DocsDocOwner", @@ -280,15 +253,6 @@ "EntriesInputChatMlMessageContentItem_ImageUrl", "EntriesInputChatMlMessageContentItem_Text", "EntriesRelation", - "Entry", - "EntryContent", - "EntryContentItem", - "EntryContentItemItem", - "EntryContentItemItem_ImageUrl", - "EntryContentItemItem_Text", - "EntrySource", - "Execution", - "ExecutionStatus", "ExecutionTransitionsRouteListRequestDirection", "ExecutionTransitionsRouteListRequestSortBy", "ExecutionTransitionsRouteListResponse", @@ -302,15 +266,12 @@ "ExecutionsUpdateExecutionRequest", "ExecutionsUpdateExecutionRequest_Cancelled", "ExecutionsUpdateExecutionRequest_Running", - "History", "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", - "JobStatus", "JobsJobState", "JobsJobStatus", "JulepApiEnvironment", - "Session", "SessionsContextOverflowType", "SessionsMultiAgentMultiUserSession", "SessionsMultiAgentNoUserSession", @@ -328,7 +289,6 @@ "SessionsSingleAgentMultiUserSession", "SessionsSingleAgentNoUserSession", "SessionsSingleAgentSingleUserSession", - "Task", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", @@ -354,7 +314,6 @@ "TasksWorkflowStep_ToolCall", "TasksWorkflowStep_Yield", "TasksYieldStep", - "Tool", "ToolsChosenFunctionCall", "ToolsChosenToolCall", "ToolsChosenToolCall_Function", @@ -367,9 +326,6 @@ "ToolsToolResponse", "ToolsToolType", "ToolsTool_Function", - "Transition", - "TransitionType", - "User", "UserDocsRouteListRequestDirection", "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index cde175633..78fbcafbe 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -67,6 +67,7 @@ from .types.common_resource_deleted_response import CommonResourceDeletedResponse from .types.common_resource_updated_response import CommonResourceUpdatedResponse from .types.common_uuid import CommonUuid +from .types.common_valid_python_identifier import CommonValidPythonIdentifier from .types.docs_doc import DocsDoc from .types.docs_doc_search_request import DocsDocSearchRequest from .types.docs_embed_query_request import DocsEmbedQueryRequest @@ -2156,7 +2157,7 @@ def tasks_route_create( tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -2248,7 +2249,7 @@ def tasks_route_create_or_update( tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -2338,7 +2339,7 @@ def tasks_route_update( tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -2606,7 +2607,7 @@ def task_executions_route_create( ) client.task_executions_route_create( id="id", - input={}, + input={"key": "value"}, ) """ _response = self._client_wrapper.httpx_client.request( @@ -2687,7 +2688,7 @@ def tool_route_update( id: CommonUuid, *, type: ToolsToolType, - background: bool, + name: CommonValidPythonIdentifier, function: typing.Optional[ToolsFunctionDef] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, @@ -2705,8 +2706,8 @@ def tool_route_update( type : ToolsToolType Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - background : bool - The tool should be run in the background (not supported at the moment) + name : CommonValidPythonIdentifier + Name of the tool (must be unique for this agent and a valid python identifier string ) function : typing.Optional[ToolsFunctionDef] @@ -2735,7 +2736,7 @@ def tool_route_update( client.tool_route_update( id="id", type="function", - background=True, + name="name", ) """ _response = self._client_wrapper.httpx_client.request( @@ -2743,7 +2744,7 @@ def tool_route_update( method="PUT", json={ "type": type, - "background": background, + "name": name, "function": function, "integration": integration, "system": system, @@ -2809,7 +2810,7 @@ def tool_route_patch( id: CommonUuid, *, type: typing.Optional[ToolsToolType] = OMIT, - background: typing.Optional[bool] = OMIT, + name: typing.Optional[CommonValidPythonIdentifier] = OMIT, function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, @@ -2827,8 +2828,8 @@ def tool_route_patch( type : typing.Optional[ToolsToolType] Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - background : typing.Optional[bool] - The tool should be run in the background (not supported at the moment) + name : typing.Optional[CommonValidPythonIdentifier] + Name of the tool (must be unique for this agent and a valid python identifier string ) function : typing.Optional[ToolsFunctionDefUpdate] @@ -2863,7 +2864,7 @@ def tool_route_patch( method="PATCH", json={ "type": type, - "background": background, + "name": name, "function": function, "integration": integration, "system": system, @@ -5714,7 +5715,7 @@ async def main() -> None: tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -5814,7 +5815,7 @@ async def main() -> None: tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -5912,7 +5913,7 @@ async def main() -> None: tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -6212,7 +6213,7 @@ async def task_executions_route_create( async def main() -> None: await client.task_executions_route_create( id="id", - input={}, + input={"key": "value"}, ) @@ -6304,7 +6305,7 @@ async def tool_route_update( id: CommonUuid, *, type: ToolsToolType, - background: bool, + name: CommonValidPythonIdentifier, function: typing.Optional[ToolsFunctionDef] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, @@ -6322,8 +6323,8 @@ async def tool_route_update( type : ToolsToolType Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - background : bool - The tool should be run in the background (not supported at the moment) + name : CommonValidPythonIdentifier + Name of the tool (must be unique for this agent and a valid python identifier string ) function : typing.Optional[ToolsFunctionDef] @@ -6357,7 +6358,7 @@ async def main() -> None: await client.tool_route_update( id="id", type="function", - background=True, + name="name", ) @@ -6368,7 +6369,7 @@ async def main() -> None: method="PUT", json={ "type": type, - "background": background, + "name": name, "function": function, "integration": integration, "system": system, @@ -6442,7 +6443,7 @@ async def tool_route_patch( id: CommonUuid, *, type: typing.Optional[ToolsToolType] = OMIT, - background: typing.Optional[bool] = OMIT, + name: typing.Optional[CommonValidPythonIdentifier] = OMIT, function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, integration: typing.Optional[typing.Any] = OMIT, system: typing.Optional[typing.Any] = OMIT, @@ -6460,8 +6461,8 @@ async def tool_route_patch( type : typing.Optional[ToolsToolType] Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - background : typing.Optional[bool] - The tool should be run in the background (not supported at the moment) + name : typing.Optional[CommonValidPythonIdentifier] + Name of the tool (must be unique for this agent and a valid python identifier string ) function : typing.Optional[ToolsFunctionDefUpdate] @@ -6504,7 +6505,7 @@ async def main() -> None: method="PATCH", json={ "type": type, - "background": background, + "name": name, "function": function, "integration": integration, "system": system, diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index 346cc49dd..d1f75f921 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -2879,7 +2879,7 @@ client.tasks_route_create( tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -3009,7 +3009,7 @@ client.tasks_route_create_or_update( tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -3146,7 +3146,7 @@ client.tasks_route_update( tools=[ ToolsCreateToolRequest( type="function", - background=True, + name="name", ) ], inherit_tools=True, @@ -3575,7 +3575,7 @@ client = JulepApi( ) client.task_executions_route_create( id="id", - input={}, + input={"key": "value"}, ) ``` @@ -3752,7 +3752,7 @@ client = JulepApi( client.tool_route_update( id="id", type="function", - background=True, + name="name", ) ``` @@ -3785,7 +3785,7 @@ client.tool_route_update(
-**background:** `bool` — The tool should be run in the background (not supported at the moment) +**name:** `CommonValidPythonIdentifier` — Name of the tool (must be unique for this agent and a valid python identifier string )
@@ -3975,7 +3975,7 @@ client.tool_route_patch(
-**background:** `typing.Optional[bool]` — The tool should be run in the background (not supported at the moment) +**name:** `typing.Optional[CommonValidPythonIdentifier]` — Name of the tool (must be unique for this agent and a valid python identifier string )
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index b569db7c8..8403f8f17 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -1,11 +1,8 @@ # This file was auto-generated by Fern from our API Definition. -from .agent import Agent -from .agent_default_settings import AgentDefaultSettings from .agent_docs_route_list_request_direction import AgentDocsRouteListRequestDirection from .agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy from .agent_docs_route_list_response import AgentDocsRouteListResponse -from .agent_instructions import AgentInstructions from .agent_tools_route_list_request_direction import ( AgentToolsRouteListRequestDirection, ) @@ -66,8 +63,6 @@ from .common_tool_ref import CommonToolRef from .common_uuid import CommonUuid from .common_valid_python_identifier import CommonValidPythonIdentifier -from .doc import Doc -from .doc_content import DocContent from .docs_doc import DocsDoc from .docs_doc_content import DocsDocContent from .docs_doc_owner import DocsDocOwner @@ -118,17 +113,6 @@ EntriesInputChatMlMessageContentItem_Text, ) from .entries_relation import EntriesRelation -from .entry import Entry -from .entry_content import EntryContent -from .entry_content_item import EntryContentItem -from .entry_content_item_item import ( - EntryContentItemItem, - EntryContentItemItem_ImageUrl, - EntryContentItemItem_Text, -) -from .entry_source import EntrySource -from .execution import Execution -from .execution_status import ExecutionStatus from .execution_transitions_route_list_request_direction import ( ExecutionTransitionsRouteListRequestDirection, ) @@ -152,14 +136,11 @@ ExecutionsUpdateExecutionRequest_Cancelled, ExecutionsUpdateExecutionRequest_Running, ) -from .history import History from .history_route_list_request_direction import HistoryRouteListRequestDirection from .history_route_list_request_sort_by import HistoryRouteListRequestSortBy from .history_route_list_response import HistoryRouteListResponse -from .job_status import JobStatus from .jobs_job_state import JobsJobState from .jobs_job_status import JobsJobStatus -from .session import Session from .sessions_context_overflow_type import SessionsContextOverflowType from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession @@ -185,7 +166,6 @@ from .sessions_single_agent_single_user_session import ( SessionsSingleAgentSingleUserSession, ) -from .task import Task from .task_executions_route_list_request_direction import ( TaskExecutionsRouteListRequestDirection, ) @@ -219,7 +199,6 @@ TasksWorkflowStep_Yield, ) from .tasks_yield_step import TasksYieldStep -from .tool import Tool from .tools_chosen_function_call import ToolsChosenFunctionCall from .tools_chosen_tool_call import ToolsChosenToolCall, ToolsChosenToolCall_Function from .tools_create_tool_request import ToolsCreateToolRequest @@ -230,9 +209,6 @@ from .tools_tool import ToolsTool, ToolsTool_Function from .tools_tool_response import ToolsToolResponse from .tools_tool_type import ToolsToolType -from .transition import Transition -from .transition_type import TransitionType -from .user import User from .user_docs_route_list_request_direction import UserDocsRouteListRequestDirection from .user_docs_route_list_request_sort_by import UserDocsRouteListRequestSortBy from .user_docs_route_list_response import UserDocsRouteListResponse @@ -249,12 +225,9 @@ from .users_user import UsersUser __all__ = [ - "Agent", - "AgentDefaultSettings", "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", - "AgentInstructions", "AgentToolsRouteListRequestDirection", "AgentToolsRouteListRequestSortBy", "AgentToolsRouteListResponse", @@ -293,8 +266,6 @@ "CommonToolRef", "CommonUuid", "CommonValidPythonIdentifier", - "Doc", - "DocContent", "DocsDoc", "DocsDocContent", "DocsDocOwner", @@ -337,15 +308,6 @@ "EntriesInputChatMlMessageContentItem_ImageUrl", "EntriesInputChatMlMessageContentItem_Text", "EntriesRelation", - "Entry", - "EntryContent", - "EntryContentItem", - "EntryContentItemItem", - "EntryContentItemItem_ImageUrl", - "EntryContentItemItem_Text", - "EntrySource", - "Execution", - "ExecutionStatus", "ExecutionTransitionsRouteListRequestDirection", "ExecutionTransitionsRouteListRequestSortBy", "ExecutionTransitionsRouteListResponse", @@ -359,14 +321,11 @@ "ExecutionsUpdateExecutionRequest", "ExecutionsUpdateExecutionRequest_Cancelled", "ExecutionsUpdateExecutionRequest_Running", - "History", "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", - "JobStatus", "JobsJobState", "JobsJobStatus", - "Session", "SessionsContextOverflowType", "SessionsMultiAgentMultiUserSession", "SessionsMultiAgentNoUserSession", @@ -384,7 +343,6 @@ "SessionsSingleAgentMultiUserSession", "SessionsSingleAgentNoUserSession", "SessionsSingleAgentSingleUserSession", - "Task", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", @@ -410,7 +368,6 @@ "TasksWorkflowStep_ToolCall", "TasksWorkflowStep_Yield", "TasksYieldStep", - "Tool", "ToolsChosenFunctionCall", "ToolsChosenToolCall", "ToolsChosenToolCall_Function", @@ -423,9 +380,6 @@ "ToolsToolResponse", "ToolsToolType", "ToolsTool_Function", - "Transition", - "TransitionType", - "User", "UserDocsRouteListRequestDirection", "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", diff --git a/sdks/python/julep/api/types/agent.py b/sdks/python/julep/api/types/agent.py deleted file mode 100644 index b580b8dcd..000000000 --- a/sdks/python/julep/api/types/agent.py +++ /dev/null @@ -1,83 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .agent_default_settings import AgentDefaultSettings -from .agent_instructions import AgentInstructions -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid - - -class Agent(pydantic_v1.BaseModel): - id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the agent - """ - - about: str = pydantic_v1.Field() - """ - About the agent - """ - - model: str = pydantic_v1.Field() - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - - instructions: AgentInstructions = pydantic_v1.Field() - """ - Instructions for the agent - """ - - default_settings: typing.Optional[AgentDefaultSettings] = pydantic_v1.Field( - default=None - ) - """ - Default settings for all sessions created by this agent - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agent_default_settings.py b/sdks/python/julep/api/types/agent_default_settings.py deleted file mode 100644 index 33145518a..000000000 --- a/sdks/python/julep/api/types/agent_default_settings.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_generation_preset_settings import ChatGenerationPresetSettings -from .chat_open_ai_settings import ChatOpenAiSettings -from .chat_v_llm_settings import ChatVLlmSettings - -AgentDefaultSettings = typing.Union[ - ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings -] diff --git a/sdks/python/julep/api/types/agent_instructions.py b/sdks/python/julep/api/types/agent_instructions.py deleted file mode 100644 index d792498bd..000000000 --- a/sdks/python/julep/api/types/agent_instructions.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/doc.py b/sdks/python/julep/api/types/doc.py deleted file mode 100644 index c882ac772..000000000 --- a/sdks/python/julep/api/types/doc.py +++ /dev/null @@ -1,60 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid -from .doc_content import DocContent - - -class Doc(pydantic_v1.BaseModel): - id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - title: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Title describing what this document contains - """ - - content: DocContent = pydantic_v1.Field() - """ - Contents of the document - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/doc_content.py b/sdks/python/julep/api/types/doc_content.py deleted file mode 100644 index 104d07d52..000000000 --- a/sdks/python/julep/api/types/doc_content.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DocContent = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/entry.py b/sdks/python/julep/api/types/entry.py deleted file mode 100644 index 641e47753..000000000 --- a/sdks/python/julep/api/types/entry.py +++ /dev/null @@ -1,60 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .entries_chat_ml_role import EntriesChatMlRole -from .entry_content import EntryContent -from .entry_source import EntrySource - - -class Entry(pydantic_v1.BaseModel): - role: EntriesChatMlRole - name: typing.Optional[str] = None - content: EntryContent - source: EntrySource - timestamp: int = pydantic_v1.Field() - """ - This is the time that this event refers to. - """ - - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - id: CommonUuid - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entry_content.py b/sdks/python/julep/api/types/entry_content.py deleted file mode 100644 index 6356ac700..000000000 --- a/sdks/python/julep/api/types/entry_content.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .entry_content_item import EntryContentItem -from .tools_chosen_tool_call import ToolsChosenToolCall -from .tools_tool import ToolsTool -from .tools_tool_response import ToolsToolResponse - -EntryContent = typing.Union[ - typing.List[EntryContentItem], - ToolsTool, - ToolsChosenToolCall, - str, - ToolsToolResponse, - typing.List[EntryContentItem], -] diff --git a/sdks/python/julep/api/types/entry_content_item.py b/sdks/python/julep/api/types/entry_content_item.py deleted file mode 100644 index 86aa2c26e..000000000 --- a/sdks/python/julep/api/types/entry_content_item.py +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .entry_content_item_item import EntryContentItemItem -from .tools_chosen_tool_call import ToolsChosenToolCall -from .tools_tool import ToolsTool -from .tools_tool_response import ToolsToolResponse - -EntryContentItem = typing.Union[ - typing.List[EntryContentItemItem], - ToolsTool, - ToolsChosenToolCall, - str, - ToolsToolResponse, -] diff --git a/sdks/python/julep/api/types/entry_content_item_item.py b/sdks/python/julep/api/types/entry_content_item_item.py deleted file mode 100644 index ea0afd988..000000000 --- a/sdks/python/julep/api/types/entry_content_item_item.py +++ /dev/null @@ -1,87 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .entries_image_url import EntriesImageUrl - - -class EntryContentItemItem_Text(pydantic_v1.BaseModel): - text: str - type: typing.Literal["text"] = "text" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class EntryContentItemItem_ImageUrl(pydantic_v1.BaseModel): - image_url: EntriesImageUrl - type: typing.Literal["image_url"] = "image_url" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -EntryContentItemItem = typing.Union[ - EntryContentItemItem_Text, EntryContentItemItem_ImageUrl -] diff --git a/sdks/python/julep/api/types/entry_source.py b/sdks/python/julep/api/types/entry_source.py deleted file mode 100644 index b787447cc..000000000 --- a/sdks/python/julep/api/types/entry_source.py +++ /dev/null @@ -1,10 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -EntrySource = typing.Union[ - typing.Literal[ - "api_request", "api_response", "tool_response", "internal", "summarizer", "meta" - ], - typing.Any, -] diff --git a/sdks/python/julep/api/types/execution.py b/sdks/python/julep/api/types/execution.py deleted file mode 100644 index 0aea0bc9d..000000000 --- a/sdks/python/julep/api/types/execution.py +++ /dev/null @@ -1,70 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .execution_status import ExecutionStatus - - -class Execution(pydantic_v1.BaseModel): - task_id: CommonUuid = pydantic_v1.Field() - """ - The ID of the task that the execution is running - """ - - status: ExecutionStatus = pydantic_v1.Field() - """ - The status of the execution - """ - - input: typing.Dict[str, typing.Any] = pydantic_v1.Field() - """ - The input to the execution - """ - - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - id: CommonUuid - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/execution_status.py b/sdks/python/julep/api/types/execution_status.py deleted file mode 100644 index ef2640dc9..000000000 --- a/sdks/python/julep/api/types/execution_status.py +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ExecutionStatus = typing.Union[ - typing.Literal[ - "queued", - "starting", - "running", - "awaiting_input", - "succeeded", - "failed", - "cancelled", - ], - typing.Any, -] diff --git a/sdks/python/julep/api/types/executions_transition.py b/sdks/python/julep/api/types/executions_transition.py index 229d5e7e2..abdd873f1 100644 --- a/sdks/python/julep/api/types/executions_transition.py +++ b/sdks/python/julep/api/types/executions_transition.py @@ -12,7 +12,7 @@ class ExecutionsTransition(pydantic_v1.BaseModel): type: ExecutionsTransitionType execution_id: CommonUuid - outputs: typing.Dict[str, typing.Any] + output: typing.Dict[str, typing.Any] current: typing.List[typing.Any] next: typing.Optional[typing.List[typing.Any]] = None id: CommonUuid diff --git a/sdks/python/julep/api/types/history.py b/sdks/python/julep/api/types/history.py deleted file mode 100644 index b3cc6499c..000000000 --- a/sdks/python/julep/api/types/history.py +++ /dev/null @@ -1,51 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .entries_entry import EntriesEntry -from .entries_relation import EntriesRelation - - -class History(pydantic_v1.BaseModel): - entries: typing.List[EntriesEntry] - relations: typing.List[EntriesRelation] - session_id: CommonUuid - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/job_status.py b/sdks/python/julep/api/types/job_status.py deleted file mode 100644 index 2badb9fc7..000000000 --- a/sdks/python/julep/api/types/job_status.py +++ /dev/null @@ -1,79 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid -from .jobs_job_state import JobsJobState - - -class JobStatus(pydantic_v1.BaseModel): - id: CommonUuid - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the job - """ - - reason: str = pydantic_v1.Field() - """ - Reason for the current state of the job - """ - - has_progress: bool = pydantic_v1.Field() - """ - Whether this Job supports progress updates - """ - - progress: float = pydantic_v1.Field() - """ - Progress percentage - """ - - state: JobsJobState = pydantic_v1.Field() - """ - Current state of the job - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/session.py b/sdks/python/julep/api/types/session.py deleted file mode 100644 index 6bff48943..000000000 --- a/sdks/python/julep/api/types/session.py +++ /dev/null @@ -1,98 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .sessions_context_overflow_type import SessionsContextOverflowType - - -class Session(pydantic_v1.BaseModel): - user: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) - """ - User ID of user associated with this session - """ - - users: typing.Optional[typing.List[CommonUuid]] = None - agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) - """ - Agent ID of agent associated with this session - """ - - agents: typing.Optional[typing.List[CommonUuid]] = None - situation: str = pydantic_v1.Field() - """ - A specific situation that sets the background for this session - """ - - summary: typing.Optional[str] = pydantic_v1.Field(default=None) - """ - Summary (null at the beginning) - generated automatically after every interaction - """ - - render_templates: bool = pydantic_v1.Field() - """ - Render system and assistant message content as jinja templates - """ - - token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) - """ - Threshold value for the adaptive context functionality - """ - - context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( - default=None - ) - """ - Action to start on context window overflow - """ - - id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - kind: typing.Optional[str] = pydantic_v1.Field(default=None) - """ - Discriminator property for Session. - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/task.py b/sdks/python/julep/api/types/task.py deleted file mode 100644 index f897c2f8d..000000000 --- a/sdks/python/julep/api/types/task.py +++ /dev/null @@ -1,85 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .tasks_workflow_step import TasksWorkflowStep -from .tools_create_tool_request import ToolsCreateToolRequest - - -class Task(pydantic_v1.BaseModel): - """ - Object describing a Task - """ - - name: str - description: str - main: typing.List[TasksWorkflowStep] = pydantic_v1.Field() - """ - The entrypoint of the task. - """ - - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( - default=None - ) - """ - The schema for the input to the task. `null` means all inputs are valid. - """ - - tools: typing.List[ToolsCreateToolRequest] = pydantic_v1.Field() - """ - Tools defined specifically for this task not included in the Agent itself. - """ - - inherit_tools: bool = pydantic_v1.Field() - """ - Whether to inherit tools from the parent agent or not. Defaults to true. - """ - - agent_id: CommonUuid - id: CommonUuid - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tool.py b/sdks/python/julep/api/types/tool.py deleted file mode 100644 index 67b956eb5..000000000 --- a/sdks/python/julep/api/types/tool.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .tools_function_def import ToolsFunctionDef -from .tools_tool_type import ToolsToolType - - -class Tool(pydantic_v1.BaseModel): - type: ToolsToolType = pydantic_v1.Field() - """ - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - """ - - background: bool = pydantic_v1.Field() - """ - The tool should be run in the background (not supported at the moment) - """ - - function: typing.Optional[ToolsFunctionDef] = None - integration: typing.Optional[typing.Any] = None - system: typing.Optional[typing.Any] = None - api_call: typing.Optional[typing.Any] = None - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - id: CommonUuid - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_create_tool_request.py b/sdks/python/julep/api/types/tools_create_tool_request.py index 3a62c63a0..cb54b8434 100644 --- a/sdks/python/julep/api/types/tools_create_tool_request.py +++ b/sdks/python/julep/api/types/tools_create_tool_request.py @@ -5,6 +5,7 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_valid_python_identifier import CommonValidPythonIdentifier from .tools_function_def import ToolsFunctionDef from .tools_tool_type import ToolsToolType @@ -19,9 +20,9 @@ class ToolsCreateToolRequest(pydantic_v1.BaseModel): Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - background: bool = pydantic_v1.Field() + name: CommonValidPythonIdentifier = pydantic_v1.Field() """ - The tool should be run in the background (not supported at the moment) + Name of the tool (must be unique for this agent and a valid python identifier string ) """ function: typing.Optional[ToolsFunctionDef] = None diff --git a/sdks/python/julep/api/types/tools_function_def.py b/sdks/python/julep/api/types/tools_function_def.py index 458c4e2e5..bc446685b 100644 --- a/sdks/python/julep/api/types/tools_function_def.py +++ b/sdks/python/julep/api/types/tools_function_def.py @@ -19,11 +19,6 @@ class ToolsFunctionDef(pydantic_v1.BaseModel): DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. """ - parameters: typing.Dict[str, typing.Any] = pydantic_v1.Field() - """ - The parameters the function accepts - """ - description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( default=None ) @@ -31,6 +26,11 @@ class ToolsFunctionDef(pydantic_v1.BaseModel): Description of the function """ + parameters: typing.Dict[str, typing.Any] = pydantic_v1.Field() + """ + The parameters the function accepts + """ + def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { "by_alias": True, diff --git a/sdks/python/julep/api/types/tools_function_def_update.py b/sdks/python/julep/api/types/tools_function_def_update.py index 8a776f71a..9cfc3bd81 100644 --- a/sdks/python/julep/api/types/tools_function_def_update.py +++ b/sdks/python/julep/api/types/tools_function_def_update.py @@ -19,18 +19,18 @@ class ToolsFunctionDefUpdate(pydantic_v1.BaseModel): DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. """ - parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( default=None ) """ - The parameters the function accepts + Description of the function """ - description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( default=None ) """ - Description of the function + The parameters the function accepts """ def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/tools_tool.py b/sdks/python/julep/api/types/tools_tool.py index d5025e231..4cfa49caf 100644 --- a/sdks/python/julep/api/types/tools_tool.py +++ b/sdks/python/julep/api/types/tools_tool.py @@ -14,9 +14,9 @@ class Base(pydantic_v1.BaseModel): - background: bool = pydantic_v1.Field() + name: CommonValidPythonIdentifier = pydantic_v1.Field() """ - The tool should be run in the background (not supported at the moment) + Name of the tool (must be unique for this agent and a valid python identifier string ) """ function: typing.Optional[ToolsFunctionDef] = None diff --git a/sdks/python/julep/api/types/transition.py b/sdks/python/julep/api/types/transition.py deleted file mode 100644 index 009ea6f8b..000000000 --- a/sdks/python/julep/api/types/transition.py +++ /dev/null @@ -1,58 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .transition_type import TransitionType - - -class Transition(pydantic_v1.BaseModel): - type: TransitionType - execution_id: CommonUuid - outputs: typing.Dict[str, typing.Any] - current: typing.List[typing.Any] - next: typing.Optional[typing.List[typing.Any]] = None - id: CommonUuid - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/transition_type.py b/sdks/python/julep/api/types/transition_type.py deleted file mode 100644 index 2958b0a51..000000000 --- a/sdks/python/julep/api/types/transition_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TransitionType = typing.Union[ - typing.Literal["finish", "wait", "error", "step", "cancelled"], typing.Any -] diff --git a/sdks/python/julep/api/types/user.py b/sdks/python/julep/api/types/user.py deleted file mode 100644 index f75f9b26c..000000000 --- a/sdks/python/julep/api/types/user.py +++ /dev/null @@ -1,64 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid - - -class User(pydantic_v1.BaseModel): - id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the user - """ - - about: str = pydantic_v1.Field() - """ - About the user - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index e78f954ed..e4d0ed7a8 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -2386,6 +2386,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 67a0fffacb44c8800defd4e85cbd2ef18c5f4f15 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 22 Jul 2024 16:43:08 -0400 Subject: [PATCH 22/36] feat(agents-api): Add migrations for developers relations and renaming information_snippets Signed-off-by: Diwank Tomer --- .../migrate_1721666295_developers_relation.py | 26 +++++++++++++++ ..._1721678846_rename_information_snippets.py | 33 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 agents-api/migrations/migrate_1721666295_developers_relation.py create mode 100644 agents-api/migrations/migrate_1721678846_rename_information_snippets.py diff --git a/agents-api/migrations/migrate_1721666295_developers_relation.py b/agents-api/migrations/migrate_1721666295_developers_relation.py new file mode 100644 index 000000000..e2da202a1 --- /dev/null +++ b/agents-api/migrations/migrate_1721666295_developers_relation.py @@ -0,0 +1,26 @@ +#/usr/bin/env python3 + +MIGRATION_ID = "developers_relation" +CREATED_AT = 1721666295.486804 + +def up(client): + client.run(""" + # Create developers table and insert default developer + ?[developer_id, email] <- [ + ["00000000-0000-0000-0000-000000000000", "developers@example.com"] + ] + + :create developers { + developer_id: Uuid, + => + email: String, + active: Bool default true, + created_at: Float default now(), + updated_at: Float default now(), + } + """) + +def down(client): + client.run(""" + ::remove developers + """) diff --git a/agents-api/migrations/migrate_1721678846_rename_information_snippets.py b/agents-api/migrations/migrate_1721678846_rename_information_snippets.py new file mode 100644 index 000000000..838ced3fb --- /dev/null +++ b/agents-api/migrations/migrate_1721678846_rename_information_snippets.py @@ -0,0 +1,33 @@ +#/usr/bin/env python3 + +MIGRATION_ID = "rename_information_snippets" +CREATED_AT = 1721678846.468865 + +rename_information_snippets = dict( + up=""" + ::rename information_snippets -> snippets + """, + down=""" + ::rename snippets -> information_snippets + """, +) + +queries_to_run = [ + rename_information_snippets, +] + + +def run(client, *queries): + joiner = "}\n\n{" + + query = joiner.join(queries) + query = f"{{\n{query}\n}}" + client.run(query) + + +def up(client): + run(client, *[q["up"] for q in queries_to_run]) + + +def down(client): + run(client, *[q["down"] for q in reversed(queries_to_run)]) From 59462d2bdd655f57e28b9b3cf5ea355839eacf9e Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 22 Jul 2024 16:43:17 -0400 Subject: [PATCH 23/36] wip Signed-off-by: Diwank Tomer --- .../agents_api/models/agent/create_agent.py | 44 +++++---- .../agents_api/models/agent/create_tools.py | 73 +++++++------- .../agents_api/models/agent/delete_agent.py | 83 ++++++++++++---- .../agents_api/models/agent/get_agent.py | 29 ++++-- .../agents_api/models/agent/list_agents.py | 23 ++++- .../agents_api/models/agent/patch_agent.py | 47 ++++++--- .../agents_api/models/agent/patch_tool.py | 21 ++-- .../agents_api/models/agent/update_agent.py | 67 +++++++------ agents-api/agents_api/models/utils.py | 91 +++++++++++++++--- typespec/agents/models.tsp | 9 +- typespec/common/interfaces.tsp | 96 ++++++++++++++++++- typespec/executions/endpoints.tsp | 8 +- typespec/main.tsp | 10 +- typespec/sessions/models.tsp | 5 + typespec/tasks/endpoints.tsp | 20 ++-- typespec/tasks/models.tsp | 5 + typespec/tools/endpoints.tsp | 10 +- typespec/users/models.tsp | 5 + 18 files changed, 477 insertions(+), 169 deletions(-) diff --git a/agents-api/agents_api/models/agent/create_agent.py b/agents-api/agents_api/models/agent/create_agent.py index 0dfde252e..20571061f 100644 --- a/agents-api/agents_api/models/agent/create_agent.py +++ b/agents-api/agents_api/models/agent/create_agent.py @@ -3,23 +3,23 @@ It includes functions to construct and execute datalog queries for inserting new agent records. """ -from uuid import UUID +from uuid import UUID, uuid4 +from beartype import beartype +from ...autogen.openapi_model import Agent, CreateAgentRequest from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query +from ..utils import cozo_query, verify_developer_id_query, wrap_in_class +@wrap_in_class(Agent, one=True, transform=lambda d: {"id": UUID(d.pop("agent_id")), **d}) @cozo_query +@beartype def create_agent_query( - agent_id: UUID, + *, developer_id: UUID, - name: str, - about: str, - model: str, - instructions: list[str] = [], - metadata: dict = {}, - default_settings: dict = {}, + agent_id: UUID | None = None, + create_agent: CreateAgentRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new agent in the database. @@ -36,11 +36,18 @@ def create_agent_query( - client (CozoClient, optional): The CozoDB client instance to use for the query. Defaults to a preconfigured client instance. Returns: - pd.DataFrame: A DataFrame containing the results of the query execution. + Agent: The newly created agent record. """ - preset = default_settings.get("preset") - default_settings["preset"] = getattr(preset, "value", preset) + agent_id = agent_id or uuid4() + + # Extract the agent data from the payload + create_agent.metadata = create_agent.metadata or {} + create_agent.instructions = create_agent.instructions if isinstance(create_agent.instructions, list) else [create_agent.instructions] + create_agent.default_settings = create_agent.default_settings or {} + + agent_data = create_agent.model_dump() + default_settings = agent_data.pop("default_settings") settings_cols, settings_vals = cozo_process_mutate_data( { @@ -61,8 +68,8 @@ def create_agent_query( # create the agent # Construct a query to insert the new agent record into the agents table agent_query = """ - ?[agent_id, developer_id, model, name, about, metadata, instructions] <- [ - [$agent_id, $developer_id, $model, $name, $about, $metadata, $instructions] + ?[agent_id, developer_id, model, name, about, metadata, instructions, created_at, updated_at] <- [ + [$agent_id, $developer_id, $model, $name, $about, $metadata, $instructions, now(), now()] ] :insert agents { @@ -73,11 +80,14 @@ def create_agent_query( about, metadata, instructions, + created_at, + updated_at, } :returning """ queries = [ + verify_developer_id_query(developer_id), default_settings_query, agent_query, ] @@ -91,10 +101,6 @@ def create_agent_query( "settings_vals": settings_vals, "agent_id": str(agent_id), "developer_id": str(developer_id), - "model": model, - "name": name, - "about": about, - "metadata": metadata, - "instructions": instructions, + **agent_data, }, ) diff --git a/agents-api/agents_api/models/agent/create_tools.py b/agents-api/agents_api/models/agent/create_tools.py index 42332b8dd..f559d57a2 100644 --- a/agents-api/agents_api/models/agent/create_tools.py +++ b/agents-api/agents_api/models/agent/create_tools.py @@ -2,65 +2,68 @@ from uuid import UUID, uuid4 +from beartype import beartype -from ...autogen.openapi_model import FunctionDef +from ...autogen.openapi_model import CreateToolRequest, Tool -from ..utils import cozo_query +from ..utils import cozo_query, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class +@wrap_in_class( + Tool, + transform=lambda d: {"id": UUID(d.pop("tool_id")), d["tool_type"]: d.pop("spec"), "type": d.pop("tool_type"), **d}, +) @cozo_query +@beartype def create_tools_query( + *, + developer_id: UUID, agent_id: UUID, - functions: list[FunctionDef], - embeddings: list[list[float]], + create_tools: list[CreateToolRequest], ) -> tuple[str, dict]: """ Constructs a datalog query for inserting tool records into the 'agent_functions' relation in the CozoDB. Parameters: - agent_id (UUID): The unique identifier for the agent. - - functions (list[FunctionDef]): A list of function definitions to be inserted. - - embeddings (list[list[float]]): A list of embeddings corresponding to each function. + - create_tools (list[CreateToolRequest]): A list of function definitions to be inserted. Returns: - - pd.DataFrame: A DataFrame containing the results of the query execution. + list[Tool] """ - # Ensure the number of functions matches the number of embeddings - assert len(functions) == len(embeddings) - # Construct the input records for the datalog query - functions_input: list[list] = [] - - for function, embedding in zip(functions, embeddings): - parameters = function.parameters.model_dump() - functions_input.append( - [ - str(agent_id), - str(uuid4()), - function.name, - function.description or "", - parameters, - embedding, - ] - ) + tools_data = [ + [ + str(agent_id), + str(uuid4()), + tool.type, + tool.name, + getattr(tool, tool.type).dict(), + ] + for tool in create_tools + ] # Datalog query for inserting new tool records into the 'agent_functions' relation - query = """ - input[agent_id, tool_id, name, description, parameters, embedding] <- $records - ?[agent_id, tool_id, name, description, parameters, embedding, updated_at] := - input[agent_id, tool_id, name, description, parameters, embedding], - updated_at = now(), + create_tools_query = """ + ?[agent_id, tool_id, tool_type, name, spec] <- $records - :insert agent_functions { + :insert tools { agent_id, tool_id, + tool_type, name, - description, - parameters, - embedding, - updated_at, + spec, } :returning """ - return (query, {"records": functions_input}) + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + create_tools_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"records": tools_data}) diff --git a/agents-api/agents_api/models/agent/delete_agent.py b/agents-api/agents_api/models/agent/delete_agent.py index 6557c63d6..071bd6b98 100644 --- a/agents-api/agents_api/models/agent/delete_agent.py +++ b/agents-api/agents_api/models/agent/delete_agent.py @@ -4,33 +4,79 @@ from uuid import UUID +from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import ResourceDeletedResponse +from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) -""" -Constructs and returns a datalog query for deleting an agent and its default settings from the database. -Parameters: -- developer_id (UUID): The UUID of the developer owning the agent. -- agent_id (UUID): The UUID of the agent to be deleted. -- client (CozoClient, optional): An instance of the CozoClient to execute the query. +@wrap_in_class( + ResourceDeletedResponse, + one=True, + transform=lambda d: {"id": UUID(d.pop("agent_id")), "deleted_at": utcnow(), "jobs": []}, +) +@cozo_query +@beartype +def delete_agent_query(*, developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: + """ + Constructs and returns a datalog query for deleting an agent and its default settings from the database. -Returns: -- tuple[str, dict]: A DataFrame containing the results of the deletion query. -""" + Parameters: + - developer_id (UUID): The UUID of the developer owning the agent. + - agent_id (UUID): The UUID of the agent to be deleted. + - client (CozoClient, optional): An instance of the CozoClient to execute the query. + Returns: + - ResourceDeletedResponse: The response indicating the deletion of the agent. + """ -@cozo_query -def delete_agent_query(developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: - query = """ - { + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + """ + # Delete docs + ?[agent_id, doc_id] := + *agent_docs{ + agent_id, + doc_id, + }, agent_id = to_uuid($agent_id) + + :delete agent_docs { + agent_id, + doc_id + } + :returning + """, + """ + # Delete tools + ?[agent_id, tool_id] := + *tools{ + agent_id, + tool_id, + }, agent_id = to_uuid($agent_id) + + :delete tools { + agent_id, + tool_id + } + :returning + """, + """ # Delete default agent settings ?[agent_id] <- [[$agent_id]] :delete agent_default_settings { agent_id } - } { + :returning + """, + """ # Delete the agent ?[agent_id, developer_id] <- [[$agent_id, $developer_id]] @@ -38,6 +84,11 @@ def delete_agent_query(developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: developer_id, agent_id } - }""" + :returning + """, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return (query, {"agent_id": str(agent_id), "developer_id": str(developer_id)}) diff --git a/agents-api/agents_api/models/agent/get_agent.py b/agents-api/agents_api/models/agent/get_agent.py index 325df7930..281283836 100644 --- a/agents-api/agents_api/models/agent/get_agent.py +++ b/agents-api/agents_api/models/agent/get_agent.py @@ -1,11 +1,21 @@ from uuid import UUID +from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Agent +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + +@wrap_in_class(Agent, one=True) @cozo_query -def get_agent_query(developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: +@beartype +def get_agent_query(*, developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: """ Fetches agent details and default settings from the database. @@ -17,13 +27,12 @@ def get_agent_query(developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: - client (CozoClient, optional): The database client used to execute the query. Returns: - - pd.DataFrame: A DataFrame containing the agent details and default settings. + - Agent """ # Constructing a datalog query to retrieve agent details and default settings. # The query uses input parameters for agent_id and developer_id to filter the results. # It joins the 'agents' and 'agent_default_settings' relations to fetch comprehensive details. - query = """ - { + get_query = """ input[agent_id, developer_id] <- [[to_uuid($agent_id), to_uuid($developer_id)]] ?[ @@ -69,9 +78,17 @@ def get_agent_query(developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: "min_p": min_p, "preset": preset, } - } """ + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + get_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + # Execute the constructed datalog query using the provided CozoClient. # The result is returned as a pandas DataFrame. return (query, {"agent_id": str(agent_id), "developer_id": str(developer_id)}) diff --git a/agents-api/agents_api/models/agent/list_agents.py b/agents-api/agents_api/models/agent/list_agents.py index 838b7acdb..4fdb8403c 100644 --- a/agents-api/agents_api/models/agent/list_agents.py +++ b/agents-api/agents_api/models/agent/list_agents.py @@ -1,13 +1,23 @@ from typing import Any from uuid import UUID +from beartype import beartype + +from ...autogen.openapi_model import Agent from ...common.utils import json -from ..utils import cozo_query +from ..utils import ( + cozo_query, + verify_developer_id_query, + wrap_in_class, +) +@wrap_in_class(Agent) @cozo_query +@beartype def list_agents_query( + *, developer_id: UUID, limit: int = 100, offset: int = 0, @@ -35,8 +45,9 @@ def list_agents_query( ) # Datalog query to retrieve agent information based on filters, sorted by creation date in descending order. - query = f""" - {{ + queries = [ + verify_developer_id_query(developer_id), + f""" input[developer_id] <- [[to_uuid($developer_id)]] ?[ @@ -65,7 +76,11 @@ def list_agents_query( :limit $limit :offset $offset :sort -created_at - }}""" + """, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( query, diff --git a/agents-api/agents_api/models/agent/patch_agent.py b/agents-api/agents_api/models/agent/patch_agent.py index ee2ad7103..ea2b43355 100644 --- a/agents-api/agents_api/models/agent/patch_agent.py +++ b/agents-api/agents_api/models/agent/patch_agent.py @@ -1,17 +1,30 @@ from uuid import UUID +from beartype import beartype +from ...autogen.openapi_model import PatchAgentRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query from ...common.utils.datetime import utcnow - - +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: {"id": d["agent_id"], "jobs": [], **d}, +) @cozo_query +@beartype def patch_agent_query( + *, agent_id: UUID, developer_id: UUID, - default_settings: dict = {}, - **update_data, + patch_agent: PatchAgentRequest, ) -> tuple[str, dict]: """Patches agent data based on provided updates. @@ -22,11 +35,14 @@ def patch_agent_query( **update_data: Arbitrary keyword arguments representing data to update. Returns: - pd.DataFrame: The result of the query execution. + ResourceUpdatedResponse: The updated agent data. """ + update_data = patch_agent.model_dump(exclude_unset=True) + # Construct the query for updating agent information in the database. # Agent update query metadata = update_data.pop("metadata", {}) or {} + default_settings = update_data.pop("default_settings", {}) or {} agent_update_cols, agent_update_vals = cozo_process_mutate_data( { **{k: v for k, v in update_data.items() if v is not None}, @@ -37,7 +53,6 @@ def patch_agent_query( ) agent_update_query = f""" - {{ # update the agent input[{agent_update_cols}] <- $agent_update_vals @@ -47,13 +62,14 @@ def patch_agent_query( agent_id: to_uuid($agent_id), metadata: md, }}, + # agent_id = to_uuid($agent_id), metadata = concat(md, $metadata) :update agents {{ - {agent_update_cols}, metadata, + {agent_update_cols}, + metadata, }} :returning - }} """ # Construct the query for updating agent's default settings in the database. @@ -66,14 +82,12 @@ def patch_agent_query( ) settings_update_query = f""" - {{ # update the agent settings ?[{settings_cols}] <- $settings_vals :update agent_default_settings {{ {settings_cols} }} - }} """ # Combine agent and settings update queries if default settings are provided. @@ -83,10 +97,17 @@ def patch_agent_query( if len(default_settings) != 0: queries.insert(0, settings_update_query) - combined_query = "\n".join(queries) + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + *queries, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( - combined_query, + query, { "agent_update_vals": agent_update_vals, "settings_vals": settings_vals, diff --git a/agents-api/agents_api/models/agent/patch_tool.py b/agents-api/agents_api/models/agent/patch_tool.py index a565d9f7b..5462d3630 100644 --- a/agents-api/agents_api/models/agent/patch_tool.py +++ b/agents-api/agents_api/models/agent/patch_tool.py @@ -1,27 +1,34 @@ from uuid import UUID -from ...autogen.openapi_model import FunctionDef +from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import PatchToolRequest, ResourceUpdatedResponse +from ..utils import cozo_query, verify_developer_id_query, wrap_in_class + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: {"id": d["agent_id"], "jobs": [], **d}, +) @cozo_query +@beartype def patch_tool_by_id_query( - agent_id: UUID, tool_id: UUID, function: FunctionDef, embedding: list[float] + *, developer_id: UUID, tool_id: UUID, update_tool: PatchToolRequest ) -> tuple[str, dict]: """ # Execute the datalog query and return the results as a DataFrame Updates the tool information for a given agent and tool ID in the 'cozodb' database. Parameters: - - agent_id (UUID): The unique identifier of the agent. + - developer_id (UUID): The unique identifier of the developer. - tool_id (UUID): The unique identifier of the tool to be updated. - - function (FunctionDef): The function definition containing the new tool information. - - embedding (list[float]): The embedding vector associated with the tool. + - update_tool (PatchToolRequest): The request payload containing the updated tool information. Returns: - - pd.DataFrame: A DataFrame containing the result of the update operation. + - ResourceUpdatedResponse: The updated tool data. """ # Agent update query # Convert the function definition to a dictionary for easier manipulation diff --git a/agents-api/agents_api/models/agent/update_agent.py b/agents-api/agents_api/models/agent/update_agent.py index c1b950b79..cdda45ae3 100644 --- a/agents-api/agents_api/models/agent/update_agent.py +++ b/agents-api/agents_api/models/agent/update_agent.py @@ -5,17 +5,31 @@ from uuid import UUID +from beartype import beartype +from ...autogen.openapi_model import UpdateAgentRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query - - +from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: {"id": d["agent_id"], "jobs": [], **d}, +) @cozo_query +@beartype def update_agent_query( + *, agent_id: UUID, developer_id: UUID, - default_settings: dict = {}, - **update_data, + update_agent: UpdateAgentRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to update an agent and its default settings in the 'cozodb' database. @@ -23,30 +37,26 @@ def update_agent_query( Parameters: - agent_id (UUID): The unique identifier of the agent to be updated. - developer_id (UUID): The unique identifier of the developer associated with the agent. - - default_settings (dict, optional): A dictionary of default settings to be updated for the agent. Defaults to an empty dict. + - update_agent (UpdateAgentRequest): The request payload containing the updated agent data. - client (CozoClient, optional): The database client used to execute the query. Defaults to a pre-configured client instance. - - **update_data: Variable keyword arguments representing additional agent data to be updated. Returns: - - pd.DataFrame: A DataFrame containing the result of the update operation. + ResourceUpdatedResponse: The updated agent data. """ + default_settings = update_agent.default_settings.model_dump(exclude_none=True) + update_data = update_agent.model_dump() + + # Remove default settings from the agent update data + update_data.pop("default_settings", None) agent_id = str(agent_id) developer_id = str(developer_id) update_data["instructions"] = update_data.get("instructions", []) - - # Assertion query to check if the agent exists - assertion_query = """ - ?[developer_id, agent_id] := - *agents { - developer_id, - agent_id, - }, - developer_id = to_uuid($developer_id), - agent_id = to_uuid($agent_id), - # Assertion to ensure the agent exists before updating. - :assert some - """ + update_data["instructions"] = ( + update_data["instructions"] + if isinstance(update_data["instructions"], list) + else [update_data["instructions"]] + ) # Construct the agent update part of the query with dynamic columns and values based on `update_data`. # Agent update query @@ -59,7 +69,6 @@ def update_agent_query( ) agent_update_query = f""" - {{ # update the agent input[{agent_update_cols}] <- $agent_update_vals original[created_at] := *agents{{ @@ -79,7 +88,6 @@ def update_agent_query( {agent_update_cols} }} :returning - }} """ # Construct the settings update part of the query if `default_settings` are provided. @@ -92,14 +100,12 @@ def update_agent_query( ) settings_update_query = f""" - {{ # update the agent settings ?[{settings_cols}] <- $settings_vals :put agent_default_settings {{ {settings_cols} }} - }} """ # Combine agent and settings update queries into a single query string. @@ -110,10 +116,17 @@ def update_agent_query( queries.insert(0, settings_update_query) # Combine the assertion query with the update queries - combined_query = "{" + assertion_query + "} " + "\n".join(queries) + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + *queries, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( - combined_query, + query, { "agent_update_vals": agent_update_vals, "settings_vals": settings_vals, diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index fe269b17c..e6abd5189 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -1,6 +1,9 @@ from functools import wraps -from typing import Callable, ParamSpec +from typing import Callable, ParamSpec, Type +from uuid import UUID +from beartype import beartype +from pydantic import BaseModel import pandas as pd from ..clients.cozo import client as cozo_client @@ -9,18 +12,84 @@ P = ParamSpec("P") -def cozo_query(func: Callable[P, tuple[str, dict]]): +def verify_developer_id_query(developer_id: UUID | str) -> str: + return f""" + ?[developer_id] := + *developers{{ + developer_id, + }}, developer_id = to_uuid("{str(developer_id)}") + + :assert some """ - Decorator that wraps a function that takes arbitrary arguments, and - returns a (query string, variables) tuple. - The wrapped function should additionally take a client keyword argument - and then run the query using the client, returning a DataFrame. + +def verify_developer_owns_resource_query(developer_id: UUID | str, resource: str, **resource_id: dict) -> str: + + resource_id_key, resource_id_value = next(iter(resource_id.items())) + + return f""" + ?[{resource_id_key}] := + *{resource}{{ + developer_id, + {resource_id_key}, + }}, developer_id = to_uuid("{str(developer_id)}"), + {resource_id_key} = to_uuid("{str(resource_id_value)}") + + :assert some """ - @wraps(func) - def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: - query, variables = func(*args, **kwargs) - return client.run(query, variables) - return wrapper +def cozo_query(func: Callable[P, tuple[str, dict]] | None = None, debug: bool | None = None): + def cozo_query_dec(func: Callable[P, tuple[str, dict]]): + """ + Decorator that wraps a function that takes arbitrary arguments, and + returns a (query string, variables) tuple. + + The wrapped function should additionally take a client keyword argument + and then run the query using the client, returning a DataFrame. + """ + + @wraps(func) + def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: + query, variables = func(*args, **kwargs) + + if debug: + from pprint import pprint + pprint(dict(query=query, variables=variables)) + + return client.run(query, variables) + + return wrapper + + if func is not None and callable(func): + return cozo_query_dec(func) + + return cozo_query_dec + +def wrap_in_class( + cls: Type[BaseModel], + one: bool = False, + transform: Callable[[dict], dict] | None = None, +): + + @beartype + def decorator(func: Callable[..., pd.DataFrame]): + @wraps(func) + @beartype + def wrapper(*args, **kwargs) -> list[cls] | cls: + df = func(*args, **kwargs) + + # Convert df to list of dicts + data = df.to_dict(orient="records") + + nonlocal transform + transform = transform or (lambda x: x) + if one: + return cls(**transform(data[0])) + + return [cls(**item) for item in map(transform, data)] + + setattr(cls, func.__name__, wrapper) + return wrapper + + return decorator diff --git a/typespec/agents/models.tsp b/typespec/agents/models.tsp index 7a925fa1f..3d8642d2e 100644 --- a/typespec/agents/models.tsp +++ b/typespec/agents/models.tsp @@ -1,6 +1,10 @@ +import "@typespec/http"; + import "../common"; import "../chat"; +using TypeSpec.Http; + using Common; using Chat; @@ -44,13 +48,10 @@ model PatchAgentRequest is UpdateAgentRequest {} /** Payload for creating a agent (and associated documents) */ model CreateAgentRequest { ...UpdateAgentRequest; - - /** Documents to index for this agent. (Max: 100 items) */ - @maxItems(100) - docs: unknown[] = #[]; } model CreateOrUpdateAgentRequest { + @path id: uuid; ...UpdateAgentRequest; } \ No newline at end of file diff --git a/typespec/common/interfaces.tsp b/typespec/common/interfaces.tsp index 2d2c5fb21..d83cf81ab 100644 --- a/typespec/common/interfaces.tsp +++ b/typespec/common/interfaces.tsp @@ -41,7 +41,7 @@ interface CreateOrUpdateEndpoint< CreateOrUpdateType, DocString extends valueof string = "Create or update a resource (ID is required in payload; existing resource will be overwritten)" > { - @put + @post @doc(DocString) createOrUpdate(@header contentType: yaml | json, ...CreateOrUpdateType): { @statusCode _: "200"; @@ -167,10 +167,33 @@ interface ChildCreateEndpoint< }; } +interface ChildCreateOrUpdateEndpoint< + CreateOrUpdateType, + DocString extends valueof string = "Create or update a resource owned by the given parent" +> { + @post + @doc(DocString) + createOrUpdate( + @header contentType: yaml | json, + + @path + @doc("ID of parent resource") + parent_id: uuid, + + ...CreateOrUpdateType, + ): { + @statusCode _: "200"; + + @body + @doc("Details of the resource updated along with ID") + body: ResourceUpdatedResponse; + }; +} + interface ChildDeleteEndpoint< DocString extends valueof string = "Delete a resource owned by the given parent using its id" > { - @post + @delete @doc( DocString ) @@ -179,13 +202,13 @@ interface ChildDeleteEndpoint< @doc( "ID of parent resource", ) - parent_id: uuid, + id: uuid, @path @doc( "ID of the resource to be deleted", ) - id: uuid, + child_id: uuid, ): { @statusCode _: "202"; @@ -196,3 +219,68 @@ interface ChildDeleteEndpoint< body: ResourceDeletedResponse; }; } + +interface ChildUpdateEndpoint< + UpdateType, + DocString extends valueof string = "Update a resource owned by the given parent using its id" +> { + @put + @doc( + DocString + ) + update( + @path + @doc( + "ID of parent resource", + ) + id: uuid, + + @path + @doc( + "ID of the resource to be updated", + ) + child_id: uuid, + + ...UpdateType, + ): { + @statusCode _: "200"; + + @body + @doc( + "Details of the resource updated along with ID", + ) + body: ResourceUpdatedResponse; + }; +} + +interface ChildPatchEndpoint< + PatchType, + DocString extends valueof string = "Patch a resource owned by the given parent using its id" +> { + @patch + @doc( + DocString + ) + patch( + @path + @doc( + "ID of parent resource", + ) + id: uuid, + + @path + @doc( + "ID of the resource to be patched", + ) + child_id: uuid, + ...PatchType, + ): { + @statusCode _: "200"; + + @body + @doc( + "Details of the resource patched along with ID", + ) + body: ResourceUpdatedResponse; + }; +} diff --git a/typespec/executions/endpoints.tsp b/typespec/executions/endpoints.tsp index 0fa7b43e5..8869b7022 100644 --- a/typespec/executions/endpoints.tsp +++ b/typespec/executions/endpoints.tsp @@ -10,11 +10,13 @@ namespace Executions; // interface Endpoints - extends UpdateEndpoint< + extends GetEndpoint {} + +interface TaskEndpoints + extends ChildUpdateEndpoint< UpdateExecutionRequest, "Update an existing Execution" - >, - GetEndpoint {} + > {} interface TransitionEndpoints extends ChildLimitOffsetPagination< diff --git a/typespec/main.tsp b/typespec/main.tsp index 6698fac76..93f1a472d 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -92,11 +92,14 @@ namespace Api { @route("/docs") interface IndividualDocsRoute extends Docs.IndividualDocEndpoints {} - @route("/tasks") + @route("/agents/{id}/tasks") interface TasksRoute extends Tasks.Endpoints {} + @route("/agents/{parent_id}/tasks") + interface TasksCreateOrUpdateRoute extends Tasks.CreateOrUpdateEndpoints {} + @route("/tasks/{id}/executions") - interface TaskExecutionsRoute extends Tasks.ExecutionEndpoints {} + interface TaskExecutionsRoute extends Tasks.ExecutionEndpoints, Executions.TaskEndpoints {} @route("/executions") interface ExecutionsRoute extends Executions.Endpoints {} @@ -104,9 +107,6 @@ namespace Api { @route("/executions/{id}/transitions") interface ExecutionTransitionsRoute extends Executions.TransitionEndpoints {} - @route("/tools") - interface ToolRoute extends Tools.Endpoints {} - @route("/jobs") interface JobRoute extends Jobs.Endpoints {} } diff --git a/typespec/sessions/models.tsp b/typespec/sessions/models.tsp index f19ec1d99..ed58f55c6 100644 --- a/typespec/sessions/models.tsp +++ b/typespec/sessions/models.tsp @@ -1,5 +1,9 @@ +import "@typespec/http"; + import "../common"; +using TypeSpec.Http; + using Common; namespace Sessions; @@ -147,6 +151,7 @@ model CreateSessionRequest { @withVisibility("create", "update") model CreateOrUpdateSessionRequest { + @path id: uuid; ...CreateSessionRequest; diff --git a/typespec/tasks/endpoints.tsp b/typespec/tasks/endpoints.tsp index 289dc7c11..5d656c78a 100644 --- a/typespec/tasks/endpoints.tsp +++ b/typespec/tasks/endpoints.tsp @@ -15,22 +15,24 @@ namespace Tasks; // TASK ENDPOINTS // +interface CreateOrUpdateEndpoints + extends ChildCreateOrUpdateEndpoint< + CreateOrUpdateTaskRequest, + "Create or update a task" + > {} + interface Endpoints - extends UpdateEndpoint< + extends ChildUpdateEndpoint< UpdateTaskRequest, "Update an existing task (overwrite existing values)" >, - PatchEndpoint< + ChildPatchEndpoint< PatchTaskRequest, "Update an existing task (merges with existing values)" >, - DeleteEndpoint<"Delete a task by its id">, - LimitOffsetPagination, - CreateOrUpdateEndpoint< - CreateOrUpdateTaskRequest, - "Create or update a task" - >, - CreateEndpoint {} + ChildDeleteEndpoint<"Delete a task by its id">, + ChildLimitOffsetPagination, + ChildCreateEndpoint {} interface ExecutionEndpoints extends ChildCreateEndpoint< diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 0135da392..7e7aab2ed 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -1,9 +1,13 @@ +import "@typespec/http"; + import "../agents"; import "../common"; import "../chat"; import "../entries"; import "../tools"; +using TypeSpec.Http; + using Agents; using Chat; using Common; @@ -168,6 +172,7 @@ model CreateTaskRequest { } model CreateOrUpdateTaskRequest { + @path id: uuid; ...CreateTaskRequest; } diff --git a/typespec/tools/endpoints.tsp b/typespec/tools/endpoints.tsp index 30e03c6d9..819af96c7 100644 --- a/typespec/tools/endpoints.tsp +++ b/typespec/tools/endpoints.tsp @@ -11,11 +11,9 @@ namespace Tools; // TOOL ENDPOINTS // -interface Endpoints - extends UpdateEndpoint, - PatchEndpoint, - DeleteEndpoint<"Delete an existing tool by id"> {} - interface AgentEndpoints extends ChildLimitOffsetPagination, - ChildCreateEndpoint {} + ChildCreateEndpoint, + ChildUpdateEndpoint, + ChildPatchEndpoint, + ChildDeleteEndpoint<"Delete an existing tool by id"> {} diff --git a/typespec/users/models.tsp b/typespec/users/models.tsp index 1d53311d4..218663cff 100644 --- a/typespec/users/models.tsp +++ b/typespec/users/models.tsp @@ -1,5 +1,9 @@ +import "@typespec/http"; + import "../common"; +using TypeSpec.Http; + using Common; namespace Users; @@ -40,6 +44,7 @@ model CreateUserRequest { } model CreateOrUpdateUserRequest { + @path id: uuid; ...UpdateUserRequest; } \ No newline at end of file From ac3fcec41ca600b78dcd977f520c4f49b4ce05b9 Mon Sep 17 00:00:00 2001 From: Julep Developers Date: Mon, 22 Jul 2024 22:02:04 +0000 Subject: [PATCH 24/36] wip Signed-off-by: Julep Developers --- agents-api/agents_api/autogen/Agents.py | 40 - agents-api/agents_api/autogen/Sessions.py | 36 - agents-api/agents_api/autogen/Tasks.py | 26 - agents-api/agents_api/autogen/Users.py | 22 - .../agents_api/models/agent/create_agent.py | 10 +- .../agents_api/models/agent/create_tools.py | 14 +- .../agents_api/models/agent/delete_agent.py | 6 +- agents-api/agents_api/models/utils.py | 12 +- .../migrate_1721666295_developers_relation.py | 16 +- ..._1721678846_rename_information_snippets.py | 2 +- agents-api/poetry.lock | 12 +- sdks/postman/collection.json | 1633 ++++--- sdks/python/julep/api/README.md | 2 - sdks/python/julep/api/__init__.py | 12 +- sdks/python/julep/api/client.py | 4176 +++++++++-------- sdks/python/julep/api/reference.md | 1232 ++--- sdks/python/julep/api/types/__init__.py | 16 +- .../api/types/agents_create_agent_request.py | 5 - ...r_update_agent_request_default_settings.py | 11 - ...te_or_update_agent_request_instructions.py | 5 - .../api/types/agents_update_agent_request.py | 79 + .../types/sessions_create_session_request.py | 82 + .../api/types/tasks_create_task_request.py | 72 + .../api/types/users_update_user_request.py | 56 + sdks/python/poetry.lock | 6 +- 25 files changed, 4051 insertions(+), 3532 deletions(-) delete mode 100644 sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py delete mode 100644 sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py create mode 100644 sdks/python/julep/api/types/agents_update_agent_request.py create mode 100644 sdks/python/julep/api/types/sessions_create_session_request.py create mode 100644 sdks/python/julep/api/types/tasks_create_task_request.py create mode 100644 sdks/python/julep/api/types/users_update_user_request.py diff --git a/agents-api/agents_api/autogen/Agents.py b/agents-api/agents_api/autogen/Agents.py index 8241d2ab7..71b53c8df 100644 --- a/agents-api/agents_api/autogen/Agents.py +++ b/agents-api/agents_api/autogen/Agents.py @@ -92,46 +92,6 @@ class CreateAgentRequest(BaseModel): """ Default settings for all sessions created by this agent """ - docs: Annotated[list, Field([], max_length=100)] - """ - Documents to index for this agent. (Max: 100 items) - """ - - -class CreateOrUpdateAgentRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - id: UUID - metadata: dict[str, Any] | None = None - name: Annotated[ - str, - Field( - "", - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Name of the agent - """ - about: str = "" - """ - About the agent - """ - model: str = "" - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - instructions: str | list[str] = "" - """ - Instructions for the agent - """ - default_settings: ( - GenerationPresetSettings | OpenAISettings | VLLMSettings | None - ) = None - """ - Default settings for all sessions created by this agent - """ class PatchAgentRequest(BaseModel): diff --git a/agents-api/agents_api/autogen/Sessions.py b/agents-api/agents_api/autogen/Sessions.py index e098d7e5e..f20480d96 100644 --- a/agents-api/agents_api/autogen/Sessions.py +++ b/agents-api/agents_api/autogen/Sessions.py @@ -9,42 +9,6 @@ from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -class CreateOrUpdateSessionRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - id: UUID - user: UUID | None = None - """ - User ID of user associated with this session - """ - users: list[UUID] | None = None - agent: UUID | None = None - """ - Agent ID of agent associated with this session - """ - agents: list[UUID] | None = None - situation: str = ( - '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' - ) - """ - A specific situation that sets the background for this session - """ - render_templates: bool = False - """ - Render system and assistant message content as jinja templates - """ - token_budget: int | None = None - """ - Threshold value for the adaptive context functionality - """ - context_overflow: Literal["truncate", "adaptive"] | None = None - """ - Action to start on context window overflow - """ - metadata: dict[str, Any] | None = None - - class CreateSessionRequest(BaseModel): """ Payload for creating a session diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py index be36b7663..f739e860e 100644 --- a/agents-api/agents_api/autogen/Tasks.py +++ b/agents-api/agents_api/autogen/Tasks.py @@ -14,32 +14,6 @@ from .Tools import CreateToolRequest -class CreateOrUpdateTaskRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - id: UUID - name: str - description: str = "" - main: list[WorkflowStep] - """ - The entrypoint of the task. - """ - input_schema: dict[str, Any] | None = None - """ - The schema for the input to the task. `null` means all inputs are valid. - """ - tools: list[CreateToolRequest] = [] - """ - Tools defined specifically for this task not included in the Agent itself. - """ - inherit_tools: bool = True - """ - Whether to inherit tools from the parent agent or not. Defaults to true. - """ - metadata: dict[str, Any] | None = None - - class CreateTaskRequest(BaseModel): """ Payload for creating a task diff --git a/agents-api/agents_api/autogen/Users.py b/agents-api/agents_api/autogen/Users.py index c815afb4e..8d36e3965 100644 --- a/agents-api/agents_api/autogen/Users.py +++ b/agents-api/agents_api/autogen/Users.py @@ -9,28 +9,6 @@ from pydantic import AwareDatetime, BaseModel, ConfigDict, Field -class CreateOrUpdateUserRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - id: UUID - metadata: dict[str, Any] | None = None - name: Annotated[ - str, - Field( - "", - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Name of the user - """ - about: str = "" - """ - About the user - """ - - class CreateUserRequest(BaseModel): """ Payload for creating a user (and associated documents) diff --git a/agents-api/agents_api/models/agent/create_agent.py b/agents-api/agents_api/models/agent/create_agent.py index 20571061f..5a51b9d9c 100644 --- a/agents-api/agents_api/models/agent/create_agent.py +++ b/agents-api/agents_api/models/agent/create_agent.py @@ -12,7 +12,9 @@ from ..utils import cozo_query, verify_developer_id_query, wrap_in_class -@wrap_in_class(Agent, one=True, transform=lambda d: {"id": UUID(d.pop("agent_id")), **d}) +@wrap_in_class( + Agent, one=True, transform=lambda d: {"id": UUID(d.pop("agent_id")), **d} +) @cozo_query @beartype def create_agent_query( @@ -43,7 +45,11 @@ def create_agent_query( # Extract the agent data from the payload create_agent.metadata = create_agent.metadata or {} - create_agent.instructions = create_agent.instructions if isinstance(create_agent.instructions, list) else [create_agent.instructions] + create_agent.instructions = ( + create_agent.instructions + if isinstance(create_agent.instructions, list) + else [create_agent.instructions] + ) create_agent.default_settings = create_agent.default_settings or {} agent_data = create_agent.model_dump() diff --git a/agents-api/agents_api/models/agent/create_tools.py b/agents-api/agents_api/models/agent/create_tools.py index f559d57a2..292b4c620 100644 --- a/agents-api/agents_api/models/agent/create_tools.py +++ b/agents-api/agents_api/models/agent/create_tools.py @@ -6,12 +6,22 @@ from ...autogen.openapi_model import CreateToolRequest, Tool -from ..utils import cozo_query, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) @wrap_in_class( Tool, - transform=lambda d: {"id": UUID(d.pop("tool_id")), d["tool_type"]: d.pop("spec"), "type": d.pop("tool_type"), **d}, + transform=lambda d: { + "id": UUID(d.pop("tool_id")), + d["tool_type"]: d.pop("spec"), + "type": d.pop("tool_type"), + **d, + }, ) @cozo_query @beartype diff --git a/agents-api/agents_api/models/agent/delete_agent.py b/agents-api/agents_api/models/agent/delete_agent.py index 071bd6b98..3ce842b47 100644 --- a/agents-api/agents_api/models/agent/delete_agent.py +++ b/agents-api/agents_api/models/agent/delete_agent.py @@ -19,7 +19,11 @@ @wrap_in_class( ResourceDeletedResponse, one=True, - transform=lambda d: {"id": UUID(d.pop("agent_id")), "deleted_at": utcnow(), "jobs": []}, + transform=lambda d: { + "id": UUID(d.pop("agent_id")), + "deleted_at": utcnow(), + "jobs": [], + }, ) @cozo_query @beartype diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index e6abd5189..714f5f627 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -23,7 +23,9 @@ def verify_developer_id_query(developer_id: UUID | str) -> str: """ -def verify_developer_owns_resource_query(developer_id: UUID | str, resource: str, **resource_id: dict) -> str: +def verify_developer_owns_resource_query( + developer_id: UUID | str, resource: str, **resource_id: dict +) -> str: resource_id_key, resource_id_value = next(iter(resource_id.items())) @@ -39,7 +41,9 @@ def verify_developer_owns_resource_query(developer_id: UUID | str, resource: str """ -def cozo_query(func: Callable[P, tuple[str, dict]] | None = None, debug: bool | None = None): +def cozo_query( + func: Callable[P, tuple[str, dict]] | None = None, debug: bool | None = None +): def cozo_query_dec(func: Callable[P, tuple[str, dict]]): """ Decorator that wraps a function that takes arbitrary arguments, and @@ -55,6 +59,7 @@ def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: if debug: from pprint import pprint + pprint(dict(query=query, variables=variables)) return client.run(query, variables) @@ -63,9 +68,10 @@ def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: if func is not None and callable(func): return cozo_query_dec(func) - + return cozo_query_dec + def wrap_in_class( cls: Type[BaseModel], one: bool = False, diff --git a/agents-api/migrations/migrate_1721666295_developers_relation.py b/agents-api/migrations/migrate_1721666295_developers_relation.py index e2da202a1..560b056da 100644 --- a/agents-api/migrations/migrate_1721666295_developers_relation.py +++ b/agents-api/migrations/migrate_1721666295_developers_relation.py @@ -1,10 +1,12 @@ -#/usr/bin/env python3 +# /usr/bin/env python3 MIGRATION_ID = "developers_relation" CREATED_AT = 1721666295.486804 + def up(client): - client.run(""" + client.run( + """ # Create developers table and insert default developer ?[developer_id, email] <- [ ["00000000-0000-0000-0000-000000000000", "developers@example.com"] @@ -18,9 +20,13 @@ def up(client): created_at: Float default now(), updated_at: Float default now(), } - """) + """ + ) + def down(client): - client.run(""" + client.run( + """ ::remove developers - """) + """ + ) diff --git a/agents-api/migrations/migrate_1721678846_rename_information_snippets.py b/agents-api/migrations/migrate_1721678846_rename_information_snippets.py index 838ced3fb..a3fdd4f94 100644 --- a/agents-api/migrations/migrate_1721678846_rename_information_snippets.py +++ b/agents-api/migrations/migrate_1721678846_rename_information_snippets.py @@ -1,4 +1,4 @@ -#/usr/bin/env python3 +# /usr/bin/env python3 MIGRATION_ID = "rename_information_snippets" CREATED_AT = 1721678846.468865 diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 758d4d6a1..1962f7976 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -2216,13 +2216,13 @@ typing-extensions = ">=4.0.0,<5.0.0" [[package]] name = "jupyter-ai" -version = "2.19.0" +version = "2.19.1" description = "A generative AI extension for JupyterLab" optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_ai-2.19.0-py3-none-any.whl", hash = "sha256:d03540ea42b181946ccad7287b4306bd8f37af09d9f7b3e45b0adc0eb0449b34"}, - {file = "jupyter_ai-2.19.0.tar.gz", hash = "sha256:746220ac7205f57047cb8c7bb1c94c7a02cdbad9af0c534762cd06168cd66b8e"}, + {file = "jupyter_ai-2.19.1-py3-none-any.whl", hash = "sha256:9521cdfaada7c2e9c660cdbd7084235ebfaa7dfbf4f734f639f88fa892661e74"}, + {file = "jupyter_ai-2.19.1.tar.gz", hash = "sha256:4a4f61411d41ac16bc5838970ed4c54c2dd64c9b56d9277430c6a83ebd792f3d"}, ] [package.dependencies] @@ -3288,13 +3288,13 @@ files = [ [[package]] name = "openai" -version = "1.36.1" +version = "1.37.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.36.1-py3-none-any.whl", hash = "sha256:d399b9d476dbbc167aceaac6bc6ed0b2e2bb6c9e189c7f7047f822743ae62e64"}, - {file = "openai-1.36.1.tar.gz", hash = "sha256:41be9e0302e95dba8a9374b885c5cb1cec2202816a70b98736fee25a2cadd1f2"}, + {file = "openai-1.37.0-py3-none-any.whl", hash = "sha256:a903245c0ecf622f2830024acdaa78683c70abb8e9d37a497b851670864c9f73"}, + {file = "openai-1.37.0.tar.gz", hash = "sha256:dc8197fc40ab9d431777b6620d962cc49f4544ffc3011f03ce0a805e6eb54adb"}, ] [package.dependencies] diff --git a/sdks/postman/collection.json b/sdks/postman/collection.json index 919017115..b65401baf 100644 --- a/sdks/postman/collection.json +++ b/sdks/postman/collection.json @@ -196,7 +196,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", "options": { "raw": { "language": "json" @@ -239,7 +239,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", "options": { "raw": { "language": "json" @@ -255,19 +255,26 @@ }, { "_type": "endpoint", - "name": "Agents Route Create Or Update", + "name": "Agents Route Get", "request": { - "description": "Create or update an Agent", + "description": "Get an Agent by id", "url": { - "raw": "{{baseUrl}}/agents", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents" + "agents", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the resource", + "value": "id" + } + ] }, "header": [ { @@ -282,17 +289,9 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -300,17 +299,24 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update an Agent", + "description": "Get an Agent by id", "url": { - "raw": "{{baseUrl}}/agents", + "raw": "{{baseUrl}}/agents/:id", "host": [ "{{baseUrl}}" ], "path": [ - "agents" + "agents", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the resource", + "value": "id" + } + ] }, "header": [ { @@ -325,29 +331,21 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"default_settings\": {\n \"preset\": \"problem_solving\"\n }\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Agents Route Get", + "name": "Agents Route Create Or Update", "request": { - "description": "Get an Agent by id", + "description": "Create or update an Agent", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -361,7 +359,7 @@ "variable": [ { "key": "id", - "description": "ID of the resource", + "description": null, "value": "id" } ] @@ -379,9 +377,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -389,7 +395,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get an Agent by id", + "description": "Create or update an Agent", "url": { "raw": "{{baseUrl}}/agents/:id", "host": [ @@ -403,7 +409,7 @@ "variable": [ { "key": "id", - "description": "ID of the resource", + "description": null, "value": "id" } ] @@ -421,12 +427,20 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"default_settings\": {\n \"preset\": \"problem_solving\"\n }\n}", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] @@ -943,18 +957,18 @@ }, { "_type": "endpoint", - "name": "Agent Tools Route List", + "name": "Tasks Route List", "request": { - "description": "List tools of the given agent", + "description": "List tasks (paginated)", "url": { - "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/agents/:id/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ "agents", ":id", - "tools" + "tasks" ], "query": [ { @@ -1014,16 +1028,16 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List tools of the given agent", + "description": "List tasks (paginated)", "url": { - "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/agents/:id/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ "agents", ":id", - "tools" + "tasks" ], "query": [ { @@ -1078,25 +1092,25 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": []\n}", + "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"input_schema\": {\n \"key\": \"value\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n }\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Agent Tools Route Create", + "name": "Tasks Route Create", "request": { - "description": "Create a new tool for this agent", + "description": "Create a new task", "url": { - "raw": "{{baseUrl}}/agents/:id/tools", + "raw": "{{baseUrl}}/agents/:id/tasks", "host": [ "{{baseUrl}}" ], "path": [ "agents", ":id", - "tools" + "tasks" ], "query": [], "variable": [ @@ -1124,7 +1138,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -1138,16 +1152,16 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create a new tool for this agent", + "description": "Create a new task", "url": { - "raw": "{{baseUrl}}/agents/:id/tools", + "raw": "{{baseUrl}}/agents/:id/tasks", "host": [ "{{baseUrl}}" ], "path": [ "agents", ":id", - "tools" + "tasks" ], "query": [], "variable": [ @@ -1175,7 +1189,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"docs\": []\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -1191,24 +1205,31 @@ }, { "_type": "endpoint", - "name": "Individual Docs Route Get", + "name": "Tasks Route Update", "request": { - "description": "Get Doc by id", + "description": "Update an existing task (overwrite existing values)", "url": { - "raw": "{{baseUrl}}/docs/:id", + "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "docs", - ":id" + "agents", + ":id", + "tasks", + ":child_id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be updated", + "value": "child_id" } ] }, @@ -1225,9 +1246,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -1235,22 +1264,29 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get Doc by id", + "description": "Update an existing task (overwrite existing values)", "url": { - "raw": "{{baseUrl}}/docs/:id", + "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "docs", - ":id" + "agents", + ":id", + "tasks", + ":child_id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be updated", + "value": "child_id" } ] }, @@ -1267,36 +1303,51 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n}", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Individual Docs Route Delete", + "name": "Tasks Route Delete", "request": { - "description": "Delete an existing Doc by id", + "description": "Delete a task by its id", "url": { - "raw": "{{baseUrl}}/docs/:id", + "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "docs", - ":id" + "agents", + ":id", + "tasks", + ":child_id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be deleted", + "value": "child_id" } ] }, @@ -1323,22 +1374,29 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete an existing Doc by id", + "description": "Delete a task by its id", "url": { - "raw": "{{baseUrl}}/docs/:id", + "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "docs", - ":id" + "agents", + ":id", + "tasks", + ":child_id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be deleted", + "value": "child_id" } ] }, @@ -1367,19 +1425,33 @@ }, { "_type": "endpoint", - "name": "Embed Route Embed", + "name": "Tasks Route Patch", "request": { - "description": "Embed a query for search", + "description": "Update an existing task (merges with existing values)", "url": { - "raw": "{{baseUrl}}/embed", + "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "embed" + "agents", + ":id", + "tasks", + ":child_id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of parent resource", + "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be patched", + "value": "child_id" + } + ] }, "header": [ { @@ -1394,11 +1466,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -1412,17 +1484,31 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Embed a query for search", + "description": "Update an existing task (merges with existing values)", "url": { - "raw": "{{baseUrl}}/embed", + "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "embed" + "agents", + ":id", + "tasks", + ":child_id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of parent resource", + "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be patched", + "value": "child_id" + } + ] }, "header": [ { @@ -1437,11 +1523,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -1450,30 +1536,57 @@ } }, "description": "The request has succeeded.", - "body": "{\n \"vectors\": [\n [\n 1.1\n ]\n ]\n}", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Executions Route Get", + "name": "Agent Tools Route List", "request": { - "description": "Get an Execution by id", + "description": "List tools of the given agent", "url": { - "raw": "{{baseUrl}}/executions/:id", + "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "executions", - ":id" + "agents", + ":id", + "tools" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent", "value": "id" } ] @@ -1501,21 +1614,48 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get an Execution by id", + "description": "List tools of the given agent", "url": { - "raw": "{{baseUrl}}/executions/:id", + "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "executions", - ":id" + "agents", + ":id", + "tools" + ], + "query": [ + { + "key": "limit", + "description": "Limit the number of items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } ], - "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent", "value": "id" } ] @@ -1538,31 +1678,32 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n}", + "body": "{\n \"results\": []\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Executions Route Update", + "name": "Agent Tools Route Create", "request": { - "description": "Update an existing Execution", + "description": "Create a new tool for this agent", "url": { - "raw": "{{baseUrl}}/executions/:id", + "raw": "{{baseUrl}}/agents/:id/tools", "host": [ "{{baseUrl}}" ], "path": [ - "executions", - ":id" + "agents", + ":id", + "tools" ], "query": [], "variable": [ { "key": "id", - "value": "", - "description": "ID of the resource" + "description": "ID of parent resource", + "value": "id" } ] }, @@ -1572,13 +1713,18 @@ "value": "{{apiKey}}", "type": "string", "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"status\": \"cancelled\",\n \"reason\": \"example\"\n}", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", "options": { "raw": { "language": "json" @@ -1586,123 +1732,28 @@ } } }, - "response": [] - }, - { - "_type": "endpoint", - "name": "Execution Transitions Route List", - "request": { - "description": "List the Transitions of an Execution by id", - "url": { - "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "executions", - ":id", - "transitions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, "response": [ { "name": "Success", "status": "OK", "code": 200, "originalRequest": { - "description": "List the Transitions of an Execution by id", + "description": "Create a new tool for this agent", "url": { - "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/agents/:id/tools", "host": [ "{{baseUrl}}" ], "path": [ - "executions", + "agents", ":id", - "transitions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } + "tools" ], + "query": [], "variable": [ { "key": "id", - "description": "ID of parent", + "description": "ID of parent resource", "value": "id" } ] @@ -1720,36 +1771,51 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"transitions\": [\n {\n \"type\": \"finish\",\n \"execution_id\": \"execution_id\",\n \"output\": {\n \"key\": \"value\"\n },\n \"current\": [],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n }\n ]\n}", + "description": "The request has succeeded and a new resource has been created as a result.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Job Route Get", + "name": "Agent Tools Route Update", "request": { - "description": "Get the status of an existing Job by its id", + "description": "Update an existing tool (overwrite existing values)", "url": { - "raw": "{{baseUrl}}/jobs/:id", + "raw": "{{baseUrl}}/agents/:id/tools/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "jobs", - ":id" + "agents", + ":id", + "tools", + ":child_id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be updated", + "value": "child_id" } ] }, @@ -1766,9 +1832,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -1776,22 +1850,29 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get the status of an existing Job by its id", + "description": "Update an existing tool (overwrite existing values)", "url": { - "raw": "{{baseUrl}}/jobs/:id", + "raw": "{{baseUrl}}/agents/:id/tools/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "jobs", - ":id" + "agents", + ":id", + "tools", + ":child_id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be updated", + "value": "child_id" } ] }, @@ -1808,57 +1889,53 @@ "value": "application/json" } ], - "method": "GET", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"reason\": \"reason\",\n \"has_progress\": true,\n \"progress\": 1.1,\n \"state\": \"pending\"\n}", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Sessions Route List", + "name": "Agent Tools Route Delete", "request": { - "description": "List sessions (paginated)", + "description": "Delete an existing tool by id", "url": { - "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/agents/:id/tools/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents", + ":id", + "tools", + ":child_id" ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, + "query": [], + "variable": [ { - "key": "direction", - "description": "Sort direction", - "value": "asc" + "key": "id", + "description": "ID of parent resource", + "value": "id" }, { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" + "key": "child_id", + "description": "ID of the resource to be deleted", + "value": "child_id" } - ], - "variable": [] + ] }, "header": [ { @@ -1873,7 +1950,7 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, @@ -1883,43 +1960,31 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List sessions (paginated)", + "description": "Delete an existing tool by id", "url": { - "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/agents/:id/tools/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents", + ":id", + "tools", + ":child_id" ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, + "query": [], + "variable": [ { - "key": "direction", - "description": "Sort direction", - "value": "asc" + "key": "id", + "description": "ID of parent resource", + "value": "id" }, { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" + "key": "child_id", + "description": "ID of the resource to be deleted", + "value": "child_id" } - ], - "variable": [] + ] }, "header": [ { @@ -1934,31 +1999,45 @@ "value": "application/json" } ], - "method": "GET", + "method": "DELETE", "auth": null, "body": null }, - "description": "The request has succeeded.", - "body": "{\n \"results\": []\n}", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Sessions Route Create", + "name": "Agent Tools Route Patch", "request": { - "description": "Create a new session", + "description": "Update an existing tool (merges with existing values)", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents/:id/tools/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents", + ":id", + "tools", + ":child_id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of parent resource", + "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be patched", + "value": "child_id" + } + ] }, "header": [ { @@ -1973,11 +2052,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -1991,17 +2070,31 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create a new session", + "description": "Update an existing tool (merges with existing values)", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents/:id/tools/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents", + ":id", + "tools", + ":child_id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of parent resource", + "value": "id" + }, + { + "key": "child_id", + "description": "ID of the resource to be patched", + "value": "child_id" + } + ] }, "header": [ { @@ -2016,11 +2109,11 @@ "value": "application/json" } ], - "method": "POST", + "method": "PATCH", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "raw": "{}", "options": { "raw": { "language": "json" @@ -2028,27 +2121,41 @@ } } }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Sessions Route Create Or Update", + "name": "Tasks Create Or Update Route Create Or Update", "request": { - "description": "Create or update a session", + "description": "Create or update a task", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents/:parent_id/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents", + ":parent_id", + "tasks", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "parent_id", + "description": "ID of parent resource", + "value": "parent_id" + }, + { + "key": "id", + "description": null, + "value": "id" + } + ] }, "header": [ { @@ -2063,11 +2170,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2081,17 +2188,31 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update a session", + "description": "Create or update a task", "url": { - "raw": "{{baseUrl}}/sessions", + "raw": "{{baseUrl}}/agents/:parent_id/tasks/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions" + "agents", + ":parent_id", + "tasks", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "parent_id", + "description": "ID of parent resource", + "value": "parent_id" + }, + { + "key": "id", + "description": null, + "value": "id" + } + ] }, "header": [ { @@ -2106,11 +2227,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"situation\": \"situation\",\n \"render_templates\": true\n}", + "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", "options": { "raw": { "language": "json" @@ -2126,24 +2247,24 @@ }, { "_type": "endpoint", - "name": "Sessions Route Get", + "name": "Individual Docs Route Get", "request": { - "description": "Get a session by id", + "description": "Get Doc by id", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/docs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", + "docs", ":id" ], "query": [], "variable": [ { "key": "id", - "value": "", - "description": "ID of the resource" + "description": "ID of the resource", + "value": "id" } ] }, @@ -2153,26 +2274,77 @@ "value": "{{apiKey}}", "type": "string", "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" } ], "method": "GET", "auth": null, "body": null }, - "response": [] + "response": [ + { + "name": "Success", + "status": "OK", + "code": 200, + "originalRequest": { + "description": "Get Doc by id", + "url": { + "raw": "{{baseUrl}}/docs/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "docs", + ":id" + ], + "query": [], + "variable": [ + { + "key": "id", + "description": "ID of the resource", + "value": "id" + } + ] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + }, + { + "type": "text", + "key": "Content-Type", + "value": "application/json" + } + ], + "method": "GET", + "auth": null, + "body": null + }, + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n}", + "_postman_previewlanguage": "json" + } + ] }, { "_type": "endpoint", - "name": "Sessions Route Update", + "name": "Individual Docs Route Delete", "request": { - "description": "Update an existing session by its id (overwrites all existing values)", + "description": "Delete an existing Doc by id", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/docs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", + "docs", ":id" ], "query": [], @@ -2197,17 +2369,9 @@ "value": "application/json" } ], - "method": "PUT", + "method": "DELETE", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -2215,14 +2379,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update an existing session by its id (overwrites all existing values)", + "description": "Delete an existing Doc by id", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/docs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", + "docs", ":id" ], "query": [], @@ -2247,46 +2411,31 @@ "value": "application/json" } ], - "method": "PUT", + "method": "DELETE", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Sessions Route Delete", + "name": "Embed Route Embed", "request": { - "description": "Delete a session by its id", + "description": "Embed a query for search", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/embed", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":id" + "embed" ], "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] + "variable": [] }, "header": [ { @@ -2301,9 +2450,17 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -2311,24 +2468,17 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete a session by its id", + "description": "Embed a query for search", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/embed", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":id" + "embed" ], "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] + "variable": [] }, "header": [ { @@ -2343,28 +2493,36 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"vectors\": [\n [\n 1.1\n ]\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Sessions Route Patch", + "name": "Executions Route Get", "request": { - "description": "Update an existing session by its id (merges with existing values)", + "description": "Get an Execution by id", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/executions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", + "executions", ":id" ], "query": [], @@ -2389,17 +2547,9 @@ "value": "application/json" } ], - "method": "PATCH", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -2407,14 +2557,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update an existing session by its id (merges with existing values)", + "description": "Get an Execution by id", "url": { - "raw": "{{baseUrl}}/sessions/:id", + "raw": "{{baseUrl}}/executions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", + "executions", ":id" ], "query": [], @@ -2439,38 +2589,30 @@ "value": "application/json" } ], - "method": "PATCH", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "History Route List", + "name": "Execution Transitions Route List", "request": { - "description": "Get history of a Session (paginated)", + "description": "List the Transitions of an Execution by id", "url": { - "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", + "executions", ":id", - "history" + "transitions" ], "query": [ { @@ -2530,16 +2672,16 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get history of a Session (paginated)", + "description": "List the Transitions of an Execution by id", "url": { - "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", + "executions", ":id", - "history" + "transitions" ], "query": [ { @@ -2594,25 +2736,24 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"entries\": [\n {\n \"role\": \"user\",\n \"content\": [],\n \"source\": \"api_request\",\n \"timestamp\": 1,\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ],\n \"relations\": [\n {\n \"head\": \"head\",\n \"relation\": \"relation\",\n \"tail\": \"tail\"\n }\n ],\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"transitions\": [\n {\n \"type\": \"finish\",\n \"execution_id\": \"execution_id\",\n \"output\": {\n \"key\": \"value\"\n },\n \"current\": [],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "History Route Delete", + "name": "Job Route Get", "request": { - "description": "Clear the history of a Session (resets the Session)", + "description": "Get the status of an existing Job by its id", "url": { - "raw": "{{baseUrl}}/sessions/:id/history", + "raw": "{{baseUrl}}/jobs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":id", - "history" + "jobs", + ":id" ], "query": [], "variable": [ @@ -2636,7 +2777,7 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, @@ -2646,16 +2787,15 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Clear the history of a Session (resets the Session)", + "description": "Get the status of an existing Job by its id", "url": { - "raw": "{{baseUrl}}/sessions/:id/history", + "raw": "{{baseUrl}}/jobs/:id", "host": [ "{{baseUrl}}" ], "path": [ - "sessions", - ":id", - "history" + "jobs", + ":id" ], "query": [], "variable": [ @@ -2679,28 +2819,28 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "GET", "auth": null, "body": null }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"reason\": \"reason\",\n \"has_progress\": true,\n \"progress\": 1.1,\n \"state\": \"pending\"\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Tasks Route List", + "name": "Sessions Route List", "request": { - "description": "List tasks (paginated)", + "description": "List sessions (paginated)", "url": { - "raw": "{{baseUrl}}/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "tasks" + "sessions" ], "query": [ { @@ -2754,14 +2894,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List tasks (paginated)", + "description": "List sessions (paginated)", "url": { - "raw": "{{baseUrl}}/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "tasks" + "sessions" ], "query": [ { @@ -2810,23 +2950,23 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"input_schema\": {\n \"key\": \"value\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n }\n }\n ]\n}", + "body": "{\n \"results\": []\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Tasks Route Create", + "name": "Sessions Route Create", "request": { - "description": "Create a new task", + "description": "Create a new session", "url": { - "raw": "{{baseUrl}}/tasks", + "raw": "{{baseUrl}}/sessions", "host": [ "{{baseUrl}}" ], "path": [ - "tasks" + "sessions" ], "query": [], "variable": [] @@ -2848,7 +2988,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -2862,14 +3002,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create a new task", + "description": "Create a new session", "url": { - "raw": "{{baseUrl}}/tasks", + "raw": "{{baseUrl}}/sessions", "host": [ "{{baseUrl}}" ], "path": [ - "tasks" + "sessions" ], "query": [], "variable": [] @@ -2891,7 +3031,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -2907,19 +3047,63 @@ }, { "_type": "endpoint", - "name": "Tasks Route Create Or Update", + "name": "Sessions Route Get", + "request": { + "description": "Get a session by id", + "url": { + "raw": "{{baseUrl}}/sessions/:id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "sessions", + ":id" + ], + "query": [], + "variable": [ + { + "key": "id", + "value": "", + "description": "ID of the resource" + } + ] + }, + "header": [ + { + "key": "Authorization", + "value": "{{apiKey}}", + "type": "string", + "description": null + } + ], + "method": "GET", + "auth": null, + "body": null + }, + "response": [] + }, + { + "_type": "endpoint", + "name": "Sessions Route Create Or Update", "request": { - "description": "Create or update a task", + "description": "Create or update a session", "url": { - "raw": "{{baseUrl}}/tasks", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks" + "sessions", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": null, + "value": "id" + } + ] }, "header": [ { @@ -2934,11 +3118,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -2952,17 +3136,24 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update a task", + "description": "Create or update a session", "url": { - "raw": "{{baseUrl}}/tasks", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks" + "sessions", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": null, + "value": "id" + } + ] }, "header": [ { @@ -2977,11 +3168,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -2997,16 +3188,16 @@ }, { "_type": "endpoint", - "name": "Tasks Route Update", + "name": "Sessions Route Update", "request": { - "description": "Update an existing task (overwrite existing values)", + "description": "Update an existing session by its id (overwrites all existing values)", "url": { - "raw": "{{baseUrl}}/tasks/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id" ], "query": [], @@ -3035,7 +3226,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -3049,14 +3240,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update an existing task (overwrite existing values)", + "description": "Update an existing session by its id (overwrites all existing values)", "url": { - "raw": "{{baseUrl}}/tasks/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id" ], "query": [], @@ -3085,7 +3276,7 @@ "auth": null, "body": { "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", + "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", "options": { "raw": { "language": "json" @@ -3101,16 +3292,16 @@ }, { "_type": "endpoint", - "name": "Tasks Route Delete", + "name": "Sessions Route Delete", "request": { - "description": "Delete a task by its id", + "description": "Delete a session by its id", "url": { - "raw": "{{baseUrl}}/tasks/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id" ], "query": [], @@ -3145,14 +3336,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete a task by its id", + "description": "Delete a session by its id", "url": { - "raw": "{{baseUrl}}/tasks/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id" ], "query": [], @@ -3189,16 +3380,16 @@ }, { "_type": "endpoint", - "name": "Tasks Route Patch", + "name": "Sessions Route Patch", "request": { - "description": "Update an existing task (merges with existing values)", + "description": "Update an existing session by its id (merges with existing values)", "url": { - "raw": "{{baseUrl}}/tasks/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id" ], "query": [], @@ -3241,14 +3432,14 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update an existing task (merges with existing values)", + "description": "Update an existing session by its id (merges with existing values)", "url": { - "raw": "{{baseUrl}}/tasks/:id", + "raw": "{{baseUrl}}/sessions/:id", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id" ], "query": [], @@ -3293,18 +3484,18 @@ }, { "_type": "endpoint", - "name": "Task Executions Route List", + "name": "History Route List", "request": { - "description": "List executions of the given task", + "description": "Get history of a Session (paginated)", "url": { - "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id", - "executions" + "history" ], "query": [ { @@ -3364,16 +3555,16 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "List executions of the given task", + "description": "Get history of a Session (paginated)", "url": { - "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", + "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id", - "executions" + "history" ], "query": [ { @@ -3428,31 +3619,31 @@ "body": null }, "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n }\n ]\n}", + "body": "{\n \"results\": [\n {\n \"entries\": [\n {\n \"role\": \"user\",\n \"content\": [],\n \"source\": \"api_request\",\n \"timestamp\": 1,\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ],\n \"relations\": [\n {\n \"head\": \"head\",\n \"relation\": \"relation\",\n \"tail\": \"tail\"\n }\n ],\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Task Executions Route Create", + "name": "History Route Delete", "request": { - "description": "Create an execution for the given task", + "description": "Clear the history of a Session (resets the Session)", "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", + "raw": "{{baseUrl}}/sessions/:id/history", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id", - "executions" + "history" ], "query": [], "variable": [ { "key": "id", - "description": "ID of parent resource", + "description": "ID of the resource", "value": "id" } ] @@ -3470,17 +3661,9 @@ "value": "application/json" } ], - "method": "POST", + "method": "DELETE", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -3488,22 +3671,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create an execution for the given task", + "description": "Clear the history of a Session (resets the Session)", "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", + "raw": "{{baseUrl}}/sessions/:id/history", "host": [ "{{baseUrl}}" ], "path": [ - "tasks", + "sessions", ":id", - "executions" + "history" ], "query": [], "variable": [ { "key": "id", - "description": "ID of parent resource", + "description": "ID of the resource", "value": "id" } ] @@ -3521,31 +3704,23 @@ "value": "application/json" } ], - "method": "POST", + "method": "DELETE", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Task Executions Route Resume With Task Token", + "name": "Task Executions Route List", "request": { - "description": "Resume an execution with a task token", + "description": "List executions of the given task", "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", + "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], @@ -3554,11 +3729,37 @@ ":id", "executions" ], - "query": [], + "query": [ + { + "key": "limit", + "description": "Limit the number of items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], "variable": [ { "key": "id", - "description": "ID of parent Task", + "description": "ID of parent", "value": "id" } ] @@ -3576,17 +3777,9 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -3594,9 +3787,9 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Resume an execution with a task token", + "description": "List executions of the given task", "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", + "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", "host": [ "{{baseUrl}}" ], @@ -3605,11 +3798,37 @@ ":id", "executions" ], - "query": [], + "query": [ + { + "key": "limit", + "description": "Limit the number of items returned", + "value": "1" + }, + { + "key": "offset", + "description": "Offset the items returned", + "value": "1" + }, + { + "key": "sort_by", + "description": "Sort by a field", + "value": "created_at" + }, + { + "key": "direction", + "description": "Sort direction", + "value": "asc" + }, + { + "key": "metadata_filter", + "description": "JSON string of object that should be used to filter objects by metadata", + "value": "metadata_filter" + } + ], "variable": [ { "key": "id", - "description": "ID of parent Task", + "description": "ID of parent", "value": "id" } ] @@ -3626,44 +3845,37 @@ "key": "Content-Type", "value": "application/json" } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + ], + "method": "GET", + "auth": null, + "body": null }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "body": "{\n \"results\": [\n {\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n }\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Tool Route Update", + "name": "Task Executions Route Create", "request": { - "description": "Update an existing tool (overwrite existing values)", + "description": "Create an execution for the given task", "url": { - "raw": "{{baseUrl}}/tools/:id", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "tools", - ":id" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" } ] @@ -3681,11 +3893,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", + "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", "options": { "raw": { "language": "json" @@ -3699,21 +3911,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Update an existing tool (overwrite existing values)", + "description": "Create an execution for the given task", "url": { - "raw": "{{baseUrl}}/tools/:id", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "tools", - ":id" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent resource", "value": "id" } ] @@ -3731,11 +3944,11 @@ "value": "application/json" } ], - "method": "PUT", + "method": "POST", "auth": null, "body": { "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", + "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", "options": { "raw": { "language": "json" @@ -3743,31 +3956,32 @@ } } }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded and a new resource has been created as a result.", + "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Tool Route Delete", + "name": "Task Executions Route Resume With Task Token", "request": { - "description": "Delete an existing tool by id", + "description": "Resume an execution with a task token", "url": { - "raw": "{{baseUrl}}/tools/:id", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "tools", - ":id" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent Task", "value": "id" } ] @@ -3785,9 +3999,17 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -3795,21 +4017,22 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Delete an existing tool by id", + "description": "Resume an execution with a task token", "url": { - "raw": "{{baseUrl}}/tools/:id", + "raw": "{{baseUrl}}/tasks/:id/executions", "host": [ "{{baseUrl}}" ], "path": [ - "tools", - ":id" + "tasks", + ":id", + "executions" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", + "description": "ID of parent Task", "value": "id" } ] @@ -3827,36 +4050,51 @@ "value": "application/json" } ], - "method": "DELETE", + "method": "PUT", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "description": "The request has succeeded.", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Tool Route Patch", + "name": "Task Executions Route Update", "request": { - "description": "Update an existing tool (merges with existing values)", + "description": "Update an existing Execution", "url": { - "raw": "{{baseUrl}}/tools/:id", + "raw": "{{baseUrl}}/tasks/:id/executions/:child_id", "host": [ "{{baseUrl}}" ], "path": [ - "tools", - ":id" + "tasks", + ":id", + "executions", + ":child_id" ], "query": [], "variable": [ { "key": "id", - "description": "ID of the resource", - "value": "id" + "value": "", + "description": "ID of parent resource" + }, + { + "key": "child_id", + "value": "", + "description": "ID of the resource to be updated" } ] }, @@ -3866,18 +4104,13 @@ "value": "{{apiKey}}", "type": "string", "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" } ], - "method": "PATCH", + "method": "PUT", "auth": null, "body": { "mode": "raw", - "raw": "{}", + "raw": "{\n \"status\": \"cancelled\",\n \"reason\": \"example\"\n}", "options": { "raw": { "language": "json" @@ -3885,61 +4118,7 @@ } } }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing tool (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/tools/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tools", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] + "response": [] }, { "_type": "endpoint", @@ -4159,19 +4338,26 @@ }, { "_type": "endpoint", - "name": "Users Route Create Or Update", + "name": "Users Route Get", "request": { - "description": "Create or update a user", + "description": "Get a user by id", "url": { - "raw": "{{baseUrl}}/users", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users" + "users", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the resource", + "value": "id" + } + ] }, "header": [ { @@ -4186,17 +4372,9 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "response": [ { @@ -4204,17 +4382,24 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Create or update a user", + "description": "Get a user by id", "url": { - "raw": "{{baseUrl}}/users", + "raw": "{{baseUrl}}/users/:id", "host": [ "{{baseUrl}}" ], "path": [ - "users" + "users", + ":id" ], "query": [], - "variable": [] + "variable": [ + { + "key": "id", + "description": "ID of the resource", + "value": "id" + } + ] }, "header": [ { @@ -4229,29 +4414,21 @@ "value": "application/json" } ], - "method": "PUT", + "method": "GET", "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "body": null }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", + "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", "_postman_previewlanguage": "json" } ] }, { "_type": "endpoint", - "name": "Users Route Get", + "name": "Users Route Create Or Update", "request": { - "description": "Get a user by id", + "description": "Create or update a user", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4265,7 +4442,7 @@ "variable": [ { "key": "id", - "description": "ID of the resource", + "description": null, "value": "id" } ] @@ -4283,9 +4460,17 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -4293,7 +4478,7 @@ "status": "OK", "code": 200, "originalRequest": { - "description": "Get a user by id", + "description": "Create or update a user", "url": { "raw": "{{baseUrl}}/users/:id", "host": [ @@ -4307,7 +4492,7 @@ "variable": [ { "key": "id", - "description": "ID of the resource", + "description": null, "value": "id" } ] @@ -4325,12 +4510,20 @@ "value": "application/json" } ], - "method": "GET", + "method": "POST", "auth": null, - "body": null + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", + "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", "_postman_previewlanguage": "json" } ] diff --git a/sdks/python/julep/api/README.md b/sdks/python/julep/api/README.md index 41da1e6ca..daa4fb689 100644 --- a/sdks/python/julep/api/README.md +++ b/sdks/python/julep/api/README.md @@ -27,7 +27,6 @@ client.agents_route_create( about="about", model="model", instructions="instructions", - docs=[], ) ``` @@ -52,7 +51,6 @@ async def main() -> None: about="about", model="model", instructions="instructions", - docs=[], ) diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 74de16b6e..589af86d6 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -13,8 +13,6 @@ AgentsCreateAgentRequest, AgentsCreateAgentRequestDefaultSettings, AgentsCreateAgentRequestInstructions, - AgentsCreateOrUpdateAgentRequestDefaultSettings, - AgentsCreateOrUpdateAgentRequestInstructions, AgentsDocsSearchRouteSearchRequestDirection, AgentsDocsSearchRouteSearchRequestSortBy, AgentsDocsSearchRouteSearchResponse, @@ -23,6 +21,7 @@ AgentsRouteListRequestDirection, AgentsRouteListRequestSortBy, AgentsRouteListResponse, + AgentsUpdateAgentRequest, AgentsUpdateAgentRequestDefaultSettings, AgentsUpdateAgentRequestInstructions, ChatCompletionResponseFormat, @@ -103,6 +102,7 @@ JobsJobState, JobsJobStatus, SessionsContextOverflowType, + SessionsCreateSessionRequest, SessionsMultiAgentMultiUserSession, SessionsMultiAgentNoUserSession, SessionsMultiAgentSingleUserSession, @@ -122,6 +122,7 @@ TaskExecutionsRouteListRequestDirection, TaskExecutionsRouteListRequestSortBy, TaskExecutionsRouteListResponse, + TasksCreateTaskRequest, TasksErrorWorkflowStep, TasksEvaluateStep, TasksIfElseWorkflowStep, @@ -165,6 +166,7 @@ UsersRouteListRequestDirection, UsersRouteListRequestSortBy, UsersRouteListResponse, + UsersUpdateUserRequest, UsersUser, ) from .environment import JulepApiEnvironment @@ -182,8 +184,6 @@ "AgentsCreateAgentRequest", "AgentsCreateAgentRequestDefaultSettings", "AgentsCreateAgentRequestInstructions", - "AgentsCreateOrUpdateAgentRequestDefaultSettings", - "AgentsCreateOrUpdateAgentRequestInstructions", "AgentsDocsSearchRouteSearchRequestDirection", "AgentsDocsSearchRouteSearchRequestSortBy", "AgentsDocsSearchRouteSearchResponse", @@ -192,6 +192,7 @@ "AgentsRouteListRequestDirection", "AgentsRouteListRequestSortBy", "AgentsRouteListResponse", + "AgentsUpdateAgentRequest", "AgentsUpdateAgentRequestDefaultSettings", "AgentsUpdateAgentRequestInstructions", "ChatCompletionResponseFormat", @@ -273,6 +274,7 @@ "JobsJobStatus", "JulepApiEnvironment", "SessionsContextOverflowType", + "SessionsCreateSessionRequest", "SessionsMultiAgentMultiUserSession", "SessionsMultiAgentNoUserSession", "SessionsMultiAgentSingleUserSession", @@ -292,6 +294,7 @@ "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", + "TasksCreateTaskRequest", "TasksErrorWorkflowStep", "TasksEvaluateStep", "TasksIfElseWorkflowStep", @@ -335,5 +338,6 @@ "UsersRouteListRequestDirection", "UsersRouteListRequestSortBy", "UsersRouteListResponse", + "UsersUpdateUserRequest", "UsersUser", ] diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index 78fbcafbe..c8c82a127 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -30,12 +30,6 @@ from .types.agents_create_agent_request_instructions import ( AgentsCreateAgentRequestInstructions, ) -from .types.agents_create_or_update_agent_request_default_settings import ( - AgentsCreateOrUpdateAgentRequestDefaultSettings, -) -from .types.agents_create_or_update_agent_request_instructions import ( - AgentsCreateOrUpdateAgentRequestInstructions, -) from .types.agents_docs_search_route_search_request_direction import ( AgentsDocsSearchRouteSearchRequestDirection, ) @@ -284,7 +278,6 @@ def agents_route_create( about: str, model: str, instructions: AgentsCreateAgentRequestInstructions, - docs: typing.Sequence[typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, default_settings: typing.Optional[ AgentsCreateAgentRequestDefaultSettings @@ -308,9 +301,6 @@ def agents_route_create( instructions : AgentsCreateAgentRequestInstructions Instructions for the agent - docs : typing.Sequence[typing.Any] - Documents to index for this agent. (Max: 100 items) - metadata : typing.Optional[typing.Dict[str, typing.Any]] default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] @@ -337,7 +327,6 @@ def agents_route_create( about="about", model="model", instructions="instructions", - docs=[], ) """ _response = self._client_wrapper.httpx_client.request( @@ -350,7 +339,6 @@ def agents_route_create( "model": model, "instructions": instructions, "default_settings": default_settings, - "docs": docs, }, request_options=request_options, omit=OMIT, @@ -363,17 +351,61 @@ def agents_route_create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def agents_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsAgent: + """ + Get an Agent by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsAgent + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.agents_route_get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + def agents_route_create_or_update( self, - *, id: CommonUuid, + *, name: CommonIdentifierSafeUnicode, about: str, model: str, - instructions: AgentsCreateOrUpdateAgentRequestInstructions, + instructions: AgentsUpdateAgentRequestInstructions, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, default_settings: typing.Optional[ - AgentsCreateOrUpdateAgentRequestDefaultSettings + AgentsUpdateAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: @@ -393,12 +425,12 @@ def agents_route_create_or_update( model : str Model name to use (gpt-4-turbo, gemini-nano etc) - instructions : AgentsCreateOrUpdateAgentRequestInstructions + instructions : AgentsUpdateAgentRequestInstructions Instructions for the agent metadata : typing.Optional[typing.Dict[str, typing.Any]] - default_settings : typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings] + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] Default settings for all sessions created by this agent request_options : typing.Optional[RequestOptions] @@ -426,10 +458,9 @@ def agents_route_create_or_update( ) """ _response = self._client_wrapper.httpx_client.request( - "agents", - method="PUT", + f"agents/{jsonable_encoder(id)}", + method="POST", json={ - "id": id, "metadata": metadata, "name": name, "about": about, @@ -448,50 +479,6 @@ def agents_route_create_or_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> AgentsAgent: - """ - Get an Agent by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AgentsAgent - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.agents_route_get( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_update( self, id: CommonUuid, @@ -874,19 +861,19 @@ def agents_docs_search_route_search( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agent_tools_route_list( + def tasks_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: AgentToolsRouteListRequestSortBy, - direction: AgentToolsRouteListRequestDirection, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentToolsRouteListResponse: + ) -> TasksRouteListResponse: """ - List tools of the given agent + List tasks (paginated) Parameters ---------- @@ -899,10 +886,10 @@ def agent_tools_route_list( offset : CommonOffset Offset the items returned - sort_by : AgentToolsRouteListRequestSortBy + sort_by : TasksRouteListRequestSortBy Sort by a field - direction : AgentToolsRouteListRequestDirection + direction : TasksRouteListRequestDirection Sort direction metadata_filter : str @@ -913,7 +900,7 @@ def agent_tools_route_list( Returns ------- - AgentToolsRouteListResponse + TasksRouteListResponse The request has succeeded. Examples @@ -924,7 +911,7 @@ def agent_tools_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_tools_route_list( + client.tasks_route_list( id="id", limit=1, offset=1, @@ -934,7 +921,7 @@ def agent_tools_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools", + f"agents/{jsonable_encoder(id)}/tasks", method="GET", params={ "limit": limit, @@ -947,54 +934,50 @@ def agent_tools_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agent_tools_route_create( + def tasks_route_create( self, id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsCreateAgentRequestInstructions, - docs: typing.Sequence[typing.Any], + name: str, + description: str, + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsCreateAgentRequestDefaultSettings - ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceCreatedResponse: """ - Create a new tool for this agent + Create a new task Parameters ---------- id : CommonUuid ID of parent resource - name : CommonIdentifierSafeUnicode - Name of the agent + name : str - about : str - About the agent + description : str - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - instructions : AgentsCreateAgentRequestInstructions - Instructions for the agent + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - docs : typing.Sequence[typing.Any] - Documents to index for this agent. (Max: 100 items) + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - metadata : typing.Optional[typing.Dict[str, typing.Any]] + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1006,32 +989,38 @@ def agent_tools_route_create( Examples -------- + from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_tools_route_create( + client.tasks_route_create( id="id", name="name", - about="about", - model="model", - instructions="instructions", - docs=[], + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools", + f"agents/{jsonable_encoder(id)}/tasks", method="POST", json={ - "metadata": metadata, "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, - "docs": docs, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, @@ -1044,60 +1033,116 @@ def agent_tools_route_create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def individual_docs_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> DocsDoc: + def tasks_route_update( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + description: str, + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: """ - Get Doc by id + Update an existing task (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + child_id : CommonUuid + ID of the resource to be updated + + description : str + + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. + + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - DocsDoc + CommonResourceUpdatedResponse The request has succeeded. Examples -------- + from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.individual_docs_route_get( + client.tasks_route_update( id="id", + child_id="child_id", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="GET", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PUT", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def individual_docs_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + def tasks_route_delete( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceDeletedResponse: """ - Delete an existing Doc by id + Delete a task by its id Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + child_id : CommonUuid + ID of the resource to be deleted request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1115,12 +1160,13 @@ def individual_docs_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.individual_docs_route_delete( + client.tasks_route_delete( id="id", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", method="DELETE", request_options=request_options, ) @@ -1132,117 +1178,45 @@ def individual_docs_route_delete( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def embed_route_embed( + def tasks_route_patch( self, + id: CommonUuid, + child_id: CommonUuid, *, - body: DocsEmbedQueryRequest, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DocsEmbedQueryResponse: - """ - Embed a query for search - - Parameters - ---------- - body : DocsEmbedQueryRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DocsEmbedQueryResponse - The request has succeeded. - - Examples - -------- - from julep import DocsEmbedQueryRequest - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.embed_route_embed( - body=DocsEmbedQueryRequest( - text="text", - ), - ) - """ - _response = self._client_wrapper.httpx_client.request( - "embed", - method="POST", - json={"body": body}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def executions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ExecutionsExecution: + ) -> CommonResourceUpdatedResponse: """ - Get an Execution by id + Update an existing task (merges with existing values) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource - request_options : typing.Optional[RequestOptions] - Request-specific configuration. + child_id : CommonUuid + ID of the resource to be patched - Returns - ------- - ExecutionsExecution - The request has succeeded. + description : typing.Optional[str] - Examples - -------- - from julep.client import JulepApi + main : typing.Optional[typing.Sequence[TasksWorkflowStep]] + The entrypoint of the task. - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.executions_route_get( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - def executions_route_update( - self, - id: CommonUuid, - *, - request: ExecutionsUpdateExecutionRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing Execution + tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] + Tools defined specifically for this task not included in the Agent itself. - Parameters - ---------- - id : CommonUuid - ID of the resource + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. - request : ExecutionsUpdateExecutionRequest + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1254,24 +1228,28 @@ def executions_route_update( Examples -------- - from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.executions_route_update( - id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), + client.tasks_route_patch( + id="id", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="PUT", - json=request, + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, request_options=request_options, omit=OMIT, ) @@ -1283,19 +1261,19 @@ def executions_route_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def execution_transitions_route_list( + def agent_tools_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: ExecutionTransitionsRouteListRequestSortBy, - direction: ExecutionTransitionsRouteListRequestDirection, + sort_by: AgentToolsRouteListRequestSortBy, + direction: AgentToolsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionTransitionsRouteListResponse: + ) -> AgentToolsRouteListResponse: """ - List the Transitions of an Execution by id + List tools of the given agent Parameters ---------- @@ -1308,10 +1286,10 @@ def execution_transitions_route_list( offset : CommonOffset Offset the items returned - sort_by : ExecutionTransitionsRouteListRequestSortBy + sort_by : AgentToolsRouteListRequestSortBy Sort by a field - direction : ExecutionTransitionsRouteListRequestDirection + direction : AgentToolsRouteListRequestDirection Sort direction metadata_filter : str @@ -1322,7 +1300,7 @@ def execution_transitions_route_list( Returns ------- - ExecutionTransitionsRouteListResponse + AgentToolsRouteListResponse The request has succeeded. Examples @@ -1333,7 +1311,7 @@ def execution_transitions_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.execution_transitions_route_list( + client.agent_tools_route_list( id="id", limit=1, offset=1, @@ -1343,7 +1321,7 @@ def execution_transitions_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}/transitions", + f"agents/{jsonable_encoder(id)}/tools", method="GET", params={ "limit": limit, @@ -1356,30 +1334,58 @@ def execution_transitions_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def job_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> JobsJobStatus: + def agent_tools_route_create( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: """ - Get the status of an existing Job by its id + Create a new tool for this agent Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - JobsJobStatus - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- @@ -1389,59 +1395,80 @@ def job_route_get( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.job_route_get( + client.agent_tools_route_create( id="id", + name="name", + about="about", + model="model", + instructions="instructions", ) """ _response = self._client_wrapper.httpx_client.request( - f"jobs/{jsonable_encoder(id)}", - method="GET", + f"agents/{jsonable_encoder(id)}/tools", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_list( + def agent_tools_route_update( self, + id: CommonUuid, + child_id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: SessionsRouteListRequestSortBy, - direction: SessionsRouteListRequestDirection, - metadata_filter: str, + type: ToolsToolType, + name: CommonValidPythonIdentifier, + function: typing.Optional[ToolsFunctionDef] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - List sessions (paginated) + Update an existing tool (overwrite existing values) Parameters ---------- - limit : CommonLimit - Limit the number of items returned + id : CommonUuid + ID of parent resource - offset : CommonOffset - Offset the items returned + child_id : CommonUuid + ID of the resource to be updated - sort_by : SessionsRouteListRequestSortBy - Sort by a field + type : ToolsToolType + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - direction : SessionsRouteListRequestDirection - Sort direction + name : CommonValidPythonIdentifier + Name of the tool (must be unique for this agent and a valid python identifier string ) - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + function : typing.Optional[ToolsFunctionDef] + + integration : typing.Optional[typing.Any] + + system : typing.Optional[typing.Any] + + api_call : typing.Optional[typing.Any] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -1452,84 +1479,132 @@ def sessions_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + client.agent_tools_route_update( + id="id", + child_id="child_id", + type="function", + name="name", ) """ _response = self._client_wrapper.httpx_client.request( - "sessions", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="PUT", + json={ + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_create( + def agent_tools_route_delete( self, + id: CommonUuid, + child_id: CommonUuid, *, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + ) -> CommonResourceDeletedResponse: """ - Create a new session + Delete an existing tool by id Parameters ---------- - situation : str - A specific situation that sets the background for this session + id : CommonUuid + ID of parent resource - render_templates : bool - Render system and assistant message content as jinja templates + child_id : CommonUuid + ID of the resource to be deleted - user : typing.Optional[CommonUuid] - User ID of user associated with this session + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - users : typing.Optional[typing.Sequence[CommonUuid]] + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session + Examples + -------- + from julep.client import JulepApi - agents : typing.Optional[typing.Sequence[CommonUuid]] + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.agent_tools_route_delete( + id="id", + child_id="child_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + def agent_tools_route_patch( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + type: typing.Optional[ToolsToolType] = OMIT, + name: typing.Optional[CommonValidPythonIdentifier] = OMIT, + function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing tool (merges with existing values) - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + Parameters + ---------- + id : CommonUuid + ID of parent resource - metadata : typing.Optional[typing.Dict[str, typing.Any]] + child_id : CommonUuid + ID of the resource to be patched + + type : typing.Optional[ToolsToolType] + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + + name : typing.Optional[CommonValidPythonIdentifier] + Name of the tool (must be unique for this agent and a valid python identifier string ) + + function : typing.Optional[ToolsFunctionDefUpdate] + + integration : typing.Optional[typing.Any] + + system : typing.Optional[typing.Any] + + api_call : typing.Optional[typing.Any] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- @@ -1539,79 +1614,72 @@ def sessions_route_create( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_create( - situation="situation", - render_templates=True, + client.agent_tools_route_patch( + id="id", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - "sessions", - method="POST", + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="PATCH", json={ - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_create_or_update( + def tasks_create_or_update_route_create_or_update( self, - *, + parent_id: CommonUuid, id: CommonUuid, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + *, + name: str, + description: str, + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Create or update a session + Create or update a task Parameters ---------- - id : CommonUuid - - situation : str - A specific situation that sets the background for this session + parent_id : CommonUuid + ID of parent resource - render_templates : bool - Render system and assistant message content as jinja templates + id : CommonUuid - user : typing.Optional[CommonUuid] - User ID of user associated with this session + name : str - users : typing.Optional[typing.Sequence[CommonUuid]] + description : str - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - agents : typing.Optional[typing.Sequence[CommonUuid]] + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -1625,31 +1693,38 @@ def sessions_route_create_or_update( Examples -------- + from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_create_or_update( + client.tasks_create_or_update_route_create_or_update( + parent_id="parent_id", id="id", - situation="situation", - render_templates=True, + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) """ _response = self._client_wrapper.httpx_client.request( - "sessions", - method="PUT", + f"agents/{jsonable_encoder(parent_id)}/tasks/{jsonable_encoder(id)}", + method="POST", json={ - "id": id, - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, "metadata": metadata, }, request_options=request_options, @@ -1663,11 +1738,11 @@ def sessions_route_create_or_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_get( + def individual_docs_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsSession: + ) -> DocsDoc: """ - Get a session by id + Get Doc by id Parameters ---------- @@ -1679,7 +1754,7 @@ def sessions_route_get( Returns ------- - SessionsSession + DocsDoc The request has succeeded. Examples @@ -1690,63 +1765,41 @@ def sessions_route_get( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_get( - id="string", + client.individual_docs_route_get( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", + f"docs/{jsonable_encoder(id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_update( - self, - id: CommonUuid, - *, - situation: str, - render_templates: bool, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + def individual_docs_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Update an existing session by its id (overwrites all existing values) + Delete an existing Doc by id Parameters ---------- id : CommonUuid ID of the resource - situation : str - A specific situation that sets the background for this session - - render_templates : bool - Render system and assistant message content as jinja templates - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -1756,116 +1809,91 @@ def sessions_route_update( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_update( + client.individual_docs_route_delete( id="id", - situation="situation", - render_templates=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PUT", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, + f"docs/{jsonable_encoder(id)}", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + def embed_route_embed( + self, + *, + body: DocsEmbedQueryRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> DocsEmbedQueryResponse: """ - Delete a session by its id + Embed a query for search Parameters ---------- - id : CommonUuid - ID of the resource + body : DocsEmbedQueryRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + DocsEmbedQueryResponse + The request has succeeded. Examples -------- + from julep import DocsEmbedQueryRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_delete( - id="id", + client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="DELETE", + "embed", + method="POST", + json={"body": body}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def sessions_route_patch( - self, - id: CommonUuid, - *, - situation: typing.Optional[str] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + def executions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExecutionsExecution: """ - Update an existing session by its id (merges with existing values) + Get an Execution by id Parameters ---------- id : CommonUuid ID of the resource - situation : typing.Optional[str] - A specific situation that sets the background for this session - - render_templates : typing.Optional[bool] - Render system and assistant message content as jinja templates - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + ExecutionsExecution The request has succeeded. Examples @@ -1876,44 +1904,36 @@ def sessions_route_patch( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.sessions_route_patch( + client.executions_route_get( id="id", ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PATCH", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, + f"executions/{jsonable_encoder(id)}", + method="GET", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_list( + def execution_transitions_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + ) -> ExecutionTransitionsRouteListResponse: """ - Get history of a Session (paginated) + List the Transitions of an Execution by id Parameters ---------- @@ -1926,10 +1946,10 @@ def history_route_list( offset : CommonOffset Offset the items returned - sort_by : HistoryRouteListRequestSortBy + sort_by : ExecutionTransitionsRouteListRequestSortBy Sort by a field - direction : HistoryRouteListRequestDirection + direction : ExecutionTransitionsRouteListRequestDirection Sort direction metadata_filter : str @@ -1940,7 +1960,7 @@ def history_route_list( Returns ------- - HistoryRouteListResponse + ExecutionTransitionsRouteListResponse The request has succeeded. Examples @@ -1951,7 +1971,7 @@ def history_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.history_route_list( + client.execution_transitions_route_list( id="id", limit=1, offset=1, @@ -1961,7 +1981,7 @@ def history_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", + f"executions/{jsonable_encoder(id)}/transitions", method="GET", params={ "limit": limit, @@ -1974,17 +1994,17 @@ def history_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_delete( + def job_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + ) -> JobsJobStatus: """ - Clear the history of a Session (resets the Session) + Get the status of an existing Job by its id Parameters ---------- @@ -1996,8 +2016,8 @@ def history_route_delete( Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + JobsJobStatus + The request has succeeded. Examples -------- @@ -2007,35 +2027,35 @@ def history_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.history_route_delete( + client.job_route_get( id="id", ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="DELETE", + f"jobs/{jsonable_encoder(id)}", + method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_list( + def sessions_route_list( self, *, limit: CommonLimit, offset: CommonOffset, - sort_by: TasksRouteListRequestSortBy, - direction: TasksRouteListRequestDirection, + sort_by: SessionsRouteListRequestSortBy, + direction: SessionsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteListResponse: + ) -> SessionsRouteListResponse: """ - List tasks (paginated) + List sessions (paginated) Parameters ---------- @@ -2045,10 +2065,10 @@ def tasks_route_list( offset : CommonOffset Offset the items returned - sort_by : TasksRouteListRequestSortBy + sort_by : SessionsRouteListRequestSortBy Sort by a field - direction : TasksRouteListRequestDirection + direction : SessionsRouteListRequestDirection Sort direction metadata_filter : str @@ -2059,7 +2079,7 @@ def tasks_route_list( Returns ------- - TasksRouteListResponse + SessionsRouteListResponse The request has succeeded. Examples @@ -2070,7 +2090,7 @@ def tasks_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_list( + client.sessions_route_list( limit=1, offset=1, sort_by="created_at", @@ -2079,7 +2099,7 @@ def tasks_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - "tasks", + "sessions", method="GET", params={ "limit": limit, @@ -2092,44 +2112,52 @@ def tasks_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_create( + def sessions_route_create( self, *, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceCreatedResponse: """ - Create a new task + Create a new session Parameters ---------- - name : str + situation : str + A specific situation that sets the background for this session - description : str + render_templates : bool + Render system and assistant message content as jinja templates - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. + user : typing.Optional[CommonUuid] + User ID of user associated with this session - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. + users : typing.Optional[typing.Sequence[CommonUuid]] - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -2143,36 +2171,29 @@ def tasks_route_create( Examples -------- - from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_create( - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + client.sessions_route_create( + situation="situation", + render_templates=True, ) """ _response = self._client_wrapper.httpx_client.request( - "tasks", + "sessions", method="POST", json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, "metadata": metadata, }, request_options=request_options, @@ -2186,41 +2207,93 @@ def tasks_route_create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_create_or_update( + def sessions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsSession: + """ + Get a session by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsSession + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_get( + id="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_create_or_update( self, - *, id: CommonUuid, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + *, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Create or update a task + Create or update a session Parameters ---------- id : CommonUuid - name : str + situation : str + A specific situation that sets the background for this session - description : str + render_templates : bool + Render system and assistant message content as jinja templates - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. + user : typing.Optional[CommonUuid] + User ID of user associated with this session - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. + users : typing.Optional[typing.Sequence[CommonUuid]] - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -2234,38 +2307,30 @@ def tasks_route_create_or_update( Examples -------- - from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_create_or_update( + client.sessions_route_create_or_update( id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + situation="situation", + render_templates=True, ) """ _response = self._client_wrapper.httpx_client.request( - "tasks", - method="PUT", + f"sessions/{jsonable_encoder(id)}", + method="POST", json={ - "id": id, - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, "metadata": metadata, }, request_options=request_options, @@ -2279,39 +2344,36 @@ def tasks_route_create_or_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_update( + def sessions_route_update( self, id: CommonUuid, *, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing task (overwrite existing values) + Update an existing session by its id (overwrites all existing values) Parameters ---------- id : CommonUuid ID of the resource - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. + situation : str + A specific situation that sets the background for this session - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. + render_templates : bool + Render system and assistant message content as jinja templates - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -2325,35 +2387,26 @@ def tasks_route_update( Examples -------- - from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_update( + client.sessions_route_update( id="id", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + situation="situation", + render_templates=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}", + f"sessions/{jsonable_encoder(id)}", method="PUT", json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, "metadata": metadata, }, request_options=request_options, @@ -2367,11 +2420,11 @@ def tasks_route_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_delete( + def sessions_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> CommonResourceDeletedResponse: """ - Delete a task by its id + Delete a session by its id Parameters ---------- @@ -2394,12 +2447,12 @@ def tasks_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_delete( + client.sessions_route_delete( id="id", ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}", + f"sessions/{jsonable_encoder(id)}", method="DELETE", request_options=request_options, ) @@ -2411,39 +2464,36 @@ def tasks_route_delete( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_patch( + def sessions_route_patch( self, id: CommonUuid, *, - description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, - inherit_tools: typing.Optional[bool] = OMIT, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing task (merges with existing values) + Update an existing session by its id (merges with existing values) Parameters ---------- id : CommonUuid ID of the resource - description : typing.Optional[str] - - main : typing.Optional[typing.Sequence[TasksWorkflowStep]] - The entrypoint of the task. + situation : typing.Optional[str] + A specific situation that sets the background for this session - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + render_templates : typing.Optional[bool] + Render system and assistant message content as jinja templates - tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] - Tools defined specifically for this task not included in the Agent itself. + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - inherit_tools : typing.Optional[bool] - Whether to inherit tools from the parent agent or not. Defaults to true. + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -2463,19 +2513,18 @@ def tasks_route_patch( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_patch( + client.sessions_route_patch( id="id", ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}", + f"sessions/{jsonable_encoder(id)}", method="PATCH", json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, "metadata": metadata, }, request_options=request_options, @@ -2489,19 +2538,19 @@ def tasks_route_patch( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def task_executions_route_list( + def history_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: TaskExecutionsRouteListRequestSortBy, - direction: TaskExecutionsRouteListRequestDirection, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteListResponse: + ) -> HistoryRouteListResponse: """ - List executions of the given task + Get history of a Session (paginated) Parameters ---------- @@ -2514,10 +2563,10 @@ def task_executions_route_list( offset : CommonOffset Offset the items returned - sort_by : TaskExecutionsRouteListRequestSortBy + sort_by : HistoryRouteListRequestSortBy Sort by a field - direction : TaskExecutionsRouteListRequestDirection + direction : HistoryRouteListRequestDirection Sort direction metadata_filter : str @@ -2528,7 +2577,7 @@ def task_executions_route_list( Returns ------- - TaskExecutionsRouteListResponse + HistoryRouteListResponse The request has succeeded. Examples @@ -2539,7 +2588,7 @@ def task_executions_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.task_executions_route_list( + client.history_route_list( id="id", limit=1, offset=1, @@ -2549,7 +2598,7 @@ def task_executions_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", + f"sessions/{jsonable_encoder(id)}/history", method="GET", params={ "limit": limit, @@ -2562,40 +2611,30 @@ def task_executions_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def task_executions_route_create( - self, - id: CommonUuid, - *, - input: typing.Dict[str, typing.Any], - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Create an execution for the given task + Clear the history of a Session (resets the Session) Parameters ---------- id : CommonUuid - ID of parent resource - - input : typing.Dict[str, typing.Any] - The input to the execution - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -2605,54 +2644,63 @@ def task_executions_route_create( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.task_executions_route_create( + client.history_route_delete( id="id", - input={"key": "value"}, ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", - method="POST", - json={"input": input, "metadata": metadata}, + f"sessions/{jsonable_encoder(id)}/history", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def task_executions_route_resume_with_task_token( + def task_executions_route_list( self, id: CommonUuid, *, - task_token: str, - input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TaskExecutionsRouteListRequestSortBy, + direction: TaskExecutionsRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> TaskExecutionsRouteListResponse: """ - Resume an execution with a task token + List executions of the given task Parameters ---------- id : CommonUuid - ID of parent Task + ID of parent - task_token : str - A Task Token is a unique identifier for a specific Task Execution. + limit : CommonLimit + Limit the number of items returned - input : typing.Optional[typing.Dict[str, typing.Any]] - The input to resume the execution with + offset : CommonOffset + Offset the items returned + + sort_by : TaskExecutionsRouteListRequestSortBy + Sort by a field + + direction : TaskExecutionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + TaskExecutionsRouteListResponse The request has succeeded. Examples @@ -2663,67 +2711,63 @@ def task_executions_route_resume_with_task_token( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.task_executions_route_resume_with_task_token( + client.task_executions_route_list( id="id", - task_token="task_token", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( f"tasks/{jsonable_encoder(id)}/executions", - method="PUT", - json={"task_token": task_token, "input": input, "status": "running"}, + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tool_route_update( + def task_executions_route_create( self, id: CommonUuid, *, - type: ToolsToolType, - name: CommonValidPythonIdentifier, - function: typing.Optional[ToolsFunctionDef] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, + input: typing.Dict[str, typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> CommonResourceCreatedResponse: """ - Update an existing tool (overwrite existing values) + Create an execution for the given task Parameters ---------- id : CommonUuid - ID of the resource - - type : ToolsToolType - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : CommonValidPythonIdentifier - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDef] - - integration : typing.Optional[typing.Any] + ID of parent resource - system : typing.Optional[typing.Any] + input : typing.Dict[str, typing.Any] + The input to the execution - api_call : typing.Optional[typing.Any] + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- @@ -2733,52 +2777,55 @@ def tool_route_update( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tool_route_update( + client.task_executions_route_create( id="id", - type="function", - name="name", + input={"key": "value"}, ) """ _response = self._client_wrapper.httpx_client.request( - f"tools/{jsonable_encoder(id)}", - method="PUT", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, + f"tasks/{jsonable_encoder(id)}/executions", + method="POST", + json={"input": input, "metadata": metadata}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tool_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + def task_executions_route_resume_with_task_token( + self, + id: CommonUuid, + *, + task_token: str, + input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: """ - Delete an existing tool by id + Resume an execution with a task token Parameters ---------- id : CommonUuid - ID of the resource + ID of parent Task + + task_token : str + A Task Token is a unique identifier for a specific Task Execution. + + input : typing.Optional[typing.Dict[str, typing.Any]] + The input to resume the execution with request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- @@ -2788,56 +2835,46 @@ def tool_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tool_route_delete( + client.task_executions_route_resume_with_task_token( id="id", + task_token="task_token", ) """ _response = self._client_wrapper.httpx_client.request( - f"tools/{jsonable_encoder(id)}", - method="DELETE", + f"tasks/{jsonable_encoder(id)}/executions", + method="PUT", + json={"task_token": task_token, "input": input, "status": "running"}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tool_route_patch( + def task_executions_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - type: typing.Optional[ToolsToolType] = OMIT, - name: typing.Optional[CommonValidPythonIdentifier] = OMIT, - function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, + request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing tool (merges with existing values) + Update an existing Execution Parameters ---------- id : CommonUuid - ID of the resource - - type : typing.Optional[ToolsToolType] - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : typing.Optional[CommonValidPythonIdentifier] - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDefUpdate] - - integration : typing.Optional[typing.Any] + ID of parent resource - system : typing.Optional[typing.Any] + child_id : CommonUuid + ID of the resource to be updated - api_call : typing.Optional[typing.Any] + request : ExecutionsUpdateExecutionRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2849,27 +2886,25 @@ def tool_route_patch( Examples -------- + from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tool_route_patch( - id="id", + client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), ) """ _response = self._client_wrapper.httpx_client.request( - f"tools/{jsonable_encoder(id)}", - method="PATCH", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, + f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", + method="PUT", + json=request, request_options=request_options, omit=OMIT, ) @@ -3017,36 +3052,23 @@ def users_route_create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def users_route_create_or_update( - self, - *, - id: CommonUuid, - name: CommonIdentifierSafeUnicode, - about: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + def users_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersUser: """ - Create or update a user + Get a user by id Parameters ---------- id : CommonUuid - - name : CommonIdentifierSafeUnicode - Name of the user - - about : str - About the user - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + UsersUser The request has succeeded. Examples @@ -3057,44 +3079,53 @@ def users_route_create_or_update( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.users_route_create_or_update( + client.users_route_get( id="id", - name="name", - about="about", ) """ _response = self._client_wrapper.httpx_client.request( - "users", - method="PUT", - json={"id": id, "metadata": metadata, "name": name, "about": about}, + f"users/{jsonable_encoder(id)}", + method="GET", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def users_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> UsersUser: + def users_route_create_or_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: """ - Get a user by id + Create or update a user Parameters ---------- id : CommonUuid - ID of the resource + + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - UsersUser + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -3105,18 +3136,22 @@ def users_route_get( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.users_route_get( + client.users_route_create_or_update( id="id", + name="name", + about="about", ) """ _response = self._client_wrapper.httpx_client.request( f"users/{jsonable_encoder(id)}", - method="GET", + method="POST", + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -3567,8 +3602,396 @@ async def agents_route_list( Returns ------- - AgentsRouteListResponse - The request has succeeded. + AgentsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "agents", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_create( + self, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create a new Agent + + Parameters + ---------- + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "agents", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsAgent: + """ + Get an Agent by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsAgent + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_create_or_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Create or update an Agent + + Parameters + ---------- + id : CommonUuid + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_create_or_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="PUT", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete Agent by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -3583,74 +4006,63 @@ async def agents_route_list( async def main() -> None: - await client.agents_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + await client.agents_route_delete( + id="id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "agents", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, + f"agents/{jsonable_encoder(id)}", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_create( + async def agents_route_patch( self, + id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsCreateAgentRequestInstructions, - docs: typing.Sequence[typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, + model: typing.Optional[str] = OMIT, + instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, default_settings: typing.Optional[ - AgentsCreateAgentRequestDefaultSettings + AgentsPatchAgentRequestDefaultSettings ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + ) -> CommonResourceUpdatedResponse: """ - Create a new Agent + Update an existing Agent by id (merges with existing values) Parameters ---------- - name : CommonIdentifierSafeUnicode + id : CommonUuid + ID of the resource + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + name : typing.Optional[CommonIdentifierSafeUnicode] Name of the agent - about : str + about : typing.Optional[str] About the agent - model : str + model : typing.Optional[str] Model name to use (gpt-4-turbo, gemini-nano etc) - instructions : AgentsCreateAgentRequestInstructions + instructions : typing.Optional[AgentsPatchAgentRequestInstructions] Instructions for the agent - docs : typing.Sequence[typing.Any] - Documents to index for this agent. (Max: 100 items) - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] Default settings for all sessions created by this agent request_options : typing.Optional[RequestOptions] @@ -3658,8 +4070,8 @@ async def agents_route_create( Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- @@ -3674,20 +4086,16 @@ async def agents_route_create( async def main() -> None: - await client.agents_route_create( - name="name", - about="about", - model="model", - instructions="instructions", - docs=[], + await client.agents_route_patch( + id="id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "agents", - method="POST", + f"agents/{jsonable_encoder(id)}", + method="PATCH", json={ "metadata": metadata, "name": name, @@ -3695,63 +4103,58 @@ async def main() -> None: "model": model, "instructions": instructions, "default_settings": default_settings, - "docs": docs, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_create_or_update( + async def agent_docs_route_list( self, - *, id: CommonUuid, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsCreateOrUpdateAgentRequestInstructions, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsCreateOrUpdateAgentRequestDefaultSettings - ] = OMIT, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentDocsRouteListRequestSortBy, + direction: AgentDocsRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> AgentDocsRouteListResponse: """ - Create or update an Agent + List Docs owned by an Agent Parameters ---------- id : CommonUuid + ID of parent - name : CommonIdentifierSafeUnicode - Name of the agent - - about : str - About the agent + limit : CommonLimit + Limit the number of items returned - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) + offset : CommonOffset + Offset the items returned - instructions : AgentsCreateOrUpdateAgentRequestInstructions - Instructions for the agent + sort_by : AgentDocsRouteListRequestSortBy + Sort by a field - metadata : typing.Optional[typing.Dict[str, typing.Any]] + direction : AgentDocsRouteListRequestDirection + Sort direction - default_settings : typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + AgentDocsRouteListResponse The request has succeeded. Examples @@ -3767,63 +4170,88 @@ async def agents_route_create_or_update( async def main() -> None: - await client.agents_route_create_or_update( + await client.agent_docs_route_list( id="id", - name="name", - about="about", - model="model", - instructions="instructions", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "agents", - method="PUT", - json={ - "id": id, - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, + f"agents/{jsonable_encoder(id)}/docs", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> AgentsAgent: + async def agents_docs_search_route_search( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsDocsSearchRouteSearchRequestSortBy, + direction: AgentsDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: DocsDocSearchRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentsDocsSearchRouteSearchResponse: """ - Get an Agent by id + Search Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of the resource + ID of the parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : AgentsDocsSearchRouteSearchRequestSortBy + Sort by a field + + direction : AgentsDocsSearchRouteSearchRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + body : DocsDocSearchRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsAgent + AgentsDocsSearchRouteSearchResponse The request has succeeded. Examples -------- import asyncio + from julep import DocsDocSearchRequest_Vector from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -3833,71 +4261,88 @@ async def agents_route_get( async def main() -> None: - await client.agents_route_get( - id="id", + await client.agents_docs_search_route_search( + id="string", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="string", + body=DocsDocSearchRequest_Vector( + text="string", + vector=[1.1], + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="GET", + f"agents/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_update( + async def tasks_route_list( self, id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsUpdateAgentRequestInstructions, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsUpdateAgentRequestDefaultSettings - ] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> TasksRouteListResponse: """ - Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + List tasks (paginated) Parameters ---------- id : CommonUuid - ID of the resource - - name : CommonIdentifierSafeUnicode - Name of the agent - - about : str - About the agent + ID of parent - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) + limit : CommonLimit + Limit the number of items returned - instructions : AgentsUpdateAgentRequestInstructions - Instructions for the agent + offset : CommonOffset + Offset the items returned - metadata : typing.Optional[typing.Dict[str, typing.Any]] + sort_by : TasksRouteListRequestSortBy + Sort by a field - default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + direction : TasksRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + TasksRouteListResponse The request has succeeded. Examples @@ -3913,62 +4358,90 @@ async def agents_route_update( async def main() -> None: - await client.agents_route_update( + await client.tasks_route_list( id="id", - name="name", - about="about", - model="model", - instructions="instructions", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="PUT", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, + f"agents/{jsonable_encoder(id)}/tasks", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + async def tasks_route_create( + self, + id: CommonUuid, + *, + name: str, + description: str, + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: """ - Delete Agent by id + Create a new task Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + name : str + + description : str + + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. + + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- import asyncio + from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -3978,64 +4451,85 @@ async def agents_route_delete( async def main() -> None: - await client.agents_route_delete( + await client.tasks_route_create( id="id", + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="DELETE", + f"agents/{jsonable_encoder(id)}/tasks", + method="POST", + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_route_patch( + async def tasks_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, + description: str, + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, - about: typing.Optional[str] = OMIT, - model: typing.Optional[str] = OMIT, - instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, - default_settings: typing.Optional[ - AgentsPatchAgentRequestDefaultSettings - ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing Agent by id (merges with existing values) + Update an existing task (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource - metadata : typing.Optional[typing.Dict[str, typing.Any]] + child_id : CommonUuid + ID of the resource to be updated - name : typing.Optional[CommonIdentifierSafeUnicode] - Name of the agent + description : str - about : typing.Optional[str] - About the agent + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. - model : typing.Optional[str] - Model name to use (gpt-4-turbo, gemini-nano etc) + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. - instructions : typing.Optional[AgentsPatchAgentRequestInstructions] - Instructions for the agent + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4049,6 +4543,7 @@ async def agents_route_patch( -------- import asyncio + from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -4058,23 +4553,33 @@ async def agents_route_patch( async def main() -> None: - await client.agents_route_patch( + await client.tasks_route_update( id="id", + child_id="child_id", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="PATCH", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PUT", json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, }, request_options=request_options, omit=OMIT, @@ -4087,47 +4592,31 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agent_docs_route_list( + async def tasks_route_delete( self, id: CommonUuid, + child_id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentDocsRouteListRequestSortBy, - direction: AgentDocsRouteListRequestDirection, - metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentDocsRouteListResponse: + ) -> CommonResourceDeletedResponse: """ - List Docs owned by an Agent + Delete a task by its id Parameters ---------- id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentDocsRouteListRequestSortBy - Sort by a field - - direction : AgentDocsRouteListRequestDirection - Sort direction + ID of parent resource - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + child_id : CommonUuid + ID of the resource to be deleted request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentDocsRouteListResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -4142,88 +4631,79 @@ async def agent_docs_route_list( async def main() -> None: - await client.agent_docs_route_list( + await client.tasks_route_delete( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + child_id="child_id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/docs", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_docs_search_route_search( + async def tasks_route_patch( self, id: CommonUuid, + child_id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsDocsSearchRouteSearchRequestSortBy, - direction: AgentsDocsSearchRouteSearchRequestDirection, - metadata_filter: str, - body: DocsDocSearchRequest, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsDocsSearchRouteSearchResponse: + ) -> CommonResourceUpdatedResponse: """ - Search Docs owned by an Agent + Update an existing task (merges with existing values) Parameters ---------- id : CommonUuid - ID of the parent + ID of parent resource + + child_id : CommonUuid + ID of the resource to be patched - limit : CommonLimit - Limit the number of items returned + description : typing.Optional[str] - offset : CommonOffset - Offset the items returned + main : typing.Optional[typing.Sequence[TasksWorkflowStep]] + The entrypoint of the task. - sort_by : AgentsDocsSearchRouteSearchRequestSortBy - Sort by a field + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - direction : AgentsDocsSearchRouteSearchRequestDirection - Sort direction + tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] + Tools defined specifically for this task not included in the Agent itself. - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. - body : DocsDocSearchRequest + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsDocsSearchRouteSearchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples -------- import asyncio - from julep import DocsDocSearchRequest_Vector from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -4233,43 +4713,31 @@ async def agents_docs_search_route_search( async def main() -> None: - await client.agents_docs_search_route_search( - id="string", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="string", - body=DocsDocSearchRequest_Vector( - text="string", - vector=[1.1], - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), + await client.tasks_route_patch( + id="id", + child_id="child_id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/search", - method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, }, - json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -4370,7 +4838,6 @@ async def agent_tools_route_create( about: str, model: str, instructions: AgentsCreateAgentRequestInstructions, - docs: typing.Sequence[typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, default_settings: typing.Optional[ AgentsCreateAgentRequestDefaultSettings @@ -4397,9 +4864,6 @@ async def agent_tools_route_create( instructions : AgentsCreateAgentRequestInstructions Instructions for the agent - docs : typing.Sequence[typing.Any] - Documents to index for this agent. (Max: 100 items) - metadata : typing.Optional[typing.Dict[str, typing.Any]] default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] @@ -4432,7 +4896,6 @@ async def main() -> None: about="about", model="model", instructions="instructions", - docs=[], ) @@ -4448,7 +4911,6 @@ async def main() -> None: "model": model, "instructions": instructions, "default_settings": default_settings, - "docs": docs, }, request_options=request_options, omit=OMIT, @@ -4461,186 +4923,50 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def individual_docs_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> DocsDoc: - """ - Get Doc by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DocsDoc - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.individual_docs_route_get( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def individual_docs_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete an existing Doc by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.individual_docs_route_delete( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def embed_route_embed( + async def agent_tools_route_update( self, + id: CommonUuid, + child_id: CommonUuid, *, - body: DocsEmbedQueryRequest, + type: ToolsToolType, + name: CommonValidPythonIdentifier, + function: typing.Optional[ToolsFunctionDef] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> DocsEmbedQueryResponse: + ) -> CommonResourceUpdatedResponse: """ - Embed a query for search + Update an existing tool (overwrite existing values) Parameters ---------- - body : DocsEmbedQueryRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DocsEmbedQueryResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep import DocsEmbedQueryRequest - from julep.client import AsyncJulepApi + id : CommonUuid + ID of parent resource - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) + child_id : CommonUuid + ID of the resource to be updated + type : ToolsToolType + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - async def main() -> None: - await client.embed_route_embed( - body=DocsEmbedQueryRequest( - text="text", - ), - ) + name : CommonValidPythonIdentifier + Name of the tool (must be unique for this agent and a valid python identifier string ) + function : typing.Optional[ToolsFunctionDef] - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "embed", - method="POST", - json={"body": body}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) + integration : typing.Optional[typing.Any] - async def executions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ExecutionsExecution: - """ - Get an Execution by id + system : typing.Optional[typing.Any] - Parameters - ---------- - id : CommonUuid - ID of the resource + api_call : typing.Optional[typing.Any] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ExecutionsExecution + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -4656,56 +4982,68 @@ async def executions_route_get( async def main() -> None: - await client.executions_route_get( + await client.agent_tools_route_update( id="id", + child_id="child_id", + type="function", + name="name", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="GET", + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="PUT", + json={ + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def executions_route_update( + async def agent_tools_route_delete( self, id: CommonUuid, + child_id: CommonUuid, *, - request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> CommonResourceDeletedResponse: """ - Update an existing Execution + Delete an existing tool by id Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource - request : ExecutionsUpdateExecutionRequest + child_id : CommonUuid + ID of the resource to be deleted request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- import asyncio - from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -4715,71 +5053,71 @@ async def executions_route_update( async def main() -> None: - await client.executions_route_update( - id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), + await client.agent_tools_route_delete( + id="id", + child_id="child_id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="PUT", - json=request, + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def execution_transitions_route_list( + async def agent_tools_route_patch( self, id: CommonUuid, + child_id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: ExecutionTransitionsRouteListRequestSortBy, - direction: ExecutionTransitionsRouteListRequestDirection, - metadata_filter: str, + type: typing.Optional[ToolsToolType] = OMIT, + name: typing.Optional[CommonValidPythonIdentifier] = OMIT, + function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionTransitionsRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - List the Transitions of an Execution by id + Update an existing tool (merges with existing values) Parameters ---------- id : CommonUuid - ID of parent + ID of parent resource - limit : CommonLimit - Limit the number of items returned + child_id : CommonUuid + ID of the resource to be patched - offset : CommonOffset - Offset the items returned + type : typing.Optional[ToolsToolType] + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - sort_by : ExecutionTransitionsRouteListRequestSortBy - Sort by a field + name : typing.Optional[CommonValidPythonIdentifier] + Name of the tool (must be unique for this agent and a valid python identifier string ) - direction : ExecutionTransitionsRouteListRequestDirection - Sort direction + function : typing.Optional[ToolsFunctionDefUpdate] - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + integration : typing.Optional[typing.Any] + + system : typing.Optional[typing.Any] + + api_call : typing.Optional[typing.Any] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ExecutionTransitionsRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -4795,61 +5133,91 @@ async def execution_transitions_route_list( async def main() -> None: - await client.execution_transitions_route_list( + await client.agent_tools_route_patch( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + child_id="child_id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}/transitions", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def job_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> JobsJobStatus: + async def tasks_create_or_update_route_create_or_update( + self, + parent_id: CommonUuid, + id: CommonUuid, + *, + name: str, + description: str, + main: typing.Sequence[TasksWorkflowStep], + tools: typing.Sequence[ToolsCreateToolRequest], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: """ - Get the status of an existing Job by its id + Create or update a task Parameters ---------- + parent_id : CommonUuid + ID of parent resource + id : CommonUuid - ID of the resource + + name : str + + description : str + + main : typing.Sequence[TasksWorkflowStep] + The entrypoint of the task. + + tools : typing.Sequence[ToolsCreateToolRequest] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - JobsJobStatus + CommonResourceUpdatedResponse The request has succeeded. Examples -------- import asyncio + from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -4859,62 +5227,64 @@ async def job_route_get( async def main() -> None: - await client.job_route_get( + await client.tasks_create_or_update_route_create_or_update( + parent_id="parent_id", id="id", + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"jobs/{jsonable_encoder(id)}", - method="GET", + f"agents/{jsonable_encoder(parent_id)}/tasks/{jsonable_encoder(id)}", + method="POST", + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_list( - self, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: SessionsRouteListRequestSortBy, - direction: SessionsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteListResponse: + async def individual_docs_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> DocsDoc: """ - List sessions (paginated) + Get Doc by id Parameters ---------- - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : SessionsRouteListRequestSortBy - Sort by a field - - direction : SessionsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + id : CommonUuid + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsRouteListResponse + DocsDoc The request has succeeded. Examples @@ -4930,87 +5300,44 @@ async def sessions_route_list( async def main() -> None: - await client.sessions_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + await client.individual_docs_route_get( + id="id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "sessions", + f"docs/{jsonable_encoder(id)}", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def sessions_route_create( - self, - *, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create a new session - - Parameters - ---------- - situation : str - A specific situation that sets the background for this session - - render_templates : bool - Render system and assistant message content as jinja templates - - user : typing.Optional[CommonUuid] - User ID of user associated with this session - - users : typing.Optional[typing.Sequence[CommonUuid]] - - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session - - agents : typing.Optional[typing.Sequence[CommonUuid]] - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + async def individual_docs_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete an existing Doc by id - metadata : typing.Optional[typing.Dict[str, typing.Any]] + Parameters + ---------- + id : CommonUuid + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -5025,97 +5352,52 @@ async def sessions_route_create( async def main() -> None: - await client.sessions_route_create( - situation="situation", - render_templates=True, + await client.individual_docs_route_delete( + id="id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "sessions", - method="POST", - json={ - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, + f"docs/{jsonable_encoder(id)}", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_create_or_update( + async def embed_route_embed( self, *, - id: CommonUuid, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + body: DocsEmbedQueryRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> DocsEmbedQueryResponse: """ - Create or update a session + Embed a query for search Parameters ---------- - id : CommonUuid - - situation : str - A specific situation that sets the background for this session - - render_templates : bool - Render system and assistant message content as jinja templates - - user : typing.Optional[CommonUuid] - User ID of user associated with this session - - users : typing.Optional[typing.Sequence[CommonUuid]] - - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session - - agents : typing.Optional[typing.Sequence[CommonUuid]] - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + body : DocsEmbedQueryRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + DocsEmbedQueryResponse The request has succeeded. Examples -------- import asyncio + from julep import DocsEmbedQueryRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -5125,46 +5407,35 @@ async def sessions_route_create_or_update( async def main() -> None: - await client.sessions_route_create_or_update( - id="id", - situation="situation", - render_templates=True, + await client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "sessions", - method="PUT", - json={ - "id": id, - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, + "embed", + method="POST", + json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_get( + async def executions_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsSession: + ) -> ExecutionsExecution: """ - Get a session by id + Get an Execution by id Parameters ---------- @@ -5176,7 +5447,7 @@ async def sessions_route_get( Returns ------- - SessionsSession + ExecutionsExecution The request has succeeded. Examples @@ -5192,65 +5463,66 @@ async def sessions_route_get( async def main() -> None: - await client.sessions_route_get( - id="string", + await client.executions_route_get( + id="id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", + f"executions/{jsonable_encoder(id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_update( + async def execution_transitions_route_list( self, id: CommonUuid, *, - situation: str, - render_templates: bool, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> ExecutionTransitionsRouteListResponse: """ - Update an existing session by its id (overwrites all existing values) + List the Transitions of an Execution by id Parameters ---------- id : CommonUuid - ID of the resource + ID of parent - situation : str - A specific situation that sets the background for this session + limit : CommonLimit + Limit the number of items returned - render_templates : bool - Render system and assistant message content as jinja templates + offset : CommonOffset + Offset the items returned - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + sort_by : ExecutionTransitionsRouteListRequestSortBy + Sort by a field - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + direction : ExecutionTransitionsRouteListRequestDirection + Sort direction - metadata : typing.Optional[typing.Dict[str, typing.Any]] + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + ExecutionTransitionsRouteListResponse The request has succeeded. Examples @@ -5266,41 +5538,43 @@ async def sessions_route_update( async def main() -> None: - await client.sessions_route_update( + await client.execution_transitions_route_list( id="id", - situation="situation", - render_templates=True, + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PUT", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, + f"executions/{jsonable_encoder(id)}/transitions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_delete( + async def job_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + ) -> JobsJobStatus: """ - Delete a session by its id + Get the status of an existing Job by its id Parameters ---------- @@ -5312,8 +5586,8 @@ async def sessions_route_delete( Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + JobsJobStatus + The request has succeeded. Examples -------- @@ -5328,7 +5602,7 @@ async def sessions_route_delete( async def main() -> None: - await client.sessions_route_delete( + await client.job_route_get( id="id", ) @@ -5336,57 +5610,54 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="DELETE", + f"jobs/{jsonable_encoder(id)}", + method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_patch( + async def sessions_route_list( self, - id: CommonUuid, *, - situation: typing.Optional[str] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: SessionsRouteListRequestSortBy, + direction: SessionsRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> SessionsRouteListResponse: """ - Update an existing session by its id (merges with existing values) + List sessions (paginated) Parameters ---------- - id : CommonUuid - ID of the resource - - situation : typing.Optional[str] - A specific situation that sets the background for this session + limit : CommonLimit + Limit the number of items returned - render_templates : typing.Optional[bool] - Render system and assistant message content as jinja templates + offset : CommonOffset + Offset the items returned - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + sort_by : SessionsRouteListRequestSortBy + Sort by a field - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + direction : SessionsRouteListRequestDirection + Sort direction - metadata : typing.Optional[typing.Dict[str, typing.Any]] + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + SessionsRouteListResponse The request has succeeded. Examples @@ -5402,75 +5673,87 @@ async def sessions_route_patch( async def main() -> None: - await client.sessions_route_patch( - id="id", + await client.sessions_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PATCH", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, + "sessions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_list( + async def sessions_route_create( self, - id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + ) -> CommonResourceCreatedResponse: """ - Get history of a Session (paginated) + Create a new session Parameters ---------- - id : CommonUuid - ID of parent + situation : str + A specific situation that sets the background for this session - limit : CommonLimit - Limit the number of items returned + render_templates : bool + Render system and assistant message content as jinja templates - offset : CommonOffset - Offset the items returned + user : typing.Optional[CommonUuid] + User ID of user associated with this session - sort_by : HistoryRouteListRequestSortBy - Sort by a field + users : typing.Optional[typing.Sequence[CommonUuid]] - direction : HistoryRouteListRequestDirection - Sort direction + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteListResponse - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- @@ -5485,43 +5768,44 @@ async def history_route_list( async def main() -> None: - await client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + await client.sessions_route_create( + situation="situation", + render_templates=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + "sessions", + method="POST", + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_delete( + async def sessions_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + ) -> SessionsSession: """ - Clear the history of a Session (resets the Session) + Get a session by id Parameters ---------- @@ -5533,8 +5817,8 @@ async def history_route_delete( Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + SessionsSession + The request has succeeded. Examples -------- @@ -5549,62 +5833,78 @@ async def history_route_delete( async def main() -> None: - await client.history_route_delete( - id="id", + await client.sessions_route_get( + id="string", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="DELETE", + f"sessions/{jsonable_encoder(id)}", + method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_list( + async def sessions_route_create_or_update( self, + id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: TasksRouteListRequestSortBy, - direction: TasksRouteListRequestDirection, - metadata_filter: str, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - List tasks (paginated) + Create or update a session Parameters ---------- - limit : CommonLimit - Limit the number of items returned + id : CommonUuid - offset : CommonOffset - Offset the items returned + situation : str + A specific situation that sets the background for this session - sort_by : TasksRouteListRequestSortBy - Sort by a field + render_templates : bool + Render system and assistant message content as jinja templates - direction : TasksRouteListRequestDirection - Sort direction + user : typing.Optional[CommonUuid] + User ID of user associated with this session - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + users : typing.Optional[typing.Sequence[CommonUuid]] + + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session + + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -5620,69 +5920,70 @@ async def tasks_route_list( async def main() -> None: - await client.tasks_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + await client.sessions_route_create_or_update( + id="id", + situation="situation", + render_templates=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "tasks", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"sessions/{jsonable_encoder(id)}", + method="POST", + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_create( + async def sessions_route_update( self, + id: CommonUuid, *, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + ) -> CommonResourceUpdatedResponse: """ - Create a new task + Update an existing session by its id (overwrites all existing values) Parameters ---------- - name : str - - description : str + id : CommonUuid + ID of the resource - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. + situation : str + A specific situation that sets the background for this session - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. + render_templates : bool + Render system and assistant message content as jinja templates - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -5691,14 +5992,13 @@ async def tasks_route_create( Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- import asyncio - from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -5708,32 +6008,23 @@ async def tasks_route_create( async def main() -> None: - await client.tasks_route_create( - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + await client.sessions_route_update( + id="id", + situation="situation", + render_templates=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "tasks", - method="POST", + f"sessions/{jsonable_encoder(id)}", + method="PUT", json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, "metadata": metadata, }, request_options=request_options, @@ -5741,63 +6032,35 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_create_or_update( - self, - *, - id: CommonUuid, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + async def sessions_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Create or update a task + Delete a session by its id Parameters ---------- id : CommonUuid - - name : str - - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. - - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- import asyncio - from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -5807,80 +6070,56 @@ async def tasks_route_create_or_update( async def main() -> None: - await client.tasks_route_create_or_update( + await client.sessions_route_delete( id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "tasks", - method="PUT", - json={ - "id": id, - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, + f"sessions/{jsonable_encoder(id)}", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_update( + async def sessions_route_patch( self, id: CommonUuid, *, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing task (overwrite existing values) + Update an existing session by its id (merges with existing values) Parameters ---------- id : CommonUuid ID of the resource - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. + situation : typing.Optional[str] + A specific situation that sets the background for this session - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. + render_templates : typing.Optional[bool] + Render system and assistant message content as jinja templates - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -5896,7 +6135,6 @@ async def tasks_route_update( -------- import asyncio - from julep import ToolsCreateToolRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -5906,31 +6144,21 @@ async def tasks_route_update( async def main() -> None: - await client.tasks_route_update( + await client.sessions_route_patch( id="id", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}", - method="PUT", + f"sessions/{jsonable_encoder(id)}", + method="PATCH", json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, "metadata": metadata, }, request_options=request_options, @@ -5944,24 +6172,47 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + async def history_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> HistoryRouteListResponse: """ - Delete a task by its id + Get history of a Session (paginated) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : HistoryRouteListRequestSortBy + Sort by a field + + direction : HistoryRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + HistoryRouteListResponse + The request has succeeded. Examples -------- @@ -5976,69 +6227,56 @@ async def tasks_route_delete( async def main() -> None: - await client.tasks_route_delete( + await client.history_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}", - method="DELETE", + f"sessions/{jsonable_encoder(id)}/history", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_patch( - self, - id: CommonUuid, - *, - description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, - inherit_tools: typing.Optional[bool] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + async def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Update an existing task (merges with existing values) + Clear the history of a Session (resets the Session) Parameters ---------- id : CommonUuid ID of the resource - description : typing.Optional[str] - - main : typing.Optional[typing.Sequence[TasksWorkflowStep]] - The entrypoint of the task. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : typing.Optional[bool] - Whether to inherit tools from the parent agent or not. Defaults to true. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -6053,7 +6291,7 @@ async def tasks_route_patch( async def main() -> None: - await client.tasks_route_patch( + await client.history_route_delete( id="id", ) @@ -6061,22 +6299,13 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}", - method="PATCH", - json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, + f"sessions/{jsonable_encoder(id)}/history", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6300,39 +6529,26 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tool_route_update( + async def task_executions_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - type: ToolsToolType, - name: CommonValidPythonIdentifier, - function: typing.Optional[ToolsFunctionDef] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, + request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing tool (overwrite existing values) + Update an existing Execution Parameters ---------- id : CommonUuid - ID of the resource - - type : ToolsToolType - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : CommonValidPythonIdentifier - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDef] - - integration : typing.Optional[typing.Any] + ID of parent resource - system : typing.Optional[typing.Any] + child_id : CommonUuid + ID of the resource to be updated - api_call : typing.Optional[typing.Any] + request : ExecutionsUpdateExecutionRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -6346,6 +6562,7 @@ async def tool_route_update( -------- import asyncio + from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -6355,162 +6572,21 @@ async def tool_route_update( async def main() -> None: - await client.tool_route_update( - id="id", - type="function", - name="name", + await client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tools/{jsonable_encoder(id)}", + f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", method="PUT", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tool_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete an existing tool by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tool_route_delete( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"tools/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tool_route_patch( - self, - id: CommonUuid, - *, - type: typing.Optional[ToolsToolType] = OMIT, - name: typing.Optional[CommonValidPythonIdentifier] = OMIT, - function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing tool (merges with existing values) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - type : typing.Optional[ToolsToolType] - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : typing.Optional[CommonValidPythonIdentifier] - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDefUpdate] - - integration : typing.Optional[typing.Any] - - system : typing.Optional[typing.Any] - - api_call : typing.Optional[typing.Any] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tool_route_patch( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"tools/{jsonable_encoder(id)}", - method="PATCH", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, + json=request, request_options=request_options, omit=OMIT, ) @@ -6674,36 +6750,23 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_create_or_update( - self, - *, - id: CommonUuid, - name: CommonIdentifierSafeUnicode, - about: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + async def users_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersUser: """ - Create or update a user + Get a user by id Parameters ---------- id : CommonUuid - - name : CommonIdentifierSafeUnicode - Name of the user - - about : str - About the user - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + UsersUser The request has succeeded. Examples @@ -6719,47 +6782,56 @@ async def users_route_create_or_update( async def main() -> None: - await client.users_route_create_or_update( + await client.users_route_get( id="id", - name="name", - about="about", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "users", - method="PUT", - json={"id": id, "metadata": metadata, "name": name, "about": about}, + f"users/{jsonable_encoder(id)}", + method="GET", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> UsersUser: + async def users_route_create_or_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: """ - Get a user by id + Create or update a user Parameters ---------- id : CommonUuid - ID of the resource + + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - UsersUser + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6775,8 +6847,10 @@ async def users_route_get( async def main() -> None: - await client.users_route_get( + await client.users_route_create_or_update( id="id", + name="name", + about="about", ) @@ -6784,12 +6858,14 @@ async def main() -> None: """ _response = await self._client_wrapper.httpx_client.request( f"users/{jsonable_encoder(id)}", - method="GET", + method="POST", + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index d1f75f921..48675d71d 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -144,7 +144,6 @@ client.agents_route_create( about="about", model="model", instructions="instructions", - docs=[], ) ``` @@ -193,14 +192,6 @@ client.agents_route_create(
-**docs:** `typing.Sequence[typing.Any]` — Documents to index for this agent. (Max: 100 items) - -
-
- -
-
- **metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -229,7 +220,7 @@ client.agents_route_create(
-
client.agents_route_create_or_update(...) +
client.agents_route_get(...)
@@ -241,7 +232,7 @@ client.agents_route_create(
-Create or update an Agent +Get an Agent by id
@@ -262,12 +253,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_create_or_update( +client.agents_route_get( id="id", - name="name", - about="about", - model="model", - instructions="instructions", ) ``` @@ -284,7 +271,7 @@ client.agents_route_create_or_update(
-**id:** `CommonUuid` +**id:** `CommonUuid` — ID of the resource
@@ -292,118 +279,122 @@ client.agents_route_create_or_update(
-**name:** `CommonIdentifierSafeUnicode` — Name of the agent +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**about:** `str` — About the agent -
+
+
client.agents_route_create_or_update(...)
-**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) - -
-
+#### 📝 Description
-**instructions:** `AgentsCreateOrUpdateAgentRequestInstructions` — Instructions for the agent - -
-
-
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - +Create or update an Agent +
+
+#### 🔌 Usage +
-**default_settings:** `typing.Optional[AgentsCreateOrUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent - -
-
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_route_create_or_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", +) + +```
+#### ⚙️ Parameters - - -
- -
client.agents_route_get(...)
-#### 📝 Description -
+**id:** `CommonUuid` + +
+
+
-Get an Agent by id -
-
+**name:** `CommonIdentifierSafeUnicode` — Name of the agent +
-#### 🔌 Usage -
+**about:** `str` — About the agent + +
+
+
-```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.agents_route_get( - id="id", -) - -``` +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) +
+ +
+
+ +**instructions:** `AgentsUpdateAgentRequestInstructions` — Instructions for the agent +
-#### ⚙️ Parameters -
+**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+
-**id:** `CommonUuid` — ID of the resource +**default_settings:** `typing.Optional[AgentsUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent
@@ -985,7 +976,7 @@ client.agents_docs_search_route_search(
-
client.agent_tools_route_list(...) +
client.tasks_route_list(...)
@@ -997,7 +988,7 @@ client.agents_docs_search_route_search(
-List tools of the given agent +List tasks (paginated)
@@ -1018,7 +1009,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agent_tools_route_list( +client.tasks_route_list( id="id", limit=1, offset=1, @@ -1065,7 +1056,7 @@ client.agent_tools_route_list(
-**sort_by:** `AgentToolsRouteListRequestSortBy` — Sort by a field +**sort_by:** `TasksRouteListRequestSortBy` — Sort by a field
@@ -1073,7 +1064,7 @@ client.agent_tools_route_list(
-**direction:** `AgentToolsRouteListRequestDirection` — Sort direction +**direction:** `TasksRouteListRequestDirection` — Sort direction
@@ -1101,7 +1092,7 @@ client.agent_tools_route_list(
-
client.agent_tools_route_create(...) +
client.tasks_route_create(...)
@@ -1113,7 +1104,7 @@ client.agent_tools_route_list(
-Create a new tool for this agent +Create a new task
@@ -1128,19 +1119,25 @@ Create a new tool for this agent
```python +from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agent_tools_route_create( +client.tasks_route_create( id="id", name="name", - about="about", - model="model", - instructions="instructions", - docs=[], + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) ``` @@ -1165,7 +1162,7 @@ client.agent_tools_route_create(
-**name:** `CommonIdentifierSafeUnicode` — Name of the agent +**name:** `str`
@@ -1173,7 +1170,7 @@ client.agent_tools_route_create(
-**about:** `str` — About the agent +**description:** `str`
@@ -1181,7 +1178,7 @@ client.agent_tools_route_create(
-**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) +**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task.
@@ -1189,7 +1186,7 @@ client.agent_tools_route_create(
-**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent +**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself.
@@ -1197,7 +1194,7 @@ client.agent_tools_route_create(
-**docs:** `typing.Sequence[typing.Any]` — Documents to index for this agent. (Max: 100 items) +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true.
@@ -1205,7 +1202,7 @@ client.agent_tools_route_create(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid.
@@ -1213,7 +1210,7 @@ client.agent_tools_route_create(
-**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -1233,7 +1230,7 @@ client.agent_tools_route_create(
-
client.individual_docs_route_get(...) +
client.tasks_route_update(...)
@@ -1245,7 +1242,7 @@ client.agent_tools_route_create(
-Get Doc by id +Update an existing task (overwrite existing values)
@@ -1260,14 +1257,25 @@ Get Doc by id
```python +from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.individual_docs_route_get( +client.tasks_route_update( id="id", + child_id="child_id", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) ``` @@ -1284,7 +1292,7 @@ client.individual_docs_route_get(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent resource
@@ -1292,70 +1300,55 @@ client.individual_docs_route_get(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**child_id:** `CommonUuid` — ID of the resource to be updated
-
-
+
+
+**description:** `str` +
-
-
client.individual_docs_route_delete(...)
-#### 📝 Description - -
-
+**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. + +
+
-Delete an existing Doc by id -
-
+**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. +
-#### 🔌 Usage - -
-
-
-```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.individual_docs_route_delete( - id="id", -) - -``` -
-
+**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. +
-#### ⚙️ Parameters -
+**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+
-**id:** `CommonUuid` — ID of the resource +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -1375,7 +1368,7 @@ client.individual_docs_route_delete(
-
client.embed_route_embed(...) +
client.tasks_route_delete(...)
@@ -1387,7 +1380,7 @@ client.individual_docs_route_delete(
-Embed a query for search +Delete a task by its id
@@ -1402,17 +1395,15 @@ Embed a query for search
```python -from julep import DocsEmbedQueryRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.embed_route_embed( - body=DocsEmbedQueryRequest( - text="text", - ), +client.tasks_route_delete( + id="id", + child_id="child_id", ) ``` @@ -1429,7 +1420,15 @@ client.embed_route_embed(
-**body:** `DocsEmbedQueryRequest` +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be deleted
@@ -1449,7 +1448,7 @@ client.embed_route_embed(
-
client.executions_route_get(...) +
client.tasks_route_patch(...)
@@ -1461,7 +1460,7 @@ client.embed_route_embed(
-Get an Execution by id +Update an existing task (merges with existing values)
@@ -1482,8 +1481,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.executions_route_get( +client.tasks_route_patch( id="id", + child_id="child_id", ) ``` @@ -1500,7 +1500,7 @@ client.executions_route_get(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent resource
@@ -1508,74 +1508,47 @@ client.executions_route_get(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**child_id:** `CommonUuid` — ID of the resource to be patched
- -
+
+
+**description:** `typing.Optional[str]` +
-
-
client.executions_route_update(...)
-#### 📝 Description - -
-
+**main:** `typing.Optional[typing.Sequence[TasksWorkflowStep]]` — The entrypoint of the task. + +
+
-Update an existing Execution -
-
+**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +
-#### 🔌 Usage -
-
-
- -```python -from julep import ExecutionsUpdateExecutionRequest_Cancelled -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.executions_route_update( - id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), -) - -``` -
-
+**tools:** `typing.Optional[typing.Sequence[ToolsCreateToolRequest]]` — Tools defined specifically for this task not included in the Agent itself. +
-#### ⚙️ Parameters - -
-
-
-**id:** `CommonUuid` — ID of the resource +**inherit_tools:** `typing.Optional[bool]` — Whether to inherit tools from the parent agent or not. Defaults to true.
@@ -1583,7 +1556,7 @@ client.executions_route_update(
-**request:** `ExecutionsUpdateExecutionRequest` +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -1603,7 +1576,7 @@ client.executions_route_update(
-
client.execution_transitions_route_list(...) +
client.agent_tools_route_list(...)
@@ -1615,7 +1588,7 @@ client.executions_route_update(
-List the Transitions of an Execution by id +List tools of the given agent
@@ -1636,7 +1609,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.execution_transitions_route_list( +client.agent_tools_route_list( id="id", limit=1, offset=1, @@ -1683,7 +1656,7 @@ client.execution_transitions_route_list(
-**sort_by:** `ExecutionTransitionsRouteListRequestSortBy` — Sort by a field +**sort_by:** `AgentToolsRouteListRequestSortBy` — Sort by a field
@@ -1691,7 +1664,7 @@ client.execution_transitions_route_list(
-**direction:** `ExecutionTransitionsRouteListRequestDirection` — Sort direction +**direction:** `AgentToolsRouteListRequestDirection` — Sort direction
@@ -1719,7 +1692,7 @@ client.execution_transitions_route_list(
-
client.job_route_get(...) +
client.agent_tools_route_create(...)
@@ -1731,7 +1704,7 @@ client.execution_transitions_route_list(
-Get the status of an existing Job by its id +Create a new tool for this agent
@@ -1752,8 +1725,12 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.job_route_get( +client.agent_tools_route_create( id="id", + name="name", + about="about", + model="model", + instructions="instructions", ) ``` @@ -1770,7 +1747,55 @@ client.job_route_get(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the agent + +
+
+ +
+
+ +**about:** `str` — About the agent + +
+
+ +
+
+ +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) + +
+
+ +
+
+ +**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent
@@ -1790,7 +1815,7 @@ client.job_route_get(
-
client.sessions_route_list(...) +
client.agent_tools_route_update(...)
@@ -1802,7 +1827,7 @@ client.job_route_get(
-List sessions (paginated) +Update an existing tool (overwrite existing values)
@@ -1823,12 +1848,11 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", +client.agent_tools_route_update( + id="id", + child_id="child_id", + type="function", + name="name", ) ``` @@ -1845,7 +1869,7 @@ client.sessions_route_list(
-**limit:** `CommonLimit` — Limit the number of items returned +**id:** `CommonUuid` — ID of parent resource
@@ -1853,7 +1877,7 @@ client.sessions_route_list(
-**offset:** `CommonOffset` — Offset the items returned +**child_id:** `CommonUuid` — ID of the resource to be updated
@@ -1861,7 +1885,7 @@ client.sessions_route_list(
-**sort_by:** `SessionsRouteListRequestSortBy` — Sort by a field +**type:** `ToolsToolType` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)
@@ -1869,7 +1893,7 @@ client.sessions_route_list(
-**direction:** `SessionsRouteListRequestDirection` — Sort direction +**name:** `CommonValidPythonIdentifier` — Name of the tool (must be unique for this agent and a valid python identifier string )
@@ -1877,7 +1901,31 @@ client.sessions_route_list(
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**function:** `typing.Optional[ToolsFunctionDef]` + +
+
+ +
+
+ +**integration:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**system:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**api_call:** `typing.Optional[typing.Any]`
@@ -1897,7 +1945,7 @@ client.sessions_route_list(
-
client.sessions_route_create(...) +
client.agent_tools_route_delete(...)
@@ -1909,7 +1957,7 @@ client.sessions_route_list(
-Create a new session +Delete an existing tool by id
@@ -1930,9 +1978,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_create( - situation="situation", - render_templates=True, +client.agent_tools_route_delete( + id="id", + child_id="child_id", ) ``` @@ -1949,7 +1997,7 @@ client.sessions_route_create(
-**situation:** `str` — A specific situation that sets the background for this session +**id:** `CommonUuid` — ID of parent resource
@@ -1957,7 +2005,7 @@ client.sessions_route_create(
-**render_templates:** `bool` — Render system and assistant message content as jinja templates +**child_id:** `CommonUuid` — ID of the resource to be deleted
@@ -1965,15 +2013,71 @@ client.sessions_route_create(
-**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + +
+ +
client.agent_tools_route_patch(...)
-**users:** `typing.Optional[typing.Sequence[CommonUuid]]` +#### 📝 Description + +
+
+ +
+
+ +Update an existing tool (merges with existing values) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_patch( + id="id", + child_id="child_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource
@@ -1981,7 +2085,7 @@ client.sessions_route_create(
-**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session +**child_id:** `CommonUuid` — ID of the resource to be patched
@@ -1989,7 +2093,7 @@ client.sessions_route_create(
-**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` +**type:** `typing.Optional[ToolsToolType]` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now)
@@ -1997,7 +2101,7 @@ client.sessions_route_create(
-**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality +**name:** `typing.Optional[CommonValidPythonIdentifier]` — Name of the tool (must be unique for this agent and a valid python identifier string )
@@ -2005,7 +2109,7 @@ client.sessions_route_create(
-**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow +**function:** `typing.Optional[ToolsFunctionDefUpdate]`
@@ -2013,7 +2117,23 @@ client.sessions_route_create(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**integration:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**system:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**api_call:** `typing.Optional[typing.Any]`
@@ -2033,7 +2153,7 @@ client.sessions_route_create(
-
client.sessions_route_create_or_update(...) +
client.tasks_create_or_update_route_create_or_update(...)
@@ -2045,7 +2165,7 @@ client.sessions_route_create(
-Create or update a session +Create or update a task
@@ -2060,16 +2180,26 @@ Create or update a session
```python +from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_create_or_update( +client.tasks_create_or_update_route_create_or_update( + parent_id="parent_id", id="id", - situation="situation", - render_templates=True, + name="name", + description="description", + main=[], + tools=[ + ToolsCreateToolRequest( + type="function", + name="name", + ) + ], + inherit_tools=True, ) ``` @@ -2086,7 +2216,7 @@ client.sessions_route_create_or_update(
-**id:** `CommonUuid` +**parent_id:** `CommonUuid` — ID of parent resource
@@ -2094,15 +2224,7 @@ client.sessions_route_create_or_update(
-**situation:** `str` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `bool` — Render system and assistant message content as jinja templates +**id:** `CommonUuid`
@@ -2110,7 +2232,7 @@ client.sessions_route_create_or_update(
-**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session +**name:** `str`
@@ -2118,7 +2240,7 @@ client.sessions_route_create_or_update(
-**users:** `typing.Optional[typing.Sequence[CommonUuid]]` +**description:** `str`
@@ -2126,7 +2248,7 @@ client.sessions_route_create_or_update(
-**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session +**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task.
@@ -2134,7 +2256,7 @@ client.sessions_route_create_or_update(
-**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` +**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself.
@@ -2142,7 +2264,7 @@ client.sessions_route_create_or_update(
-**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true.
@@ -2150,7 +2272,7 @@ client.sessions_route_create_or_update(
-**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid.
@@ -2178,7 +2300,7 @@ client.sessions_route_create_or_update(
-
client.sessions_route_get(...) +
client.individual_docs_route_get(...)
@@ -2190,7 +2312,7 @@ client.sessions_route_create_or_update(
-Get a session by id +Get Doc by id
@@ -2211,8 +2333,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_get( - id="string", +client.individual_docs_route_get( + id="id", ) ``` @@ -2249,7 +2371,7 @@ client.sessions_route_get(
-
client.sessions_route_update(...) +
client.individual_docs_route_delete(...)
@@ -2261,7 +2383,7 @@ client.sessions_route_get(
-Update an existing session by its id (overwrites all existing values) +Delete an existing Doc by id
@@ -2282,10 +2404,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_update( +client.individual_docs_route_delete( id="id", - situation="situation", - render_templates=True, ) ``` @@ -2310,46 +2430,6 @@ client.sessions_route_update(
-**situation:** `str` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `bool` — Render system and assistant message content as jinja templates - -
-
- -
-
- -**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality - -
-
- -
-
- -**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -2362,7 +2442,7 @@ client.sessions_route_update(
-
client.sessions_route_delete(...) +
client.embed_route_embed(...)
@@ -2374,7 +2454,7 @@ client.sessions_route_update(
-Delete a session by its id +Embed a query for search
@@ -2389,14 +2469,17 @@ Delete a session by its id
```python +from julep import DocsEmbedQueryRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_delete( - id="id", +client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), ) ``` @@ -2413,7 +2496,7 @@ client.sessions_route_delete(
-**id:** `CommonUuid` — ID of the resource +**body:** `DocsEmbedQueryRequest`
@@ -2433,7 +2516,7 @@ client.sessions_route_delete(
-
client.sessions_route_patch(...) +
client.executions_route_get(...)
@@ -2445,7 +2528,7 @@ client.sessions_route_delete(
-Update an existing session by its id (merges with existing values) +Get an Execution by id
@@ -2466,7 +2549,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.sessions_route_patch( +client.executions_route_get( id="id", ) @@ -2479,52 +2562,12 @@ client.sessions_route_patch( #### ⚙️ Parameters
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**situation:** `typing.Optional[str]` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `typing.Optional[bool]` — Render system and assistant message content as jinja templates - -
-
- -
-
- -**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality - -
-
- -
-
- -**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow - -
-
+
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**id:** `CommonUuid` — ID of the resource
@@ -2544,7 +2587,7 @@ client.sessions_route_patch(
-
client.history_route_list(...) +
client.execution_transitions_route_list(...)
@@ -2556,7 +2599,7 @@ client.sessions_route_patch(
-Get history of a Session (paginated) +List the Transitions of an Execution by id
@@ -2577,7 +2620,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.history_route_list( +client.execution_transitions_route_list( id="id", limit=1, offset=1, @@ -2624,7 +2667,7 @@ client.history_route_list(
-**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field +**sort_by:** `ExecutionTransitionsRouteListRequestSortBy` — Sort by a field
@@ -2632,7 +2675,7 @@ client.history_route_list(
-**direction:** `HistoryRouteListRequestDirection` — Sort direction +**direction:** `ExecutionTransitionsRouteListRequestDirection` — Sort direction
@@ -2660,7 +2703,7 @@ client.history_route_list(
-
client.history_route_delete(...) +
client.job_route_get(...)
@@ -2672,7 +2715,7 @@ client.history_route_list(
-Clear the history of a Session (resets the Session) +Get the status of an existing Job by its id
@@ -2693,7 +2736,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.history_route_delete( +client.job_route_get( id="id", ) @@ -2731,7 +2774,7 @@ client.history_route_delete(
-
client.tasks_route_list(...) +
client.sessions_route_list(...)
@@ -2743,7 +2786,7 @@ client.history_route_delete(
-List tasks (paginated) +List sessions (paginated)
@@ -2764,7 +2807,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_list( +client.sessions_route_list( limit=1, offset=1, sort_by="created_at", @@ -2802,7 +2845,7 @@ client.tasks_route_list(
-**sort_by:** `TasksRouteListRequestSortBy` — Sort by a field +**sort_by:** `SessionsRouteListRequestSortBy` — Sort by a field
@@ -2810,7 +2853,7 @@ client.tasks_route_list(
-**direction:** `TasksRouteListRequestDirection` — Sort direction +**direction:** `SessionsRouteListRequestDirection` — Sort direction
@@ -2838,7 +2881,7 @@ client.tasks_route_list(
-
client.tasks_route_create(...) +
client.sessions_route_create(...)
@@ -2850,7 +2893,7 @@ client.tasks_route_list(
-Create a new task +Create a new session
@@ -2865,24 +2908,15 @@ Create a new task
```python -from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_create( - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, +client.sessions_route_create( + situation="situation", + render_templates=True, ) ``` @@ -2899,7 +2933,7 @@ client.tasks_route_create(
-**name:** `str` +**situation:** `str` — A specific situation that sets the background for this session
@@ -2907,7 +2941,7 @@ client.tasks_route_create(
-**description:** `str` +**render_templates:** `bool` — Render system and assistant message content as jinja templates
@@ -2915,7 +2949,7 @@ client.tasks_route_create(
-**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. +**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session
@@ -2923,7 +2957,7 @@ client.tasks_route_create(
-**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. +**users:** `typing.Optional[typing.Sequence[CommonUuid]]`
@@ -2931,7 +2965,7 @@ client.tasks_route_create(
-**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. +**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session
@@ -2939,7 +2973,23 @@ client.tasks_route_create(
-**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow
@@ -2967,7 +3017,7 @@ client.tasks_route_create(
-
client.tasks_route_create_or_update(...) +
client.sessions_route_get(...)
@@ -2979,7 +3029,78 @@ client.tasks_route_create(
-Create or update a task +Get a session by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_get( + id="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +
client.sessions_route_create_or_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update a session
@@ -2994,25 +3115,16 @@ Create or update a task
```python -from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_create_or_update( +client.sessions_route_create_or_update( id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + situation="situation", + render_templates=True, ) ``` @@ -3037,7 +3149,7 @@ client.tasks_route_create_or_update(
-**name:** `str` +**situation:** `str` — A specific situation that sets the background for this session
@@ -3045,7 +3157,7 @@ client.tasks_route_create_or_update(
-**description:** `str` +**render_templates:** `bool` — Render system and assistant message content as jinja templates
@@ -3053,7 +3165,7 @@ client.tasks_route_create_or_update(
-**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. +**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session
@@ -3061,7 +3173,7 @@ client.tasks_route_create_or_update(
-**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. +**users:** `typing.Optional[typing.Sequence[CommonUuid]]`
@@ -3069,7 +3181,7 @@ client.tasks_route_create_or_update(
-**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. +**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session
@@ -3077,7 +3189,23 @@ client.tasks_route_create_or_update(
-**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow
@@ -3105,7 +3233,7 @@ client.tasks_route_create_or_update(
-
client.tasks_route_update(...) +
client.sessions_route_update(...)
@@ -3117,7 +3245,7 @@ client.tasks_route_create_or_update(
-Update an existing task (overwrite existing values) +Update an existing session by its id (overwrites all existing values)
@@ -3132,24 +3260,16 @@ Update an existing task (overwrite existing values)
```python -from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_update( +client.sessions_route_update( id="id", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + situation="situation", + render_templates=True, ) ``` @@ -3174,15 +3294,7 @@ client.tasks_route_update(
-**description:** `str` - -
-
- -
-
- -**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. +**situation:** `str` — A specific situation that sets the background for this session
@@ -3190,7 +3302,7 @@ client.tasks_route_update(
-**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. +**render_templates:** `bool` — Render system and assistant message content as jinja templates
@@ -3198,7 +3310,7 @@ client.tasks_route_update(
-**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality
@@ -3206,7 +3318,7 @@ client.tasks_route_update(
-**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow
@@ -3234,7 +3346,7 @@ client.tasks_route_update(
-
client.tasks_route_delete(...) +
client.sessions_route_delete(...)
@@ -3246,7 +3358,7 @@ client.tasks_route_update(
-Delete a task by its id +Delete a session by its id
@@ -3267,7 +3379,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_delete( +client.sessions_route_delete( id="id", ) @@ -3305,7 +3417,7 @@ client.tasks_route_delete(
-
client.tasks_route_patch(...) +
client.sessions_route_patch(...)
@@ -3317,7 +3429,7 @@ client.tasks_route_delete(
-Update an existing task (merges with existing values) +Update an existing session by its id (merges with existing values)
@@ -3338,7 +3450,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_patch( +client.sessions_route_patch( id="id", ) @@ -3364,15 +3476,7 @@ client.tasks_route_patch(
-**description:** `typing.Optional[str]` - -
-
- -
-
- -**main:** `typing.Optional[typing.Sequence[TasksWorkflowStep]]` — The entrypoint of the task. +**situation:** `typing.Optional[str]` — A specific situation that sets the background for this session
@@ -3380,7 +3484,7 @@ client.tasks_route_patch(
-**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +**render_templates:** `typing.Optional[bool]` — Render system and assistant message content as jinja templates
@@ -3388,7 +3492,7 @@ client.tasks_route_patch(
-**tools:** `typing.Optional[typing.Sequence[ToolsCreateToolRequest]]` — Tools defined specifically for this task not included in the Agent itself. +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality
@@ -3396,7 +3500,7 @@ client.tasks_route_patch(
-**inherit_tools:** `typing.Optional[bool]` — Whether to inherit tools from the parent agent or not. Defaults to true. +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow
@@ -3424,7 +3528,7 @@ client.tasks_route_patch(
-
client.task_executions_route_list(...) +
client.history_route_list(...)
@@ -3436,7 +3540,7 @@ client.tasks_route_patch(
-List executions of the given task +Get history of a Session (paginated)
@@ -3457,7 +3561,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_list( +client.history_route_list( id="id", limit=1, offset=1, @@ -3504,7 +3608,7 @@ client.task_executions_route_list(
-**sort_by:** `TaskExecutionsRouteListRequestSortBy` — Sort by a field +**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field
@@ -3512,7 +3616,7 @@ client.task_executions_route_list(
-**direction:** `TaskExecutionsRouteListRequestDirection` — Sort direction +**direction:** `HistoryRouteListRequestDirection` — Sort direction
@@ -3540,7 +3644,7 @@ client.task_executions_route_list(
-
client.task_executions_route_create(...) +
client.history_route_delete(...)
@@ -3552,7 +3656,7 @@ client.task_executions_route_list(
-Create an execution for the given task +Clear the history of a Session (resets the Session)
@@ -3573,9 +3677,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_create( +client.history_route_delete( id="id", - input={"key": "value"}, ) ``` @@ -3592,23 +3695,7 @@ client.task_executions_route_create(
-**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**input:** `typing.Dict[str, typing.Any]` — The input to the execution - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**id:** `CommonUuid` — ID of the resource
@@ -3628,7 +3715,7 @@ client.task_executions_route_create(
-
client.task_executions_route_resume_with_task_token(...) +
client.task_executions_route_list(...)
@@ -3640,7 +3727,7 @@ client.task_executions_route_create(
-Resume an execution with a task token +List executions of the given task
@@ -3661,9 +3748,13 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_resume_with_task_token( +client.task_executions_route_list( id="id", - task_token="task_token", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -3680,7 +3771,7 @@ client.task_executions_route_resume_with_task_token(
-**id:** `CommonUuid` — ID of parent Task +**id:** `CommonUuid` — ID of parent
@@ -3688,7 +3779,7 @@ client.task_executions_route_resume_with_task_token(
-**task_token:** `str` — A Task Token is a unique identifier for a specific Task Execution. +**limit:** `CommonLimit` — Limit the number of items returned
@@ -3696,7 +3787,31 @@ client.task_executions_route_resume_with_task_token(
-**input:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input to resume the execution with +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `TaskExecutionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `TaskExecutionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -3716,7 +3831,7 @@ client.task_executions_route_resume_with_task_token(
-
client.tool_route_update(...) +
client.task_executions_route_create(...)
@@ -3728,7 +3843,7 @@ client.task_executions_route_resume_with_task_token(
-Update an existing tool (overwrite existing values) +Create an execution for the given task
@@ -3749,10 +3864,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tool_route_update( +client.task_executions_route_create( id="id", - type="function", - name="name", + input={"key": "value"}, ) ``` @@ -3769,39 +3883,7 @@ client.tool_route_update(
-**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**type:** `ToolsToolType` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - -
-
- -
-
- -**name:** `CommonValidPythonIdentifier` — Name of the tool (must be unique for this agent and a valid python identifier string ) - -
-
- -
-
- -**function:** `typing.Optional[ToolsFunctionDef]` - -
-
- -
-
- -**integration:** `typing.Optional[typing.Any]` +**id:** `CommonUuid` — ID of parent resource
@@ -3809,7 +3891,7 @@ client.tool_route_update(
-**system:** `typing.Optional[typing.Any]` +**input:** `typing.Dict[str, typing.Any]` — The input to the execution
@@ -3817,7 +3899,7 @@ client.tool_route_update(
-**api_call:** `typing.Optional[typing.Any]` +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -3837,7 +3919,7 @@ client.tool_route_update(
-
client.tool_route_delete(...) +
client.task_executions_route_resume_with_task_token(...)
@@ -3849,7 +3931,7 @@ client.tool_route_update(
-Delete an existing tool by id +Resume an execution with a task token
@@ -3870,8 +3952,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tool_route_delete( +client.task_executions_route_resume_with_task_token( id="id", + task_token="task_token", ) ``` @@ -3888,7 +3971,23 @@ client.tool_route_delete(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent Task + +
+
+ +
+
+ +**task_token:** `str` — A Task Token is a unique identifier for a specific Task Execution. + +
+
+ +
+
+ +**input:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input to resume the execution with
@@ -3908,7 +4007,7 @@ client.tool_route_delete(
-
client.tool_route_patch(...) +
client.task_executions_route_update(...)
@@ -3920,7 +4019,7 @@ client.tool_route_delete(
-Update an existing tool (merges with existing values) +Update an existing Execution
@@ -3935,14 +4034,19 @@ Update an existing tool (merges with existing values)
```python +from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tool_route_patch( - id="id", +client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), ) ``` @@ -3959,39 +4063,7 @@ client.tool_route_patch(
-**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**type:** `typing.Optional[ToolsToolType]` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - -
-
- -
-
- -**name:** `typing.Optional[CommonValidPythonIdentifier]` — Name of the tool (must be unique for this agent and a valid python identifier string ) - -
-
- -
-
- -**function:** `typing.Optional[ToolsFunctionDefUpdate]` - -
-
- -
-
- -**integration:** `typing.Optional[typing.Any]` +**id:** `CommonUuid` — ID of parent resource
@@ -3999,7 +4071,7 @@ client.tool_route_patch(
-**system:** `typing.Optional[typing.Any]` +**child_id:** `CommonUuid` — ID of the resource to be updated
@@ -4007,7 +4079,7 @@ client.tool_route_patch(
-**api_call:** `typing.Optional[typing.Any]` +**request:** `ExecutionsUpdateExecutionRequest`
@@ -4231,7 +4303,7 @@ client.users_route_create(
-
client.users_route_create_or_update(...) +
client.users_route_get(...)
@@ -4243,7 +4315,7 @@ client.users_route_create(
-Create or update a user +Get a user by id
@@ -4264,10 +4336,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_create_or_update( +client.users_route_get( id="id", - name="name", - about="about", ) ``` @@ -4284,31 +4354,7 @@ client.users_route_create_or_update(
-**id:** `CommonUuid` - -
-
- -
-
- -**name:** `CommonIdentifierSafeUnicode` — Name of the user - -
-
- -
-
- -**about:** `str` — About the user - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**id:** `CommonUuid` — ID of the resource
@@ -4328,7 +4374,7 @@ client.users_route_create_or_update(
-
client.users_route_get(...) +
client.users_route_create_or_update(...)
@@ -4340,7 +4386,7 @@ client.users_route_create_or_update(
-Get a user by id +Create or update a user
@@ -4361,8 +4407,10 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_get( +client.users_route_create_or_update( id="id", + name="name", + about="about", ) ``` @@ -4379,7 +4427,31 @@ client.users_route_get(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the user + +
+
+ +
+
+ +**about:** `str` — About the user + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 8403f8f17..54f7ec054 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -18,12 +18,6 @@ from .agents_create_agent_request_instructions import ( AgentsCreateAgentRequestInstructions, ) -from .agents_create_or_update_agent_request_default_settings import ( - AgentsCreateOrUpdateAgentRequestDefaultSettings, -) -from .agents_create_or_update_agent_request_instructions import ( - AgentsCreateOrUpdateAgentRequestInstructions, -) from .agents_docs_search_route_search_request_direction import ( AgentsDocsSearchRouteSearchRequestDirection, ) @@ -40,6 +34,7 @@ from .agents_route_list_request_direction import AgentsRouteListRequestDirection from .agents_route_list_request_sort_by import AgentsRouteListRequestSortBy from .agents_route_list_response import AgentsRouteListResponse +from .agents_update_agent_request import AgentsUpdateAgentRequest from .agents_update_agent_request_default_settings import ( AgentsUpdateAgentRequestDefaultSettings, ) @@ -142,6 +137,7 @@ from .jobs_job_state import JobsJobState from .jobs_job_status import JobsJobStatus from .sessions_context_overflow_type import SessionsContextOverflowType +from .sessions_create_session_request import SessionsCreateSessionRequest from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession from .sessions_multi_agent_single_user_session import ( @@ -173,6 +169,7 @@ TaskExecutionsRouteListRequestSortBy, ) from .task_executions_route_list_response import TaskExecutionsRouteListResponse +from .tasks_create_task_request import TasksCreateTaskRequest from .tasks_error_workflow_step import TasksErrorWorkflowStep from .tasks_evaluate_step import TasksEvaluateStep from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep @@ -222,6 +219,7 @@ from .users_route_list_request_direction import UsersRouteListRequestDirection from .users_route_list_request_sort_by import UsersRouteListRequestSortBy from .users_route_list_response import UsersRouteListResponse +from .users_update_user_request import UsersUpdateUserRequest from .users_user import UsersUser __all__ = [ @@ -237,8 +235,6 @@ "AgentsCreateAgentRequest", "AgentsCreateAgentRequestDefaultSettings", "AgentsCreateAgentRequestInstructions", - "AgentsCreateOrUpdateAgentRequestDefaultSettings", - "AgentsCreateOrUpdateAgentRequestInstructions", "AgentsDocsSearchRouteSearchRequestDirection", "AgentsDocsSearchRouteSearchRequestSortBy", "AgentsDocsSearchRouteSearchResponse", @@ -247,6 +243,7 @@ "AgentsRouteListRequestDirection", "AgentsRouteListRequestSortBy", "AgentsRouteListResponse", + "AgentsUpdateAgentRequest", "AgentsUpdateAgentRequestDefaultSettings", "AgentsUpdateAgentRequestInstructions", "ChatCompletionResponseFormat", @@ -327,6 +324,7 @@ "JobsJobState", "JobsJobStatus", "SessionsContextOverflowType", + "SessionsCreateSessionRequest", "SessionsMultiAgentMultiUserSession", "SessionsMultiAgentNoUserSession", "SessionsMultiAgentSingleUserSession", @@ -346,6 +344,7 @@ "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", + "TasksCreateTaskRequest", "TasksErrorWorkflowStep", "TasksEvaluateStep", "TasksIfElseWorkflowStep", @@ -389,5 +388,6 @@ "UsersRouteListRequestDirection", "UsersRouteListRequestSortBy", "UsersRouteListResponse", + "UsersUpdateUserRequest", "UsersUser", ] diff --git a/sdks/python/julep/api/types/agents_create_agent_request.py b/sdks/python/julep/api/types/agents_create_agent_request.py index 61050e062..2a545c6dc 100644 --- a/sdks/python/julep/api/types/agents_create_agent_request.py +++ b/sdks/python/julep/api/types/agents_create_agent_request.py @@ -47,11 +47,6 @@ class AgentsCreateAgentRequest(pydantic_v1.BaseModel): Default settings for all sessions created by this agent """ - docs: typing.List[typing.Any] = pydantic_v1.Field() - """ - Documents to index for this agent. (Max: 100 items) - """ - def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { "by_alias": True, diff --git a/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py deleted file mode 100644 index d3393d4e7..000000000 --- a/sdks/python/julep/api/types/agents_create_or_update_agent_request_default_settings.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_generation_preset_settings import ChatGenerationPresetSettings -from .chat_open_ai_settings import ChatOpenAiSettings -from .chat_v_llm_settings import ChatVLlmSettings - -AgentsCreateOrUpdateAgentRequestDefaultSettings = typing.Union[ - ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings -] diff --git a/sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py b/sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py deleted file mode 100644 index 4e69ede12..000000000 --- a/sdks/python/julep/api/types/agents_create_or_update_agent_request_instructions.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsCreateOrUpdateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_update_agent_request.py b/sdks/python/julep/api/types/agents_update_agent_request.py new file mode 100644 index 000000000..1b7a648a7 --- /dev/null +++ b/sdks/python/julep/api/types/agents_update_agent_request.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .agents_update_agent_request_default_settings import ( + AgentsUpdateAgentRequestDefaultSettings, +) +from .agents_update_agent_request_instructions import ( + AgentsUpdateAgentRequestInstructions, +) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode + + +class AgentsUpdateAgentRequest(pydantic_v1.BaseModel): + """ + Payload for updating a agent + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the agent + """ + + about: str = pydantic_v1.Field() + """ + About the agent + """ + + model: str = pydantic_v1.Field() + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + + instructions: AgentsUpdateAgentRequestInstructions = pydantic_v1.Field() + """ + Instructions for the agent + """ + + default_settings: typing.Optional[AgentsUpdateAgentRequestDefaultSettings] = ( + pydantic_v1.Field(default=None) + ) + """ + Default settings for all sessions created by this agent + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_create_session_request.py b/sdks/python/julep/api/types/sessions_create_session_request.py new file mode 100644 index 000000000..e6570309d --- /dev/null +++ b/sdks/python/julep/api/types/sessions_create_session_request.py @@ -0,0 +1,82 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .sessions_context_overflow_type import SessionsContextOverflowType + + +class SessionsCreateSessionRequest(pydantic_v1.BaseModel): + """ + Payload for creating a session + """ + + user: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + User ID of user associated with this session + """ + + users: typing.Optional[typing.List[CommonUuid]] = None + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of agent associated with this session + """ + + agents: typing.Optional[typing.List[CommonUuid]] = None + situation: str = pydantic_v1.Field() + """ + A specific situation that sets the background for this session + """ + + render_templates: bool = pydantic_v1.Field() + """ + Render system and assistant message content as jinja templates + """ + + token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + Threshold value for the adaptive context functionality + """ + + context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( + default=None + ) + """ + Action to start on context window overflow + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_create_task_request.py b/sdks/python/julep/api/types/tasks_create_task_request.py new file mode 100644 index 000000000..c5c0ecb54 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_create_task_request.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_workflow_step import TasksWorkflowStep +from .tools_create_tool_request import ToolsCreateToolRequest + + +class TasksCreateTaskRequest(pydantic_v1.BaseModel): + """ + Payload for creating a task + """ + + name: str + description: str + main: typing.List[TasksWorkflowStep] = pydantic_v1.Field() + """ + The entrypoint of the task. + """ + + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + default=None + ) + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + + tools: typing.List[ToolsCreateToolRequest] = pydantic_v1.Field() + """ + Tools defined specifically for this task not included in the Agent itself. + """ + + inherit_tools: bool = pydantic_v1.Field() + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_update_user_request.py b/sdks/python/julep/api/types/users_update_user_request.py new file mode 100644 index 000000000..f747a2093 --- /dev/null +++ b/sdks/python/julep/api/types/users_update_user_request.py @@ -0,0 +1,56 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode + + +class UsersUpdateUserRequest(pydantic_v1.BaseModel): + """ + Payload for updating a user + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the user + """ + + about: str = pydantic_v1.Field() + """ + About the user + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index e4d0ed7a8..d351e3d22 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -1666,13 +1666,13 @@ files = [ [[package]] name = "openai" -version = "1.36.1" +version = "1.37.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.36.1-py3-none-any.whl", hash = "sha256:d399b9d476dbbc167aceaac6bc6ed0b2e2bb6c9e189c7f7047f822743ae62e64"}, - {file = "openai-1.36.1.tar.gz", hash = "sha256:41be9e0302e95dba8a9374b885c5cb1cec2202816a70b98736fee25a2cadd1f2"}, + {file = "openai-1.37.0-py3-none-any.whl", hash = "sha256:a903245c0ecf622f2830024acdaa78683c70abb8e9d37a497b851670864c9f73"}, + {file = "openai-1.37.0.tar.gz", hash = "sha256:dc8197fc40ab9d431777b6620d962cc49f4544ffc3011f03ce0a805e6eb54adb"}, ] [package.dependencies] From 99d5e9ebdb39fc49254356efd2528636d68ef6f1 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 22 Jul 2024 18:03:26 -0400 Subject: [PATCH 25/36] wip Signed-off-by: Diwank Tomer --- agents-api/poetry.lock | 1 - sdks/python/poetry.lock | 1 - sdks/ts/src/api/index.ts | 16 +- .../api/models/Agents_CreateAgentRequest.ts | 4 - .../Agents_CreateOrUpdateAgentRequest.ts | 36 -- .../Agents_CreateOrUpdateAgentRequest_id.ts | 6 + .../Sessions_CreateOrUpdateSessionRequest.ts | 36 -- ...essions_CreateOrUpdateSessionRequest_id.ts | 6 + .../models/Tasks_CreateOrUpdateTaskRequest.ts | 9 - .../Tasks_CreateOrUpdateTaskRequest_id.ts | 6 + .../models/Users_CreateOrUpdateUserRequest.ts | 18 - .../Users_CreateOrUpdateUserRequest_id.ts | 6 + .../api/schemas/$Agents_CreateAgentRequest.ts | 7 - .../$Agents_CreateOrUpdateAgentRequest.ts | 69 --- .../$Agents_CreateOrUpdateAgentRequest_id.ts | 7 + .../$Sessions_CreateOrUpdateSessionRequest.ts | 76 --- ...essions_CreateOrUpdateSessionRequest_id.ts | 7 + .../$Tasks_CreateOrUpdateTaskRequest.ts | 13 - .../$Tasks_CreateOrUpdateTaskRequest_id.ts | 7 + .../$Users_CreateOrUpdateUserRequest.ts | 33 -- .../$Users_CreateOrUpdateUserRequest_id.ts | 7 + sdks/ts/src/api/services/DefaultService.ts | 560 ++++++++++-------- 22 files changed, 380 insertions(+), 551 deletions(-) delete mode 100644 sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts create mode 100644 sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts delete mode 100644 sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts create mode 100644 sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts delete mode 100644 sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts create mode 100644 sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts delete mode 100644 sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts create mode 100644 sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts delete mode 100644 sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts delete mode 100644 sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts delete mode 100644 sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 1962f7976..f59b5323e 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -4131,7 +4131,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index d351e3d22..fd11722b1 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -2386,7 +2386,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index 05bdd33a7..64cc1299a 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -12,7 +12,7 @@ export type { OpenAPIConfig } from "./core/OpenAPI"; export type { Agents_Agent } from "./models/Agents_Agent"; export type { Agents_CreateAgentRequest } from "./models/Agents_CreateAgentRequest"; -export type { Agents_CreateOrUpdateAgentRequest } from "./models/Agents_CreateOrUpdateAgentRequest"; +export type { Agents_CreateOrUpdateAgentRequest_id } from "./models/Agents_CreateOrUpdateAgentRequest_id"; export type { Agents_PatchAgentRequest } from "./models/Agents_PatchAgentRequest"; export type { Agents_UpdateAgentRequest } from "./models/Agents_UpdateAgentRequest"; export type { Chat_CompletionResponseFormat } from "./models/Chat_CompletionResponseFormat"; @@ -65,7 +65,7 @@ export type { Executions_UpdateExecutionRequest } from "./models/Executions_Upda export type { Jobs_JobState } from "./models/Jobs_JobState"; export type { Jobs_JobStatus } from "./models/Jobs_JobStatus"; export type { Sessions_ContextOverflowType } from "./models/Sessions_ContextOverflowType"; -export type { Sessions_CreateOrUpdateSessionRequest } from "./models/Sessions_CreateOrUpdateSessionRequest"; +export type { Sessions_CreateOrUpdateSessionRequest_id } from "./models/Sessions_CreateOrUpdateSessionRequest_id"; export type { Sessions_CreateSessionRequest } from "./models/Sessions_CreateSessionRequest"; export type { Sessions_MultiAgentMultiUserSession } from "./models/Sessions_MultiAgentMultiUserSession"; export type { Sessions_MultiAgentNoUserSession } from "./models/Sessions_MultiAgentNoUserSession"; @@ -76,7 +76,7 @@ export type { Sessions_SingleAgentMultiUserSession } from "./models/Sessions_Sin export type { Sessions_SingleAgentNoUserSession } from "./models/Sessions_SingleAgentNoUserSession"; export type { Sessions_SingleAgentSingleUserSession } from "./models/Sessions_SingleAgentSingleUserSession"; export type { Sessions_UpdateSessionRequest } from "./models/Sessions_UpdateSessionRequest"; -export type { Tasks_CreateOrUpdateTaskRequest } from "./models/Tasks_CreateOrUpdateTaskRequest"; +export type { Tasks_CreateOrUpdateTaskRequest_id } from "./models/Tasks_CreateOrUpdateTaskRequest_id"; export type { Tasks_CreateTaskRequest } from "./models/Tasks_CreateTaskRequest"; export type { Tasks_ErrorWorkflowStep } from "./models/Tasks_ErrorWorkflowStep"; export type { Tasks_EvaluateStep } from "./models/Tasks_EvaluateStep"; @@ -100,7 +100,7 @@ export type { Tools_Tool } from "./models/Tools_Tool"; export type { Tools_ToolResponse } from "./models/Tools_ToolResponse"; export type { Tools_ToolType } from "./models/Tools_ToolType"; export type { Tools_UpdateToolRequest } from "./models/Tools_UpdateToolRequest"; -export type { Users_CreateOrUpdateUserRequest } from "./models/Users_CreateOrUpdateUserRequest"; +export type { Users_CreateOrUpdateUserRequest_id } from "./models/Users_CreateOrUpdateUserRequest_id"; export type { Users_CreateUserRequest } from "./models/Users_CreateUserRequest"; export type { Users_PatchUserRequest } from "./models/Users_PatchUserRequest"; export type { Users_UpdateUserRequest } from "./models/Users_UpdateUserRequest"; @@ -108,7 +108,7 @@ export type { Users_User } from "./models/Users_User"; export { $Agents_Agent } from "./schemas/$Agents_Agent"; export { $Agents_CreateAgentRequest } from "./schemas/$Agents_CreateAgentRequest"; -export { $Agents_CreateOrUpdateAgentRequest } from "./schemas/$Agents_CreateOrUpdateAgentRequest"; +export { $Agents_CreateOrUpdateAgentRequest_id } from "./schemas/$Agents_CreateOrUpdateAgentRequest_id"; export { $Agents_PatchAgentRequest } from "./schemas/$Agents_PatchAgentRequest"; export { $Agents_UpdateAgentRequest } from "./schemas/$Agents_UpdateAgentRequest"; export { $Chat_CompletionResponseFormat } from "./schemas/$Chat_CompletionResponseFormat"; @@ -161,7 +161,7 @@ export { $Executions_UpdateExecutionRequest } from "./schemas/$Executions_Update export { $Jobs_JobState } from "./schemas/$Jobs_JobState"; export { $Jobs_JobStatus } from "./schemas/$Jobs_JobStatus"; export { $Sessions_ContextOverflowType } from "./schemas/$Sessions_ContextOverflowType"; -export { $Sessions_CreateOrUpdateSessionRequest } from "./schemas/$Sessions_CreateOrUpdateSessionRequest"; +export { $Sessions_CreateOrUpdateSessionRequest_id } from "./schemas/$Sessions_CreateOrUpdateSessionRequest_id"; export { $Sessions_CreateSessionRequest } from "./schemas/$Sessions_CreateSessionRequest"; export { $Sessions_MultiAgentMultiUserSession } from "./schemas/$Sessions_MultiAgentMultiUserSession"; export { $Sessions_MultiAgentNoUserSession } from "./schemas/$Sessions_MultiAgentNoUserSession"; @@ -172,7 +172,7 @@ export { $Sessions_SingleAgentMultiUserSession } from "./schemas/$Sessions_Singl export { $Sessions_SingleAgentNoUserSession } from "./schemas/$Sessions_SingleAgentNoUserSession"; export { $Sessions_SingleAgentSingleUserSession } from "./schemas/$Sessions_SingleAgentSingleUserSession"; export { $Sessions_UpdateSessionRequest } from "./schemas/$Sessions_UpdateSessionRequest"; -export { $Tasks_CreateOrUpdateTaskRequest } from "./schemas/$Tasks_CreateOrUpdateTaskRequest"; +export { $Tasks_CreateOrUpdateTaskRequest_id } from "./schemas/$Tasks_CreateOrUpdateTaskRequest_id"; export { $Tasks_CreateTaskRequest } from "./schemas/$Tasks_CreateTaskRequest"; export { $Tasks_ErrorWorkflowStep } from "./schemas/$Tasks_ErrorWorkflowStep"; export { $Tasks_EvaluateStep } from "./schemas/$Tasks_EvaluateStep"; @@ -196,7 +196,7 @@ export { $Tools_Tool } from "./schemas/$Tools_Tool"; export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse"; export { $Tools_ToolType } from "./schemas/$Tools_ToolType"; export { $Tools_UpdateToolRequest } from "./schemas/$Tools_UpdateToolRequest"; -export { $Users_CreateOrUpdateUserRequest } from "./schemas/$Users_CreateOrUpdateUserRequest"; +export { $Users_CreateOrUpdateUserRequest_id } from "./schemas/$Users_CreateOrUpdateUserRequest_id"; export { $Users_CreateUserRequest } from "./schemas/$Users_CreateUserRequest"; export { $Users_PatchUserRequest } from "./schemas/$Users_PatchUserRequest"; export { $Users_UpdateUserRequest } from "./schemas/$Users_UpdateUserRequest"; diff --git a/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts b/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts index 56d5ff6c5..c9c95127b 100644 --- a/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts +++ b/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts @@ -34,8 +34,4 @@ export type Agents_CreateAgentRequest = { | Chat_GenerationPresetSettings | Chat_OpenAISettings | Chat_vLLMSettings; - /** - * Documents to index for this agent. (Max: 100 items) - */ - docs: Array; }; diff --git a/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts deleted file mode 100644 index 282bdb28b..000000000 --- a/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; -import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; -import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -export type Agents_CreateOrUpdateAgentRequest = { - id: Common_uuid; - metadata?: Record; - /** - * Name of the agent - */ - name: Common_identifierSafeUnicode; - /** - * About the agent - */ - about: string; - /** - * Model name to use (gpt-4-turbo, gemini-nano etc) - */ - model: string; - /** - * Instructions for the agent - */ - instructions: string | Array; - /** - * Default settings for all sessions created by this agent - */ - default_settings?: - | Chat_GenerationPresetSettings - | Chat_OpenAISettings - | Chat_vLLMSettings; -}; diff --git a/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts new file mode 100644 index 000000000..a0b127a69 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Agents_CreateOrUpdateAgentRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts deleted file mode 100644 index c5358076f..000000000 --- a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; -export type Sessions_CreateOrUpdateSessionRequest = { - id: Common_uuid; - /** - * User ID of user associated with this session - */ - user?: Common_uuid; - users?: Array; - /** - * Agent ID of agent associated with this session - */ - agent?: Common_uuid; - agents?: Array; - /** - * A specific situation that sets the background for this session - */ - situation: string; - /** - * Render system and assistant message content as jinja templates - */ - render_templates: boolean; - /** - * Threshold value for the adaptive context functionality - */ - token_budget: number | null; - /** - * Action to start on context window overflow - */ - context_overflow: Sessions_ContextOverflowType | null; - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts new file mode 100644 index 000000000..e668e6ee3 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Sessions_CreateOrUpdateSessionRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts deleted file mode 100644 index c2ee78e0a..000000000 --- a/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -export type Tasks_CreateOrUpdateTaskRequest = Record< - string, - Array ->; diff --git a/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts new file mode 100644 index 000000000..aa19b3598 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Tasks_CreateOrUpdateTaskRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts deleted file mode 100644 index 35371bac1..000000000 --- a/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -export type Users_CreateOrUpdateUserRequest = { - id: Common_uuid; - metadata?: Record; - /** - * Name of the user - */ - name: Common_identifierSafeUnicode; - /** - * About the user - */ - about: string; -}; diff --git a/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts new file mode 100644 index 000000000..7338d9bed --- /dev/null +++ b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Users_CreateOrUpdateUserRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts index 12d4405fe..035b10261 100644 --- a/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts +++ b/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts @@ -62,12 +62,5 @@ export const $Agents_CreateAgentRequest = { }, ], }, - docs: { - type: "array", - contains: { - properties: {}, - }, - isRequired: true, - }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest.ts deleted file mode 100644 index c89a9f596..000000000 --- a/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Agents_CreateOrUpdateAgentRequest = { - properties: { - id: { - type: "Common_uuid", - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the agent`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the agent`, - isRequired: true, - }, - model: { - type: "string", - description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, - isRequired: true, - }, - instructions: { - type: "any-of", - description: `Instructions for the agent`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - default_settings: { - type: "any-of", - description: `Default settings for all sessions created by this agent`, - contains: [ - { - type: "Chat_GenerationPresetSettings", - }, - { - type: "Chat_OpenAISettings", - }, - { - type: "Chat_vLLMSettings", - }, - ], - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts new file mode 100644 index 000000000..e5db88f15 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agents_CreateOrUpdateAgentRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts deleted file mode 100644 index 091dfe6bf..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_CreateOrUpdateSessionRequest = { - properties: { - id: { - type: "Common_uuid", - isRequired: true, - }, - user: { - type: "all-of", - description: `User ID of user associated with this session`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - users: { - type: "array", - contains: { - type: "Common_uuid", - }, - }, - agent: { - type: "all-of", - description: `Agent ID of agent associated with this session`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - agents: { - type: "array", - contains: { - type: "Common_uuid", - }, - }, - situation: { - type: "string", - description: `A specific situation that sets the background for this session`, - isRequired: true, - }, - render_templates: { - type: "boolean", - description: `Render system and assistant message content as jinja templates`, - isRequired: true, - }, - token_budget: { - type: "number", - description: `Threshold value for the adaptive context functionality`, - isRequired: true, - isNullable: true, - format: "uint16", - }, - context_overflow: { - type: "one-of", - description: `Action to start on context window overflow`, - contains: [ - { - type: "Sessions_ContextOverflowType", - }, - ], - isRequired: true, - isNullable: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts new file mode 100644 index 000000000..56cc353a0 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_CreateOrUpdateSessionRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts deleted file mode 100644 index deb0f3130..000000000 --- a/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tasks_CreateOrUpdateTaskRequest = { - type: "dictionary", - contains: { - type: "array", - contains: { - type: "Tasks_WorkflowStep", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts new file mode 100644 index 000000000..54aca71b6 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_CreateOrUpdateTaskRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest.ts deleted file mode 100644 index 856df4898..000000000 --- a/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Users_CreateOrUpdateUserRequest = { - properties: { - id: { - type: "Common_uuid", - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the user`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the user`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts new file mode 100644 index 000000000..47f504e4c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Users_CreateOrUpdateUserRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index 6c558b1f7..50b270426 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -4,7 +4,6 @@ /* eslint-disable */ import type { Agents_Agent } from "../models/Agents_Agent"; import type { Agents_CreateAgentRequest } from "../models/Agents_CreateAgentRequest"; -import type { Agents_CreateOrUpdateAgentRequest } from "../models/Agents_CreateOrUpdateAgentRequest"; import type { Agents_PatchAgentRequest } from "../models/Agents_PatchAgentRequest"; import type { Agents_UpdateAgentRequest } from "../models/Agents_UpdateAgentRequest"; import type { Common_limit } from "../models/Common_limit"; @@ -25,12 +24,10 @@ import type { Executions_TaskTokenResumeExecutionRequest } from "../models/Execu import type { Executions_Transition } from "../models/Executions_Transition"; import type { Executions_UpdateExecutionRequest } from "../models/Executions_UpdateExecutionRequest"; import type { Jobs_JobStatus } from "../models/Jobs_JobStatus"; -import type { Sessions_CreateOrUpdateSessionRequest } from "../models/Sessions_CreateOrUpdateSessionRequest"; import type { Sessions_CreateSessionRequest } from "../models/Sessions_CreateSessionRequest"; import type { Sessions_PatchSessionRequest } from "../models/Sessions_PatchSessionRequest"; import type { Sessions_Session } from "../models/Sessions_Session"; import type { Sessions_UpdateSessionRequest } from "../models/Sessions_UpdateSessionRequest"; -import type { Tasks_CreateOrUpdateTaskRequest } from "../models/Tasks_CreateOrUpdateTaskRequest"; import type { Tasks_CreateTaskRequest } from "../models/Tasks_CreateTaskRequest"; import type { Tasks_PatchTaskRequest } from "../models/Tasks_PatchTaskRequest"; import type { Tasks_Task } from "../models/Tasks_Task"; @@ -38,7 +35,6 @@ import type { Tasks_UpdateTaskRequest } from "../models/Tasks_UpdateTaskRequest" import type { Tools_PatchToolRequest } from "../models/Tools_PatchToolRequest"; import type { Tools_Tool } from "../models/Tools_Tool"; import type { Tools_UpdateToolRequest } from "../models/Tools_UpdateToolRequest"; -import type { Users_CreateOrUpdateUserRequest } from "../models/Users_CreateOrUpdateUserRequest"; import type { Users_CreateUserRequest } from "../models/Users_CreateUserRequest"; import type { Users_PatchUserRequest } from "../models/Users_PatchUserRequest"; import type { Users_UpdateUserRequest } from "../models/Users_UpdateUserRequest"; @@ -117,13 +113,18 @@ export class DefaultService { * @throws ApiError */ public agentsRouteCreateOrUpdate({ + id, requestBody, }: { - requestBody: Agents_CreateOrUpdateAgentRequest; + id: Common_uuid; + requestBody: Agents_UpdateAgentRequest; }): CancelablePromise { return this.httpRequest.request({ - method: "PUT", - url: "/agents", + method: "POST", + url: "/agents/{id}", + path: { + id: id, + }, body: requestBody, mediaType: "application/json", }); @@ -336,6 +337,175 @@ export class DefaultService { mediaType: "application/json", }); } + /** + * List tasks (paginated) + * @returns any The request has succeeded. + * @throws ApiError + */ + public tasksRouteList({ + id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * ID of parent + */ + id: Common_uuid; + /** + * Limit the number of items returned + */ + limit?: Common_limit; + /** + * Offset the items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { + return this.httpRequest.request({ + method: "GET", + url: "/agents/{id}/tasks", + path: { + id: id, + }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Create a new task + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. + * @throws ApiError + */ + public tasksRouteCreate({ + id, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + requestBody: Tasks_CreateTaskRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/agents/{id}/tasks", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing task (overwrite existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public tasksRouteUpdate({ + id, + childId, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be updated + */ + childId: Common_uuid; + requestBody: Tasks_UpdateTaskRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PUT", + url: "/agents/{id}/tasks/{child_id}", + path: { + id: id, + child_id: childId, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing task (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public tasksRoutePatch({ + id, + childId, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be patched + */ + childId: Common_uuid; + requestBody: Tasks_PatchTaskRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/agents/{id}/tasks/{child_id}", + path: { + id: id, + child_id: childId, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Delete a task by its id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public tasksRouteDelete({ + id, + childId, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be deleted + */ + childId: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/agents/{id}/tasks/{child_id}", + path: { + id: id, + child_id: childId, + }, + }); + } /** * List tools of the given agent * @returns any The request has succeeded. @@ -416,6 +586,123 @@ export class DefaultService { mediaType: "application/json", }); } + /** + * Update an existing tool (overwrite existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public agentToolsRouteUpdate({ + id, + childId, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be updated + */ + childId: Common_uuid; + requestBody: Tools_UpdateToolRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PUT", + url: "/agents/{id}/tools/{child_id}", + path: { + id: id, + child_id: childId, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing tool (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public agentToolsRoutePatch({ + id, + childId, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be patched + */ + childId: Common_uuid; + requestBody: Tools_PatchToolRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/agents/{id}/tools/{child_id}", + path: { + id: id, + child_id: childId, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Delete an existing tool by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public agentToolsRouteDelete({ + id, + childId, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be deleted + */ + childId: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/agents/{id}/tools/{child_id}", + path: { + id: id, + child_id: childId, + }, + }); + } + /** + * Create or update a task + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public tasksCreateOrUpdateRouteCreateOrUpdate({ + parentId, + id, + requestBody, + }: { + /** + * ID of parent resource + */ + parentId: Common_uuid; + id: Common_uuid; + requestBody: Tasks_CreateTaskRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/agents/{parent_id}/tasks/{id}", + path: { + parent_id: parentId, + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } /** * Get Doc by id * @returns Docs_Doc The request has succeeded. @@ -477,31 +764,6 @@ export class DefaultService { mediaType: "application/json", }); } - /** - * Update an existing Execution - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public executionsRouteUpdate({ - id, - requestBody, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - requestBody: Executions_UpdateExecutionRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/executions/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } /** * Get an Execution by id * @returns Executions_Execution The request has succeeded. @@ -671,13 +933,18 @@ export class DefaultService { * @throws ApiError */ public sessionsRouteCreateOrUpdate({ + id, requestBody, }: { - requestBody: Sessions_CreateOrUpdateSessionRequest; + id: Common_uuid; + requestBody: Sessions_CreateSessionRequest; }): CancelablePromise { return this.httpRequest.request({ - method: "PUT", - url: "/sessions", + method: "POST", + url: "/sessions/{id}", + path: { + id: id, + }, body: requestBody, mediaType: "application/json", }); @@ -850,158 +1117,6 @@ export class DefaultService { }, }); } - /** - * List tasks (paginated) - * @returns any The request has succeeded. - * @throws ApiError - */ - public tasksRouteList({ - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", - }: { - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/tasks", - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, - }); - } - /** - * Create or update a task - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public tasksRouteCreateOrUpdate({ - requestBody, - }: { - requestBody: Tasks_CreateOrUpdateTaskRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/tasks", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Create a new task - * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. - * @throws ApiError - */ - public tasksRouteCreate({ - requestBody, - }: { - requestBody: Tasks_CreateTaskRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/tasks", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing task (overwrite existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public tasksRouteUpdate({ - id, - requestBody, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - requestBody: Tasks_UpdateTaskRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/tasks/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing task (merges with existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public tasksRoutePatch({ - id, - requestBody, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - requestBody: Tasks_PatchTaskRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PATCH", - url: "/tasks/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete a task by its id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. - * @throws ApiError - */ - public tasksRouteDelete({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/tasks/{id}", - path: { - id: id, - }, - }); - } /** * Create an execution for the given task * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. @@ -1111,76 +1226,36 @@ export class DefaultService { }); } /** - * Update an existing tool (overwrite existing values) + * Update an existing Execution * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ - public toolRouteUpdate({ + public taskExecutionsRouteUpdate({ id, + childId, requestBody, }: { /** - * ID of the resource + * ID of parent resource */ id: Common_uuid; - requestBody: Tools_UpdateToolRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/tools/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing tool (merges with existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public toolRoutePatch({ - id, - requestBody, - }: { /** - * ID of the resource + * ID of the resource to be updated */ - id: Common_uuid; - requestBody: Tools_PatchToolRequest; + childId: Common_uuid; + requestBody: Executions_UpdateExecutionRequest; }): CancelablePromise { return this.httpRequest.request({ - method: "PATCH", - url: "/tools/{id}", + method: "PUT", + url: "/tasks/{id}/executions/{child_id}", path: { id: id, + child_id: childId, }, body: requestBody, mediaType: "application/json", }); } - /** - * Delete an existing tool by id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. - * @throws ApiError - */ - public toolRouteDelete({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/tools/{id}", - path: { - id: id, - }, - }); - } /** * List users (paginated) * @returns any The request has succeeded. @@ -1251,13 +1326,18 @@ export class DefaultService { * @throws ApiError */ public usersRouteCreateOrUpdate({ + id, requestBody, }: { - requestBody: Users_CreateOrUpdateUserRequest; + id: Common_uuid; + requestBody: Users_UpdateUserRequest; }): CancelablePromise { return this.httpRequest.request({ - method: "PUT", - url: "/users", + method: "POST", + url: "/users/{id}", + path: { + id: id, + }, body: requestBody, mediaType: "application/json", }); From 752fbafaf13bcb5fbbdab8037fc41d8d084bdc09 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Mon, 22 Jul 2024 21:46:13 -0400 Subject: [PATCH 26/36] fix(agents-api): Update agent/tool models Signed-off-by: Diwank Tomer --- .../agents_api/autogen/openapi_model.py | 2 + .../models/agent/create_or_update_agent.py | 126 ++++++++++++++++++ .../agents_api/models/agent/create_tools.py | 7 +- .../agents_api/models/agent/patch_tool.py | 74 +++++----- agents-api/agents_api/models/utils.py | 6 +- ...rate_1721576813_extended_tool_relations.py | 6 +- 6 files changed, 177 insertions(+), 44 deletions(-) create mode 100644 agents-api/agents_api/models/agent/create_or_update_agent.py diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index 7951a420a..d4c3b361c 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -9,3 +9,5 @@ from .Tasks import * # noqa: F401, F403 from .Tools import * # noqa: F401, F403 from .Users import * # noqa: F401, F403 + +CreateOrUpdateAgentRequest = UpdateAgentRequest \ No newline at end of file diff --git a/agents-api/agents_api/models/agent/create_or_update_agent.py b/agents-api/agents_api/models/agent/create_or_update_agent.py new file mode 100644 index 000000000..5c4f7a687 --- /dev/null +++ b/agents-api/agents_api/models/agent/create_or_update_agent.py @@ -0,0 +1,126 @@ +""" +This module contains the functionality for creating agents in the CozoDB database. +It includes functions to construct and execute datalog queries for inserting new agent records. +""" + +from uuid import UUID, uuid4 + +from beartype import beartype + +from ...autogen.openapi_model import Agent, CreateOrUpdateAgentRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import cozo_query, verify_developer_id_query, wrap_in_class + + +@wrap_in_class( + Agent, one=True, transform=lambda d: {"id": UUID(d.pop("agent_id")), **d} +) +@cozo_query +@beartype +def create_or_update_agent_query( + *, + developer_id: UUID, + agent_id: UUID, + create_or_update_agent: CreateOrUpdateAgentRequest, +) -> tuple[str, dict]: + """ + Constructs and executes a datalog query to create a new agent in the database. + + Parameters: + - agent_id (UUID): The unique identifier for the agent. + - developer_id (UUID): The unique identifier for the developer creating the agent. + - name (str): The name of the agent. + - about (str): A description of the agent. + - instructions (list[str], optional): A list of instructions for using the agent. Defaults to an empty list. + - model (str, optional): The model identifier for the agent. Defaults to "julep-ai/samantha-1-turbo". + - metadata (dict, optional): A dictionary of metadata for the agent. Defaults to an empty dict. + - default_settings (dict, optional): A dictionary of default settings for the agent. Defaults to an empty dict. + - client (CozoClient, optional): The CozoDB client instance to use for the query. Defaults to a preconfigured client instance. + + Returns: + Agent: The newly created agent record. + """ + + # Extract the agent data from the payload + create_or_update_agent.metadata = create_or_update_agent.metadata or {} + create_or_update_agent.instructions = ( + create_or_update_agent.instructions + if isinstance(create_or_update_agent.instructions, list) + else [create_or_update_agent.instructions] + ) + create_or_update_agent.default_settings = create_or_update_agent.default_settings or {} + + agent_data = create_or_update_agent.model_dump() + default_settings = agent_data.pop("default_settings") + + settings_cols, settings_vals = cozo_process_mutate_data( + { + **default_settings, + "agent_id": str(agent_id), + } + ) + + # Create default agent settings + # Construct a query to insert default settings for the new agent + default_settings_query = f""" + ?[{settings_cols}] <- $settings_vals + + :put agent_default_settings {{ + {settings_cols} + }} + """ + # create the agent + # Construct a query to insert the new agent record into the agents table + agent_query = """ + input[agent_id, developer_id, model, name, about, metadata, instructions, updated_at] <- [ + [$agent_id, $developer_id, $model, $name, $about, $metadata, $instructions, now()] + ] + + ?[agent_id, developer_id, model, name, about, metadata, instructions, created_at, updated_at] := + input[_agent_id, developer_id, model, name, about, metadata, instructions, updated_at], + *agents{ + agent_id, + created_at, + }, + agent_id = to_uuid(_agent_id), + + ?[agent_id, developer_id, model, name, about, metadata, instructions, created_at, updated_at] := + input[_agent_id, developer_id, model, name, about, metadata, instructions, updated_at], + not *agents{ + agent_id, + }, created_at = now(), + agent_id = to_uuid(_agent_id), + + :put agents { + developer_id, + agent_id => + model, + name, + about, + metadata, + instructions, + created_at, + updated_at, + } + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + agent_query, + ] + if default_settings: + queries.insert(1, default_settings_query) + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return ( + query, + { + "settings_vals": settings_vals, + "agent_id": str(agent_id), + "developer_id": str(developer_id), + **agent_data, + }, + ) diff --git a/agents-api/agents_api/models/agent/create_tools.py b/agents-api/agents_api/models/agent/create_tools.py index 292b4c620..9e3484348 100644 --- a/agents-api/agents_api/models/agent/create_tools.py +++ b/agents-api/agents_api/models/agent/create_tools.py @@ -18,8 +18,7 @@ Tool, transform=lambda d: { "id": UUID(d.pop("tool_id")), - d["tool_type"]: d.pop("spec"), - "type": d.pop("tool_type"), + d["type"]: d.pop("spec"), **d, }, ) @@ -55,12 +54,12 @@ def create_tools_query( # Datalog query for inserting new tool records into the 'agent_functions' relation create_tools_query = """ - ?[agent_id, tool_id, tool_type, name, spec] <- $records + ?[agent_id, tool_id, type, name, spec] <- $records :insert tools { agent_id, tool_id, - tool_type, + type, name, spec, } diff --git a/agents-api/agents_api/models/agent/patch_tool.py b/agents-api/agents_api/models/agent/patch_tool.py index 5462d3630..ebb2c331f 100644 --- a/agents-api/agents_api/models/agent/patch_tool.py +++ b/agents-api/agents_api/models/agent/patch_tool.py @@ -4,67 +4,71 @@ from beartype import beartype from ...autogen.openapi_model import PatchToolRequest, ResourceUpdatedResponse - +from ...common.utils.cozo import cozo_process_mutate_data from ..utils import cozo_query, verify_developer_id_query, wrap_in_class @wrap_in_class( ResourceUpdatedResponse, one=True, - transform=lambda d: {"id": d["agent_id"], "jobs": [], **d}, + transform=lambda d: {"id": d["tool_id"], "jobs": [], **d}, ) @cozo_query @beartype def patch_tool_by_id_query( - *, developer_id: UUID, tool_id: UUID, update_tool: PatchToolRequest + *, agent_id: UUID, tool_id: UUID, patch_tool: PatchToolRequest ) -> tuple[str, dict]: """ # Execute the datalog query and return the results as a DataFrame Updates the tool information for a given agent and tool ID in the 'cozodb' database. Parameters: - - developer_id (UUID): The unique identifier of the developer. + - agent_id (UUID): The unique identifier of the agent. - tool_id (UUID): The unique identifier of the tool to be updated. - - update_tool (PatchToolRequest): The request payload containing the updated tool information. + - patch_tool (PatchToolRequest): The request payload containing the updated tool information. Returns: - ResourceUpdatedResponse: The updated tool data. """ - # Agent update query - # Convert the function definition to a dictionary for easier manipulation - function = function.model_dump() - # Prepare the parameters for the datalog query - params = { - "input": [ - [ - str(agent_id), - str(tool_id), - function["name"], - function["description"], - function.get("parameters", {}), - embedding, - ] - ] - } + + + # Extract the tool data from the payload + patch_data = patch_tool.model_dump() + + # Assert that only one of the tool type fields is present + if tool_type := patch_data.get("type"): + assert patch_data[tool_type] is not None, f"Missing {tool_type} field" + else: + assert len([ + patch_data.get(tool_type) is not None for tool_type in ["function", "integration", "system", "api_call"] + ]) == 1, "Invalid tool update" + + patch_data["type"] = next( + tool_type for tool_type in ["function", "integration", "system", "api_call"] + if patch_data.get(tool_type) is not None + ) + + # Rename the tool definition to 'spec' + patch_data["spec"] = patch_data.pop(patch_data["type"]) + + tool_cols, tool_vals = cozo_process_mutate_data( + { + **patch_data, + "agent_id": str(agent_id), + "tool_id": str(tool_id), + } + ) # Construct the datalog query for updating the tool information - query = """ - input[agent_id, tool_id, name, description, parameters, embedding] <- $input + query = f""" + input[{tool_cols}] <- $input - ?[agent_id, tool_id, name, description, parameters, embedding, updated_at] := - input[agent_id, tool_id, name, description, parameters, embedding], + ?[{tool_cols}, updated_at] := + input[{tool_cols}], updated_at = now() - :update agent_functions { - agent_id, - tool_id, - name, - description, - parameters, - embedding, - updated_at, - } + :update tools {{ {tool_cols}, updated_at }} :returning """ - return (query, params) + return (query, tool_vals) diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index 714f5f627..37c202545 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -57,12 +57,14 @@ def cozo_query_dec(func: Callable[P, tuple[str, dict]]): def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: query, variables = func(*args, **kwargs) + result = client.run(query, variables) + if debug: from pprint import pprint - pprint(dict(query=query, variables=variables)) + pprint(dict(query=query, variables=variables, result=result.to_dict(orient="records"))) - return client.run(query, variables) + return result return wrapper diff --git a/agents-api/migrations/migrate_1721576813_extended_tool_relations.py b/agents-api/migrations/migrate_1721576813_extended_tool_relations.py index ad7315ea5..2e4583a18 100644 --- a/agents-api/migrations/migrate_1721576813_extended_tool_relations.py +++ b/agents-api/migrations/migrate_1721576813_extended_tool_relations.py @@ -24,16 +24,16 @@ create_tools_relation = dict( up=""" - ?[agent_id, tool_id, tool_type, name, spec, updated_at, created_at] := *agent_functions{ + ?[agent_id, tool_id, type, name, spec, updated_at, created_at] := *agent_functions{ agent_id, tool_id, name, description, parameters, updated_at, created_at - }, tool_type = "function", + }, type = "function", spec = {"description": description, "parameters": parameters} :create tools { agent_id: Uuid, tool_id: Uuid, => - tool_type: String, + type: String, name: String, spec: Json, From 9bb58c30222a1bc2c95dd6cedc4e430d3359eda1 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Thu, 25 Jul 2024 01:35:36 -0400 Subject: [PATCH 27/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Entries.py | 2 +- .../agents_api/autogen/openapi_model.py | 62 ++++++-- .../agents_api/common/protocol/entries.py | 7 +- .../models/agent/create_or_update_agent.py | 6 +- .../agents_api/models/agent/create_tools.py | 78 ---------- .../agents_api/models/agent/list_agents.py | 8 +- .../agents_api/models/agent/patch_agent.py | 5 +- .../agents_api/models/agent/update_agent.py | 19 ++- .../agents_api/models/agent/update_tool.py | 46 ------ .../models/session/create_session.py | 124 ++++++++++------ .../agents_api/models/session/get_session.py | 48 ++++-- .../agents_api/models/tools/create_tools.py | 137 ++++++++---------- .../agents_api/models/tools/delete_tools.py | 38 ++++- .../agents_api/models/tools/embed_tools.py | 35 ----- .../agents_api/models/tools/get_tool.py | 67 +++++++++ .../agents_api/models/tools/get_tools.py | 42 ------ .../agents_api/models/tools/list_tools.py | 54 +++++-- .../models/{agent => tools}/patch_tool.py | 54 ++++--- .../agents_api/models/tools/search_tools.py | 76 ---------- .../models/tools/test_tool_queries.py | 55 +------ .../agents_api/models/tools/update_tool.py | 29 ++++ .../models/user/create_or_update_user.py | 92 ++++++++++++ .../agents_api/models/user/create_user.py | 34 +++-- agents-api/agents_api/models/user/get_user.py | 21 ++- .../agents_api/models/user/list_users.py | 28 +++- .../agents_api/models/user/patch_user.py | 36 ++++- .../agents_api/models/user/update_user.py | 31 +++- agents-api/agents_api/models/utils.py | 35 +++-- agents-api/poetry.lock | 41 +++--- agents-api/pyproject.toml | 31 +++- sdks/python/poetry.lock | 6 +- typespec/users/models.tsp | 4 - 32 files changed, 753 insertions(+), 598 deletions(-) delete mode 100644 agents-api/agents_api/models/agent/create_tools.py delete mode 100644 agents-api/agents_api/models/agent/update_tool.py delete mode 100644 agents-api/agents_api/models/tools/embed_tools.py create mode 100644 agents-api/agents_api/models/tools/get_tool.py delete mode 100644 agents-api/agents_api/models/tools/get_tools.py rename agents-api/agents_api/models/{agent => tools}/patch_tool.py (53%) delete mode 100644 agents-api/agents_api/models/tools/search_tools.py create mode 100644 agents-api/agents_api/models/tools/update_tool.py create mode 100644 agents-api/agents_api/models/user/create_or_update_user.py diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index 36d0132c7..a82dbc6a6 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field from .Tools import ChosenToolCall, Tool, ToolResponse diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index d4c3b361c..22d916938 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -1,13 +1,49 @@ -from .Agents import * # noqa: F401, F403 -from .Chat import * # noqa: F401, F403 -from .Common import * # noqa: F401, F403 -from .Docs import * # noqa: F401, F403 -from .Entries import * # noqa: F401, F403 -from .Executions import * # noqa: F401, F403 -from .Jobs import * # noqa: F401, F403 -from .Sessions import * # noqa: F401, F403 -from .Tasks import * # noqa: F401, F403 -from .Tools import * # noqa: F401, F403 -from .Users import * # noqa: F401, F403 - -CreateOrUpdateAgentRequest = UpdateAgentRequest \ No newline at end of file +# ruff: noqa: F401, F403, F405 +from uuid import UUID + +from .Agents import * +from .Chat import * +from .Common import * +from .Docs import * +from .Entries import * +from .Executions import * +from .Jobs import * +from .Sessions import * +from .Tasks import * +from .Tools import * +from .Users import * + +CreateOrUpdateAgentRequest = UpdateAgentRequest +CreateOrUpdateUserRequest = UpdateUserRequest +ChatMLRole = Entry.model_fields["role"].annotation + +def make_session( + *, + agents: list[UUID], + users: list[UUID], + **data: dict, +) -> Session: + """ + Create a new session object. + """ + cls, participants = None, {} + match (len(agents), len(users)): + case (0, _): + raise ValueError("At least one agent must be provided.") + case (1, 0): + cls = SingleAgentNoUserSession + participants = {"agent": agents[0]} + case (1, 1): + cls = SingleAgentSingleUserSession + participants = {"agent": agents[0], "user": users[0]} + case (1, u) if u > 1: + cls = SingleAgentMultiUserSession + participants = {"agent": agents[0], "users": users} + case _: + cls = MultiAgentMultiUserSession + participants = {"agents": agents, "users": users} + + return cls( + **data, + **participants, + ) \ No newline at end of file diff --git a/agents-api/agents_api/common/protocol/entries.py b/agents-api/agents_api/common/protocol/entries.py index 8abb062e0..1a06e089f 100644 --- a/agents-api/agents_api/common/protocol/entries.py +++ b/agents-api/agents_api/common/protocol/entries.py @@ -4,10 +4,9 @@ from pydantic import BaseModel, Field, computed_field from agents_api.autogen.openapi_model import ( - Role, + ChatMLRole, ChatMLImageContentPart, ChatMLTextContentPart, - ImageDetail, ) from agents_api.common.utils.datetime import utcnow @@ -27,7 +26,7 @@ class Entry(BaseModel): ) # Uses a default factory to generate a unique UUID session_id: UUID source: EntrySource = Field(default="api_request") - role: Role + role: ChatMLRole name: str | None = None content: str | list[ChatMLTextContentPart] | list[ChatMLImageContentPart] | dict tokenizer: str = Field(default="character_count") @@ -55,7 +54,7 @@ def token_count(self) -> int: elif isinstance(part, ChatMLImageContentPart): content_length += ( LOW_IMAGE_TOKEN_COUNT - if part.image_url.detail == ImageDetail.low + if part.image_url.detail == "low" else HIGH_IMAGE_TOKEN_COUNT ) diff --git a/agents-api/agents_api/models/agent/create_or_update_agent.py b/agents-api/agents_api/models/agent/create_or_update_agent.py index 5c4f7a687..60e09e751 100644 --- a/agents-api/agents_api/models/agent/create_or_update_agent.py +++ b/agents-api/agents_api/models/agent/create_or_update_agent.py @@ -3,7 +3,7 @@ It includes functions to construct and execute datalog queries for inserting new agent records. """ -from uuid import UUID, uuid4 +from uuid import UUID from beartype import beartype @@ -48,7 +48,9 @@ def create_or_update_agent_query( if isinstance(create_or_update_agent.instructions, list) else [create_or_update_agent.instructions] ) - create_or_update_agent.default_settings = create_or_update_agent.default_settings or {} + create_or_update_agent.default_settings = ( + create_or_update_agent.default_settings or {} + ) agent_data = create_or_update_agent.model_dump() default_settings = agent_data.pop("default_settings") diff --git a/agents-api/agents_api/models/agent/create_tools.py b/agents-api/agents_api/models/agent/create_tools.py deleted file mode 100644 index 9e3484348..000000000 --- a/agents-api/agents_api/models/agent/create_tools.py +++ /dev/null @@ -1,78 +0,0 @@ -"""This module contains functions for creating tools in the CozoDB database.""" - -from uuid import UUID, uuid4 - -from beartype import beartype - -from ...autogen.openapi_model import CreateToolRequest, Tool - -from ..utils import ( - cozo_query, - verify_developer_id_query, - verify_developer_owns_resource_query, - wrap_in_class, -) - - -@wrap_in_class( - Tool, - transform=lambda d: { - "id": UUID(d.pop("tool_id")), - d["type"]: d.pop("spec"), - **d, - }, -) -@cozo_query -@beartype -def create_tools_query( - *, - developer_id: UUID, - agent_id: UUID, - create_tools: list[CreateToolRequest], -) -> tuple[str, dict]: - """ - Constructs a datalog query for inserting tool records into the 'agent_functions' relation in the CozoDB. - - Parameters: - - agent_id (UUID): The unique identifier for the agent. - - create_tools (list[CreateToolRequest]): A list of function definitions to be inserted. - - Returns: - list[Tool] - """ - - tools_data = [ - [ - str(agent_id), - str(uuid4()), - tool.type, - tool.name, - getattr(tool, tool.type).dict(), - ] - for tool in create_tools - ] - - # Datalog query for inserting new tool records into the 'agent_functions' relation - create_tools_query = """ - ?[agent_id, tool_id, type, name, spec] <- $records - - :insert tools { - agent_id, - tool_id, - type, - name, - spec, - } - :returning - """ - - queries = [ - verify_developer_id_query(developer_id), - verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), - create_tools_query, - ] - - query = "}\n\n{\n".join(queries) - query = f"{{ {query} }}" - - return (query, {"records": tools_data}) diff --git a/agents-api/agents_api/models/agent/list_agents.py b/agents-api/agents_api/models/agent/list_agents.py index 4fdb8403c..5eebb3a65 100644 --- a/agents-api/agents_api/models/agent/list_agents.py +++ b/agents-api/agents_api/models/agent/list_agents.py @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, Literal from uuid import UUID from beartype import beartype @@ -21,6 +21,8 @@ def list_agents_query( developer_id: UUID, limit: int = 100, offset: int = 0, + sort_by: Literal["created_at", "updated_at", "deleted_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", metadata_filter: dict[str, Any] = {}, ) -> tuple[str, dict]: """ @@ -44,6 +46,8 @@ def list_agents_query( ] ) + sort = f"{'-' if direction == 'desc' else ''}{sort_by}" + # Datalog query to retrieve agent information based on filters, sorted by creation date in descending order. queries = [ verify_developer_id_query(developer_id), @@ -75,7 +79,7 @@ def list_agents_query( :limit $limit :offset $offset - :sort -created_at + :sort {sort} """, ] diff --git a/agents-api/agents_api/models/agent/patch_agent.py b/agents-api/agents_api/models/agent/patch_agent.py index ea2b43355..7932e70da 100644 --- a/agents-api/agents_api/models/agent/patch_agent.py +++ b/agents-api/agents_api/models/agent/patch_agent.py @@ -52,7 +52,7 @@ def patch_agent_query( } ) - agent_update_query = f""" + update_query = f""" # update the agent input[{agent_update_cols}] <- $agent_update_vals @@ -62,7 +62,6 @@ def patch_agent_query( agent_id: to_uuid($agent_id), metadata: md, }}, - # agent_id = to_uuid($agent_id), metadata = concat(md, $metadata) :update agents {{ @@ -92,7 +91,7 @@ def patch_agent_query( # Combine agent and settings update queries if default settings are provided. # Combine the queries - queries = [agent_update_query] + queries = [update_query] if len(default_settings) != 0: queries.insert(0, settings_update_query) diff --git a/agents-api/agents_api/models/agent/update_agent.py b/agents-api/agents_api/models/agent/update_agent.py index cdda45ae3..a32d041d8 100644 --- a/agents-api/agents_api/models/agent/update_agent.py +++ b/agents-api/agents_api/models/agent/update_agent.py @@ -9,7 +9,6 @@ from ...autogen.openapi_model import UpdateAgentRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data -from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, verify_developer_id_query, @@ -58,6 +57,19 @@ def update_agent_query( else [update_data["instructions"]] ) + assertion_query = """ + ?[developer_id, agent_id] := + *agents { + developer_id, + agent_id, + }, + developer_id = to_uuid($developer_id), + agent_id = to_uuid($agent_id), + + # Assertion to ensure the agent exists before updating. + :assert some + """ + # Construct the agent update part of the query with dynamic columns and values based on `update_data`. # Agent update query agent_update_cols, agent_update_vals = cozo_process_mutate_data( @@ -68,7 +80,7 @@ def update_agent_query( } ) - agent_update_query = f""" + update_query = f""" # update the agent input[{agent_update_cols}] <- $agent_update_vals original[created_at] := *agents{{ @@ -110,7 +122,7 @@ def update_agent_query( # Combine agent and settings update queries into a single query string. # Combine the queries - queries = [agent_update_query] + queries = [update_query] if len(default_settings) != 0: queries.insert(0, settings_update_query) @@ -119,6 +131,7 @@ def update_agent_query( queries = [ verify_developer_id_query(developer_id), verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + assertion_query, *queries, ] diff --git a/agents-api/agents_api/models/agent/update_tool.py b/agents-api/agents_api/models/agent/update_tool.py deleted file mode 100644 index c62be074b..000000000 --- a/agents-api/agents_api/models/agent/update_tool.py +++ /dev/null @@ -1,46 +0,0 @@ -from uuid import UUID - - -from ...autogen.openapi_model import FunctionDef - -from ..utils import cozo_query - - -@cozo_query -def update_tool_by_id_query( - agent_id: UUID, tool_id: UUID, function: FunctionDef, embedding: list[float] -) -> tuple[str, dict]: - # Agent update query - function = function.model_dump() - params = { - "input": [ - [ - str(agent_id), - str(tool_id), - function["name"], - function.get("description", "") or "", - function.get("parameters", {}) or {}, - embedding, - ] - ] - } - - query = """ - input[agent_id, tool_id, name, description, parameters, embedding] <- $input - ?[agent_id, tool_id, name, description, parameters, embedding, updated_at] := - input[agent_id, tool_id, name, description, parameters, embedding], - updated_at= now() - - :put agent_functions { - agent_id, - tool_id, - name, - description, - parameters, - embedding, - updated_at, - } - :returning - """ - - return (query, params) diff --git a/agents-api/agents_api/models/session/create_session.py b/agents-api/agents_api/models/session/create_session.py index 8eebd5280..90dd5fa3a 100644 --- a/agents-api/agents_api/models/session/create_session.py +++ b/agents-api/agents_api/models/session/create_session.py @@ -3,63 +3,87 @@ It constructs and executes a datalog query to insert session data. """ -from beartype import beartype +from uuid import UUID, uuid4 -from uuid import UUID +from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Session, CreateSessionRequest +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class( + Session, + one=True, + transform=lambda d: { + "id": UUID(d.pop("session_id")), + "updated_at": (d.pop("updated_at")[0]), + **d, + }, +) @cozo_query @beartype def create_session_query( - session_id: UUID, + *, developer_id: UUID, - agent_id: UUID, - user_id: UUID | None, - situation: str | None, - metadata: dict = {}, - render_templates: bool = False, - token_budget: int | None = None, - context_overflow: str | None = None, + session_id: UUID | None = None, + create_session: CreateSessionRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new session in the database. - - Parameters: - - session_id (UUID): The unique identifier for the session. - - developer_id (UUID): The unique identifier for the developer. - - agent_id (UUID): The unique identifier for the agent. - - user_id (UUID | None): The unique identifier for the user, if applicable. - - situation (str | None): The situation/context of the session. - - metadata (dict): Additional metadata for the session. - - render_templates (bool): Specifies whether to render templates. - - token_budget (int | None): Token count threshold to consider it as a context window overflow - - context_overflow (str | None): Action to take on context window overflow - - Returns: - - pd.DataFrame: The result of the query execution. """ - situation: str = situation or "" + session_id = session_id or uuid4() + + create_session.metadata = create_session.metadata or {} + session_data = create_session.model_dump() + + user = session_data.pop("user") + agent = session_data.pop("agent") + users = session_data.pop("users") + agents = session_data.pop("agents") + + # Only one of agent or agents should be provided. + if agent and agents: + raise ValueError("Only one of 'agent' or 'agents' should be provided.") + + agents = agents or ([agent] if agent else []) + assert len(agents) > 0, "At least one agent must be provided." + + # Users are zero or more, so we default to an empty list if not provided. + if not (user or users): + users = [] + + else: + users = users or [user] + + participants = [ + *[("user", str(user)) for user in users], + *[("agent", str(agent)) for agent in agents], + ] # Construct the datalog query for creating a new session and its lookup. - query = """ - { + lookup_query = """ # This section creates a new session lookup to ensure uniqueness and manage session metadata. - ?[session_id, agent_id, user_id] <- [[ - $session_id, - $agent_id, - $user_id, - ]] + session[session_id] <- [[$session_id]] + participants[participant_type, participant_id] <- $participants + ?[session_id, participant_id, participant_type] := + session[session_id], + participants[participant_type, participant_id], :insert session_lookup { - agent_id, - user_id, session_id, + participant_id, + participant_type, } - } { + """ + + create_query = """ # Insert the new session data into the 'session' table with the specified columns. ?[session_id, developer_id, situation, metadata, render_templates, token_budget, context_overflow] <- [[ $session_id, @@ -82,20 +106,32 @@ def create_session_query( } # Specify the data to return after the query execution, typically the newly created session's ID. :returning - }""" + """ + + queries = [ + verify_developer_id_query(developer_id), + *[ + verify_developer_owns_resource_query( + developer_id, + f"{participant_type}s", + **{f"{participant_type}_id": participant_id}, + ) + for participant_type, participant_id in participants + ], + lookup_query, + create_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" # Execute the constructed query with the provided parameters and return the result. return ( query, { "session_id": str(session_id), - "agent_id": str(agent_id), - "user_id": str(user_id) if user_id else None, "developer_id": str(developer_id), - "situation": situation, - "metadata": metadata, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, + "participants": participants, + **session_data, }, ) diff --git a/agents-api/agents_api/models/session/get_session.py b/agents-api/agents_api/models/session/get_session.py index 09b763489..0af38b0d0 100644 --- a/agents-api/agents_api/models/session/get_session.py +++ b/agents-api/agents_api/models/session/get_session.py @@ -3,12 +3,20 @@ from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import make_session +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class(make_session, one=True) @cozo_query @beartype def get_session_query( + *, developer_id: UUID, session_id: UUID, ) -> tuple[str, dict]: @@ -18,9 +26,6 @@ def get_session_query( Parameters: developer_id (UUID): The developer's unique identifier. session_id (UUID): The session's unique identifier. - - Returns: - pd.DataFrame: The result of the query as a pandas DataFrame. """ session_id = str(session_id) developer_id = str(developer_id) @@ -28,15 +33,23 @@ def get_session_query( # This query retrieves session information by using `input` to pass parameters, # projects specific fields from the `sessions` and `session_lookup` relations, # and converts `updated_at` to an integer for easier handling. - query = """ + get_query = """ input[developer_id, session_id] <- [[ to_uuid($developer_id), to_uuid($session_id), ]] + participants[collect(participant_id), participant_type] := + input[_, session_id], + *session_lookup{ + session_id, + participant_id, + participant_type, + } + ?[ - agent_id, - user_id, + agents, + users, id, situation, summary, @@ -47,6 +60,8 @@ def get_session_query( token_budget, context_overflow, ] := input[developer_id, id], + participants[users, "user"], + participants[agents, "agent"], *sessions{ developer_id, session_id: id, @@ -59,11 +74,18 @@ def get_session_query( token_budget, context_overflow, @ "NOW" - }, - *session_lookup{ - agent_id, - user_id, - session_id: id, - }, updated_at = to_int(validity)""" + }, updated_at = to_int(validity) + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, "sessions", session_id=session_id + ), + get_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return (query, {"session_id": session_id, "developer_id": developer_id}) diff --git a/agents-api/agents_api/models/tools/create_tools.py b/agents-api/agents_api/models/tools/create_tools.py index 9fa151b27..6e333f619 100644 --- a/agents-api/agents_api/models/tools/create_tools.py +++ b/agents-api/agents_api/models/tools/create_tools.py @@ -1,87 +1,78 @@ -from uuid import uuid4, UUID +"""This module contains functions for creating tools in the CozoDB database.""" -from beartype import beartype - - -from ...autogen.openapi_model import FunctionDef -from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query -from ...common.utils.datetime import utcnow - - -@cozo_query -@beartype -def create_function_query( - agent_id: UUID, - id: UUID, - function: FunctionDef, -) -> tuple[str, dict]: - created_at = utcnow().timestamp() - - # Process function definitions - function = function.model_dump() +from uuid import UUID, uuid4 - function_data = { - "agent_id": str(agent_id), - "tool_id": str(id), - "created_at": created_at, - "name": function["name"], - "description": function["description"], - "parameters": function.get("parameters", {}), - } - - function_cols, function_rows = cozo_process_mutate_data(function_data) +from beartype import beartype - query = f""" - {{ - # Create functions - ?[{function_cols}] <- $function_rows +from ...autogen.openapi_model import CreateToolRequest, Tool - :insert agent_functions {{ - {function_cols} - }} - :returning - }}""" - - return (query, {"function_rows": function_rows}) +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class( + Tool, + transform=lambda d: { + "id": UUID(d.pop("tool_id")), + d["type"]: d.pop("spec"), + **d, + }, +) @cozo_query @beartype -def create_multiple_functions_query( +def create_tools_query( + *, + developer_id: UUID, agent_id: UUID, - functions: list[FunctionDef], + create_tools: list[CreateToolRequest], ) -> tuple[str, dict]: - agent_id = str(agent_id) - created_at = utcnow().timestamp() - - # Process function definitions - functions = [fn.model_dump() for fn in functions] - - function_cols, function_rows = "", [] - - for function in functions: - function_data = { - "agent_id": agent_id, - "created_at": created_at, - "tool_id": str(uuid4()), - "name": function["name"], - "description": function["description"], - "parameters": function["parameters"], + """ + Constructs a datalog query for inserting tool records into the 'agent_functions' relation in the CozoDB. + + Parameters: + - agent_id (UUID): The unique identifier for the agent. + - create_tools (list[CreateToolRequest]): A list of function definitions to be inserted. + + Returns: + list[Tool] + """ + + tools_data = [ + [ + str(agent_id), + str(uuid4()), + tool.type, + tool.name, + getattr(tool, tool.type).dict(), + ] + for tool in create_tools + ] + + # Datalog query for inserting new tool records into the 'agent_functions' relation + create_query = """ + ?[agent_id, tool_id, type, name, spec] <- $records + + :insert tools { + agent_id, + tool_id, + type, + name, + spec, } + :returning + """ - function_cols, new_function_rows = cozo_process_mutate_data(function_data) - function_rows += new_function_rows - - query = f""" - {{ - # Create functions - ?[{function_cols}] <- $function_rows + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + create_query, + ] - :insert agent_functions {{ - {function_cols} - }} - :returning - }}""" + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" - return (query, {"function_rows": function_rows}) + return (query, {"records": tools_data}) diff --git a/agents-api/agents_api/models/tools/delete_tools.py b/agents-api/agents_api/models/tools/delete_tools.py index f68d7391d..655bfe85e 100644 --- a/agents-api/agents_api/models/tools/delete_tools.py +++ b/agents-api/agents_api/models/tools/delete_tools.py @@ -3,31 +3,53 @@ from beartype import beartype -from ..utils import cozo_query - - +from ...autogen.openapi_model import ResourceDeletedResponse +from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@wrap_in_class( + ResourceDeletedResponse, + one=True, + transform=lambda d: {"id": d["tool_id"], "deleted_at": utcnow(), "jobs": [], **d}, +) @cozo_query @beartype -def delete_function_by_id_query( +def delete_tool_query( + *, + developer_id: UUID, agent_id: UUID, tool_id: UUID, ) -> tuple[str, dict]: agent_id = str(agent_id) tool_id = str(tool_id) - query = """ - { + delete_query = """ # Delete function ?[tool_id, agent_id] <- [[ to_uuid($tool_id), to_uuid($agent_id), ]] - :delete agent_functions { + :delete tools { tool_id, agent_id, } :returning - }""" + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + delete_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return (query, {"tool_id": tool_id, "agent_id": agent_id}) diff --git a/agents-api/agents_api/models/tools/embed_tools.py b/agents-api/agents_api/models/tools/embed_tools.py deleted file mode 100644 index cfdc1b56a..000000000 --- a/agents-api/agents_api/models/tools/embed_tools.py +++ /dev/null @@ -1,35 +0,0 @@ -from uuid import UUID - -from beartype import beartype - - -from ..utils import cozo_query - - -@cozo_query -@beartype -def embed_functions_query( - agent_id: UUID, - tool_ids: list[UUID], - embeddings: list[list[float]], -) -> tuple[str, dict]: - agent_id = str(agent_id) - tool_ids = [str(id) for id in tool_ids] - assert len(tool_ids) == len(embeddings) - - records = [ - [agent_id, tool_id, embedding] - for tool_id, embedding in zip(tool_ids, embeddings) - ] - - query = """ - { - ?[agent_id, tool_id, embedding] <- $records - - :update agent_functions { - agent_id, tool_id, embedding - } - :returning - }""" - - return (query, {"records": records}) diff --git a/agents-api/agents_api/models/tools/get_tool.py b/agents-api/agents_api/models/tools/get_tool.py new file mode 100644 index 000000000..2899ad23d --- /dev/null +++ b/agents-api/agents_api/models/tools/get_tool.py @@ -0,0 +1,67 @@ +from uuid import UUID + +from beartype import beartype + + +from ...autogen.openapi_model import Tool +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@wrap_in_class( + Tool, + transform=lambda d: { + "id": UUID(d.pop("tool_id")), + d["type"]: d.pop("spec"), + **d, + }, + one=True, +) +@cozo_query +@beartype +def get_tool_query( + *, + developer_id: UUID, + agent_id: UUID, + tool_id: UUID, +) -> tuple[str, dict]: + agent_id = str(agent_id) + tool_id = str(tool_id) + + get_query = """ + input[agent_id, tool_id] <- [[to_uuid($agent_id), to_uuid($tool_id)]] + + ?[ + agent_id, + tool_id, + type, + name, + spec, + updated_at, + created_at, + ] := input[agent_id, tool_id], + *tools { + agent_id, + tool_id, + name, + type, + spec, + updated_at, + created_at, + } + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + get_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"agent_id": agent_id, "tool_id": tool_id}) diff --git a/agents-api/agents_api/models/tools/get_tools.py b/agents-api/agents_api/models/tools/get_tools.py deleted file mode 100644 index 2f392d3c3..000000000 --- a/agents-api/agents_api/models/tools/get_tools.py +++ /dev/null @@ -1,42 +0,0 @@ -from uuid import UUID - -from beartype import beartype - - -from ..utils import cozo_query - - -@cozo_query -@beartype -def get_function_by_id_query( - agent_id: UUID, - tool_id: UUID, -) -> tuple[str, dict]: - agent_id = str(agent_id) - tool_id = str(tool_id) - - query = """ - { - input[agent_id, tool_id] <- [[to_uuid($agent_id), to_uuid($tool_id)]] - - ?[ - agent_id, - tool_id, - name, - description, - parameters, - updated_at, - created_at, - ] := input[agent_id, tool_id], - *agent_functions { - agent_id, - tool_id, - name, - description, - parameters, - updated_at, - created_at, - } - }""" - - return (query, {"agent_id": agent_id, "tool_id": tool_id}) diff --git a/agents-api/agents_api/models/tools/list_tools.py b/agents-api/agents_api/models/tools/list_tools.py index dfba19730..1e20a2e3d 100644 --- a/agents-api/agents_api/models/tools/list_tools.py +++ b/agents-api/agents_api/models/tools/list_tools.py @@ -1,45 +1,71 @@ +from typing import Literal from uuid import UUID from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Tool +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class(Tool) @cozo_query @beartype -def list_functions_by_agent_query( +def list_tools_query( + *, + developer_id: UUID, agent_id: UUID, limit: int = 100, offset: int = 0, + sort_by: Literal["created_at", "updated_at", "deleted_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", ) -> tuple[str, dict]: agent_id = str(agent_id) - query = """ - { + sort = f"{'-' if direction == 'desc' else ''}{sort_by}" + + list_query = f""" input[agent_id] <- [[to_uuid($agent_id)]] ?[ agent_id, - tool_id, + id, name, - description, - parameters, + type, + spec, updated_at, created_at, ] := input[agent_id], - *agent_functions { + *tools {{ agent_id, - tool_id, + tool_id: id, name, - description, - parameters, + type, + spec, updated_at, created_at, - } + }} :limit $limit :offset $offset - }""" + :sort {sort} + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + list_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" - return (query, {"agent_id": agent_id, "limit": limit, "offset": offset}) + return ( + query, + {"agent_id": agent_id, "limit": limit, "offset": offset}, + ) diff --git a/agents-api/agents_api/models/agent/patch_tool.py b/agents-api/agents_api/models/tools/patch_tool.py similarity index 53% rename from agents-api/agents_api/models/agent/patch_tool.py rename to agents-api/agents_api/models/tools/patch_tool.py index ebb2c331f..b063603c5 100644 --- a/agents-api/agents_api/models/agent/patch_tool.py +++ b/agents-api/agents_api/models/tools/patch_tool.py @@ -5,7 +5,12 @@ from ...autogen.openapi_model import PatchToolRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query, verify_developer_id_query, wrap_in_class +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) @wrap_in_class( @@ -15,8 +20,8 @@ ) @cozo_query @beartype -def patch_tool_by_id_query( - *, agent_id: UUID, tool_id: UUID, patch_tool: PatchToolRequest +def patch_tool_query( + *, developer_id: UUID, agent_id: UUID, tool_id: UUID, patch_tool: PatchToolRequest ) -> tuple[str, dict]: """ # Execute the datalog query and return the results as a DataFrame @@ -31,25 +36,27 @@ def patch_tool_by_id_query( - ResourceUpdatedResponse: The updated tool data. """ - # Extract the tool data from the payload - patch_data = patch_tool.model_dump() + patch_data = patch_tool.model_dump(exclude_none=True) # Assert that only one of the tool type fields is present - if tool_type := patch_data.get("type"): - assert patch_data[tool_type] is not None, f"Missing {tool_type} field" - else: - assert len([ - patch_data.get(tool_type) is not None for tool_type in ["function", "integration", "system", "api_call"] - ]) == 1, "Invalid tool update" + tool_specs = [ + (tool_type, patch_data.get(tool_type)) + for tool_type in ["function", "integration", "system", "api_call"] + if patch_data.get(tool_type) is not None + ] + + assert len(tool_specs) <= 1, "Invalid tool update" + tool_type, tool_spec = tool_specs[0] if tool_specs else (None, None) - patch_data["type"] = next( - tool_type for tool_type in ["function", "integration", "system", "api_call"] - if patch_data.get(tool_type) is not None - ) + if tool_type is not None: + patch_data["type"] = patch_data.get("type", tool_type) + assert patch_data["type"] == tool_type, "Invalid tool update" - # Rename the tool definition to 'spec' - patch_data["spec"] = patch_data.pop(patch_data["type"]) + if tool_spec is not None: + # Rename the tool definition to 'spec' + patch_data["spec"] = tool_spec + del patch_data[tool_type] tool_cols, tool_vals = cozo_process_mutate_data( { @@ -60,7 +67,7 @@ def patch_tool_by_id_query( ) # Construct the datalog query for updating the tool information - query = f""" + patch_query = f""" input[{tool_cols}] <- $input ?[{tool_cols}, updated_at] := @@ -71,4 +78,13 @@ def patch_tool_by_id_query( :returning """ - return (query, tool_vals) + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + patch_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, dict(input=tool_vals)) diff --git a/agents-api/agents_api/models/tools/search_tools.py b/agents-api/agents_api/models/tools/search_tools.py deleted file mode 100644 index 9c61babe7..000000000 --- a/agents-api/agents_api/models/tools/search_tools.py +++ /dev/null @@ -1,76 +0,0 @@ -from uuid import UUID - -from beartype import beartype - - -from ..utils import cozo_query - - -@cozo_query -@beartype -def search_functions_by_embedding_query( - agent_id: UUID, - query_embedding: list[float], - k: int = 3, - confidence: float = 0.8, -) -> tuple[str, dict]: - agent_id = str(agent_id) - radius: float = 1.0 - confidence - - query = """ - input[ - agent_id, - query_embedding, - ] <- [[ - to_uuid($agent_id), - vec($query_embedding), - ]] - - candidate[ - tool_id - ] := input[agent_id, _], - *agent_functions { - agent_id, - tool_id - } - - ?[ - agent_id, - tool_id, - name, - description, - parameters, - updated_at, - created_at, - distance, - vector, - ] := input[agent_id, query_embedding], - candidate[tool_id], - ~agent_functions:embedding_space { - agent_id, - tool_id, - name, - description, - parameters, - updated_at, - created_at | - query: query_embedding, - k: $k, - ef: 128, - radius: $radius, - bind_distance: distance, - bind_vector: vector, - } - - :sort distance - """ - - return ( - query, - { - "agent_id": agent_id, - "query_embedding": query_embedding, - "k": k, - "radius": radius, - }, - ) diff --git a/agents-api/agents_api/models/tools/test_tool_queries.py b/agents-api/agents_api/models/tools/test_tool_queries.py index f47f6e7b2..be68d10bb 100644 --- a/agents-api/agents_api/models/tools/test_tool_queries.py +++ b/agents-api/agents_api/models/tools/test_tool_queries.py @@ -8,10 +8,8 @@ from ...autogen.openapi_model import FunctionDef from .create_tools import create_function_query, create_multiple_functions_query from .delete_tools import delete_function_by_id_query -from .embed_tools import embed_functions_query -from .get_tools import get_function_by_id_query +from .get_tool import get_function_by_id_query from .list_tools import list_functions_by_agent_query -from .search_tools import search_functions_by_embedding_query def cozo_client(migrations_dir: str = "./migrations"): @@ -127,54 +125,3 @@ def _(): result = list_functions_by_agent_query(agent_id, client=client) assert len(result["tool_id"]) == num_functions - - -@test("model: embed functions") -def _(): - client = cozo_client() - - agent_id = uuid4() - tool_id = uuid4() - function = FunctionDef( - name="hello_world", - description="A function that prints hello world", - parameters={"type": "object", "properties": {}}, - ) - - # Create function - create_function_query(agent_id, tool_id, function, client=client) - - # embed functions - embedding = [1.0] * 768 - embed_functions_query(agent_id, [tool_id], [embedding], client=client) - - -@test("model: search functions") -def _(): - client = cozo_client() - - agent_id = uuid4() - tool_id = uuid4() - function = FunctionDef( - name="hello_world", - description="A function that prints hello world", - parameters={"type": "object", "properties": {}}, - ) - - # Create function - create_function_query(agent_id, tool_id, function, client=client) - - # embed functions - embedding = [1.0] * 768 - embed_functions_query(agent_id, [tool_id], [embedding], client=client) - - ### Search - query_embedding = [0.99] * 768 - - result = search_functions_by_embedding_query( - agent_id, - query_embedding, - client=client, - ) - - assert len(result) == 1, "Only 1 should have been found" diff --git a/agents-api/agents_api/models/tools/update_tool.py b/agents-api/agents_api/models/tools/update_tool.py new file mode 100644 index 000000000..63459f6bc --- /dev/null +++ b/agents-api/agents_api/models/tools/update_tool.py @@ -0,0 +1,29 @@ +from uuid import UUID + +from beartype import beartype + +from ...autogen.openapi_model import ( + PatchToolRequest, + ResourceUpdatedResponse, + UpdateToolRequest, +) +from .patch_tool import patch_tool_query + + +@beartype +def update_tool_query( + *, + developer_id: UUID, + agent_id: UUID, + tool_id: UUID, + update_tool: UpdateToolRequest, + **kwargs +) -> ResourceUpdatedResponse: + # Same as patch_tool_query, but with a different request payload + return patch_tool_query( + developer_id=developer_id, + agent_id=agent_id, + tool_id=tool_id, + patch_tool=PatchToolRequest(**update_tool.model_dump()), + **kwargs, + ) diff --git a/agents-api/agents_api/models/user/create_or_update_user.py b/agents-api/agents_api/models/user/create_or_update_user.py new file mode 100644 index 000000000..34dbf9348 --- /dev/null +++ b/agents-api/agents_api/models/user/create_or_update_user.py @@ -0,0 +1,92 @@ +""" +This module contains the functionality for creating users in the CozoDB database. +It includes functions to construct and execute datalog queries for inserting new user records. +""" + +from uuid import UUID + +from beartype import beartype + +from ...autogen.openapi_model import User, CreateOrUpdateUserRequest +from ..utils import cozo_query, verify_developer_id_query, wrap_in_class + + +@wrap_in_class(User, one=True, transform=lambda d: {"id": UUID(d.pop("user_id")), **d}) +@cozo_query +@beartype +def create_or_update_user_query( + *, + developer_id: UUID, + user_id: UUID, + create_or_update_user: CreateOrUpdateUserRequest, +) -> tuple[str, dict]: + """ + Constructs and executes a datalog query to create a new user in the database. + + Parameters: + - user_id (UUID): The unique identifier for the user. + - developer_id (UUID): The unique identifier for the developer creating the user. + - name (str): The name of the user. + - about (str): A description of the user. + - metadata (dict, optional): A dictionary of metadata for the user. Defaults to an empty dict. + - client (CozoClient, optional): The CozoDB client instance to use for the query. Defaults to a preconfigured client instance. + + Returns: + User: The newly created user record. + """ + + # Extract the user data from the payload + create_or_update_user.metadata = create_or_update_user.metadata or {} + + user_data = create_or_update_user.model_dump() + + # Create the user + # Construct a query to insert the new user record into the users table + user_query = """ + input[user_id, developer_id, name, about, metadata, updated_at] <- [ + [$user_id, $developer_id, $name, $about, $metadata, now()] + ] + + ?[user_id, developer_id, name, about, metadata, created_at, updated_at] := + input[_user_id, developer_id, name, about, metadata, updated_at], + *users{ + user_id, + created_at, + }, + user_id = to_uuid(_user_id), + + ?[user_id, developer_id, name, about, metadata, created_at, updated_at] := + input[_user_id, developer_id, name, about, metadata, updated_at], + not *users{ + user_id, + }, created_at = now(), + user_id = to_uuid(_user_id), + + :put users { + developer_id, + user_id => + name, + about, + metadata, + created_at, + updated_at, + } + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + user_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return ( + query, + { + "user_id": str(user_id), + "developer_id": str(developer_id), + **user_data, + }, + ) diff --git a/agents-api/agents_api/models/user/create_user.py b/agents-api/agents_api/models/user/create_user.py index 39b653069..28001bc95 100644 --- a/agents-api/agents_api/models/user/create_user.py +++ b/agents-api/agents_api/models/user/create_user.py @@ -5,20 +5,21 @@ from beartype import beartype -from uuid import UUID +from uuid import uuid4, UUID -from ..utils import cozo_query +from ...autogen.openapi_model import User, CreateUserRequest +from ..utils import cozo_query, verify_developer_id_query, wrap_in_class +@wrap_in_class(User, one=True, transform=lambda d: {"id": UUID(d.pop("user_id")), **d}) @cozo_query @beartype def create_user_query( - user_id: UUID, + *, developer_id: UUID, - name: str, - about: str, - metadata: dict = {}, + user_id: UUID | None = None, + create_user: CreateUserRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new user in the CozoDB database. @@ -35,8 +36,11 @@ def create_user_query( pd.DataFrame: A DataFrame containing the result of the query execution. """ - query = """ - { + user_id = user_id or uuid4() + create_user.metadata = create_user.metadata or {} + user_data = create_user.model_dump() + + create_query = """ # Then create the user ?[user_id, developer_id, name, about, metadata] <- [ [to_uuid($user_id), to_uuid($developer_id), $name, $about, $metadata] @@ -50,15 +54,21 @@ def create_user_query( metadata, } :returning - }""" + """ + + queries = [ + verify_developer_id_query(developer_id), + create_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( query, { "user_id": str(user_id), "developer_id": str(developer_id), - "name": name, - "about": about, - "metadata": metadata, + **user_data, }, ) diff --git a/agents-api/agents_api/models/user/get_user.py b/agents-api/agents_api/models/user/get_user.py index e0c5380a4..16783037f 100644 --- a/agents-api/agents_api/models/user/get_user.py +++ b/agents-api/agents_api/models/user/get_user.py @@ -3,12 +3,20 @@ from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import User +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class(User, one=True) @cozo_query @beartype def get_user_query( + *, developer_id: UUID, user_id: UUID, ) -> tuple[str, dict]: @@ -16,7 +24,7 @@ def get_user_query( user_id = str(user_id) developer_id = str(developer_id) - query = """ + get_query = """ input[developer_id, user_id] <- [[to_uuid($developer_id), to_uuid($user_id)]] ?[ @@ -37,4 +45,13 @@ def get_user_query( metadata, }""" + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "users", user_id=user_id), + get_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + return (query, {"developer_id": developer_id, "user_id": user_id}) diff --git a/agents-api/agents_api/models/user/list_users.py b/agents-api/agents_api/models/user/list_users.py index c56a0c07b..907d5c60e 100644 --- a/agents-api/agents_api/models/user/list_users.py +++ b/agents-api/agents_api/models/user/list_users.py @@ -1,19 +1,27 @@ -from typing import Any +from typing import Any, Literal from uuid import UUID from beartype import beartype - -from ..utils import cozo_query +from ...autogen.openapi_model import User from ...common.utils import json +from ..utils import ( + cozo_query, + verify_developer_id_query, + wrap_in_class, +) +@wrap_in_class(User) @cozo_query @beartype def list_users_query( + *, developer_id: UUID, limit: int = 100, offset: int = 0, + sort_by: Literal["created_at", "updated_at", "deleted_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", metadata_filter: dict[str, Any] = {}, ) -> tuple[str, dict]: """ @@ -36,8 +44,10 @@ def list_users_query( ] ) + sort = f"{'-' if direction == 'desc' else ''}{sort_by}" + # Define the datalog query for retrieving user information based on the specified filters and sorting them by creation date in descending order. - query = f""" + list_query = f""" input[developer_id] <- [[to_uuid($developer_id)]] ?[ @@ -62,9 +72,17 @@ def list_users_query( :limit $limit :offset $offset - :sort -created_at + :sort {sort} """ + queries = [ + verify_developer_id_query(developer_id), + list_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + # Execute the datalog query with the specified parameters and return the results as a DataFrame. return ( query, diff --git a/agents-api/agents_api/models/user/patch_user.py b/agents-api/agents_api/models/user/patch_user.py index 48d30ff2f..0f72845f6 100644 --- a/agents-api/agents_api/models/user/patch_user.py +++ b/agents-api/agents_api/models/user/patch_user.py @@ -1,19 +1,33 @@ """Module for generating datalog queries to update user information in the 'cozodb' database.""" -from beartype import beartype - from uuid import UUID +from beartype import beartype + +from ...autogen.openapi_model import PatchUserRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: {"id": d["user_id"], "jobs": [], **d}, +) @cozo_query @beartype def patch_user_query( - developer_id: UUID, user_id: UUID, **update_data + *, + developer_id: UUID, + user_id: UUID, + patch_user: PatchUserRequest, ) -> tuple[str, dict]: """ Generates a datalog query for updating a user's information. @@ -27,6 +41,8 @@ def patch_user_query( - tuple[str, dict]: A pandas DataFrame containing the results of the query execution. """ + update_data = patch_user.model_dump(exclude_unset=True) + # Prepare data for mutation by filtering out None values and adding system-generated fields. metadata = update_data.pop("metadata", {}) or {} user_update_cols, user_update_vals = cozo_process_mutate_data( @@ -39,8 +55,7 @@ def patch_user_query( ) # Construct the datalog query for updating user information. - # TODO: Modify user update to modify `updated_at` field - query = f""" + update_query = f""" # update the user input[{user_update_cols}] <- $user_update_vals @@ -58,6 +73,15 @@ def patch_user_query( :returning """ + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "users", user_id=user_id), + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + return ( query, { diff --git a/agents-api/agents_api/models/user/update_user.py b/agents-api/agents_api/models/user/update_user.py index 3a50db119..d1e3989e2 100644 --- a/agents-api/agents_api/models/user/update_user.py +++ b/agents-api/agents_api/models/user/update_user.py @@ -3,14 +3,25 @@ from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import UpdateUserRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: {"id": d["user_id"], "jobs": [], **d}, +) @cozo_query @beartype def update_user_query( - developer_id: UUID, user_id: UUID, **update_data + *, developer_id: UUID, user_id: UUID, update_user: UpdateUserRequest ) -> tuple[str, dict]: """Updates user information in the 'cozodb' database. @@ -25,6 +36,8 @@ def update_user_query( """ user_id = str(user_id) developer_id = str(developer_id) + update_data = update_user.model_dump() + # Prepares the update data by filtering out None values and adding user_id and developer_id. user_update_cols, user_update_vals = cozo_process_mutate_data( { @@ -48,7 +61,7 @@ def update_user_query( """ # Constructs the update operation for the user, setting new values and updating 'updated_at'. - query = f""" + update_query = f""" # update the user # This line updates the user's information based on the provided columns and values. input[{user_update_cols}] <- $user_update_vals @@ -71,8 +84,16 @@ def update_user_query( :returning """ - query = "{" + assertion_query + "} {" + query + "}" - # Combines the assertion and update queries. + # Combine the assertion query with the update queries + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "users", user_id=user_id), + assertion_query, + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( query, diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index 37c202545..f8b004757 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -53,19 +53,34 @@ def cozo_query_dec(func: Callable[P, tuple[str, dict]]): and then run the query using the client, returning a DataFrame. """ + if debug: + from pprint import pprint + @wraps(func) def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: query, variables = func(*args, **kwargs) - result = client.run(query, variables) + debug and pprint( + dict( + query=query, + variables=variables, + ) + ) - if debug: - from pprint import pprint + result = client.run(query, variables) - pprint(dict(query=query, variables=variables, result=result.to_dict(orient="records"))) + debug and pprint( + dict( + result=result.to_dict(orient="records"), + ) + ) return result + # Set the wrapped function as an attribute of the wrapper, + # forwards the __wrapped__ attribute if it exists. + setattr(wrapper, "__wrapped__", getattr(func, "__wrapped__", func)) + return wrapper if func is not None and callable(func): @@ -75,16 +90,13 @@ def wrapper(*args, client=cozo_client, **kwargs) -> pd.DataFrame: def wrap_in_class( - cls: Type[BaseModel], + cls: Type[BaseModel] | Callable[..., BaseModel], one: bool = False, transform: Callable[[dict], dict] | None = None, ): - - @beartype def decorator(func: Callable[..., pd.DataFrame]): @wraps(func) - @beartype - def wrapper(*args, **kwargs) -> list[cls] | cls: + def wrapper(*args, **kwargs): df = func(*args, **kwargs) # Convert df to list of dicts @@ -97,7 +109,10 @@ def wrapper(*args, **kwargs) -> list[cls] | cls: return [cls(**item) for item in map(transform, data)] - setattr(cls, func.__name__, wrapper) + # Set the wrapped function as an attribute of the wrapper, + # forwards the __wrapped__ attribute if it exists. + setattr(wrapper, "__wrapped__", getattr(func, "__wrapped__", func)) + return wrapper return decorator diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index f59b5323e..10d3d0b3c 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -1465,13 +1465,13 @@ protobuf = ">=3.20.2,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4 [[package]] name = "google-cloud-storage" -version = "2.17.0" +version = "2.18.0" description = "Google Cloud Storage API client library" optional = false python-versions = ">=3.7" files = [ - {file = "google-cloud-storage-2.17.0.tar.gz", hash = "sha256:49378abff54ef656b52dca5ef0f2eba9aa83dc2b2c72c78714b03a1a95fe9388"}, - {file = "google_cloud_storage-2.17.0-py2.py3-none-any.whl", hash = "sha256:5b393bc766b7a3bc6f5407b9e665b2450d36282614b7945e570b3480a456d1e1"}, + {file = "google_cloud_storage-2.18.0-py2.py3-none-any.whl", hash = "sha256:e8e1a9577952143c3fca8163005ecfadd2d70ec080fa158a8b305000e2c22fbb"}, + {file = "google_cloud_storage-2.18.0.tar.gz", hash = "sha256:0aa3f7c57f3632f81b455d91558d2b27ada96eee2de3aaa17f689db1470d9578"}, ] [package.dependencies] @@ -1483,7 +1483,8 @@ google-resumable-media = ">=2.6.0" requests = ">=2.18.0,<3.0.0dev" [package.extras] -protobuf = ["protobuf (<5.0.0dev)"] +protobuf = ["protobuf (<6.0.0dev)"] +tracing = ["opentelemetry-api (>=1.1.0)"] [[package]] name = "google-crc32c" @@ -1820,13 +1821,13 @@ socks = ["socksio (==1.*)"] [[package]] name = "huggingface-hub" -version = "0.24.0" +version = "0.24.1" description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub" optional = false python-versions = ">=3.8.0" files = [ - {file = "huggingface_hub-0.24.0-py3-none-any.whl", hash = "sha256:7ad92edefb93d8145c061f6df8d99df2ff85f8379ba5fac8a95aca0642afa5d7"}, - {file = "huggingface_hub-0.24.0.tar.gz", hash = "sha256:6c7092736b577d89d57b3cdfea026f1b0dc2234ae783fa0d59caf1bf7d52dfa7"}, + {file = "huggingface_hub-0.24.1-py3-none-any.whl", hash = "sha256:d3a623d0f2cbb9399299aefc85e3423fa2689f18ab9b6e1aa0f95d1793889f30"}, + {file = "huggingface_hub-0.24.1.tar.gz", hash = "sha256:6915e34c7b1282b0f7c2387c12db21003b79889f1dad57da0434ecd10f3293a8"}, ] [package.dependencies] @@ -1890,13 +1891,13 @@ networkx = ">=2" [[package]] name = "importlib-metadata" -version = "8.0.0" +version = "8.1.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-8.0.0-py3-none-any.whl", hash = "sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f"}, - {file = "importlib_metadata-8.0.0.tar.gz", hash = "sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812"}, + {file = "importlib_metadata-8.1.0-py3-none-any.whl", hash = "sha256:3cd29f739ed65973840b068e3132135ce954c254d48b5b640484467ef7ab3c8c"}, + {file = "importlib_metadata-8.1.0.tar.gz", hash = "sha256:fcdcb1d5ead7bdf3dd32657bb94ebe9d2aabfe89a19782ddc32da5041d6ebfb4"}, ] [package.dependencies] @@ -5389,19 +5390,19 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "transformers" -version = "4.42.4" +version = "4.43.1" description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow" optional = false python-versions = ">=3.8.0" files = [ - {file = "transformers-4.42.4-py3-none-any.whl", hash = "sha256:6d59061392d0f1da312af29c962df9017ff3c0108c681a56d1bc981004d16d24"}, - {file = "transformers-4.42.4.tar.gz", hash = "sha256:f956e25e24df851f650cb2c158b6f4352dfae9d702f04c113ed24fc36ce7ae2d"}, + {file = "transformers-4.43.1-py3-none-any.whl", hash = "sha256:eb44b731902e062acbaff196ae4896d7cb3494ddf38275aa00a5fcfb5b34f17d"}, + {file = "transformers-4.43.1.tar.gz", hash = "sha256:662252c4d0e31b6684f68f68d5cc8206dd7f83da80eb3235be3dc5b3c9fdbdbd"}, ] [package.dependencies] filelock = "*" huggingface-hub = ">=0.23.2,<1.0" -numpy = ">=1.17,<2.0" +numpy = ">=1.17" packaging = ">=20.0" pyyaml = ">=5.1" regex = "!=2019.12.17" @@ -5413,14 +5414,14 @@ tqdm = ">=4.27" [package.extras] accelerate = ["accelerate (>=0.21.0)"] agents = ["Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "datasets (!=2.5.0)", "diffusers", "opencv-python", "sentencepiece (>=0.1.91,!=0.1.92)", "torch"] -all = ["Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "phonemizer", "protobuf", "pyctcdecode (>=0.4.0)", "ray[tune] (>=2.7.0)", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision"] +all = ["Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "codecarbon (==1.2.0)", "decord (==0.6.0)", "flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1,<0.14.0)", "librosa", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "phonemizer", "protobuf", "pyctcdecode (>=0.4.0)", "ray[tune] (>=2.7.0)", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision"] audio = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] benchmark = ["optimum-benchmark (>=0.2.0)"] codecarbon = ["codecarbon (==1.2.0)"] deepspeed = ["accelerate (>=0.21.0)", "deepspeed (>=0.9.3)"] deepspeed-testing = ["GitPython (<3.1.19)", "accelerate (>=0.21.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "deepspeed (>=0.9.3)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "nltk", "optuna", "parameterized", "protobuf", "psutil", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "timeout-decorator"] -dev = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "beautifulsoup4", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "decord (==0.6.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "flax (>=0.4.1,<=0.7.0)", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "ray[tune] (>=2.7.0)", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] -dev-tensorflow = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "isort (>=5.5.4)", "kenlm", "keras-nlp (>=0.3.1)", "librosa", "nltk", "onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "tokenizers (>=0.19,<0.20)", "urllib3 (<2.0.0)"] +dev = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "av (==9.2.0)", "beautifulsoup4", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "decord (==0.6.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "flax (>=0.4.1,<=0.7.0)", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "kenlm", "keras-nlp (>=0.3.1,<0.14.0)", "librosa", "nltk", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "ray[tune] (>=2.7.0)", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "scipy (<1.13.0)", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] +dev-tensorflow = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "isort (>=5.5.4)", "kenlm", "keras-nlp (>=0.3.1,<0.14.0)", "librosa", "nltk", "onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx", "timeout-decorator", "tokenizers (>=0.19,<0.20)", "urllib3 (<2.0.0)"] dev-torch = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.21.0)", "beautifulsoup4", "codecarbon (==1.2.0)", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "isort (>=5.5.4)", "kenlm", "librosa", "nltk", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "optuna", "parameterized", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "ray[tune] (>=2.7.0)", "rhoknp (>=1.1.0,<1.3.1)", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "scikit-learn", "sentencepiece (>=0.1.91,!=0.1.92)", "sigopt", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "tensorboard", "timeout-decorator", "timm (<=0.9.16)", "tokenizers (>=0.19,<0.20)", "torch", "torchaudio", "torchvision", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)", "urllib3 (<2.0.0)"] flax = ["flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "optax (>=0.0.8,<=0.1.4)", "scipy (<1.13.0)"] flax-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] @@ -5443,15 +5444,15 @@ sigopt = ["sigopt"] sklearn = ["scikit-learn"] speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"] testing = ["GitPython (<3.1.19)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (!=2.5.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "nltk", "parameterized", "psutil", "pydantic", "pytest (>=7.2.0,<8.0.0)", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.4.4)", "sacrebleu (>=1.4.12,<2.0.0)", "sacremoses", "sentencepiece (>=0.1.91,!=0.1.92)", "tensorboard", "timeout-decorator"] -tf = ["keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx"] -tf-cpu = ["keras (>2.9,<2.16)", "keras-nlp (>=0.3.1)", "onnxconverter-common", "tensorflow-cpu (>2.9,<2.16)", "tensorflow-probability (<0.24)", "tensorflow-text (<2.16)", "tf2onnx"] +tf = ["keras-nlp (>=0.3.1,<0.14.0)", "onnxconverter-common", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx"] +tf-cpu = ["keras (>2.9,<2.16)", "keras-nlp (>=0.3.1,<0.14.0)", "onnxconverter-common", "tensorflow-cpu (>2.9,<2.16)", "tensorflow-probability (<0.24)", "tensorflow-text (<2.16)", "tf2onnx"] tf-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"] timm = ["timm (<=0.9.16)"] tokenizers = ["tokenizers (>=0.19,<0.20)"] torch = ["accelerate (>=0.21.0)", "torch"] torch-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"] torch-vision = ["Pillow (>=10.0.1,<=15.0)", "torchvision"] -torchhub = ["filelock", "huggingface-hub (>=0.23.2,<1.0)", "importlib-metadata", "numpy (>=1.17,<2.0)", "packaging (>=20.0)", "protobuf", "regex (!=2019.12.17)", "requests", "sentencepiece (>=0.1.91,!=0.1.92)", "tokenizers (>=0.19,<0.20)", "torch", "tqdm (>=4.27)"] +torchhub = ["filelock", "huggingface-hub (>=0.23.2,<1.0)", "importlib-metadata", "numpy (>=1.17)", "packaging (>=20.0)", "protobuf", "regex (!=2019.12.17)", "requests", "sentencepiece (>=0.1.91,!=0.1.92)", "tokenizers (>=0.19,<0.20)", "torch", "tqdm (>=4.27)"] video = ["av (==9.2.0)", "decord (==0.6.0)"] vision = ["Pillow (>=10.0.1,<=15.0)"] diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index a7fc79989..78f968712 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -67,4 +67,33 @@ check = [ "typecheck", ] test = "ward" -codegen = "datamodel-codegen --input ../openapi.yaml --input-file-type openapi --output agents_api/autogen/ --use-operation-id-as-name --use-double-quotes --use-schema-description --target-python-version 3.10 --reuse-model --strict-nullable --openapi-scopes schemas --use-exact-imports --keep-model-order --disable-timestamp --allow-population-by-field-name --use-field-description --field-include-all-keys --use-unique-items-as-set --use-subclass-enum --use-union-operator --use-one-literal-as-default --use-default --use-annotated --enum-field-as-literal all --output-model-type pydantic_v2.BaseModel --field-constraints --use-standard-collections --use-non-positive-negative-number-constrained-types --use-pendulum --collapse-root-models" +codegen = """ +datamodel-codegen \ + --input ../openapi.yaml \ + --input-file-type openapi \ + --output agents_api/autogen/ \ + --output-model-type pydantic_v2.BaseModel \ + --strict-nullable \ + --allow-population-by-field-name \ + --field-include-all-keys \ + --enum-field-as-literal all \ + --field-constraints \ + --reuse-model \ + --use-operation-id-as-name \ + --use-schema-description \ + --use-field-description \ + --use-annotated \ + --use-default \ + --use-unique-items-as-set \ + --use-subclass-enum \ + --use-union-operator \ + --use-one-literal-as-default \ + --use-double-quotes \ + --use-exact-imports \ + --use-standard-collections \ + --use-non-positive-negative-number-constrained-types \ + --collapse-root-models \ + --target-python-version 3.10 \ + --openapi-scopes schemas \ + --keep-model-order \ + --disable-timestamp""" \ No newline at end of file diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index fd11722b1..931110e40 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -814,13 +814,13 @@ networkx = ">=2" [[package]] name = "importlib-metadata" -version = "8.0.0" +version = "8.1.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-8.0.0-py3-none-any.whl", hash = "sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f"}, - {file = "importlib_metadata-8.0.0.tar.gz", hash = "sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812"}, + {file = "importlib_metadata-8.1.0-py3-none-any.whl", hash = "sha256:3cd29f739ed65973840b068e3132135ce954c254d48b5b640484467ef7ab3c8c"}, + {file = "importlib_metadata-8.1.0.tar.gz", hash = "sha256:fcdcb1d5ead7bdf3dd32657bb94ebe9d2aabfe89a19782ddc32da5041d6ebfb4"}, ] [package.dependencies] diff --git a/typespec/users/models.tsp b/typespec/users/models.tsp index 218663cff..3bcd691ae 100644 --- a/typespec/users/models.tsp +++ b/typespec/users/models.tsp @@ -37,10 +37,6 @@ model PatchUserRequest is UpdateUserRequest {} /** Payload for creating a user (and associated documents) */ model CreateUserRequest { ...UpdateUserRequest; - - /** Documents to index for this user. (Max: 100 items) */ - @maxItems(100) - docs: unknown[] = #[]; } model CreateOrUpdateUserRequest { From c31f5636ed339bbf7d8d6aa6b2a1e19b81dcf3ff Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Thu, 25 Jul 2024 22:24:55 -0400 Subject: [PATCH 28/36] wip Signed-off-by: Diwank Tomer --- .../agents_api/autogen/openapi_model.py | 5 +- .../agents_api/models/agent/list_agents.py | 3 - .../agents_api/models/agent/update_agent.py | 15 -- .../session/create_or_update_session.py | 144 ++++++++++++++++++ .../models/session/delete_session.py | 58 +++++-- .../agents_api/models/session/get_session.py | 10 +- .../models/session/list_sessions.py | 61 ++++++-- .../models/session/patch_session.py | 57 ++++--- .../models/session/update_session.py | 57 ++++--- .../agents_api/models/user/update_user.py | 15 -- agents-api/agents_api/models/utils.py | 1 - typespec/chat/endpoints.tsp | 8 +- typespec/main.tsp | 3 + 13 files changed, 323 insertions(+), 114 deletions(-) create mode 100644 agents-api/agents_api/models/session/create_or_update_session.py diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index 22d916938..336f25c86 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -15,8 +15,11 @@ CreateOrUpdateAgentRequest = UpdateAgentRequest CreateOrUpdateUserRequest = UpdateUserRequest +CreateOrUpdateSessionRequest = CreateSessionRequest + ChatMLRole = Entry.model_fields["role"].annotation + def make_session( *, agents: list[UUID], @@ -46,4 +49,4 @@ def make_session( return cls( **data, **participants, - ) \ No newline at end of file + ) diff --git a/agents-api/agents_api/models/agent/list_agents.py b/agents-api/agents_api/models/agent/list_agents.py index 5eebb3a65..8dcb27606 100644 --- a/agents-api/agents_api/models/agent/list_agents.py +++ b/agents-api/agents_api/models/agent/list_agents.py @@ -34,9 +34,6 @@ def list_agents_query( offset: Number of agents to skip before starting to collect the result set. metadata_filter: Dictionary to filter agents based on metadata. client: Instance of CozoClient to execute the query. - - Returns: - A pandas DataFrame containing the query results. """ # Transforms the metadata_filter dictionary into a string representation for the datalog query. metadata_filter_str = ", ".join( diff --git a/agents-api/agents_api/models/agent/update_agent.py b/agents-api/agents_api/models/agent/update_agent.py index a32d041d8..af652a8e4 100644 --- a/agents-api/agents_api/models/agent/update_agent.py +++ b/agents-api/agents_api/models/agent/update_agent.py @@ -57,19 +57,6 @@ def update_agent_query( else [update_data["instructions"]] ) - assertion_query = """ - ?[developer_id, agent_id] := - *agents { - developer_id, - agent_id, - }, - developer_id = to_uuid($developer_id), - agent_id = to_uuid($agent_id), - - # Assertion to ensure the agent exists before updating. - :assert some - """ - # Construct the agent update part of the query with dynamic columns and values based on `update_data`. # Agent update query agent_update_cols, agent_update_vals = cozo_process_mutate_data( @@ -127,11 +114,9 @@ def update_agent_query( if len(default_settings) != 0: queries.insert(0, settings_update_query) - # Combine the assertion query with the update queries queries = [ verify_developer_id_query(developer_id), verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), - assertion_query, *queries, ] diff --git a/agents-api/agents_api/models/session/create_or_update_session.py b/agents-api/agents_api/models/session/create_or_update_session.py new file mode 100644 index 000000000..a5a3cf3ed --- /dev/null +++ b/agents-api/agents_api/models/session/create_or_update_session.py @@ -0,0 +1,144 @@ +from beartype import beartype + +from uuid import UUID + + +from ...autogen.openapi_model import ( + CreateOrUpdateSessionRequest, + ResourceUpdatedResponse, +) +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: { + "id": d["session_id"], + "updated_at": d.pop("updated_at")[0], + "jobs": [], + **d, + }, +) +@cozo_query(debug=True) +@beartype +def create_or_update_session_query( + *, + session_id: UUID, + developer_id: UUID, + create_or_update_session: CreateOrUpdateSessionRequest, +) -> tuple[str, dict]: + + create_or_update_session.metadata = create_or_update_session.metadata or {} + session_data = create_or_update_session.model_dump() + + user = session_data.pop("user") + agent = session_data.pop("agent") + users = session_data.pop("users") + agents = session_data.pop("agents") + + # Only one of agent or agents should be provided. + if agent and agents: + raise ValueError("Only one of 'agent' or 'agents' should be provided.") + + agents = agents or ([agent] if agent else []) + assert len(agents) > 0, "At least one agent must be provided." + + # Users are zero or more, so we default to an empty list if not provided. + if not (user or users): + users = [] + + else: + users = users or [user] + + participants = [ + *[("user", str(user)) for user in users], + *[("agent", str(agent)) for agent in agents], + ] + + # Construct the datalog query for creating a new session and its lookup. + clear_lookup_query = """ + input[session_id] <- [[$session_id]] + ?[session_id, participant_id, participant_type] := + input[session_id], + *session_lookup { + session_id, + participant_type, + participant_id, + }, + + :delete session_lookup { + session_id, + participant_type, + participant_id, + } + """ + + lookup_query = """ + # This section creates a new session lookup to ensure uniqueness and manage session metadata. + session[session_id] <- [[$session_id]] + participants[participant_type, participant_id] <- $participants + ?[session_id, participant_id, participant_type] := + session[session_id], + participants[participant_type, participant_id], + + :put session_lookup { + session_id, + participant_id, + participant_type, + } + """ + + session_update_cols, session_update_vals = cozo_process_mutate_data( + {k: v for k, v in session_data.items() if v is not None} + ) + + # Construct the datalog query for creating or updating session information. + update_query = f""" + input[{session_update_cols}] <- $session_update_vals + ids[session_id, developer_id] <- [[to_uuid($session_id), to_uuid($developer_id)]] + + ?[{session_update_cols}, session_id, developer_id] := + input[{session_update_cols}], + ids[session_id, developer_id], + + :put sessions {{ + {session_update_cols}, session_id, developer_id + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + *[ + verify_developer_owns_resource_query( + developer_id, + f"{participant_type}s", + **{f"{participant_type}_id": participant_id}, + ) + for participant_type, participant_id in participants + ], + clear_lookup_query, + lookup_query, + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return ( + query, + { + "session_update_vals": session_update_vals, + "session_id": str(session_id), + "developer_id": str(developer_id), + "participants": participants, + }, + ) diff --git a/agents-api/agents_api/models/session/delete_session.py b/agents-api/agents_api/models/session/delete_session.py index bd34e11e3..7a27b32af 100644 --- a/agents-api/agents_api/models/session/delete_session.py +++ b/agents-api/agents_api/models/session/delete_session.py @@ -1,16 +1,33 @@ """This module contains the implementation for deleting sessions from the 'cozodb' database using datalog queries.""" -from beartype import beartype - from uuid import UUID +from beartype import beartype + -from ..utils import cozo_query +from ...autogen.openapi_model import ResourceDeletedResponse +from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class( + ResourceDeletedResponse, + one=True, + transform=lambda d: { + "id": UUID(d.pop("session_id")), + "deleted_at": utcnow(), + "jobs": [], + }, +) @cozo_query @beartype def delete_session_query( + *, developer_id: UUID, session_id: UUID, ) -> tuple[str, dict]: @@ -22,14 +39,13 @@ def delete_session_query( - session_id (UUID): The unique identifier for the session to be deleted. Returns: - - pd.DataFrame: A DataFrame containing the result of the deletion query. + - ResourceDeletedResponse: The response indicating the deletion of the session. """ session_id = str(session_id) developer_id = str(developer_id) # Constructs and executes a datalog query to delete the specified session and its associated data based on the session_id and developer_id. - query = """ - { + delete_lookup_query = """ # Convert session_id to UUID format input[session_id] <- [[ to_uuid($session_id), @@ -37,24 +53,26 @@ def delete_session_query( # Select sessions based on the session_id provided ?[ - agent_id, - user_id, session_id, + participant_id, + participant_type, ] := input[session_id], *session_lookup{ - agent_id, - user_id, session_id, + participant_id, + participant_type, } # Delete entries from session_lookup table matching the criteria :delete session_lookup { - agent_id, - user_id, session_id, + participant_id, + participant_type, } - } { + """ + + delete_query = """ # Convert developer_id and session_id to UUID format input[developer_id, session_id] <- [[ to_uuid($developer_id), @@ -76,7 +94,19 @@ def delete_session_query( session_id, updated_at, } - } + :returning """ + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, "sessions", session_id=session_id + ), + delete_lookup_query, + delete_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + return (query, {"session_id": session_id, "developer_id": developer_id}) diff --git a/agents-api/agents_api/models/session/get_session.py b/agents-api/agents_api/models/session/get_session.py index 0af38b0d0..ba258d139 100644 --- a/agents-api/agents_api/models/session/get_session.py +++ b/agents-api/agents_api/models/session/get_session.py @@ -47,6 +47,14 @@ def get_session_query( participant_type, } + # We have to do this dance because users can be zero or more + users_p[users] := + participants[users, "user"] + + users_p[users] := + not participants[_, "user"], + users = [] + ?[ agents, users, @@ -60,7 +68,7 @@ def get_session_query( token_budget, context_overflow, ] := input[developer_id, id], - participants[users, "user"], + users_p[users], participants[agents, "agent"], *sessions{ developer_id, diff --git a/agents-api/agents_api/models/session/list_sessions.py b/agents-api/agents_api/models/session/list_sessions.py index ec5c40310..4e8362226 100644 --- a/agents-api/agents_api/models/session/list_sessions.py +++ b/agents-api/agents_api/models/session/list_sessions.py @@ -1,21 +1,30 @@ """This module contains functions for querying session data from the 'cozodb' database.""" -from beartype import beartype - -from typing import Any +from typing import Any, Literal from uuid import UUID +from beartype import beartype + +from ...autogen.openapi_model import make_session from ...common.utils import json -from ..utils import cozo_query +from ..utils import ( + cozo_query, + verify_developer_id_query, + wrap_in_class, +) +@wrap_in_class(make_session) @cozo_query @beartype def list_sessions_query( + *, developer_id: UUID, limit: int = 100, offset: int = 0, + sort_by: Literal["created_at", "updated_at", "deleted_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", metadata_filter: dict[str, Any] = {}, ) -> tuple[str, dict]: """Lists sessions from the 'cozodb' database based on the provided filters. @@ -25,9 +34,6 @@ def list_sessions_query( limit (int): The maximum number of sessions to return. offset (int): The offset from which to start listing sessions. metadata_filter (dict[str, Any]): A dictionary of metadata fields to filter sessions by. - - Returns: - pd.DataFrame: A DataFrame containing the queried session data. """ metadata_filter_str = ", ".join( [ @@ -36,14 +42,31 @@ def list_sessions_query( ] ) - query = f""" + sort = f"{'-' if direction == 'desc' else ''}{sort_by}" + + list_query = f""" input[developer_id] <- [[ to_uuid($developer_id), ]] + participants[collect(participant_id), participant_type, session_id] := + *session_lookup{{ + session_id, + participant_id, + participant_type, + }} + + # We have to do this dance because users can be zero or more + users_p[users, session_id] := + participants[users, "user", session_id] + + users_p[users, session_id] := + not participants[_, "user", session_id], + users = [] + ?[ - agent_id, - user_id, + agents, + users, id, situation, summary, @@ -66,19 +89,25 @@ def list_sessions_query( context_overflow, @ "NOW" }}, - *session_lookup{{ - agent_id, - user_id, - session_id: id, - }}, + users_p[users, id], + participants[agents, "agent", id], updated_at = to_int(validity), {metadata_filter_str} :limit $limit :offset $offset - :sort -created_at + :sort {sort} """ + # Datalog query to retrieve agent information based on filters, sorted by creation date in descending order. + queries = [ + verify_developer_id_query(developer_id), + list_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + # Execute the datalog query and return the results as a pandas DataFrame. return ( query, diff --git a/agents-api/agents_api/models/session/patch_session.py b/agents-api/agents_api/models/session/patch_session.py index 1f98e08cb..7071599b3 100644 --- a/agents-api/agents_api/models/session/patch_session.py +++ b/agents-api/agents_api/models/session/patch_session.py @@ -5,8 +5,14 @@ from uuid import UUID +from ...autogen.openapi_model import PatchSessionRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) _fields = [ @@ -21,37 +27,33 @@ # TODO: Add support for updating `render_templates` field +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: { + "id": d["session_id"], + "updated_at": d.pop("updated_at")[0], + "jobs": [], + **d, + }, +) @cozo_query @beartype def patch_session_query( + *, session_id: UUID, developer_id: UUID, - **update_data, + patch_session: PatchSessionRequest, ) -> tuple[str, dict]: """Patch session data in the 'cozodb' database. Parameters: - session_id (UUID): The unique identifier for the session to be updated. - developer_id (UUID): The unique identifier for the developer making the update. - - **update_data: Arbitrary keyword arguments representing the data to update. - - Returns: - pd.DataFrame: A pandas DataFrame containing the result of the update operation. - """ - # Process the update data to prepare it for the query. - assertion_query = """ - ?[session_id, developer_id] := - *sessions { - session_id, - developer_id, - }, - session_id = to_uuid($session_id), - developer_id = to_uuid($developer_id), - - # Assertion to ensure the session exists before updating. - :assert some + - patch_session (PatchSessionRequest): The request payload containing the updates to apply. """ + update_data = patch_session.model_dump(exclude_unset=True) metadata = update_data.pop("metadata", {}) or {} session_update_cols, session_update_vals = cozo_process_mutate_data( @@ -70,8 +72,7 @@ def patch_session_query( ) # Construct the datalog query for updating session information. - session_update_query = f""" - {{ + update_query = f""" input[{session_update_cols}] <- $session_update_vals ids[session_id, developer_id] <- [[to_uuid($session_id), to_uuid($developer_id)]] @@ -89,13 +90,21 @@ def patch_session_query( }} :returning - }} """ - combined_query = "{" + assertion_query + "}" + session_update_query + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, "sessions", session_id=session_id + ), + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( - combined_query, + query, { "session_update_vals": session_update_vals, "session_id": str(session_id), diff --git a/agents-api/agents_api/models/session/update_session.py b/agents-api/agents_api/models/session/update_session.py index 902c5b832..6481122e4 100644 --- a/agents-api/agents_api/models/session/update_session.py +++ b/agents-api/agents_api/models/session/update_session.py @@ -1,11 +1,16 @@ -from uuid import UUID - from beartype import beartype +from uuid import UUID -from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query +from ...autogen.openapi_model import UpdateSessionRequest, ResourceUpdatedResponse +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) _fields = [ "situation", @@ -19,25 +24,26 @@ # TODO: Add support for updating `render_templates` field +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: { + "id": d["session_id"], + "updated_at": d.pop("updated_at")[0], + "jobs": [], + **d, + }, +) @cozo_query @beartype def update_session_query( + *, session_id: UUID, developer_id: UUID, - **update_data, + update_session: UpdateSessionRequest, ) -> tuple[str, dict]: - # Process the update data to prepare it for the query. - assertion_query = """ - ?[session_id, developer_id] := - *sessions { - session_id, - developer_id, - }, - session_id = to_uuid($session_id), - developer_id = to_uuid($developer_id), - # Assertion to ensure the session exists before updating. - :assert some - """ + + update_data = update_session.model_dump(exclude_unset=True) session_update_cols, session_update_vals = cozo_process_mutate_data( {k: v for k, v in update_data.items() if v is not None} @@ -55,8 +61,7 @@ def update_session_query( ) # Construct the datalog query for updating session information. - session_update_query = f""" - {{ + update_query = f""" input[{session_update_cols}] <- $session_update_vals ids[session_id, developer_id] <- [[to_uuid($session_id), to_uuid($developer_id)]] @@ -73,13 +78,21 @@ def update_session_query( }} :returning - }} """ - combined_query = "{" + assertion_query + "}" + session_update_query + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, "sessions", session_id=session_id + ), + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( - combined_query, + query, { "session_update_vals": session_update_vals, "session_id": str(session_id), diff --git a/agents-api/agents_api/models/user/update_user.py b/agents-api/agents_api/models/user/update_user.py index d1e3989e2..cf699fe21 100644 --- a/agents-api/agents_api/models/user/update_user.py +++ b/agents-api/agents_api/models/user/update_user.py @@ -47,19 +47,6 @@ def update_user_query( } ) - assertion_query = """ - ?[developer_id, user_id] := - *users { - developer_id, - user_id, - }, - developer_id = to_uuid($developer_id), - user_id = to_uuid($user_id), - - # Assertion to ensure the user exists before updating. - :assert some - """ - # Constructs the update operation for the user, setting new values and updating 'updated_at'. update_query = f""" # update the user @@ -84,11 +71,9 @@ def update_user_query( :returning """ - # Combine the assertion query with the update queries queries = [ verify_developer_id_query(developer_id), verify_developer_owns_resource_query(developer_id, "users", user_id=user_id), - assertion_query, update_query, ] diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index f8b004757..fd427d420 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -2,7 +2,6 @@ from typing import Callable, ParamSpec, Type from uuid import UUID -from beartype import beartype from pydantic import BaseModel import pandas as pd diff --git a/typespec/chat/endpoints.tsp b/typespec/chat/endpoints.tsp index 5418633c1..232a44ab0 100644 --- a/typespec/chat/endpoints.tsp +++ b/typespec/chat/endpoints.tsp @@ -21,13 +21,17 @@ interface Endpoints { generate( @header contentType: yaml | json; - @body + @path + @doc("The session ID") + id: uuid; + + @bodyRoot @doc("Request to generate a response from the model") body: ChatInput; ): { @statusCode _: "200"; - @body + @bodyRoot @doc("Response from the model") body: ChatResponse; }; diff --git a/typespec/main.tsp b/typespec/main.tsp index 93f1a472d..c7585a3d7 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -86,6 +86,9 @@ namespace Api { @route("/sessions/{id}/history") interface HistoryRoute extends Entries.Endpoints {} + @route("/sessions/{id}/chat") + interface ChatRoute extends Chat.Endpoints {} + @route("/embed") interface EmbedRoute extends Docs.EmbedEndpoints {} From 027faca17676febb02aeff9c4f68edf861d8abe4 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Fri, 26 Jul 2024 09:33:29 -0400 Subject: [PATCH 29/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Chat.py | 145 +- agents-api/agents_api/autogen/Entries.py | 39 +- agents-api/agents_api/autogen/Tools.py | 25 + agents-api/agents_api/autogen/Users.py | 4 - .../agents_api/models/agent/create_agent.py | 18 +- .../models/agent/create_or_update_agent.py | 20 +- .../agents_api/models/agent/delete_agent.py | 2 +- .../agents_api/models/agent/get_agent.py | 2 +- .../agents_api/models/agent/list_agents.py | 2 +- .../agents_api/models/agent/patch_agent.py | 6 +- .../agents_api/models/agent/update_agent.py | 10 +- .../session/create_or_update_session.py | 8 +- .../models/session/create_session.py | 8 +- .../models/session/delete_session.py | 2 +- .../agents_api/models/session/get_session.py | 2 +- .../models/session/list_sessions.py | 2 +- .../models/session/patch_session.py | 8 +- .../models/session/update_session.py | 6 +- .../agents_api/models/tools/create_tools.py | 8 +- .../agents_api/models/tools/delete_tools.py | 2 +- .../agents_api/models/tools/get_tool.py | 2 +- .../agents_api/models/tools/list_tools.py | 2 +- .../agents_api/models/tools/patch_tool.py | 2 +- .../agents_api/models/tools/update_tool.py | 10 +- .../models/user/create_or_update_user.py | 8 +- .../agents_api/models/user/create_user.py | 8 +- agents-api/agents_api/models/user/get_user.py | 2 +- .../agents_api/models/user/list_users.py | 2 +- .../agents_api/models/user/patch_user.py | 6 +- .../agents_api/models/user/update_user.py | 2 +- agents-api/poetry.lock | 424 +- sdks/postman/collection.json | 5042 ----------------- sdks/python/julep/api/__init__.py | 56 + sdks/python/julep/api/client.py | 154 +- sdks/python/julep/api/reference.md | 101 +- sdks/python/julep/api/types/__init__.py | 65 + .../julep/api/types/chat_base_chat_output.py | 53 + .../api/types/chat_base_chat_response.py | 65 + .../api/types/chat_base_token_log_prob.py | 48 + .../julep/api/types/chat_chat_output_chunk.py | 53 + .../api/types/chat_chunk_chat_response.py | 49 + .../julep/api/types/chat_competion_usage.py | 59 + .../julep/api/types/chat_finish_reason.py | 7 + .../julep/api/types/chat_log_prob_response.py | 48 + .../api/types/chat_message_chat_response.py | 49 + .../api/types/chat_multiple_chat_output.py | 50 + .../api/types/chat_route_generate_request.py | 15 + .../chat_route_generate_request_agent.py | 154 + ...oute_generate_request_agent_tool_choice.py | 9 + ...oute_generate_request_frequency_penalty.py | 149 + ...e_request_frequency_penalty_tool_choice.py | 9 + .../chat_route_generate_request_preset.py | 135 + ...ute_generate_request_preset_tool_choice.py | 9 + .../api/types/chat_route_generate_response.py | 8 + .../api/types/chat_single_chat_output.py | 50 + .../julep/api/types/chat_token_log_prob.py | 45 + .../api/types/entries_chat_ml_message.py | 71 + .../types/entries_chat_ml_message_content.py | 9 + .../entries_chat_ml_message_content_item.py | 87 + .../api/types/tools_named_function_choice.py | 46 + .../api/types/tools_named_tool_choice.py | 89 + sdks/python/poetry.lock | 222 +- sdks/ts/src/api/index.ts | 30 + sdks/ts/src/api/models/Chat_BaseChatOutput.ts | 17 + .../src/api/models/Chat_BaseChatResponse.ts | 26 + .../src/api/models/Chat_BaseTokenLogProb.ts | 12 + .../ts/src/api/models/Chat_ChatOutputChunk.ts | 15 + .../src/api/models/Chat_ChunkChatResponse.ts | 12 + sdks/ts/src/api/models/Chat_CompetionUsage.ts | 21 + sdks/ts/src/api/models/Chat_FinishReason.ts | 16 + .../ts/src/api/models/Chat_LogProbResponse.ts | 11 + .../api/models/Chat_MessageChatResponse.ts | 12 + .../src/api/models/Chat_MultipleChatOutput.ts | 12 + .../src/api/models/Chat_SingleChatOutput.ts | 12 + sdks/ts/src/api/models/Chat_TokenLogProb.ts | 8 + .../src/api/models/Entries_ChatMLMessage.ts | 30 + .../api/models/Tools_NamedFunctionChoice.ts | 14 + .../src/api/models/Tools_NamedToolChoice.ts | 16 + .../src/api/models/Users_CreateUserRequest.ts | 4 - .../src/api/schemas/$Chat_BaseChatOutput.ts | 34 + .../src/api/schemas/$Chat_BaseChatResponse.ts | 50 + .../src/api/schemas/$Chat_BaseTokenLogProb.ts | 27 + .../src/api/schemas/$Chat_ChatOutputChunk.ts | 27 + .../api/schemas/$Chat_ChunkChatResponse.ts | 23 + .../src/api/schemas/$Chat_CompetionUsage.ts | 30 + sdks/ts/src/api/schemas/$Chat_FinishReason.ts | 7 + .../src/api/schemas/$Chat_LogProbResponse.ts | 16 + .../api/schemas/$Chat_MessageChatResponse.ts | 23 + .../api/schemas/$Chat_MultipleChatOutput.ts | 24 + .../src/api/schemas/$Chat_SingleChatOutput.ts | 21 + sdks/ts/src/api/schemas/$Chat_TokenLogProb.ts | 23 + .../src/api/schemas/$Entries_ChatMLMessage.ts | 63 + .../api/schemas/$Tools_NamedFunctionChoice.ts | 34 + .../src/api/schemas/$Tools_NamedToolChoice.ts | 30 + .../api/schemas/$Users_CreateUserRequest.ts | 7 - sdks/ts/src/api/services/DefaultService.ts | 251 + 96 files changed, 3277 insertions(+), 5474 deletions(-) delete mode 100644 sdks/postman/collection.json create mode 100644 sdks/python/julep/api/types/chat_base_chat_output.py create mode 100644 sdks/python/julep/api/types/chat_base_chat_response.py create mode 100644 sdks/python/julep/api/types/chat_base_token_log_prob.py create mode 100644 sdks/python/julep/api/types/chat_chat_output_chunk.py create mode 100644 sdks/python/julep/api/types/chat_chunk_chat_response.py create mode 100644 sdks/python/julep/api/types/chat_competion_usage.py create mode 100644 sdks/python/julep/api/types/chat_finish_reason.py create mode 100644 sdks/python/julep/api/types/chat_log_prob_response.py create mode 100644 sdks/python/julep/api/types/chat_message_chat_response.py create mode 100644 sdks/python/julep/api/types/chat_multiple_chat_output.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_request.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_request_agent.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_request_agent_tool_choice.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty_tool_choice.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_request_preset.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_request_preset_tool_choice.py create mode 100644 sdks/python/julep/api/types/chat_route_generate_response.py create mode 100644 sdks/python/julep/api/types/chat_single_chat_output.py create mode 100644 sdks/python/julep/api/types/chat_token_log_prob.py create mode 100644 sdks/python/julep/api/types/entries_chat_ml_message.py create mode 100644 sdks/python/julep/api/types/entries_chat_ml_message_content.py create mode 100644 sdks/python/julep/api/types/entries_chat_ml_message_content_item.py create mode 100644 sdks/python/julep/api/types/tools_named_function_choice.py create mode 100644 sdks/python/julep/api/types/tools_named_tool_choice.py create mode 100644 sdks/ts/src/api/models/Chat_BaseChatOutput.ts create mode 100644 sdks/ts/src/api/models/Chat_BaseChatResponse.ts create mode 100644 sdks/ts/src/api/models/Chat_BaseTokenLogProb.ts create mode 100644 sdks/ts/src/api/models/Chat_ChatOutputChunk.ts create mode 100644 sdks/ts/src/api/models/Chat_ChunkChatResponse.ts create mode 100644 sdks/ts/src/api/models/Chat_CompetionUsage.ts create mode 100644 sdks/ts/src/api/models/Chat_FinishReason.ts create mode 100644 sdks/ts/src/api/models/Chat_LogProbResponse.ts create mode 100644 sdks/ts/src/api/models/Chat_MessageChatResponse.ts create mode 100644 sdks/ts/src/api/models/Chat_MultipleChatOutput.ts create mode 100644 sdks/ts/src/api/models/Chat_SingleChatOutput.ts create mode 100644 sdks/ts/src/api/models/Chat_TokenLogProb.ts create mode 100644 sdks/ts/src/api/models/Entries_ChatMLMessage.ts create mode 100644 sdks/ts/src/api/models/Tools_NamedFunctionChoice.ts create mode 100644 sdks/ts/src/api/models/Tools_NamedToolChoice.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_BaseChatOutput.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_BaseChatResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_BaseTokenLogProb.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_ChatOutputChunk.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_ChunkChatResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_CompetionUsage.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_FinishReason.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_LogProbResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_MessageChatResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_MultipleChatOutput.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_SingleChatOutput.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_TokenLogProb.ts create mode 100644 sdks/ts/src/api/schemas/$Entries_ChatMLMessage.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_NamedFunctionChoice.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_NamedToolChoice.ts diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index 4350dc15a..6669fbcec 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -4,8 +4,108 @@ from __future__ import annotations from typing import Annotated, Literal +from uuid import UUID -from pydantic import BaseModel, ConfigDict, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel + +from .Docs import DocReference +from .Entries import ChatMLMessage + + +class BaseChatOutput(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + index: int + finish_reason: Literal["stop", "length", "content_filter", "tool_calls"] + """ + The reason the model stopped generating tokens + """ + logprobs: Annotated[LogProbResponse | None, Field(...)] + """ + The log probabilities of tokens + """ + + +class BaseChatResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + usage: Annotated[CompetionUsage | None, Field(...)] + """ + Usage statistics for the completion request + """ + jobs: list[UUID] + """ + Background job IDs that may have been spawned from this interaction. + """ + docs: list[DocReference] + """ + Documents referenced for this request (for citation purposes). + """ + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + + +class BaseTokenLogProb(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + token: str + logprob: float + """ + The log probability of the token + """ + bytes: Annotated[list[int] | None, Field(...)] + + +class ChatOutputChunk(BaseChatOutput): + """ + Streaming chat completion output + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + delta: ChatMLMessage + """ + The message generated by the model + """ + + +class ChunkChatResponse(BaseChatResponse): + model_config = ConfigDict( + populate_by_name=True, + ) + choices: list[ChatOutputChunk] + """ + The deltas generated by the model + """ + + +class CompetionUsage(BaseModel): + """ + Usage statistics for the completion request + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + completion_tokens: Annotated[int, Field(json_schema_extra={"readOnly": True})] + """ + Number of tokens in the generated completion + """ + prompt_tokens: Annotated[int, Field(json_schema_extra={"readOnly": True})] + """ + Number of tokens in the prompt + """ + total_tokens: Annotated[int, Field(json_schema_extra={"readOnly": True})] + """ + Total number of tokens used in the request (prompt + completion) + """ class CompletionResponseFormat(BaseModel): @@ -41,6 +141,31 @@ class GenerationPresetSettings(BaseModel): """ +class LogProbResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + content: Annotated[list[TokenLogProb] | None, Field(...)] + """ + The log probabilities of the tokens + """ + + +class MessageChatResponse(ChunkChatResponse): + pass + + +class MultipleChatOutput(BaseChatOutput): + """ + The output returned by the model. Note that, depending on the model provider, they might return more than one message. + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + messages: list[ChatMLMessage] + + class OpenAISettings(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -63,6 +188,24 @@ class OpenAISettings(BaseModel): """ +class SingleChatOutput(BaseChatOutput): + """ + The output returned by the model. Note that, depending on the model provider, they might return more than one message. + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + message: ChatMLMessage + + +class TokenLogProb(BaseTokenLogProb): + model_config = ConfigDict( + populate_by_name=True, + ) + top_logprobs: list[BaseTokenLogProb] + + class VLLMSettings(BaseModel): model_config = ConfigDict( populate_by_name=True, diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index a82dbc6a6..d982f0586 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel from .Tools import ChosenToolCall, Tool, ToolResponse @@ -37,6 +37,43 @@ class ChatMLImageContentPart(BaseChatMLContentPart): """ +class ChatMLMessage(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + role: Literal[ + "user", + "agent", + "system", + "function", + "function_response", + "function_call", + "auto", + ] + """ + The role of the message + """ + content: str | list[str] | list[ChatMLTextContentPart | ChatMLImageContentPart] + """ + The content parts of the message + """ + name: str | None = None + """ + Name + """ + tool_calls: Annotated[ + list[ChosenToolCall], Field([], json_schema_extra={"readOnly": True}) + ] + """ + Tool calls generated by the model. + """ + created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] + """ + When this resource was created as UTC date-time + """ + id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + + class ChatMLTextContentPart(BaseChatMLContentPart): model_config = ConfigDict( populate_by_name=True, diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index b7b4aa6b4..08578844f 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -116,6 +116,20 @@ class FunctionDefUpdate(BaseModel): """ +class NamedToolChoice(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function", "integration", "system", "api_call"] + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + function: FunctionCallOption | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + class PatchToolRequest(BaseModel): """ Payload for patching a tool @@ -219,3 +233,14 @@ class FunctionTool(Tool): """ The function to call """ + + +class NamedFunctionChoice(NamedToolChoice): + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function"] = "function" + function: FunctionCallOption + """ + The function to call + """ diff --git a/agents-api/agents_api/autogen/Users.py b/agents-api/agents_api/autogen/Users.py index 8d36e3965..4e99f6923 100644 --- a/agents-api/agents_api/autogen/Users.py +++ b/agents-api/agents_api/autogen/Users.py @@ -32,10 +32,6 @@ class CreateUserRequest(BaseModel): """ About the user """ - docs: Annotated[list, Field([], max_length=100)] - """ - Documents to index for this user. (Max: 100 items) - """ class PatchUserRequest(BaseModel): diff --git a/agents-api/agents_api/models/agent/create_agent.py b/agents-api/agents_api/models/agent/create_agent.py index 5a51b9d9c..b77033a7b 100644 --- a/agents-api/agents_api/models/agent/create_agent.py +++ b/agents-api/agents_api/models/agent/create_agent.py @@ -17,11 +17,11 @@ ) @cozo_query @beartype -def create_agent_query( +def create_agent( *, developer_id: UUID, agent_id: UUID | None = None, - create_agent: CreateAgentRequest, + data: CreateAgentRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new agent in the database. @@ -44,15 +44,15 @@ def create_agent_query( agent_id = agent_id or uuid4() # Extract the agent data from the payload - create_agent.metadata = create_agent.metadata or {} - create_agent.instructions = ( - create_agent.instructions - if isinstance(create_agent.instructions, list) - else [create_agent.instructions] + data.metadata = data.metadata or {} + data.instructions = ( + data.instructions + if isinstance(data.instructions, list) + else [data.instructions] ) - create_agent.default_settings = create_agent.default_settings or {} + data.default_settings = data.default_settings or {} - agent_data = create_agent.model_dump() + agent_data = data.model_dump() default_settings = agent_data.pop("default_settings") settings_cols, settings_vals = cozo_process_mutate_data( diff --git a/agents-api/agents_api/models/agent/create_or_update_agent.py b/agents-api/agents_api/models/agent/create_or_update_agent.py index 60e09e751..fe00dd9b5 100644 --- a/agents-api/agents_api/models/agent/create_or_update_agent.py +++ b/agents-api/agents_api/models/agent/create_or_update_agent.py @@ -17,11 +17,11 @@ ) @cozo_query @beartype -def create_or_update_agent_query( +def create_or_update_agent( *, developer_id: UUID, agent_id: UUID, - create_or_update_agent: CreateOrUpdateAgentRequest, + data: CreateOrUpdateAgentRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new agent in the database. @@ -42,17 +42,17 @@ def create_or_update_agent_query( """ # Extract the agent data from the payload - create_or_update_agent.metadata = create_or_update_agent.metadata or {} - create_or_update_agent.instructions = ( - create_or_update_agent.instructions - if isinstance(create_or_update_agent.instructions, list) - else [create_or_update_agent.instructions] + data.metadata = data.metadata or {} + data.instructions = ( + data.instructions + if isinstance(data.instructions, list) + else [data.instructions] ) - create_or_update_agent.default_settings = ( - create_or_update_agent.default_settings or {} + data.default_settings = ( + data.default_settings or {} ) - agent_data = create_or_update_agent.model_dump() + agent_data = data.model_dump() default_settings = agent_data.pop("default_settings") settings_cols, settings_vals = cozo_process_mutate_data( diff --git a/agents-api/agents_api/models/agent/delete_agent.py b/agents-api/agents_api/models/agent/delete_agent.py index 3ce842b47..3db55628a 100644 --- a/agents-api/agents_api/models/agent/delete_agent.py +++ b/agents-api/agents_api/models/agent/delete_agent.py @@ -27,7 +27,7 @@ ) @cozo_query @beartype -def delete_agent_query(*, developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: +def delete_agent(*, developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: """ Constructs and returns a datalog query for deleting an agent and its default settings from the database. diff --git a/agents-api/agents_api/models/agent/get_agent.py b/agents-api/agents_api/models/agent/get_agent.py index 281283836..9475b0eb9 100644 --- a/agents-api/agents_api/models/agent/get_agent.py +++ b/agents-api/agents_api/models/agent/get_agent.py @@ -15,7 +15,7 @@ @wrap_in_class(Agent, one=True) @cozo_query @beartype -def get_agent_query(*, developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: +def get_agent(*, developer_id: UUID, agent_id: UUID) -> tuple[str, dict]: """ Fetches agent details and default settings from the database. diff --git a/agents-api/agents_api/models/agent/list_agents.py b/agents-api/agents_api/models/agent/list_agents.py index 8dcb27606..0912c864c 100644 --- a/agents-api/agents_api/models/agent/list_agents.py +++ b/agents-api/agents_api/models/agent/list_agents.py @@ -16,7 +16,7 @@ @wrap_in_class(Agent) @cozo_query @beartype -def list_agents_query( +def list_agents( *, developer_id: UUID, limit: int = 100, diff --git a/agents-api/agents_api/models/agent/patch_agent.py b/agents-api/agents_api/models/agent/patch_agent.py index 7932e70da..5d84f599f 100644 --- a/agents-api/agents_api/models/agent/patch_agent.py +++ b/agents-api/agents_api/models/agent/patch_agent.py @@ -20,11 +20,11 @@ ) @cozo_query @beartype -def patch_agent_query( +def patch_agent( *, agent_id: UUID, developer_id: UUID, - patch_agent: PatchAgentRequest, + data: PatchAgentRequest, ) -> tuple[str, dict]: """Patches agent data based on provided updates. @@ -37,7 +37,7 @@ def patch_agent_query( Returns: ResourceUpdatedResponse: The updated agent data. """ - update_data = patch_agent.model_dump(exclude_unset=True) + update_data = data.model_dump(exclude_unset=True) # Construct the query for updating agent information in the database. # Agent update query diff --git a/agents-api/agents_api/models/agent/update_agent.py b/agents-api/agents_api/models/agent/update_agent.py index af652a8e4..96c0d3d97 100644 --- a/agents-api/agents_api/models/agent/update_agent.py +++ b/agents-api/agents_api/models/agent/update_agent.py @@ -24,11 +24,11 @@ ) @cozo_query @beartype -def update_agent_query( +def update_agent( *, agent_id: UUID, developer_id: UUID, - update_agent: UpdateAgentRequest, + data: UpdateAgentRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to update an agent and its default settings in the 'cozodb' database. @@ -36,14 +36,14 @@ def update_agent_query( Parameters: - agent_id (UUID): The unique identifier of the agent to be updated. - developer_id (UUID): The unique identifier of the developer associated with the agent. - - update_agent (UpdateAgentRequest): The request payload containing the updated agent data. + - data (UpdateAgentRequest): The request payload containing the updated agent data. - client (CozoClient, optional): The database client used to execute the query. Defaults to a pre-configured client instance. Returns: ResourceUpdatedResponse: The updated agent data. """ - default_settings = update_agent.default_settings.model_dump(exclude_none=True) - update_data = update_agent.model_dump() + default_settings = data.default_settings.model_dump(exclude_none=True) + update_data = data.model_dump() # Remove default settings from the agent update data update_data.pop("default_settings", None) diff --git a/agents-api/agents_api/models/session/create_or_update_session.py b/agents-api/agents_api/models/session/create_or_update_session.py index a5a3cf3ed..a09d0a37b 100644 --- a/agents-api/agents_api/models/session/create_or_update_session.py +++ b/agents-api/agents_api/models/session/create_or_update_session.py @@ -28,15 +28,15 @@ ) @cozo_query(debug=True) @beartype -def create_or_update_session_query( +def create_or_update_session( *, session_id: UUID, developer_id: UUID, - create_or_update_session: CreateOrUpdateSessionRequest, + data: CreateOrUpdateSessionRequest, ) -> tuple[str, dict]: - create_or_update_session.metadata = create_or_update_session.metadata or {} - session_data = create_or_update_session.model_dump() + data.metadata = data.metadata or {} + session_data = data.model_dump() user = session_data.pop("user") agent = session_data.pop("agent") diff --git a/agents-api/agents_api/models/session/create_session.py b/agents-api/agents_api/models/session/create_session.py index 90dd5fa3a..13d00f484 100644 --- a/agents-api/agents_api/models/session/create_session.py +++ b/agents-api/agents_api/models/session/create_session.py @@ -28,11 +28,11 @@ ) @cozo_query @beartype -def create_session_query( +def create_session( *, developer_id: UUID, session_id: UUID | None = None, - create_session: CreateSessionRequest, + data: CreateSessionRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new session in the database. @@ -40,8 +40,8 @@ def create_session_query( session_id = session_id or uuid4() - create_session.metadata = create_session.metadata or {} - session_data = create_session.model_dump() + data.metadata = data.metadata or {} + session_data = data.model_dump() user = session_data.pop("user") agent = session_data.pop("agent") diff --git a/agents-api/agents_api/models/session/delete_session.py b/agents-api/agents_api/models/session/delete_session.py index 7a27b32af..a32a90a36 100644 --- a/agents-api/agents_api/models/session/delete_session.py +++ b/agents-api/agents_api/models/session/delete_session.py @@ -26,7 +26,7 @@ ) @cozo_query @beartype -def delete_session_query( +def delete_session( *, developer_id: UUID, session_id: UUID, diff --git a/agents-api/agents_api/models/session/get_session.py b/agents-api/agents_api/models/session/get_session.py index ba258d139..3a37fb532 100644 --- a/agents-api/agents_api/models/session/get_session.py +++ b/agents-api/agents_api/models/session/get_session.py @@ -15,7 +15,7 @@ @wrap_in_class(make_session, one=True) @cozo_query @beartype -def get_session_query( +def get_session( *, developer_id: UUID, session_id: UUID, diff --git a/agents-api/agents_api/models/session/list_sessions.py b/agents-api/agents_api/models/session/list_sessions.py index 4e8362226..2f3da454a 100644 --- a/agents-api/agents_api/models/session/list_sessions.py +++ b/agents-api/agents_api/models/session/list_sessions.py @@ -18,7 +18,7 @@ @wrap_in_class(make_session) @cozo_query @beartype -def list_sessions_query( +def list_sessions( *, developer_id: UUID, limit: int = 100, diff --git a/agents-api/agents_api/models/session/patch_session.py b/agents-api/agents_api/models/session/patch_session.py index 7071599b3..090a6b240 100644 --- a/agents-api/agents_api/models/session/patch_session.py +++ b/agents-api/agents_api/models/session/patch_session.py @@ -39,21 +39,21 @@ ) @cozo_query @beartype -def patch_session_query( +def patch_session( *, session_id: UUID, developer_id: UUID, - patch_session: PatchSessionRequest, + data: PatchSessionRequest, ) -> tuple[str, dict]: """Patch session data in the 'cozodb' database. Parameters: - session_id (UUID): The unique identifier for the session to be updated. - developer_id (UUID): The unique identifier for the developer making the update. - - patch_session (PatchSessionRequest): The request payload containing the updates to apply. + - data (PatchSessionRequest): The request payload containing the updates to apply. """ - update_data = patch_session.model_dump(exclude_unset=True) + update_data = data.model_dump(exclude_unset=True) metadata = update_data.pop("metadata", {}) or {} session_update_cols, session_update_vals = cozo_process_mutate_data( diff --git a/agents-api/agents_api/models/session/update_session.py b/agents-api/agents_api/models/session/update_session.py index 6481122e4..beb863155 100644 --- a/agents-api/agents_api/models/session/update_session.py +++ b/agents-api/agents_api/models/session/update_session.py @@ -36,14 +36,14 @@ ) @cozo_query @beartype -def update_session_query( +def update_session( *, session_id: UUID, developer_id: UUID, - update_session: UpdateSessionRequest, + data: UpdateSessionRequest, ) -> tuple[str, dict]: - update_data = update_session.model_dump(exclude_unset=True) + update_data = data.model_dump(exclude_unset=True) session_update_cols, session_update_vals = cozo_process_mutate_data( {k: v for k, v in update_data.items() if v is not None} diff --git a/agents-api/agents_api/models/tools/create_tools.py b/agents-api/agents_api/models/tools/create_tools.py index 6e333f619..56c9bea22 100644 --- a/agents-api/agents_api/models/tools/create_tools.py +++ b/agents-api/agents_api/models/tools/create_tools.py @@ -24,18 +24,18 @@ ) @cozo_query @beartype -def create_tools_query( +def create_tools( *, developer_id: UUID, agent_id: UUID, - create_tools: list[CreateToolRequest], + data: list[CreateToolRequest], ) -> tuple[str, dict]: """ Constructs a datalog query for inserting tool records into the 'agent_functions' relation in the CozoDB. Parameters: - agent_id (UUID): The unique identifier for the agent. - - create_tools (list[CreateToolRequest]): A list of function definitions to be inserted. + - data (list[CreateToolRequest]): A list of function definitions to be inserted. Returns: list[Tool] @@ -49,7 +49,7 @@ def create_tools_query( tool.name, getattr(tool, tool.type).dict(), ] - for tool in create_tools + for tool in data ] # Datalog query for inserting new tool records into the 'agent_functions' relation diff --git a/agents-api/agents_api/models/tools/delete_tools.py b/agents-api/agents_api/models/tools/delete_tools.py index 655bfe85e..81ffefeef 100644 --- a/agents-api/agents_api/models/tools/delete_tools.py +++ b/agents-api/agents_api/models/tools/delete_tools.py @@ -20,7 +20,7 @@ ) @cozo_query @beartype -def delete_tool_query( +def delete_tool( *, developer_id: UUID, agent_id: UUID, diff --git a/agents-api/agents_api/models/tools/get_tool.py b/agents-api/agents_api/models/tools/get_tool.py index 2899ad23d..da961229c 100644 --- a/agents-api/agents_api/models/tools/get_tool.py +++ b/agents-api/agents_api/models/tools/get_tool.py @@ -23,7 +23,7 @@ ) @cozo_query @beartype -def get_tool_query( +def get_tool( *, developer_id: UUID, agent_id: UUID, diff --git a/agents-api/agents_api/models/tools/list_tools.py b/agents-api/agents_api/models/tools/list_tools.py index 1e20a2e3d..794dd1873 100644 --- a/agents-api/agents_api/models/tools/list_tools.py +++ b/agents-api/agents_api/models/tools/list_tools.py @@ -16,7 +16,7 @@ @wrap_in_class(Tool) @cozo_query @beartype -def list_tools_query( +def list_tools( *, developer_id: UUID, agent_id: UUID, diff --git a/agents-api/agents_api/models/tools/patch_tool.py b/agents-api/agents_api/models/tools/patch_tool.py index b063603c5..a3aab308a 100644 --- a/agents-api/agents_api/models/tools/patch_tool.py +++ b/agents-api/agents_api/models/tools/patch_tool.py @@ -20,7 +20,7 @@ ) @cozo_query @beartype -def patch_tool_query( +def patch_tool( *, developer_id: UUID, agent_id: UUID, tool_id: UUID, patch_tool: PatchToolRequest ) -> tuple[str, dict]: """ diff --git a/agents-api/agents_api/models/tools/update_tool.py b/agents-api/agents_api/models/tools/update_tool.py index 63459f6bc..ac81f14b3 100644 --- a/agents-api/agents_api/models/tools/update_tool.py +++ b/agents-api/agents_api/models/tools/update_tool.py @@ -7,23 +7,23 @@ ResourceUpdatedResponse, UpdateToolRequest, ) -from .patch_tool import patch_tool_query +from .patch_tool import patch_tool @beartype -def update_tool_query( +def update_tool( *, developer_id: UUID, agent_id: UUID, tool_id: UUID, - update_tool: UpdateToolRequest, + data: UpdateToolRequest, **kwargs ) -> ResourceUpdatedResponse: # Same as patch_tool_query, but with a different request payload - return patch_tool_query( + return patch_tool( developer_id=developer_id, agent_id=agent_id, tool_id=tool_id, - patch_tool=PatchToolRequest(**update_tool.model_dump()), + patch_tool=PatchToolRequest(**data.model_dump()), **kwargs, ) diff --git a/agents-api/agents_api/models/user/create_or_update_user.py b/agents-api/agents_api/models/user/create_or_update_user.py index 34dbf9348..f6760aa36 100644 --- a/agents-api/agents_api/models/user/create_or_update_user.py +++ b/agents-api/agents_api/models/user/create_or_update_user.py @@ -14,11 +14,11 @@ @wrap_in_class(User, one=True, transform=lambda d: {"id": UUID(d.pop("user_id")), **d}) @cozo_query @beartype -def create_or_update_user_query( +def create_or_update_user( *, developer_id: UUID, user_id: UUID, - create_or_update_user: CreateOrUpdateUserRequest, + data: CreateOrUpdateUserRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new user in the database. @@ -36,9 +36,9 @@ def create_or_update_user_query( """ # Extract the user data from the payload - create_or_update_user.metadata = create_or_update_user.metadata or {} + data.metadata = data.metadata or {} - user_data = create_or_update_user.model_dump() + user_data = data.model_dump() # Create the user # Construct a query to insert the new user record into the users table diff --git a/agents-api/agents_api/models/user/create_user.py b/agents-api/agents_api/models/user/create_user.py index 28001bc95..b972a7bc7 100644 --- a/agents-api/agents_api/models/user/create_user.py +++ b/agents-api/agents_api/models/user/create_user.py @@ -15,11 +15,11 @@ @wrap_in_class(User, one=True, transform=lambda d: {"id": UUID(d.pop("user_id")), **d}) @cozo_query @beartype -def create_user_query( +def create_user( *, developer_id: UUID, user_id: UUID | None = None, - create_user: CreateUserRequest, + data: CreateUserRequest, ) -> tuple[str, dict]: """ Constructs and executes a datalog query to create a new user in the CozoDB database. @@ -37,8 +37,8 @@ def create_user_query( """ user_id = user_id or uuid4() - create_user.metadata = create_user.metadata or {} - user_data = create_user.model_dump() + data.metadata = data.metadata or {} + user_data = data.model_dump() create_query = """ # Then create the user diff --git a/agents-api/agents_api/models/user/get_user.py b/agents-api/agents_api/models/user/get_user.py index 16783037f..84259d2b2 100644 --- a/agents-api/agents_api/models/user/get_user.py +++ b/agents-api/agents_api/models/user/get_user.py @@ -15,7 +15,7 @@ @wrap_in_class(User, one=True) @cozo_query @beartype -def get_user_query( +def get_user( *, developer_id: UUID, user_id: UUID, diff --git a/agents-api/agents_api/models/user/list_users.py b/agents-api/agents_api/models/user/list_users.py index 907d5c60e..bb98b4cf5 100644 --- a/agents-api/agents_api/models/user/list_users.py +++ b/agents-api/agents_api/models/user/list_users.py @@ -15,7 +15,7 @@ @wrap_in_class(User) @cozo_query @beartype -def list_users_query( +def list_users( *, developer_id: UUID, limit: int = 100, diff --git a/agents-api/agents_api/models/user/patch_user.py b/agents-api/agents_api/models/user/patch_user.py index 0f72845f6..ff508731e 100644 --- a/agents-api/agents_api/models/user/patch_user.py +++ b/agents-api/agents_api/models/user/patch_user.py @@ -23,11 +23,11 @@ ) @cozo_query @beartype -def patch_user_query( +def patch_user( *, developer_id: UUID, user_id: UUID, - patch_user: PatchUserRequest, + data: PatchUserRequest, ) -> tuple[str, dict]: """ Generates a datalog query for updating a user's information. @@ -41,7 +41,7 @@ def patch_user_query( - tuple[str, dict]: A pandas DataFrame containing the results of the query execution. """ - update_data = patch_user.model_dump(exclude_unset=True) + update_data = data.model_dump(exclude_unset=True) # Prepare data for mutation by filtering out None values and adding system-generated fields. metadata = update_data.pop("metadata", {}) or {} diff --git a/agents-api/agents_api/models/user/update_user.py b/agents-api/agents_api/models/user/update_user.py index cf699fe21..756de53f1 100644 --- a/agents-api/agents_api/models/user/update_user.py +++ b/agents-api/agents_api/models/user/update_user.py @@ -20,7 +20,7 @@ ) @cozo_query @beartype -def update_user_query( +def update_user( *, developer_id: UUID, user_id: UUID, update_user: UpdateUserRequest ) -> tuple[str, dict]: """Updates user information in the 'cozodb' database. diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 10d3d0b3c..c87eeb9e7 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -1350,13 +1350,13 @@ requests = ["requests (>=2.20.0,<3.0.0.dev0)"] [[package]] name = "google-cloud-aiplatform" -version = "1.59.0" +version = "1.60.0" description = "Vertex AI API client library" optional = false python-versions = ">=3.8" files = [ - {file = "google-cloud-aiplatform-1.59.0.tar.gz", hash = "sha256:2bebb59c0ba3e3b4b568305418ca1b021977988adbee8691a5bed09b037e7e63"}, - {file = "google_cloud_aiplatform-1.59.0-py2.py3-none-any.whl", hash = "sha256:549e6eb1844b0f853043309138ebe2db00de4bbd8197b3bde26804ac163ef52a"}, + {file = "google-cloud-aiplatform-1.60.0.tar.gz", hash = "sha256:782c7f1ec0e77a7c7daabef3b65bfd506ed2b4b1dc2186753c43cd6faf8dd04e"}, + {file = "google_cloud_aiplatform-1.60.0-py2.py3-none-any.whl", hash = "sha256:5f14159c9575f4b46335027e3ceb8fa57bd5eaa76a07f858105b8c6c034ec0d6"}, ] [package.dependencies] @@ -1378,8 +1378,8 @@ cloud-profiler = ["tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow datasets = ["pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)"] endpoint = ["requests (>=2.28.1)"] full = ["cloudpickle (<3.0)", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.109.1)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-cloud-logging (<4.0)", "google-vizier (>=0.1.6)", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.1.1)", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "requests (>=2.28.1)", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0dev)"] -langchain = ["langchain (>=0.1.16,<0.3)", "langchain-core (<0.2)", "langchain-google-vertexai (<2)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)", "tenacity (<=8.3)"] -langchain-testing = ["absl-py", "cloudpickle (>=3.0,<4.0)", "langchain (>=0.1.16,<0.3)", "langchain-core (<0.2)", "langchain-google-vertexai (<2)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)", "pytest-xdist", "tenacity (<=8.3)"] +langchain = ["langchain (>=0.1.16,<0.3)", "langchain-core (<0.3)", "langchain-google-vertexai (<2)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)", "tenacity (<=8.3)"] +langchain-testing = ["absl-py", "cloudpickle (>=3.0,<4.0)", "google-cloud-trace (<2)", "langchain (>=0.1.16,<0.3)", "langchain-core (<0.3)", "langchain-google-vertexai (<2)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)", "pytest-xdist", "tenacity (<=8.3)"] lit = ["explainable-ai-sdk (>=1.0.0)", "lit-nlp (==0.4.0)", "pandas (>=1.0.0)", "tensorflow (>=2.3.0,<3.0.0dev)"] metadata = ["numpy (>=1.15.0)", "pandas (>=1.0.0)"] pipelines = ["pyyaml (>=5.3.1,<7)"] @@ -1389,7 +1389,7 @@ private-endpoints = ["requests (>=2.28.1)", "urllib3 (>=1.21.1,<1.27)"] rapid-evaluation = ["pandas (>=1.0.0,<2.2.0)", "tqdm (>=4.23.0)"] ray = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=6.0.1)", "pydantic (<2)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "setuptools (<70.0.0)"] ray-testing = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pytest-xdist", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "ray[train] (==2.9.3)", "scikit-learn", "setuptools (<70.0.0)", "tensorflow", "torch (>=2.0.0,<2.1.0)", "xgboost", "xgboost-ray"] -reasoningengine = ["cloudpickle (>=3.0,<4.0)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)"] +reasoningengine = ["cloudpickle (>=3.0,<4.0)", "google-cloud-trace (<2)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)"] tensorboard = ["tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "werkzeug (>=2.0.0,<2.1.0dev)"] testing = ["bigframes", "cloudpickle (<3.0)", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.109.1)", "google-api-core (>=2.11,<3.0.0)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-cloud-logging (<4.0)", "google-vizier (>=0.1.6)", "grpcio-testing", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "ipython", "kfp (>=2.6.0,<3.0.0)", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.1.1)", "nltk", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pandas (>=1.0.0,<2.2.0)", "pyarrow (>=10.0.1)", "pyarrow (>=14.0.0)", "pyarrow (>=3.0.0,<8.0dev)", "pyarrow (>=6.0.1)", "pydantic (<2)", "pyfakefs", "pytest-asyncio", "pytest-xdist", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<=2.9.3)", "ray[default] (>=2.5,<=2.9.3)", "requests (>=2.28.1)", "requests-toolbelt (<1.0.0)", "scikit-learn", "sentencepiece (>=0.2.0)", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<3.0.0dev)", "tensorflow (==2.13.0)", "tensorflow (==2.16.1)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.3.0,<3.0.0dev)", "tensorflow (>=2.4.0,<3.0.0dev)", "torch (>=2.0.0,<2.1.0)", "torch (>=2.2.0)", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0dev)", "xgboost"] tokenization = ["sentencepiece (>=0.2.0)"] @@ -1821,13 +1821,13 @@ socks = ["socksio (==1.*)"] [[package]] name = "huggingface-hub" -version = "0.24.1" +version = "0.24.2" description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub" optional = false python-versions = ">=3.8.0" files = [ - {file = "huggingface_hub-0.24.1-py3-none-any.whl", hash = "sha256:d3a623d0f2cbb9399299aefc85e3423fa2689f18ab9b6e1aa0f95d1793889f30"}, - {file = "huggingface_hub-0.24.1.tar.gz", hash = "sha256:6915e34c7b1282b0f7c2387c12db21003b79889f1dad57da0434ecd10f3293a8"}, + {file = "huggingface_hub-0.24.2-py3-none-any.whl", hash = "sha256:abdf3244d3a274c4b1fbc5c4a1ef700032b3f60ba93cc63e4f036fd082aa2805"}, + {file = "huggingface_hub-0.24.2.tar.gz", hash = "sha256:92be892405d2f6a7a8479016f9a5662354f202b2c6c1ff499609621aed1fae10"}, ] [package.dependencies] @@ -1891,13 +1891,13 @@ networkx = ">=2" [[package]] name = "importlib-metadata" -version = "8.1.0" +version = "8.2.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-8.1.0-py3-none-any.whl", hash = "sha256:3cd29f739ed65973840b068e3132135ce954c254d48b5b640484467ef7ab3c8c"}, - {file = "importlib_metadata-8.1.0.tar.gz", hash = "sha256:fcdcb1d5ead7bdf3dd32657bb94ebe9d2aabfe89a19782ddc32da5041d6ebfb4"}, + {file = "importlib_metadata-8.2.0-py3-none-any.whl", hash = "sha256:11901fa0c2f97919b288679932bb64febaeacf289d18ac84dd68cb2e74213369"}, + {file = "importlib_metadata-8.2.0.tar.gz", hash = "sha256:72e8d4399996132204f9a16dcc751af254a48f8d1b20b9ff0f98d4a8f901e73d"}, ] [package.dependencies] @@ -3289,13 +3289,13 @@ files = [ [[package]] name = "openai" -version = "1.37.0" +version = "1.37.1" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.37.0-py3-none-any.whl", hash = "sha256:a903245c0ecf622f2830024acdaa78683c70abb8e9d37a497b851670864c9f73"}, - {file = "openai-1.37.0.tar.gz", hash = "sha256:dc8197fc40ab9d431777b6620d962cc49f4544ffc3011f03ce0a805e6eb54adb"}, + {file = "openai-1.37.1-py3-none-any.whl", hash = "sha256:9a6adda0d6ae8fce02d235c5671c399cfa40d6a281b3628914c7ebf244888ee3"}, + {file = "openai-1.37.1.tar.gz", hash = "sha256:faf87206785a6b5d9e34555d6a3242482a6852bc802e453e2a891f68ee04ce55"}, ] [package.dependencies] @@ -3659,22 +3659,22 @@ testing = ["google-api-core (>=1.31.5)"] [[package]] name = "protobuf" -version = "4.25.3" +version = "4.25.4" description = "" optional = false python-versions = ">=3.8" files = [ - {file = "protobuf-4.25.3-cp310-abi3-win32.whl", hash = "sha256:d4198877797a83cbfe9bffa3803602bbe1625dc30d8a097365dbc762e5790faa"}, - {file = "protobuf-4.25.3-cp310-abi3-win_amd64.whl", hash = "sha256:209ba4cc916bab46f64e56b85b090607a676f66b473e6b762e6f1d9d591eb2e8"}, - {file = "protobuf-4.25.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:f1279ab38ecbfae7e456a108c5c0681e4956d5b1090027c1de0f934dfdb4b35c"}, - {file = "protobuf-4.25.3-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:e7cb0ae90dd83727f0c0718634ed56837bfeeee29a5f82a7514c03ee1364c019"}, - {file = "protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:7c8daa26095f82482307bc717364e7c13f4f1c99659be82890dcfc215194554d"}, - {file = "protobuf-4.25.3-cp38-cp38-win32.whl", hash = "sha256:f4f118245c4a087776e0a8408be33cf09f6c547442c00395fbfb116fac2f8ac2"}, - {file = "protobuf-4.25.3-cp38-cp38-win_amd64.whl", hash = "sha256:c053062984e61144385022e53678fbded7aea14ebb3e0305ae3592fb219ccfa4"}, - {file = "protobuf-4.25.3-cp39-cp39-win32.whl", hash = "sha256:19b270aeaa0099f16d3ca02628546b8baefe2955bbe23224aaf856134eccf1e4"}, - {file = "protobuf-4.25.3-cp39-cp39-win_amd64.whl", hash = "sha256:e3c97a1555fd6388f857770ff8b9703083de6bf1f9274a002a332d65fbb56c8c"}, - {file = "protobuf-4.25.3-py3-none-any.whl", hash = "sha256:f0700d54bcf45424477e46a9f0944155b46fb0639d69728739c0e47bab83f2b9"}, - {file = "protobuf-4.25.3.tar.gz", hash = "sha256:25b5d0b42fd000320bd7830b349e3b696435f3b329810427a6bcce6a5492cc5c"}, + {file = "protobuf-4.25.4-cp310-abi3-win32.whl", hash = "sha256:db9fd45183e1a67722cafa5c1da3e85c6492a5383f127c86c4c4aa4845867dc4"}, + {file = "protobuf-4.25.4-cp310-abi3-win_amd64.whl", hash = "sha256:ba3d8504116a921af46499471c63a85260c1a5fc23333154a427a310e015d26d"}, + {file = "protobuf-4.25.4-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:eecd41bfc0e4b1bd3fa7909ed93dd14dd5567b98c941d6c1ad08fdcab3d6884b"}, + {file = "protobuf-4.25.4-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:4c8a70fdcb995dcf6c8966cfa3a29101916f7225e9afe3ced4395359955d3835"}, + {file = "protobuf-4.25.4-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:3319e073562e2515c6ddc643eb92ce20809f5d8f10fead3332f71c63be6a7040"}, + {file = "protobuf-4.25.4-cp38-cp38-win32.whl", hash = "sha256:7e372cbbda66a63ebca18f8ffaa6948455dfecc4e9c1029312f6c2edcd86c4e1"}, + {file = "protobuf-4.25.4-cp38-cp38-win_amd64.whl", hash = "sha256:051e97ce9fa6067a4546e75cb14f90cf0232dcb3e3d508c448b8d0e4265b61c1"}, + {file = "protobuf-4.25.4-cp39-cp39-win32.whl", hash = "sha256:90bf6fd378494eb698805bbbe7afe6c5d12c8e17fca817a646cd6a1818c696ca"}, + {file = "protobuf-4.25.4-cp39-cp39-win_amd64.whl", hash = "sha256:ac79a48d6b99dfed2729ccccee547b34a1d3d63289c71cef056653a846a2240f"}, + {file = "protobuf-4.25.4-py3-none-any.whl", hash = "sha256:bfbebc1c8e4793cfd58589acfb8a1026be0003e852b9da7db5a4285bde996978"}, + {file = "protobuf-4.25.4.tar.gz", hash = "sha256:0dc4a62cc4052a036ee2204d26fe4d835c62827c855c8a03f29fe6da146b380d"}, ] [[package]] @@ -4283,90 +4283,90 @@ rpds-py = ">=0.7.0" [[package]] name = "regex" -version = "2024.5.15" +version = "2024.7.24" description = "Alternative regular expression module, to replace re." optional = false python-versions = ">=3.8" files = [ - {file = "regex-2024.5.15-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a81e3cfbae20378d75185171587cbf756015ccb14840702944f014e0d93ea09f"}, - {file = "regex-2024.5.15-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7b59138b219ffa8979013be7bc85bb60c6f7b7575df3d56dc1e403a438c7a3f6"}, - {file = "regex-2024.5.15-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0bd000c6e266927cb7a1bc39d55be95c4b4f65c5be53e659537537e019232b1"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5eaa7ddaf517aa095fa8da0b5015c44d03da83f5bd49c87961e3c997daed0de7"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba68168daedb2c0bab7fd7e00ced5ba90aebf91024dea3c88ad5063c2a562cca"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6e8d717bca3a6e2064fc3a08df5cbe366369f4b052dcd21b7416e6d71620dca1"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1337b7dbef9b2f71121cdbf1e97e40de33ff114801263b275aafd75303bd62b5"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f9ebd0a36102fcad2f03696e8af4ae682793a5d30b46c647eaf280d6cfb32796"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9efa1a32ad3a3ea112224897cdaeb6aa00381627f567179c0314f7b65d354c62"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:1595f2d10dff3d805e054ebdc41c124753631b6a471b976963c7b28543cf13b0"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:b802512f3e1f480f41ab5f2cfc0e2f761f08a1f41092d6718868082fc0d27143"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:a0981022dccabca811e8171f913de05720590c915b033b7e601f35ce4ea7019f"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:19068a6a79cf99a19ccefa44610491e9ca02c2be3305c7760d3831d38a467a6f"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1b5269484f6126eee5e687785e83c6b60aad7663dafe842b34691157e5083e53"}, - {file = "regex-2024.5.15-cp310-cp310-win32.whl", hash = "sha256:ada150c5adfa8fbcbf321c30c751dc67d2f12f15bd183ffe4ec7cde351d945b3"}, - {file = "regex-2024.5.15-cp310-cp310-win_amd64.whl", hash = "sha256:ac394ff680fc46b97487941f5e6ae49a9f30ea41c6c6804832063f14b2a5a145"}, - {file = "regex-2024.5.15-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f5b1dff3ad008dccf18e652283f5e5339d70bf8ba7c98bf848ac33db10f7bc7a"}, - {file = "regex-2024.5.15-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c6a2b494a76983df8e3d3feea9b9ffdd558b247e60b92f877f93a1ff43d26656"}, - {file = "regex-2024.5.15-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a32b96f15c8ab2e7d27655969a23895eb799de3665fa94349f3b2fbfd547236f"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:10002e86e6068d9e1c91eae8295ef690f02f913c57db120b58fdd35a6bb1af35"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ec54d5afa89c19c6dd8541a133be51ee1017a38b412b1321ccb8d6ddbeb4cf7d"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:10e4ce0dca9ae7a66e6089bb29355d4432caed736acae36fef0fdd7879f0b0cb"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e507ff1e74373c4d3038195fdd2af30d297b4f0950eeda6f515ae3d84a1770f"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d1f059a4d795e646e1c37665b9d06062c62d0e8cc3c511fe01315973a6542e40"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0721931ad5fe0dda45d07f9820b90b2148ccdd8e45bb9e9b42a146cb4f695649"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:833616ddc75ad595dee848ad984d067f2f31be645d603e4d158bba656bbf516c"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:287eb7f54fc81546346207c533ad3c2c51a8d61075127d7f6d79aaf96cdee890"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:19dfb1c504781a136a80ecd1fff9f16dddf5bb43cec6871778c8a907a085bb3d"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:119af6e56dce35e8dfb5222573b50c89e5508d94d55713c75126b753f834de68"}, - {file = "regex-2024.5.15-cp311-cp311-win32.whl", hash = "sha256:1c1c174d6ec38d6c8a7504087358ce9213d4332f6293a94fbf5249992ba54efa"}, - {file = "regex-2024.5.15-cp311-cp311-win_amd64.whl", hash = "sha256:9e717956dcfd656f5055cc70996ee2cc82ac5149517fc8e1b60261b907740201"}, - {file = "regex-2024.5.15-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:632b01153e5248c134007209b5c6348a544ce96c46005d8456de1d552455b014"}, - {file = "regex-2024.5.15-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e64198f6b856d48192bf921421fdd8ad8eb35e179086e99e99f711957ffedd6e"}, - {file = "regex-2024.5.15-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68811ab14087b2f6e0fc0c2bae9ad689ea3584cad6917fc57be6a48bbd012c49"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f8ec0c2fea1e886a19c3bee0cd19d862b3aa75dcdfb42ebe8ed30708df64687a"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d0c0c0003c10f54a591d220997dd27d953cd9ccc1a7294b40a4be5312be8797b"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2431b9e263af1953c55abbd3e2efca67ca80a3de8a0437cb58e2421f8184717a"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a605586358893b483976cffc1723fb0f83e526e8f14c6e6614e75919d9862cf"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:391d7f7f1e409d192dba8bcd42d3e4cf9e598f3979cdaed6ab11288da88cb9f2"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9ff11639a8d98969c863d4617595eb5425fd12f7c5ef6621a4b74b71ed8726d5"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4eee78a04e6c67e8391edd4dad3279828dd66ac4b79570ec998e2155d2e59fd5"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8fe45aa3f4aa57faabbc9cb46a93363edd6197cbc43523daea044e9ff2fea83e"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:d0a3d8d6acf0c78a1fff0e210d224b821081330b8524e3e2bc5a68ef6ab5803d"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c486b4106066d502495b3025a0a7251bf37ea9540433940a23419461ab9f2a80"}, - {file = "regex-2024.5.15-cp312-cp312-win32.whl", hash = "sha256:c49e15eac7c149f3670b3e27f1f28a2c1ddeccd3a2812cba953e01be2ab9b5fe"}, - {file = "regex-2024.5.15-cp312-cp312-win_amd64.whl", hash = "sha256:673b5a6da4557b975c6c90198588181029c60793835ce02f497ea817ff647cb2"}, - {file = "regex-2024.5.15-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:87e2a9c29e672fc65523fb47a90d429b70ef72b901b4e4b1bd42387caf0d6835"}, - {file = "regex-2024.5.15-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c3bea0ba8b73b71b37ac833a7f3fd53825924165da6a924aec78c13032f20850"}, - {file = "regex-2024.5.15-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bfc4f82cabe54f1e7f206fd3d30fda143f84a63fe7d64a81558d6e5f2e5aaba9"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5bb9425fe881d578aeca0b2b4b3d314ec88738706f66f219c194d67179337cb"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:64c65783e96e563103d641760664125e91bd85d8e49566ee560ded4da0d3e704"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cf2430df4148b08fb4324b848672514b1385ae3807651f3567871f130a728cc3"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5397de3219a8b08ae9540c48f602996aa6b0b65d5a61683e233af8605c42b0f2"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:455705d34b4154a80ead722f4f185b04c4237e8e8e33f265cd0798d0e44825fa"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b2b6f1b3bb6f640c1a92be3bbfbcb18657b125b99ecf141fb3310b5282c7d4ed"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3ad070b823ca5890cab606c940522d05d3d22395d432f4aaaf9d5b1653e47ced"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:5b5467acbfc153847d5adb21e21e29847bcb5870e65c94c9206d20eb4e99a384"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:e6662686aeb633ad65be2a42b4cb00178b3fbf7b91878f9446075c404ada552f"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:2b4c884767504c0e2401babe8b5b7aea9148680d2e157fa28f01529d1f7fcf67"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:3cd7874d57f13bf70078f1ff02b8b0aa48d5b9ed25fc48547516c6aba36f5741"}, - {file = "regex-2024.5.15-cp38-cp38-win32.whl", hash = "sha256:e4682f5ba31f475d58884045c1a97a860a007d44938c4c0895f41d64481edbc9"}, - {file = "regex-2024.5.15-cp38-cp38-win_amd64.whl", hash = "sha256:d99ceffa25ac45d150e30bd9ed14ec6039f2aad0ffa6bb87a5936f5782fc1569"}, - {file = "regex-2024.5.15-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:13cdaf31bed30a1e1c2453ef6015aa0983e1366fad2667657dbcac7b02f67133"}, - {file = "regex-2024.5.15-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cac27dcaa821ca271855a32188aa61d12decb6fe45ffe3e722401fe61e323cd1"}, - {file = "regex-2024.5.15-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7dbe2467273b875ea2de38ded4eba86cbcbc9a1a6d0aa11dcf7bd2e67859c435"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64f18a9a3513a99c4bef0e3efd4c4a5b11228b48aa80743be822b71e132ae4f5"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d347a741ea871c2e278fde6c48f85136c96b8659b632fb57a7d1ce1872547600"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1878b8301ed011704aea4c806a3cadbd76f84dece1ec09cc9e4dc934cfa5d4da"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4babf07ad476aaf7830d77000874d7611704a7fcf68c9c2ad151f5d94ae4bfc4"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:35cb514e137cb3488bce23352af3e12fb0dbedd1ee6e60da053c69fb1b29cc6c"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cdd09d47c0b2efee9378679f8510ee6955d329424c659ab3c5e3a6edea696294"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:72d7a99cd6b8f958e85fc6ca5b37c4303294954eac1376535b03c2a43eb72629"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:a094801d379ab20c2135529948cb84d417a2169b9bdceda2a36f5f10977ebc16"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c0c18345010870e58238790a6779a1219b4d97bd2e77e1140e8ee5d14df071aa"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:16093f563098448ff6b1fa68170e4acbef94e6b6a4e25e10eae8598bb1694b5d"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:e38a7d4e8f633a33b4c7350fbd8bad3b70bf81439ac67ac38916c4a86b465456"}, - {file = "regex-2024.5.15-cp39-cp39-win32.whl", hash = "sha256:71a455a3c584a88f654b64feccc1e25876066c4f5ef26cd6dd711308aa538694"}, - {file = "regex-2024.5.15-cp39-cp39-win_amd64.whl", hash = "sha256:cab12877a9bdafde5500206d1020a584355a97884dfd388af3699e9137bf7388"}, - {file = "regex-2024.5.15.tar.gz", hash = "sha256:d3ee02d9e5f482cc8309134a91eeaacbdd2261ba111b0fef3748eeb4913e6a2c"}, + {file = "regex-2024.7.24-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b0d3f567fafa0633aee87f08b9276c7062da9616931382993c03808bb68ce"}, + {file = "regex-2024.7.24-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3426de3b91d1bc73249042742f45c2148803c111d1175b283270177fdf669024"}, + {file = "regex-2024.7.24-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f273674b445bcb6e4409bf8d1be67bc4b58e8b46fd0d560055d515b8830063cd"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23acc72f0f4e1a9e6e9843d6328177ae3074b4182167e34119ec7233dfeccf53"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65fd3d2e228cae024c411c5ccdffae4c315271eee4a8b839291f84f796b34eca"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c414cbda77dbf13c3bc88b073a1a9f375c7b0cb5e115e15d4b73ec3a2fbc6f59"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf7a89eef64b5455835f5ed30254ec19bf41f7541cd94f266ab7cbd463f00c41"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19c65b00d42804e3fbea9708f0937d157e53429a39b7c61253ff15670ff62cb5"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7a5486ca56c8869070a966321d5ab416ff0f83f30e0e2da1ab48815c8d165d46"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:6f51f9556785e5a203713f5efd9c085b4a45aecd2a42573e2b5041881b588d1f"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:a4997716674d36a82eab3e86f8fa77080a5d8d96a389a61ea1d0e3a94a582cf7"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:c0abb5e4e8ce71a61d9446040c1e86d4e6d23f9097275c5bd49ed978755ff0fe"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:18300a1d78cf1290fa583cd8b7cde26ecb73e9f5916690cf9d42de569c89b1ce"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:416c0e4f56308f34cdb18c3f59849479dde5b19febdcd6e6fa4d04b6c31c9faa"}, + {file = "regex-2024.7.24-cp310-cp310-win32.whl", hash = "sha256:fb168b5924bef397b5ba13aabd8cf5df7d3d93f10218d7b925e360d436863f66"}, + {file = "regex-2024.7.24-cp310-cp310-win_amd64.whl", hash = "sha256:6b9fc7e9cc983e75e2518496ba1afc524227c163e43d706688a6bb9eca41617e"}, + {file = "regex-2024.7.24-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:382281306e3adaaa7b8b9ebbb3ffb43358a7bbf585fa93821300a418bb975281"}, + {file = "regex-2024.7.24-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4fdd1384619f406ad9037fe6b6eaa3de2749e2e12084abc80169e8e075377d3b"}, + {file = "regex-2024.7.24-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3d974d24edb231446f708c455fd08f94c41c1ff4f04bcf06e5f36df5ef50b95a"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a2ec4419a3fe6cf8a4795752596dfe0adb4aea40d3683a132bae9c30b81e8d73"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eb563dd3aea54c797adf513eeec819c4213d7dbfc311874eb4fd28d10f2ff0f2"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:45104baae8b9f67569f0f1dca5e1f1ed77a54ae1cd8b0b07aba89272710db61e"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:994448ee01864501912abf2bad9203bffc34158e80fe8bfb5b031f4f8e16da51"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3fac296f99283ac232d8125be932c5cd7644084a30748fda013028c815ba3364"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7e37e809b9303ec3a179085415cb5f418ecf65ec98cdfe34f6a078b46ef823ee"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:01b689e887f612610c869421241e075c02f2e3d1ae93a037cb14f88ab6a8934c"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f6442f0f0ff81775eaa5b05af8a0ffa1dda36e9cf6ec1e0d3d245e8564b684ce"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:871e3ab2838fbcb4e0865a6e01233975df3a15e6fce93b6f99d75cacbd9862d1"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c918b7a1e26b4ab40409820ddccc5d49871a82329640f5005f73572d5eaa9b5e"}, + {file = "regex-2024.7.24-cp311-cp311-win32.whl", hash = "sha256:2dfbb8baf8ba2c2b9aa2807f44ed272f0913eeeba002478c4577b8d29cde215c"}, + {file = "regex-2024.7.24-cp311-cp311-win_amd64.whl", hash = "sha256:538d30cd96ed7d1416d3956f94d54e426a8daf7c14527f6e0d6d425fcb4cca52"}, + {file = "regex-2024.7.24-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:fe4ebef608553aff8deb845c7f4f1d0740ff76fa672c011cc0bacb2a00fbde86"}, + {file = "regex-2024.7.24-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:74007a5b25b7a678459f06559504f1eec2f0f17bca218c9d56f6a0a12bfffdad"}, + {file = "regex-2024.7.24-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7df9ea48641da022c2a3c9c641650cd09f0cd15e8908bf931ad538f5ca7919c9"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a1141a1dcc32904c47f6846b040275c6e5de0bf73f17d7a409035d55b76f289"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80c811cfcb5c331237d9bad3bea2c391114588cf4131707e84d9493064d267f9"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7214477bf9bd195894cf24005b1e7b496f46833337b5dedb7b2a6e33f66d962c"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d55588cba7553f0b6ec33130bc3e114b355570b45785cebdc9daed8c637dd440"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:558a57cfc32adcf19d3f791f62b5ff564922942e389e3cfdb538a23d65a6b610"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a512eed9dfd4117110b1881ba9a59b31433caed0c4101b361f768e7bcbaf93c5"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:86b17ba823ea76256b1885652e3a141a99a5c4422f4a869189db328321b73799"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5eefee9bfe23f6df09ffb6dfb23809f4d74a78acef004aa904dc7c88b9944b05"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:731fcd76bbdbf225e2eb85b7c38da9633ad3073822f5ab32379381e8c3c12e94"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:eaef80eac3b4cfbdd6de53c6e108b4c534c21ae055d1dbea2de6b3b8ff3def38"}, + {file = "regex-2024.7.24-cp312-cp312-win32.whl", hash = "sha256:185e029368d6f89f36e526764cf12bf8d6f0e3a2a7737da625a76f594bdfcbfc"}, + {file = "regex-2024.7.24-cp312-cp312-win_amd64.whl", hash = "sha256:2f1baff13cc2521bea83ab2528e7a80cbe0ebb2c6f0bfad15be7da3aed443908"}, + {file = "regex-2024.7.24-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:66b4c0731a5c81921e938dcf1a88e978264e26e6ac4ec96a4d21ae0354581ae0"}, + {file = "regex-2024.7.24-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:88ecc3afd7e776967fa16c80f974cb79399ee8dc6c96423321d6f7d4b881c92b"}, + {file = "regex-2024.7.24-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:64bd50cf16bcc54b274e20235bf8edbb64184a30e1e53873ff8d444e7ac656b2"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb462f0e346fcf41a901a126b50f8781e9a474d3927930f3490f38a6e73b6950"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a82465ebbc9b1c5c50738536fdfa7cab639a261a99b469c9d4c7dcbb2b3f1e57"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:68a8f8c046c6466ac61a36b65bb2395c74451df2ffb8458492ef49900efed293"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac8e84fff5d27420f3c1e879ce9929108e873667ec87e0c8eeb413a5311adfe"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ba2537ef2163db9e6ccdbeb6f6424282ae4dea43177402152c67ef869cf3978b"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:43affe33137fcd679bdae93fb25924979517e011f9dea99163f80b82eadc7e53"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:c9bb87fdf2ab2370f21e4d5636e5317775e5d51ff32ebff2cf389f71b9b13750"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:945352286a541406f99b2655c973852da7911b3f4264e010218bbc1cc73168f2"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:8bc593dcce679206b60a538c302d03c29b18e3d862609317cb560e18b66d10cf"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:3f3b6ca8eae6d6c75a6cff525c8530c60e909a71a15e1b731723233331de4169"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c51edc3541e11fbe83f0c4d9412ef6c79f664a3745fab261457e84465ec9d5a8"}, + {file = "regex-2024.7.24-cp38-cp38-win32.whl", hash = "sha256:d0a07763776188b4db4c9c7fb1b8c494049f84659bb387b71c73bbc07f189e96"}, + {file = "regex-2024.7.24-cp38-cp38-win_amd64.whl", hash = "sha256:8fd5afd101dcf86a270d254364e0e8dddedebe6bd1ab9d5f732f274fa00499a5"}, + {file = "regex-2024.7.24-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0ffe3f9d430cd37d8fa5632ff6fb36d5b24818c5c986893063b4e5bdb84cdf24"}, + {file = "regex-2024.7.24-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:25419b70ba00a16abc90ee5fce061228206173231f004437730b67ac77323f0d"}, + {file = "regex-2024.7.24-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:33e2614a7ce627f0cdf2ad104797d1f68342d967de3695678c0cb84f530709f8"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d33a0021893ede5969876052796165bab6006559ab845fd7b515a30abdd990dc"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04ce29e2c5fedf296b1a1b0acc1724ba93a36fb14031f3abfb7abda2806c1535"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b16582783f44fbca6fcf46f61347340c787d7530d88b4d590a397a47583f31dd"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:836d3cc225b3e8a943d0b02633fb2f28a66e281290302a79df0e1eaa984ff7c1"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:438d9f0f4bc64e8dea78274caa5af971ceff0f8771e1a2333620969936ba10be"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:973335b1624859cb0e52f96062a28aa18f3a5fc77a96e4a3d6d76e29811a0e6e"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c5e69fd3eb0b409432b537fe3c6f44ac089c458ab6b78dcec14478422879ec5f"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fbf8c2f00904eaf63ff37718eb13acf8e178cb940520e47b2f05027f5bb34ce3"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ae2757ace61bc4061b69af19e4689fa4416e1a04840f33b441034202b5cd02d4"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:44fc61b99035fd9b3b9453f1713234e5a7c92a04f3577252b45feefe1b327759"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:84c312cdf839e8b579f504afcd7b65f35d60b6285d892b19adea16355e8343c9"}, + {file = "regex-2024.7.24-cp39-cp39-win32.whl", hash = "sha256:ca5b2028c2f7af4e13fb9fc29b28d0ce767c38c7facdf64f6c2cd040413055f1"}, + {file = "regex-2024.7.24-cp39-cp39-win_amd64.whl", hash = "sha256:7c479f5ae937ec9985ecaf42e2e10631551d909f203e31308c12d703922742f9"}, + {file = "regex-2024.7.24.tar.gz", hash = "sha256:9cfd009eed1a46b27c14039ad5bbc5e71b6367c5b2e6d5f5da0ea91600817506"}, ] [[package]] @@ -4435,110 +4435,114 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "rpds-py" -version = "0.19.0" +version = "0.19.1" description = "Python bindings to Rust's persistent data structures (rpds)" optional = false python-versions = ">=3.8" files = [ - {file = "rpds_py-0.19.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:fb37bd599f031f1a6fb9e58ec62864ccf3ad549cf14bac527dbfa97123edcca4"}, - {file = "rpds_py-0.19.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3384d278df99ec2c6acf701d067147320b864ef6727405d6470838476e44d9e8"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e54548e0be3ac117595408fd4ca0ac9278fde89829b0b518be92863b17ff67a2"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8eb488ef928cdbc05a27245e52de73c0d7c72a34240ef4d9893fdf65a8c1a955"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a5da93debdfe27b2bfc69eefb592e1831d957b9535e0943a0ee8b97996de21b5"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:79e205c70afddd41f6ee79a8656aec738492a550247a7af697d5bd1aee14f766"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:959179efb3e4a27610e8d54d667c02a9feaa86bbabaf63efa7faa4dfa780d4f1"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a6e605bb9edcf010f54f8b6a590dd23a4b40a8cb141255eec2a03db249bc915b"}, - {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9133d75dc119a61d1a0ded38fb9ba40a00ef41697cc07adb6ae098c875195a3f"}, - {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dd36b712d35e757e28bf2f40a71e8f8a2d43c8b026d881aa0c617b450d6865c9"}, - {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:354f3a91718489912f2e0fc331c24eaaf6a4565c080e00fbedb6015857c00582"}, - {file = "rpds_py-0.19.0-cp310-none-win32.whl", hash = "sha256:ebcbf356bf5c51afc3290e491d3722b26aaf5b6af3c1c7f6a1b757828a46e336"}, - {file = "rpds_py-0.19.0-cp310-none-win_amd64.whl", hash = "sha256:75a6076289b2df6c8ecb9d13ff79ae0cad1d5fb40af377a5021016d58cd691ec"}, - {file = "rpds_py-0.19.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6d45080095e585f8c5097897313def60caa2046da202cdb17a01f147fb263b81"}, - {file = "rpds_py-0.19.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5c9581019c96f865483d031691a5ff1cc455feb4d84fc6920a5ffc48a794d8a"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1540d807364c84516417115c38f0119dfec5ea5c0dd9a25332dea60b1d26fc4d"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9e65489222b410f79711dc3d2d5003d2757e30874096b2008d50329ea4d0f88c"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9da6f400eeb8c36f72ef6646ea530d6d175a4f77ff2ed8dfd6352842274c1d8b"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37f46bb11858717e0efa7893c0f7055c43b44c103e40e69442db5061cb26ed34"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:071d4adc734de562bd11d43bd134330fb6249769b2f66b9310dab7460f4bf714"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9625367c8955e4319049113ea4f8fee0c6c1145192d57946c6ffcd8fe8bf48dd"}, - {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e19509145275d46bc4d1e16af0b57a12d227c8253655a46bbd5ec317e941279d"}, - {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d438e4c020d8c39961deaf58f6913b1bf8832d9b6f62ec35bd93e97807e9cbc"}, - {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:90bf55d9d139e5d127193170f38c584ed3c79e16638890d2e36f23aa1630b952"}, - {file = "rpds_py-0.19.0-cp311-none-win32.whl", hash = "sha256:8d6ad132b1bc13d05ffe5b85e7a01a3998bf3a6302ba594b28d61b8c2cf13aaf"}, - {file = "rpds_py-0.19.0-cp311-none-win_amd64.whl", hash = "sha256:7ec72df7354e6b7f6eb2a17fa6901350018c3a9ad78e48d7b2b54d0412539a67"}, - {file = "rpds_py-0.19.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:5095a7c838a8647c32aa37c3a460d2c48debff7fc26e1136aee60100a8cd8f68"}, - {file = "rpds_py-0.19.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f2f78ef14077e08856e788fa482107aa602636c16c25bdf59c22ea525a785e9"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7cc6cb44f8636fbf4a934ca72f3e786ba3c9f9ba4f4d74611e7da80684e48d2"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cf902878b4af334a09de7a45badbff0389e7cf8dc2e4dcf5f07125d0b7c2656d"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:688aa6b8aa724db1596514751ffb767766e02e5c4a87486ab36b8e1ebc1aedac"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57dbc9167d48e355e2569346b5aa4077f29bf86389c924df25c0a8b9124461fb"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b4cf5a9497874822341c2ebe0d5850fed392034caadc0bad134ab6822c0925b"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8a790d235b9d39c70a466200d506bb33a98e2ee374a9b4eec7a8ac64c2c261fa"}, - {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1d16089dfa58719c98a1c06f2daceba6d8e3fb9b5d7931af4a990a3c486241cb"}, - {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:bc9128e74fe94650367fe23f37074f121b9f796cabbd2f928f13e9661837296d"}, - {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c8f77e661ffd96ff104bebf7d0f3255b02aa5d5b28326f5408d6284c4a8b3248"}, - {file = "rpds_py-0.19.0-cp312-none-win32.whl", hash = "sha256:5f83689a38e76969327e9b682be5521d87a0c9e5a2e187d2bc6be4765f0d4600"}, - {file = "rpds_py-0.19.0-cp312-none-win_amd64.whl", hash = "sha256:06925c50f86da0596b9c3c64c3837b2481337b83ef3519e5db2701df695453a4"}, - {file = "rpds_py-0.19.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:52e466bea6f8f3a44b1234570244b1cff45150f59a4acae3fcc5fd700c2993ca"}, - {file = "rpds_py-0.19.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e21cc693045fda7f745c790cb687958161ce172ffe3c5719ca1764e752237d16"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b31f059878eb1f5da8b2fd82480cc18bed8dcd7fb8fe68370e2e6285fa86da6"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1dd46f309e953927dd018567d6a9e2fb84783963650171f6c5fe7e5c41fd5666"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34a01a4490e170376cd79258b7f755fa13b1a6c3667e872c8e35051ae857a92b"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bcf426a8c38eb57f7bf28932e68425ba86def6e756a5b8cb4731d8e62e4e0223"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68eea5df6347d3f1378ce992d86b2af16ad7ff4dcb4a19ccdc23dea901b87fb"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dab8d921b55a28287733263c0e4c7db11b3ee22aee158a4de09f13c93283c62d"}, - {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6fe87efd7f47266dfc42fe76dae89060038f1d9cb911f89ae7e5084148d1cc08"}, - {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:535d4b52524a961d220875688159277f0e9eeeda0ac45e766092bfb54437543f"}, - {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:8b1a94b8afc154fbe36978a511a1f155f9bd97664e4f1f7a374d72e180ceb0ae"}, - {file = "rpds_py-0.19.0-cp38-none-win32.whl", hash = "sha256:7c98298a15d6b90c8f6e3caa6457f4f022423caa5fa1a1ca7a5e9e512bdb77a4"}, - {file = "rpds_py-0.19.0-cp38-none-win_amd64.whl", hash = "sha256:b0da31853ab6e58a11db3205729133ce0df26e6804e93079dee095be3d681dc1"}, - {file = "rpds_py-0.19.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:5039e3cef7b3e7a060de468a4a60a60a1f31786da94c6cb054e7a3c75906111c"}, - {file = "rpds_py-0.19.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab1932ca6cb8c7499a4d87cb21ccc0d3326f172cfb6a64021a889b591bb3045c"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2afd2164a1e85226fcb6a1da77a5c8896c18bfe08e82e8ceced5181c42d2179"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b1c30841f5040de47a0046c243fc1b44ddc87d1b12435a43b8edff7e7cb1e0d0"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f757f359f30ec7dcebca662a6bd46d1098f8b9fb1fcd661a9e13f2e8ce343ba1"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15e65395a59d2e0e96caf8ee5389ffb4604e980479c32742936ddd7ade914b22"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb0f6eb3a320f24b94d177e62f4074ff438f2ad9d27e75a46221904ef21a7b05"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b228e693a2559888790936e20f5f88b6e9f8162c681830eda303bad7517b4d5a"}, - {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2575efaa5d949c9f4e2cdbe7d805d02122c16065bfb8d95c129372d65a291a0b"}, - {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5c872814b77a4e84afa293a1bee08c14daed1068b2bb1cc312edbf020bbbca2b"}, - {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:850720e1b383df199b8433a20e02b25b72f0fded28bc03c5bd79e2ce7ef050be"}, - {file = "rpds_py-0.19.0-cp39-none-win32.whl", hash = "sha256:ce84a7efa5af9f54c0aa7692c45861c1667080814286cacb9958c07fc50294fb"}, - {file = "rpds_py-0.19.0-cp39-none-win_amd64.whl", hash = "sha256:1c26da90b8d06227d7769f34915913911222d24ce08c0ab2d60b354e2d9c7aff"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:75969cf900d7be665ccb1622a9aba225cf386bbc9c3bcfeeab9f62b5048f4a07"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:8445f23f13339da640d1be8e44e5baf4af97e396882ebbf1692aecd67f67c479"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5a7c1062ef8aea3eda149f08120f10795835fc1c8bc6ad948fb9652a113ca55"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:462b0c18fbb48fdbf980914a02ee38c423a25fcc4cf40f66bacc95a2d2d73bc8"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3208f9aea18991ac7f2b39721e947bbd752a1abbe79ad90d9b6a84a74d44409b"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3444fe52b82f122d8a99bf66777aed6b858d392b12f4c317da19f8234db4533"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88cb4bac7185a9f0168d38c01d7a00addece9822a52870eee26b8d5b61409213"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6b130bd4163c93798a6b9bb96be64a7c43e1cec81126ffa7ffaa106e1fc5cef5"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:a707b158b4410aefb6b054715545bbb21aaa5d5d0080217290131c49c2124a6e"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:dc9ac4659456bde7c567107556ab065801622396b435a3ff213daef27b495388"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:81ea573aa46d3b6b3d890cd3c0ad82105985e6058a4baed03cf92518081eec8c"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3f148c3f47f7f29a79c38cc5d020edcb5ca780020fab94dbc21f9af95c463581"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0906357f90784a66e89ae3eadc2654f36c580a7d65cf63e6a616e4aec3a81be"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f629ecc2db6a4736b5ba95a8347b0089240d69ad14ac364f557d52ad68cf94b0"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6feacd1d178c30e5bc37184526e56740342fd2aa6371a28367bad7908d454fc"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae8b6068ee374fdfab63689be0963333aa83b0815ead5d8648389a8ded593378"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78d57546bad81e0da13263e4c9ce30e96dcbe720dbff5ada08d2600a3502e526"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8b6683a37338818646af718c9ca2a07f89787551057fae57c4ec0446dc6224b"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e8481b946792415adc07410420d6fc65a352b45d347b78fec45d8f8f0d7496f0"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:bec35eb20792ea64c3c57891bc3ca0bedb2884fbac2c8249d9b731447ecde4fa"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:aa5476c3e3a402c37779e95f7b4048db2cb5b0ed0b9d006983965e93f40fe05a"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:19d02c45f2507b489fd4df7b827940f1420480b3e2e471e952af4d44a1ea8e34"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a3e2fd14c5d49ee1da322672375963f19f32b3d5953f0615b175ff7b9d38daed"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:93a91c2640645303e874eada51f4f33351b84b351a689d470f8108d0e0694210"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5b9fc03bf76a94065299d4a2ecd8dfbae4ae8e2e8098bbfa6ab6413ca267709"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5a4b07cdf3f84310c08c1de2c12ddadbb7a77568bcb16e95489f9c81074322ed"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba0ed0dc6763d8bd6e5de5cf0d746d28e706a10b615ea382ac0ab17bb7388633"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:474bc83233abdcf2124ed3f66230a1c8435896046caa4b0b5ab6013c640803cc"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329c719d31362355a96b435f4653e3b4b061fcc9eba9f91dd40804ca637d914e"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ef9101f3f7b59043a34f1dccbb385ca760467590951952d6701df0da9893ca0c"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:0121803b0f424ee2109d6e1f27db45b166ebaa4b32ff47d6aa225642636cd834"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:8344127403dea42f5970adccf6c5957a71a47f522171fafaf4c6ddb41b61703a"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:443cec402ddd650bb2b885113e1dcedb22b1175c6be223b14246a714b61cd521"}, - {file = "rpds_py-0.19.0.tar.gz", hash = "sha256:4fdc9afadbeb393b4bbbad75481e0ea78e4469f2e1d713a90811700830b553a9"}, + {file = "rpds_py-0.19.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:aaf71f95b21f9dc708123335df22e5a2fef6307e3e6f9ed773b2e0938cc4d491"}, + {file = "rpds_py-0.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ca0dda0c5715efe2ab35bb83f813f681ebcd2840d8b1b92bfc6fe3ab382fae4a"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81db2e7282cc0487f500d4db203edc57da81acde9e35f061d69ed983228ffe3b"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1a8dfa125b60ec00c7c9baef945bb04abf8ac772d8ebefd79dae2a5f316d7850"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:271accf41b02687cef26367c775ab220372ee0f4925591c6796e7c148c50cab5"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f9bc4161bd3b970cd6a6fcda70583ad4afd10f2750609fb1f3ca9505050d4ef3"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0cf2a0dbb5987da4bd92a7ca727eadb225581dd9681365beba9accbe5308f7d"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b5e28e56143750808c1c79c70a16519e9bc0a68b623197b96292b21b62d6055c"}, + {file = "rpds_py-0.19.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c7af6f7b80f687b33a4cdb0a785a5d4de1fb027a44c9a049d8eb67d5bfe8a687"}, + {file = "rpds_py-0.19.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e429fc517a1c5e2a70d576077231538a98d59a45dfc552d1ac45a132844e6dfb"}, + {file = "rpds_py-0.19.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d2dbd8f4990d4788cb122f63bf000357533f34860d269c1a8e90ae362090ff3a"}, + {file = "rpds_py-0.19.1-cp310-none-win32.whl", hash = "sha256:e0f9d268b19e8f61bf42a1da48276bcd05f7ab5560311f541d22557f8227b866"}, + {file = "rpds_py-0.19.1-cp310-none-win_amd64.whl", hash = "sha256:df7c841813f6265e636fe548a49664c77af31ddfa0085515326342a751a6ba51"}, + {file = "rpds_py-0.19.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:902cf4739458852fe917104365ec0efbea7d29a15e4276c96a8d33e6ed8ec137"}, + {file = "rpds_py-0.19.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f3d73022990ab0c8b172cce57c69fd9a89c24fd473a5e79cbce92df87e3d9c48"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3837c63dd6918a24de6c526277910e3766d8c2b1627c500b155f3eecad8fad65"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cdb7eb3cf3deb3dd9e7b8749323b5d970052711f9e1e9f36364163627f96da58"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:26ab43b6d65d25b1a333c8d1b1c2f8399385ff683a35ab5e274ba7b8bb7dc61c"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75130df05aae7a7ac171b3b5b24714cffeabd054ad2ebc18870b3aa4526eba23"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c34f751bf67cab69638564eee34023909380ba3e0d8ee7f6fe473079bf93f09b"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2671cb47e50a97f419a02cd1e0c339b31de017b033186358db92f4d8e2e17d8"}, + {file = "rpds_py-0.19.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:3c73254c256081704dba0a333457e2fb815364018788f9b501efe7c5e0ada401"}, + {file = "rpds_py-0.19.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4383beb4a29935b8fa28aca8fa84c956bf545cb0c46307b091b8d312a9150e6a"}, + {file = "rpds_py-0.19.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:dbceedcf4a9329cc665452db1aaf0845b85c666e4885b92ee0cddb1dbf7e052a"}, + {file = "rpds_py-0.19.1-cp311-none-win32.whl", hash = "sha256:f0a6d4a93d2a05daec7cb885157c97bbb0be4da739d6f9dfb02e101eb40921cd"}, + {file = "rpds_py-0.19.1-cp311-none-win_amd64.whl", hash = "sha256:c149a652aeac4902ecff2dd93c3b2681c608bd5208c793c4a99404b3e1afc87c"}, + {file = "rpds_py-0.19.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:56313be667a837ff1ea3508cebb1ef6681d418fa2913a0635386cf29cff35165"}, + {file = "rpds_py-0.19.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6d1d7539043b2b31307f2c6c72957a97c839a88b2629a348ebabe5aa8b626d6b"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e1dc59a5e7bc7f44bd0c048681f5e05356e479c50be4f2c1a7089103f1621d5"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b8f78398e67a7227aefa95f876481485403eb974b29e9dc38b307bb6eb2315ea"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ef07a0a1d254eeb16455d839cef6e8c2ed127f47f014bbda64a58b5482b6c836"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8124101e92c56827bebef084ff106e8ea11c743256149a95b9fd860d3a4f331f"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08ce9c95a0b093b7aec75676b356a27879901488abc27e9d029273d280438505"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0b02dd77a2de6e49078c8937aadabe933ceac04b41c5dde5eca13a69f3cf144e"}, + {file = "rpds_py-0.19.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4dd02e29c8cbed21a1875330b07246b71121a1c08e29f0ee3db5b4cfe16980c4"}, + {file = "rpds_py-0.19.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9c7042488165f7251dc7894cd533a875d2875af6d3b0e09eda9c4b334627ad1c"}, + {file = "rpds_py-0.19.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f809a17cc78bd331e137caa25262b507225854073fd319e987bd216bed911b7c"}, + {file = "rpds_py-0.19.1-cp312-none-win32.whl", hash = "sha256:3ddab996807c6b4227967fe1587febade4e48ac47bb0e2d3e7858bc621b1cace"}, + {file = "rpds_py-0.19.1-cp312-none-win_amd64.whl", hash = "sha256:32e0db3d6e4f45601b58e4ac75c6f24afbf99818c647cc2066f3e4b192dabb1f"}, + {file = "rpds_py-0.19.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:747251e428406b05fc86fee3904ee19550c4d2d19258cef274e2151f31ae9d38"}, + {file = "rpds_py-0.19.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dc733d35f861f8d78abfaf54035461e10423422999b360966bf1c443cbc42705"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bbda75f245caecff8faa7e32ee94dfaa8312a3367397975527f29654cd17a6ed"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bd04d8cab16cab5b0a9ffc7d10f0779cf1120ab16c3925404428f74a0a43205a"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2d66eb41ffca6cc3c91d8387509d27ba73ad28371ef90255c50cb51f8953301"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fdf4890cda3b59170009d012fca3294c00140e7f2abe1910e6a730809d0f3f9b"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1fa67ef839bad3815124f5f57e48cd50ff392f4911a9f3cf449d66fa3df62a5"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b82c9514c6d74b89a370c4060bdb80d2299bc6857e462e4a215b4ef7aa7b090e"}, + {file = "rpds_py-0.19.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c7b07959866a6afb019abb9564d8a55046feb7a84506c74a6f197cbcdf8a208e"}, + {file = "rpds_py-0.19.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4f580ae79d0b861dfd912494ab9d477bea535bfb4756a2269130b6607a21802e"}, + {file = "rpds_py-0.19.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c6d20c8896c00775e6f62d8373aba32956aa0b850d02b5ec493f486c88e12859"}, + {file = "rpds_py-0.19.1-cp313-none-win32.whl", hash = "sha256:afedc35fe4b9e30ab240b208bb9dc8938cb4afe9187589e8d8d085e1aacb8309"}, + {file = "rpds_py-0.19.1-cp313-none-win_amd64.whl", hash = "sha256:1d4af2eb520d759f48f1073ad3caef997d1bfd910dc34e41261a595d3f038a94"}, + {file = "rpds_py-0.19.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:34bca66e2e3eabc8a19e9afe0d3e77789733c702c7c43cd008e953d5d1463fde"}, + {file = "rpds_py-0.19.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:24f8ae92c7fae7c28d0fae9b52829235df83f34847aa8160a47eb229d9666c7b"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71157f9db7f6bc6599a852852f3389343bea34315b4e6f109e5cbc97c1fb2963"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1d494887d40dc4dd0d5a71e9d07324e5c09c4383d93942d391727e7a40ff810b"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7b3661e6d4ba63a094138032c1356d557de5b3ea6fd3cca62a195f623e381c76"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97fbb77eaeb97591efdc654b8b5f3ccc066406ccfb3175b41382f221ecc216e8"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4cc4bc73e53af8e7a42c8fd7923bbe35babacfa7394ae9240b3430b5dcf16b2a"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:35af5e4d5448fa179fd7fff0bba0fba51f876cd55212f96c8bbcecc5c684ae5c"}, + {file = "rpds_py-0.19.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3511f6baf8438326e351097cecd137eb45c5f019944fe0fd0ae2fea2fd26be39"}, + {file = "rpds_py-0.19.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:57863d16187995c10fe9cf911b897ed443ac68189179541734502353af33e693"}, + {file = "rpds_py-0.19.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:9e318e6786b1e750a62f90c6f7fa8b542102bdcf97c7c4de2a48b50b61bd36ec"}, + {file = "rpds_py-0.19.1-cp38-none-win32.whl", hash = "sha256:53dbc35808c6faa2ce3e48571f8f74ef70802218554884787b86a30947842a14"}, + {file = "rpds_py-0.19.1-cp38-none-win_amd64.whl", hash = "sha256:8df1c283e57c9cb4d271fdc1875f4a58a143a2d1698eb0d6b7c0d7d5f49c53a1"}, + {file = "rpds_py-0.19.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e76c902d229a3aa9d5ceb813e1cbcc69bf5bda44c80d574ff1ac1fa3136dea71"}, + {file = "rpds_py-0.19.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:de1f7cd5b6b351e1afd7568bdab94934d656abe273d66cda0ceea43bbc02a0c2"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:24fc5a84777cb61692d17988989690d6f34f7f95968ac81398d67c0d0994a897"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:74129d5ffc4cde992d89d345f7f7d6758320e5d44a369d74d83493429dad2de5"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5e360188b72f8080fefa3adfdcf3618604cc8173651c9754f189fece068d2a45"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13e6d4840897d4e4e6b2aa1443e3a8eca92b0402182aafc5f4ca1f5e24f9270a"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f09529d2332264a902688031a83c19de8fda5eb5881e44233286b9c9ec91856d"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0d4b52811dcbc1aba08fd88d475f75b4f6db0984ba12275d9bed1a04b2cae9b5"}, + {file = "rpds_py-0.19.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:dd635c2c4043222d80d80ca1ac4530a633102a9f2ad12252183bcf338c1b9474"}, + {file = "rpds_py-0.19.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f35b34a5184d5e0cc360b61664c1c06e866aab077b5a7c538a3e20c8fcdbf90b"}, + {file = "rpds_py-0.19.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d4ec0046facab83012d821b33cead742a35b54575c4edfb7ed7445f63441835f"}, + {file = "rpds_py-0.19.1-cp39-none-win32.whl", hash = "sha256:f5b8353ea1a4d7dfb59a7f45c04df66ecfd363bb5b35f33b11ea579111d4655f"}, + {file = "rpds_py-0.19.1-cp39-none-win_amd64.whl", hash = "sha256:1fb93d3486f793d54a094e2bfd9cd97031f63fcb5bc18faeb3dd4b49a1c06523"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7d5c7e32f3ee42f77d8ff1a10384b5cdcc2d37035e2e3320ded909aa192d32c3"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:89cc8921a4a5028d6dd388c399fcd2eef232e7040345af3d5b16c04b91cf3c7e"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bca34e913d27401bda2a6f390d0614049f5a95b3b11cd8eff80fe4ec340a1208"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5953391af1405f968eb5701ebbb577ebc5ced8d0041406f9052638bafe52209d"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:840e18c38098221ea6201f091fc5d4de6128961d2930fbbc96806fb43f69aec1"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6d8b735c4d162dc7d86a9cf3d717f14b6c73637a1f9cd57fe7e61002d9cb1972"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce757c7c90d35719b38fa3d4ca55654a76a40716ee299b0865f2de21c146801c"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a9421b23c85f361a133aa7c5e8ec757668f70343f4ed8fdb5a4a14abd5437244"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:3b823be829407393d84ee56dc849dbe3b31b6a326f388e171555b262e8456cc1"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:5e58b61dcbb483a442c6239c3836696b79f2cd8e7eec11e12155d3f6f2d886d1"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:39d67896f7235b2c886fb1ee77b1491b77049dcef6fbf0f401e7b4cbed86bbd4"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:8b32cd4ab6db50c875001ba4f5a6b30c0f42151aa1fbf9c2e7e3674893fb1dc4"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:1c32e41de995f39b6b315d66c27dea3ef7f7c937c06caab4c6a79a5e09e2c415"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:1a129c02b42d46758c87faeea21a9f574e1c858b9f358b6dd0bbd71d17713175"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:346557f5b1d8fd9966059b7a748fd79ac59f5752cd0e9498d6a40e3ac1c1875f"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:31e450840f2f27699d014cfc8865cc747184286b26d945bcea6042bb6aa4d26e"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01227f8b3e6c8961490d869aa65c99653df80d2f0a7fde8c64ebddab2b9b02fd"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:69084fd29bfeff14816666c93a466e85414fe6b7d236cfc108a9c11afa6f7301"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4d2b88efe65544a7d5121b0c3b003ebba92bfede2ea3577ce548b69c5235185"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6ea961a674172ed2235d990d7edf85d15d8dfa23ab8575e48306371c070cda67"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:5beffdbe766cfe4fb04f30644d822a1080b5359df7db3a63d30fa928375b2720"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:720f3108fb1bfa32e51db58b832898372eb5891e8472a8093008010911e324c5"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:c2087dbb76a87ec2c619253e021e4fb20d1a72580feeaa6892b0b3d955175a71"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2ddd50f18ebc05ec29a0d9271e9dbe93997536da3546677f8ca00b76d477680c"}, + {file = "rpds_py-0.19.1.tar.gz", hash = "sha256:31dd5794837f00b46f4096aa8ccaa5972f73a938982e32ed817bb520c465e520"}, ] [[package]] @@ -5390,13 +5394,13 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "transformers" -version = "4.43.1" +version = "4.43.2" description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow" optional = false python-versions = ">=3.8.0" files = [ - {file = "transformers-4.43.1-py3-none-any.whl", hash = "sha256:eb44b731902e062acbaff196ae4896d7cb3494ddf38275aa00a5fcfb5b34f17d"}, - {file = "transformers-4.43.1.tar.gz", hash = "sha256:662252c4d0e31b6684f68f68d5cc8206dd7f83da80eb3235be3dc5b3c9fdbdbd"}, + {file = "transformers-4.43.2-py3-none-any.whl", hash = "sha256:283c8b47cf38640c5c0caea60be0dfa948669fa48e9739b03717cbf5e8b20f11"}, + {file = "transformers-4.43.2.tar.gz", hash = "sha256:99dbbdeef9d451cdbc1c5316dce3af3dd5bb56b6cda5d0c564253e8fa7ccaf02"}, ] [package.dependencies] diff --git a/sdks/postman/collection.json b/sdks/postman/collection.json deleted file mode 100644 index b65401baf..000000000 --- a/sdks/postman/collection.json +++ /dev/null @@ -1,5042 +0,0 @@ -{ - "info": { - "name": "Julep API", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "description": null - }, - "variable": [ - { - "key": "baseUrl", - "value": "https://api-alpha.julep.ai/api", - "type": "string" - }, - { - "key": "apiKey", - "value": "", - "type": "string" - } - ], - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{apiKey}}", - "type": "string" - }, - { - "key": "key", - "value": "Authorization", - "type": "string" - }, - { - "key": "in", - "value": "header", - "type": "string" - } - ] - }, - "item": [ - { - "_type": "endpoint", - "name": "Agents Route List", - "request": { - "description": "List Agents (paginated)", - "url": { - "raw": "{{baseUrl}}/agents?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List Agents (paginated)", - "url": { - "raw": "{{baseUrl}}/agents?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agents Route Create", - "request": { - "description": "Create a new Agent", - "url": { - "raw": "{{baseUrl}}/agents", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create a new Agent", - "url": { - "raw": "{{baseUrl}}/agents", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agents Route Get", - "request": { - "description": "Get an Agent by id", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Get an Agent by id", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\",\n \"default_settings\": {\n \"preset\": \"problem_solving\"\n }\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agents Route Create Or Update", - "request": { - "description": "Create or update an Agent", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create or update an Agent", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agents Route Update", - "request": { - "description": "Update an existing Agent by id (overwrites existing values; use PATCH for merging instead)", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing Agent by id (overwrites existing values; use PATCH for merging instead)", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agents Route Delete", - "request": { - "description": "Delete Agent by id", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Delete Agent by id", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agents Route Patch", - "request": { - "description": "Update an existing Agent by id (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing Agent by id (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agent Docs Route List", - "request": { - "description": "List Docs owned by an Agent", - "url": { - "raw": "{{baseUrl}}/agents/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "docs" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List Docs owned by an Agent", - "url": { - "raw": "{{baseUrl}}/agents/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "docs" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agents Docs Search Route Search", - "request": { - "description": "Search Docs owned by an Agent", - "url": { - "raw": "{{baseUrl}}/agents/:id/search?limit=&offset=&sort_by=&direction=&metadata_filter=", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "search" - ], - "query": [ - { - "key": "limit", - "value": "", - "description": "Limit the number of items returned" - }, - { - "key": "offset", - "value": "", - "description": "Offset the items returned" - }, - { - "key": "sort_by", - "value": "", - "description": "Sort by a field" - }, - { - "key": "direction", - "value": "", - "description": "Sort direction" - }, - { - "key": "metadata_filter", - "value": "", - "description": "JSON string of object that should be used to filter objects by metadata" - } - ], - "variable": [ - { - "key": "id", - "value": "", - "description": "ID of the parent" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"body\": {\n \"mode\": \"vector\",\n \"vector\": [\n 0\n ]\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [] - }, - { - "_type": "endpoint", - "name": "Tasks Route List", - "request": { - "description": "List tasks (paginated)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List tasks (paginated)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"input_schema\": {\n \"key\": \"value\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true,\n \"agent_id\": \"agent_id\",\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n }\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Tasks Route Create", - "request": { - "description": "Create a new task", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create a new task", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Tasks Route Update", - "request": { - "description": "Update an existing task (overwrite existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be updated", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing task (overwrite existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be updated", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Tasks Route Delete", - "request": { - "description": "Delete a task by its id", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be deleted", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Delete a task by its id", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be deleted", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Tasks Route Patch", - "request": { - "description": "Update an existing task (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be patched", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing task (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tasks/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tasks", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be patched", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agent Tools Route List", - "request": { - "description": "List tools of the given agent", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List tools of the given agent", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": []\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agent Tools Route Create", - "request": { - "description": "Create a new tool for this agent", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create a new tool for this agent", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"model\": \"model\",\n \"instructions\": \"instructions\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agent Tools Route Update", - "request": { - "description": "Update an existing tool (overwrite existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be updated", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing tool (overwrite existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be updated", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"type\": \"function\",\n \"name\": \"name\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agent Tools Route Delete", - "request": { - "description": "Delete an existing tool by id", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be deleted", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Delete an existing tool by id", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be deleted", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Agent Tools Route Patch", - "request": { - "description": "Update an existing tool (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be patched", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing tool (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/agents/:id/tools/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":id", - "tools", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - }, - { - "key": "child_id", - "description": "ID of the resource to be patched", - "value": "child_id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Tasks Create Or Update Route Create Or Update", - "request": { - "description": "Create or update a task", - "url": { - "raw": "{{baseUrl}}/agents/:parent_id/tasks/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":parent_id", - "tasks", - ":id" - ], - "query": [], - "variable": [ - { - "key": "parent_id", - "description": "ID of parent resource", - "value": "parent_id" - }, - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create or update a task", - "url": { - "raw": "{{baseUrl}}/agents/:parent_id/tasks/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "agents", - ":parent_id", - "tasks", - ":id" - ], - "query": [], - "variable": [ - { - "key": "parent_id", - "description": "ID of parent resource", - "value": "parent_id" - }, - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"description\": \"description\",\n \"main\": [],\n \"tools\": [\n {\n \"type\": \"function\",\n \"name\": \"name\"\n }\n ],\n \"inherit_tools\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Individual Docs Route Get", - "request": { - "description": "Get Doc by id", - "url": { - "raw": "{{baseUrl}}/docs/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "docs", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Get Doc by id", - "url": { - "raw": "{{baseUrl}}/docs/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "docs", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Individual Docs Route Delete", - "request": { - "description": "Delete an existing Doc by id", - "url": { - "raw": "{{baseUrl}}/docs/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "docs", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Delete an existing Doc by id", - "url": { - "raw": "{{baseUrl}}/docs/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "docs", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Embed Route Embed", - "request": { - "description": "Embed a query for search", - "url": { - "raw": "{{baseUrl}}/embed", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "embed" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Embed a query for search", - "url": { - "raw": "{{baseUrl}}/embed", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "embed" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"body\": {\n \"text\": \"text\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"vectors\": [\n [\n 1.1\n ]\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Executions Route Get", - "request": { - "description": "Get an Execution by id", - "url": { - "raw": "{{baseUrl}}/executions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "executions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Get an Execution by id", - "url": { - "raw": "{{baseUrl}}/executions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "executions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Execution Transitions Route List", - "request": { - "description": "List the Transitions of an Execution by id", - "url": { - "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "executions", - ":id", - "transitions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List the Transitions of an Execution by id", - "url": { - "raw": "{{baseUrl}}/executions/:id/transitions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "executions", - ":id", - "transitions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"transitions\": [\n {\n \"type\": \"finish\",\n \"execution_id\": \"execution_id\",\n \"output\": {\n \"key\": \"value\"\n },\n \"current\": [],\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Job Route Get", - "request": { - "description": "Get the status of an existing Job by its id", - "url": { - "raw": "{{baseUrl}}/jobs/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "jobs", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Get the status of an existing Job by its id", - "url": { - "raw": "{{baseUrl}}/jobs/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "jobs", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"reason\": \"reason\",\n \"has_progress\": true,\n \"progress\": 1.1,\n \"state\": \"pending\"\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Sessions Route List", - "request": { - "description": "List sessions (paginated)", - "url": { - "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List sessions (paginated)", - "url": { - "raw": "{{baseUrl}}/sessions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": []\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Sessions Route Create", - "request": { - "description": "Create a new session", - "url": { - "raw": "{{baseUrl}}/sessions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create a new session", - "url": { - "raw": "{{baseUrl}}/sessions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Sessions Route Get", - "request": { - "description": "Get a session by id", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "value": "", - "description": "ID of the resource" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [] - }, - { - "_type": "endpoint", - "name": "Sessions Route Create Or Update", - "request": { - "description": "Create or update a session", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create or update a session", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Sessions Route Update", - "request": { - "description": "Update an existing session by its id (overwrites all existing values)", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing session by its id (overwrites all existing values)", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"situation\": \"situation\",\n \"render_templates\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Sessions Route Delete", - "request": { - "description": "Delete a session by its id", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Delete a session by its id", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Sessions Route Patch", - "request": { - "description": "Update an existing session by its id (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing session by its id (merges with existing values)", - "url": { - "raw": "{{baseUrl}}/sessions/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "History Route List", - "request": { - "description": "Get history of a Session (paginated)", - "url": { - "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id", - "history" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Get history of a Session (paginated)", - "url": { - "raw": "{{baseUrl}}/sessions/:id/history?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id", - "history" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"entries\": [\n {\n \"role\": \"user\",\n \"content\": [],\n \"source\": \"api_request\",\n \"timestamp\": 1,\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"id\": \"id\"\n }\n ],\n \"relations\": [\n {\n \"head\": \"head\",\n \"relation\": \"relation\",\n \"tail\": \"tail\"\n }\n ],\n \"session_id\": \"session_id\",\n \"created_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "History Route Delete", - "request": { - "description": "Clear the history of a Session (resets the Session)", - "url": { - "raw": "{{baseUrl}}/sessions/:id/history", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id", - "history" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Clear the history of a Session (resets the Session)", - "url": { - "raw": "{{baseUrl}}/sessions/:id/history", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "sessions", - ":id", - "history" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Task Executions Route List", - "request": { - "description": "List executions of the given task", - "url": { - "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tasks", - ":id", - "executions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List executions of the given task", - "url": { - "raw": "{{baseUrl}}/tasks/:id/executions?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tasks", - ":id", - "executions" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"task_id\": \"task_id\",\n \"status\": \"queued\",\n \"input\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"id\": \"id\"\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Task Executions Route Create", - "request": { - "description": "Create an execution for the given task", - "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tasks", - ":id", - "executions" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create an execution for the given task", - "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tasks", - ":id", - "executions" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"input\": {\n \"key\": \"value\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Task Executions Route Resume With Task Token", - "request": { - "description": "Resume an execution with a task token", - "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tasks", - ":id", - "executions" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent Task", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Resume an execution with a task token", - "url": { - "raw": "{{baseUrl}}/tasks/:id/executions", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tasks", - ":id", - "executions" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of parent Task", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"status\": \"running\",\n \"task_token\": \"task_token\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Task Executions Route Update", - "request": { - "description": "Update an existing Execution", - "url": { - "raw": "{{baseUrl}}/tasks/:id/executions/:child_id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "tasks", - ":id", - "executions", - ":child_id" - ], - "query": [], - "variable": [ - { - "key": "id", - "value": "", - "description": "ID of parent resource" - }, - { - "key": "child_id", - "value": "", - "description": "ID of the resource to be updated" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"status\": \"cancelled\",\n \"reason\": \"example\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [] - }, - { - "_type": "endpoint", - "name": "Users Route List", - "request": { - "description": "List users (paginated)", - "url": { - "raw": "{{baseUrl}}/users?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List users (paginated)", - "url": { - "raw": "{{baseUrl}}/users?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Users Route Create", - "request": { - "description": "Create a new user", - "url": { - "raw": "{{baseUrl}}/users", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"docs\": []\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create a new user", - "url": { - "raw": "{{baseUrl}}/users", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\",\n \"docs\": []\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded and a new resource has been created as a result.", - "body": "{\n \"id\": \"id\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Users Route Get", - "request": { - "description": "Get a user by id", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Get a user by id", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"name\": \"name\",\n \"about\": \"about\"\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Users Route Create Or Update", - "request": { - "description": "Create or update a user", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Create or update a user", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": null, - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Users Route Update", - "request": { - "description": "Update an existing user by id (overwrite existing values)", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing user by id (overwrite existing values)", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PUT", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"name\",\n \"about\": \"about\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Users Route Delete", - "request": { - "description": "Delete a user by id", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Delete a user by id", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "DELETE", - "auth": null, - "body": null - }, - "description": "The request has been accepted for processing, but processing has not yet completed.", - "body": "{\n \"id\": \"id\",\n \"deleted_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "Users Route Patch", - "request": { - "description": "Update an existing user by id (merge with existing values)", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "Update an existing user by id (merge with existing values)", - "url": { - "raw": "{{baseUrl}}/users/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id" - ], - "query": [], - "variable": [ - { - "key": "id", - "description": "ID of the resource", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "PATCH", - "auth": null, - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": "The request has succeeded.", - "body": "{\n \"id\": \"id\",\n \"updated_at\": \"2024-01-15T09:30:00Z\",\n \"jobs\": [\n \"jobs\"\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "User Docs Route List", - "request": { - "description": "List Docs owned by a User", - "url": { - "raw": "{{baseUrl}}/users/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id", - "docs" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": "List Docs owned by a User", - "url": { - "raw": "{{baseUrl}}/users/:id/docs?limit=1&offset=1&sort_by=created_at&direction=asc&metadata_filter=metadata_filter", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id", - "docs" - ], - "query": [ - { - "key": "limit", - "description": "Limit the number of items returned", - "value": "1" - }, - { - "key": "offset", - "description": "Offset the items returned", - "value": "1" - }, - { - "key": "sort_by", - "description": "Sort by a field", - "value": "created_at" - }, - { - "key": "direction", - "description": "Sort direction", - "value": "asc" - }, - { - "key": "metadata_filter", - "description": "JSON string of object that should be used to filter objects by metadata", - "value": "metadata_filter" - } - ], - "variable": [ - { - "key": "id", - "description": "ID of parent", - "value": "id" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - }, - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "GET", - "auth": null, - "body": null - }, - "description": "The request has succeeded.", - "body": "{\n \"results\": [\n {\n \"id\": \"id\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"title\": \"title\",\n \"content\": \"content\"\n }\n ]\n}", - "_postman_previewlanguage": "json" - } - ] - }, - { - "_type": "endpoint", - "name": "User Docs Search Route Search", - "request": { - "description": "Search Docs owned by a User", - "url": { - "raw": "{{baseUrl}}/users/:id/search?limit=&offset=&sort_by=&direction=&metadata_filter=", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "users", - ":id", - "search" - ], - "query": [ - { - "key": "limit", - "value": "", - "description": "Limit the number of items returned" - }, - { - "key": "offset", - "value": "", - "description": "Offset the items returned" - }, - { - "key": "sort_by", - "value": "", - "description": "Sort by a field" - }, - { - "key": "direction", - "value": "", - "description": "Sort direction" - }, - { - "key": "metadata_filter", - "value": "", - "description": "JSON string of object that should be used to filter objects by metadata" - } - ], - "variable": [ - { - "key": "id", - "value": "", - "description": "ID of the parent" - } - ] - }, - "header": [ - { - "key": "Authorization", - "value": "{{apiKey}}", - "type": "string", - "description": null - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"body\": {\n \"mode\": \"vector\",\n \"vector\": [\n 0\n ]\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 589af86d6..4b858b9c7 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -24,11 +24,31 @@ AgentsUpdateAgentRequest, AgentsUpdateAgentRequestDefaultSettings, AgentsUpdateAgentRequestInstructions, + ChatBaseChatOutput, + ChatBaseChatResponse, + ChatBaseTokenLogProb, + ChatChatOutputChunk, + ChatChunkChatResponse, + ChatCompetionUsage, ChatCompletionResponseFormat, ChatCompletionResponseFormatType, + ChatFinishReason, ChatGenerationPreset, ChatGenerationPresetSettings, + ChatLogProbResponse, + ChatMessageChatResponse, + ChatMultipleChatOutput, ChatOpenAiSettings, + ChatRouteGenerateRequest, + ChatRouteGenerateRequestAgent, + ChatRouteGenerateRequestAgentToolChoice, + ChatRouteGenerateRequestFrequencyPenalty, + ChatRouteGenerateRequestFrequencyPenaltyToolChoice, + ChatRouteGenerateRequestPreset, + ChatRouteGenerateRequestPresetToolChoice, + ChatRouteGenerateResponse, + ChatSingleChatOutput, + ChatTokenLogProb, ChatVLlmSettings, CommonIdentifierSafeUnicode, CommonLimit, @@ -65,6 +85,11 @@ EntriesBaseChatMlContentPart, EntriesBaseChatMlContentPart_ImageUrl, EntriesChatMlImageContentPart, + EntriesChatMlMessage, + EntriesChatMlMessageContent, + EntriesChatMlMessageContentItem, + EntriesChatMlMessageContentItem_ImageUrl, + EntriesChatMlMessageContentItem_Text, EntriesChatMlRole, EntriesChatMlTextContentPart, EntriesEntry, @@ -153,6 +178,9 @@ ToolsFunctionDef, ToolsFunctionDefUpdate, ToolsFunctionTool, + ToolsNamedFunctionChoice, + ToolsNamedToolChoice, + ToolsNamedToolChoice_Function, ToolsTool, ToolsToolResponse, ToolsToolType, @@ -195,11 +223,31 @@ "AgentsUpdateAgentRequest", "AgentsUpdateAgentRequestDefaultSettings", "AgentsUpdateAgentRequestInstructions", + "ChatBaseChatOutput", + "ChatBaseChatResponse", + "ChatBaseTokenLogProb", + "ChatChatOutputChunk", + "ChatChunkChatResponse", + "ChatCompetionUsage", "ChatCompletionResponseFormat", "ChatCompletionResponseFormatType", + "ChatFinishReason", "ChatGenerationPreset", "ChatGenerationPresetSettings", + "ChatLogProbResponse", + "ChatMessageChatResponse", + "ChatMultipleChatOutput", "ChatOpenAiSettings", + "ChatRouteGenerateRequest", + "ChatRouteGenerateRequestAgent", + "ChatRouteGenerateRequestAgentToolChoice", + "ChatRouteGenerateRequestFrequencyPenalty", + "ChatRouteGenerateRequestFrequencyPenaltyToolChoice", + "ChatRouteGenerateRequestPreset", + "ChatRouteGenerateRequestPresetToolChoice", + "ChatRouteGenerateResponse", + "ChatSingleChatOutput", + "ChatTokenLogProb", "ChatVLlmSettings", "CommonIdentifierSafeUnicode", "CommonLimit", @@ -236,6 +284,11 @@ "EntriesBaseChatMlContentPart", "EntriesBaseChatMlContentPart_ImageUrl", "EntriesChatMlImageContentPart", + "EntriesChatMlMessage", + "EntriesChatMlMessageContent", + "EntriesChatMlMessageContentItem", + "EntriesChatMlMessageContentItem_ImageUrl", + "EntriesChatMlMessageContentItem_Text", "EntriesChatMlRole", "EntriesChatMlTextContentPart", "EntriesEntry", @@ -325,6 +378,9 @@ "ToolsFunctionDef", "ToolsFunctionDefUpdate", "ToolsFunctionTool", + "ToolsNamedFunctionChoice", + "ToolsNamedToolChoice", + "ToolsNamedToolChoice_Function", "ToolsTool", "ToolsToolResponse", "ToolsToolType", diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index c8c82a127..ae9b4e3ba 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -54,6 +54,8 @@ from .types.agents_update_agent_request_instructions import ( AgentsUpdateAgentRequestInstructions, ) +from .types.chat_route_generate_request import ChatRouteGenerateRequest +from .types.chat_route_generate_response import ChatRouteGenerateResponse from .types.common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .types.common_limit import CommonLimit from .types.common_offset import CommonOffset @@ -2538,6 +2540,71 @@ def sessions_route_patch( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def chat_route_generate( + self, + id: CommonUuid, + *, + request: ChatRouteGenerateRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> ChatRouteGenerateResponse: + """ + Generate a response from the model + + Parameters + ---------- + id : CommonUuid + The session ID + + request : ChatRouteGenerateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ChatRouteGenerateResponse + The request has succeeded. + + Examples + -------- + from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.chat_route_generate( + id="id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}/chat", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + def history_route_list( self, id: CommonUuid, @@ -2995,7 +3062,6 @@ def users_route_create( *, name: CommonIdentifierSafeUnicode, about: str, - docs: typing.Sequence[typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceCreatedResponse: @@ -3010,9 +3076,6 @@ def users_route_create( about : str About the user - docs : typing.Sequence[typing.Any] - Documents to index for this user. (Max: 100 items) - metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] @@ -3034,13 +3097,12 @@ def users_route_create( client.users_route_create( name="name", about="about", - docs=[], ) """ _response = self._client_wrapper.httpx_client.request( "users", method="POST", - json={"metadata": metadata, "name": name, "about": about, "docs": docs}, + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, omit=OMIT, ) @@ -6172,6 +6234,79 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + async def chat_route_generate( + self, + id: CommonUuid, + *, + request: ChatRouteGenerateRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> ChatRouteGenerateResponse: + """ + Generate a response from the model + + Parameters + ---------- + id : CommonUuid + The session ID + + request : ChatRouteGenerateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ChatRouteGenerateResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.chat_route_generate( + id="id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}/chat", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + async def history_route_list( self, id: CommonUuid, @@ -6685,7 +6820,6 @@ async def users_route_create( *, name: CommonIdentifierSafeUnicode, about: str, - docs: typing.Sequence[typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceCreatedResponse: @@ -6700,9 +6834,6 @@ async def users_route_create( about : str About the user - docs : typing.Sequence[typing.Any] - Documents to index for this user. (Max: 100 items) - metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] @@ -6729,7 +6860,6 @@ async def main() -> None: await client.users_route_create( name="name", about="about", - docs=[], ) @@ -6738,7 +6868,7 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( "users", method="POST", - json={"metadata": metadata, "name": name, "about": about, "docs": docs}, + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, omit=OMIT, ) diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index 48675d71d..84b18b9d1 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -3524,6 +3524,98 @@ client.sessions_route_patch(
+ + +
+ +
client.chat_route_generate(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Generate a response from the model +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.chat_route_generate( + id="id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — The session ID + +
+
+ +
+
+ +**request:** `ChatRouteGenerateRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -4242,7 +4334,6 @@ client = JulepApi( client.users_route_create( name="name", about="about", - docs=[], ) ``` @@ -4275,14 +4366,6 @@ client.users_route_create(
-**docs:** `typing.Sequence[typing.Any]` — Documents to index for this user. (Max: 100 items) - -
-
- -
-
- **metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 54f7ec054..d8b836a4b 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -41,11 +41,39 @@ from .agents_update_agent_request_instructions import ( AgentsUpdateAgentRequestInstructions, ) +from .chat_base_chat_output import ChatBaseChatOutput +from .chat_base_chat_response import ChatBaseChatResponse +from .chat_base_token_log_prob import ChatBaseTokenLogProb +from .chat_chat_output_chunk import ChatChatOutputChunk +from .chat_chunk_chat_response import ChatChunkChatResponse +from .chat_competion_usage import ChatCompetionUsage from .chat_completion_response_format import ChatCompletionResponseFormat from .chat_completion_response_format_type import ChatCompletionResponseFormatType +from .chat_finish_reason import ChatFinishReason from .chat_generation_preset import ChatGenerationPreset from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_log_prob_response import ChatLogProbResponse +from .chat_message_chat_response import ChatMessageChatResponse +from .chat_multiple_chat_output import ChatMultipleChatOutput from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_route_generate_request import ChatRouteGenerateRequest +from .chat_route_generate_request_agent import ChatRouteGenerateRequestAgent +from .chat_route_generate_request_agent_tool_choice import ( + ChatRouteGenerateRequestAgentToolChoice, +) +from .chat_route_generate_request_frequency_penalty import ( + ChatRouteGenerateRequestFrequencyPenalty, +) +from .chat_route_generate_request_frequency_penalty_tool_choice import ( + ChatRouteGenerateRequestFrequencyPenaltyToolChoice, +) +from .chat_route_generate_request_preset import ChatRouteGenerateRequestPreset +from .chat_route_generate_request_preset_tool_choice import ( + ChatRouteGenerateRequestPresetToolChoice, +) +from .chat_route_generate_response import ChatRouteGenerateResponse +from .chat_single_chat_output import ChatSingleChatOutput +from .chat_token_log_prob import ChatTokenLogProb from .chat_v_llm_settings import ChatVLlmSettings from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_limit import CommonLimit @@ -86,6 +114,13 @@ EntriesBaseChatMlContentPart_ImageUrl, ) from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart +from .entries_chat_ml_message import EntriesChatMlMessage +from .entries_chat_ml_message_content import EntriesChatMlMessageContent +from .entries_chat_ml_message_content_item import ( + EntriesChatMlMessageContentItem, + EntriesChatMlMessageContentItem_ImageUrl, + EntriesChatMlMessageContentItem_Text, +) from .entries_chat_ml_role import EntriesChatMlRole from .entries_chat_ml_text_content_part import EntriesChatMlTextContentPart from .entries_entry import EntriesEntry @@ -203,6 +238,8 @@ from .tools_function_def import ToolsFunctionDef from .tools_function_def_update import ToolsFunctionDefUpdate from .tools_function_tool import ToolsFunctionTool +from .tools_named_function_choice import ToolsNamedFunctionChoice +from .tools_named_tool_choice import ToolsNamedToolChoice, ToolsNamedToolChoice_Function from .tools_tool import ToolsTool, ToolsTool_Function from .tools_tool_response import ToolsToolResponse from .tools_tool_type import ToolsToolType @@ -246,11 +283,31 @@ "AgentsUpdateAgentRequest", "AgentsUpdateAgentRequestDefaultSettings", "AgentsUpdateAgentRequestInstructions", + "ChatBaseChatOutput", + "ChatBaseChatResponse", + "ChatBaseTokenLogProb", + "ChatChatOutputChunk", + "ChatChunkChatResponse", + "ChatCompetionUsage", "ChatCompletionResponseFormat", "ChatCompletionResponseFormatType", + "ChatFinishReason", "ChatGenerationPreset", "ChatGenerationPresetSettings", + "ChatLogProbResponse", + "ChatMessageChatResponse", + "ChatMultipleChatOutput", "ChatOpenAiSettings", + "ChatRouteGenerateRequest", + "ChatRouteGenerateRequestAgent", + "ChatRouteGenerateRequestAgentToolChoice", + "ChatRouteGenerateRequestFrequencyPenalty", + "ChatRouteGenerateRequestFrequencyPenaltyToolChoice", + "ChatRouteGenerateRequestPreset", + "ChatRouteGenerateRequestPresetToolChoice", + "ChatRouteGenerateResponse", + "ChatSingleChatOutput", + "ChatTokenLogProb", "ChatVLlmSettings", "CommonIdentifierSafeUnicode", "CommonLimit", @@ -287,6 +344,11 @@ "EntriesBaseChatMlContentPart", "EntriesBaseChatMlContentPart_ImageUrl", "EntriesChatMlImageContentPart", + "EntriesChatMlMessage", + "EntriesChatMlMessageContent", + "EntriesChatMlMessageContentItem", + "EntriesChatMlMessageContentItem_ImageUrl", + "EntriesChatMlMessageContentItem_Text", "EntriesChatMlRole", "EntriesChatMlTextContentPart", "EntriesEntry", @@ -375,6 +437,9 @@ "ToolsFunctionDef", "ToolsFunctionDefUpdate", "ToolsFunctionTool", + "ToolsNamedFunctionChoice", + "ToolsNamedToolChoice", + "ToolsNamedToolChoice_Function", "ToolsTool", "ToolsToolResponse", "ToolsToolType", diff --git a/sdks/python/julep/api/types/chat_base_chat_output.py b/sdks/python/julep/api/types/chat_base_chat_output.py new file mode 100644 index 000000000..fa09e9f85 --- /dev/null +++ b/sdks/python/julep/api/types/chat_base_chat_output.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_finish_reason import ChatFinishReason +from .chat_log_prob_response import ChatLogProbResponse + + +class ChatBaseChatOutput(pydantic_v1.BaseModel): + index: int + finish_reason: ChatFinishReason = pydantic_v1.Field() + """ + The reason the model stopped generating tokens + """ + + logprobs: typing.Optional[ChatLogProbResponse] = pydantic_v1.Field(default=None) + """ + The log probabilities of tokens + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_base_chat_response.py b/sdks/python/julep/api/types/chat_base_chat_response.py new file mode 100644 index 000000000..39a64cba7 --- /dev/null +++ b/sdks/python/julep/api/types/chat_base_chat_response.py @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_competion_usage import ChatCompetionUsage +from .common_uuid import CommonUuid +from .docs_doc_reference import DocsDocReference + + +class ChatBaseChatResponse(pydantic_v1.BaseModel): + usage: typing.Optional[ChatCompetionUsage] = pydantic_v1.Field(default=None) + """ + Usage statistics for the completion request + """ + + jobs: typing.List[CommonUuid] = pydantic_v1.Field() + """ + Background job IDs that may have been spawned from this interaction. + """ + + docs: typing.List[DocsDocReference] = pydantic_v1.Field() + """ + Documents referenced for this request (for citation purposes). + """ + + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + id: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_base_token_log_prob.py b/sdks/python/julep/api/types/chat_base_token_log_prob.py new file mode 100644 index 000000000..088bf7ec6 --- /dev/null +++ b/sdks/python/julep/api/types/chat_base_token_log_prob.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 + + +class ChatBaseTokenLogProb(pydantic_v1.BaseModel): + token: str + logprob: float = pydantic_v1.Field() + """ + The log probability of the token + """ + + bytes: typing.Optional[typing.List[int]] = None + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_chat_output_chunk.py b/sdks/python/julep/api/types/chat_chat_output_chunk.py new file mode 100644 index 000000000..6eb42c639 --- /dev/null +++ b/sdks/python/julep/api/types/chat_chat_output_chunk.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_base_chat_output import ChatBaseChatOutput +from .entries_chat_ml_message import EntriesChatMlMessage + + +class ChatChatOutputChunk(ChatBaseChatOutput): + """ + Streaming chat completion output + """ + + delta: EntriesChatMlMessage = pydantic_v1.Field() + """ + The message generated by the model + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_chunk_chat_response.py b/sdks/python/julep/api/types/chat_chunk_chat_response.py new file mode 100644 index 000000000..b18fa4359 --- /dev/null +++ b/sdks/python/julep/api/types/chat_chunk_chat_response.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_base_chat_response import ChatBaseChatResponse +from .chat_chat_output_chunk import ChatChatOutputChunk + + +class ChatChunkChatResponse(ChatBaseChatResponse): + choices: typing.List[ChatChatOutputChunk] = pydantic_v1.Field() + """ + The deltas generated by the model + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_competion_usage.py b/sdks/python/julep/api/types/chat_competion_usage.py new file mode 100644 index 000000000..f6f798330 --- /dev/null +++ b/sdks/python/julep/api/types/chat_competion_usage.py @@ -0,0 +1,59 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 + + +class ChatCompetionUsage(pydantic_v1.BaseModel): + """ + Usage statistics for the completion request + """ + + completion_tokens: int = pydantic_v1.Field() + """ + Number of tokens in the generated completion + """ + + prompt_tokens: int = pydantic_v1.Field() + """ + Number of tokens in the prompt + """ + + total_tokens: int = pydantic_v1.Field() + """ + Total number of tokens used in the request (prompt + completion) + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_finish_reason.py b/sdks/python/julep/api/types/chat_finish_reason.py new file mode 100644 index 000000000..2c91e07c4 --- /dev/null +++ b/sdks/python/julep/api/types/chat_finish_reason.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ChatFinishReason = typing.Union[ + typing.Literal["stop", "length", "content_filter", "tool_calls"], typing.Any +] diff --git a/sdks/python/julep/api/types/chat_log_prob_response.py b/sdks/python/julep/api/types/chat_log_prob_response.py new file mode 100644 index 000000000..cd6ebcc17 --- /dev/null +++ b/sdks/python/julep/api/types/chat_log_prob_response.py @@ -0,0 +1,48 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_token_log_prob import ChatTokenLogProb + + +class ChatLogProbResponse(pydantic_v1.BaseModel): + content: typing.Optional[typing.List[ChatTokenLogProb]] = pydantic_v1.Field( + default=None + ) + """ + The log probabilities of the tokens + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_message_chat_response.py b/sdks/python/julep/api/types/chat_message_chat_response.py new file mode 100644 index 000000000..fd8b40082 --- /dev/null +++ b/sdks/python/julep/api/types/chat_message_chat_response.py @@ -0,0 +1,49 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_base_chat_response import ChatBaseChatResponse +from .chat_chat_output_chunk import ChatChatOutputChunk + + +class ChatMessageChatResponse(ChatBaseChatResponse): + choices: typing.List[ChatChatOutputChunk] = pydantic_v1.Field() + """ + The deltas generated by the model + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_multiple_chat_output.py b/sdks/python/julep/api/types/chat_multiple_chat_output.py new file mode 100644 index 000000000..ab41027eb --- /dev/null +++ b/sdks/python/julep/api/types/chat_multiple_chat_output.py @@ -0,0 +1,50 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_base_chat_output import ChatBaseChatOutput +from .entries_chat_ml_message import EntriesChatMlMessage + + +class ChatMultipleChatOutput(ChatBaseChatOutput): + """ + The output returned by the model. Note that, depending on the model provider, they might return more than one message. + """ + + messages: typing.List[EntriesChatMlMessage] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_route_generate_request.py b/sdks/python/julep/api/types/chat_route_generate_request.py new file mode 100644 index 000000000..33c9ec62d --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_request.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_route_generate_request_agent import ChatRouteGenerateRequestAgent +from .chat_route_generate_request_frequency_penalty import ( + ChatRouteGenerateRequestFrequencyPenalty, +) +from .chat_route_generate_request_preset import ChatRouteGenerateRequestPreset + +ChatRouteGenerateRequest = typing.Union[ + ChatRouteGenerateRequestPreset, + ChatRouteGenerateRequestFrequencyPenalty, + ChatRouteGenerateRequestAgent, +] diff --git a/sdks/python/julep/api/types/chat_route_generate_request_agent.py b/sdks/python/julep/api/types/chat_route_generate_request_agent.py new file mode 100644 index 000000000..6ab50c264 --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_request_agent.py @@ -0,0 +1,154 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_completion_response_format import ChatCompletionResponseFormat +from .chat_route_generate_request_agent_tool_choice import ( + ChatRouteGenerateRequestAgentToolChoice, +) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_logit_bias import CommonLogitBias +from .common_uuid import CommonUuid +from .entries_input_chat_ml_message import EntriesInputChatMlMessage +from .tools_function_tool import ToolsFunctionTool + + +class ChatRouteGenerateRequestAgent(pydantic_v1.BaseModel): + messages: typing.List[EntriesInputChatMlMessage] = pydantic_v1.Field() + """ + A list of new input messages comprising the conversation so far. + """ + + tools: typing.Optional[typing.List[ToolsFunctionTool]] = pydantic_v1.Field( + default=None + ) + """ + (Advanced) List of tools that are provided in addition to agent's default set of tools. + """ + + tool_choice: typing.Optional[ChatRouteGenerateRequestAgentToolChoice] = ( + pydantic_v1.Field(default=None) + ) + """ + Can be one of existing tools given to the agent earlier or the ones provided in this request. + """ + + recall: bool = pydantic_v1.Field() + """ + Whether previous memories should be recalled or not (will be enabled in a future release) + """ + + remember: bool = pydantic_v1.Field() + """ + Whether this interaction should form new memories or not (will be enabled in a future release) + """ + + save: bool = pydantic_v1.Field() + """ + Whether this interaction should be stored in the session history or not + """ + + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None + ) + """ + Identifier of the model to be used + """ + + stream: bool = pydantic_v1.Field() + """ + Indicates if the server should stream the response as it's generated + """ + + stop: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + + seed: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + + max_tokens: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + The maximum number of tokens to generate in the chat completion + """ + + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic_v1.Field( + default=None + ) + """ + Modify the likelihood of specified tokens appearing in the completion + """ + + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic_v1.Field( + default=None + ) + """ + Response format (set to `json_object` to restrict output to JSON) + """ + + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + + repetition_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + length_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ + + min_p: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Minimum probability compared to leading token to be considered + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_route_generate_request_agent_tool_choice.py b/sdks/python/julep/api/types/chat_route_generate_request_agent_tool_choice.py new file mode 100644 index 000000000..9e95f3e1d --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_request_agent_tool_choice.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tools_named_tool_choice import ToolsNamedToolChoice + +ChatRouteGenerateRequestAgentToolChoice = typing.Union[ + typing.Literal["auto"], typing.Literal["none"], ToolsNamedToolChoice +] diff --git a/sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty.py b/sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty.py new file mode 100644 index 000000000..f62b323df --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty.py @@ -0,0 +1,149 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_completion_response_format import ChatCompletionResponseFormat +from .chat_route_generate_request_frequency_penalty_tool_choice import ( + ChatRouteGenerateRequestFrequencyPenaltyToolChoice, +) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_logit_bias import CommonLogitBias +from .common_uuid import CommonUuid +from .entries_input_chat_ml_message import EntriesInputChatMlMessage +from .tools_function_tool import ToolsFunctionTool + + +class ChatRouteGenerateRequestFrequencyPenalty(pydantic_v1.BaseModel): + messages: typing.List[EntriesInputChatMlMessage] = pydantic_v1.Field() + """ + A list of new input messages comprising the conversation so far. + """ + + tools: typing.Optional[typing.List[ToolsFunctionTool]] = pydantic_v1.Field( + default=None + ) + """ + (Advanced) List of tools that are provided in addition to agent's default set of tools. + """ + + tool_choice: typing.Optional[ChatRouteGenerateRequestFrequencyPenaltyToolChoice] = ( + pydantic_v1.Field(default=None) + ) + """ + Can be one of existing tools given to the agent earlier or the ones provided in this request. + """ + + recall: bool = pydantic_v1.Field() + """ + Whether previous memories should be recalled or not (will be enabled in a future release) + """ + + remember: bool = pydantic_v1.Field() + """ + Whether this interaction should form new memories or not (will be enabled in a future release) + """ + + save: bool = pydantic_v1.Field() + """ + Whether this interaction should be stored in the session history or not + """ + + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None + ) + """ + Identifier of the model to be used + """ + + stream: bool = pydantic_v1.Field() + """ + Indicates if the server should stream the response as it's generated + """ + + stop: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + + seed: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + + max_tokens: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + The maximum number of tokens to generate in the chat completion + """ + + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic_v1.Field( + default=None + ) + """ + Modify the likelihood of specified tokens appearing in the completion + """ + + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic_v1.Field( + default=None + ) + """ + Response format (set to `json_object` to restrict output to JSON) + """ + + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + + frequency_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + presence_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty_tool_choice.py b/sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty_tool_choice.py new file mode 100644 index 000000000..73169ee30 --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_request_frequency_penalty_tool_choice.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tools_named_tool_choice import ToolsNamedToolChoice + +ChatRouteGenerateRequestFrequencyPenaltyToolChoice = typing.Union[ + typing.Literal["auto"], typing.Literal["none"], ToolsNamedToolChoice +] diff --git a/sdks/python/julep/api/types/chat_route_generate_request_preset.py b/sdks/python/julep/api/types/chat_route_generate_request_preset.py new file mode 100644 index 000000000..b98ccd98d --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_request_preset.py @@ -0,0 +1,135 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_completion_response_format import ChatCompletionResponseFormat +from .chat_generation_preset import ChatGenerationPreset +from .chat_route_generate_request_preset_tool_choice import ( + ChatRouteGenerateRequestPresetToolChoice, +) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_logit_bias import CommonLogitBias +from .common_uuid import CommonUuid +from .entries_input_chat_ml_message import EntriesInputChatMlMessage +from .tools_function_tool import ToolsFunctionTool + + +class ChatRouteGenerateRequestPreset(pydantic_v1.BaseModel): + messages: typing.List[EntriesInputChatMlMessage] = pydantic_v1.Field() + """ + A list of new input messages comprising the conversation so far. + """ + + tools: typing.Optional[typing.List[ToolsFunctionTool]] = pydantic_v1.Field( + default=None + ) + """ + (Advanced) List of tools that are provided in addition to agent's default set of tools. + """ + + tool_choice: typing.Optional[ChatRouteGenerateRequestPresetToolChoice] = ( + pydantic_v1.Field(default=None) + ) + """ + Can be one of existing tools given to the agent earlier or the ones provided in this request. + """ + + recall: bool = pydantic_v1.Field() + """ + Whether previous memories should be recalled or not (will be enabled in a future release) + """ + + remember: bool = pydantic_v1.Field() + """ + Whether this interaction should form new memories or not (will be enabled in a future release) + """ + + save: bool = pydantic_v1.Field() + """ + Whether this interaction should be stored in the session history or not + """ + + model: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None + ) + """ + Identifier of the model to be used + """ + + stream: bool = pydantic_v1.Field() + """ + Indicates if the server should stream the response as it's generated + """ + + stop: typing.Optional[typing.List[str]] = pydantic_v1.Field(default=None) + """ + Up to 4 sequences where the API will stop generating further tokens. + """ + + seed: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + If specified, the system will make a best effort to sample deterministically for that particular seed value + """ + + max_tokens: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + The maximum number of tokens to generate in the chat completion + """ + + logit_bias: typing.Optional[typing.Dict[str, CommonLogitBias]] = pydantic_v1.Field( + default=None + ) + """ + Modify the likelihood of specified tokens appearing in the completion + """ + + response_format: typing.Optional[ChatCompletionResponseFormat] = pydantic_v1.Field( + default=None + ) + """ + Response format (set to `json_object` to restrict output to JSON) + """ + + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + """ + + preset: typing.Optional[ChatGenerationPreset] = pydantic_v1.Field(default=None) + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_route_generate_request_preset_tool_choice.py b/sdks/python/julep/api/types/chat_route_generate_request_preset_tool_choice.py new file mode 100644 index 000000000..92d41ff7f --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_request_preset_tool_choice.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tools_named_tool_choice import ToolsNamedToolChoice + +ChatRouteGenerateRequestPresetToolChoice = typing.Union[ + typing.Literal["auto"], typing.Literal["none"], ToolsNamedToolChoice +] diff --git a/sdks/python/julep/api/types/chat_route_generate_response.py b/sdks/python/julep/api/types/chat_route_generate_response.py new file mode 100644 index 000000000..b7c5a68ec --- /dev/null +++ b/sdks/python/julep/api/types/chat_route_generate_response.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_chunk_chat_response import ChatChunkChatResponse +from .chat_message_chat_response import ChatMessageChatResponse + +ChatRouteGenerateResponse = typing.Union[ChatChunkChatResponse, ChatMessageChatResponse] diff --git a/sdks/python/julep/api/types/chat_single_chat_output.py b/sdks/python/julep/api/types/chat_single_chat_output.py new file mode 100644 index 000000000..236d7d566 --- /dev/null +++ b/sdks/python/julep/api/types/chat_single_chat_output.py @@ -0,0 +1,50 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_base_chat_output import ChatBaseChatOutput +from .entries_chat_ml_message import EntriesChatMlMessage + + +class ChatSingleChatOutput(ChatBaseChatOutput): + """ + The output returned by the model. Note that, depending on the model provider, they might return more than one message. + """ + + message: EntriesChatMlMessage + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_token_log_prob.py b/sdks/python/julep/api/types/chat_token_log_prob.py new file mode 100644 index 000000000..03780e6ce --- /dev/null +++ b/sdks/python/julep/api/types/chat_token_log_prob.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_base_token_log_prob import ChatBaseTokenLogProb + + +class ChatTokenLogProb(ChatBaseTokenLogProb): + top_logprobs: typing.List[ChatBaseTokenLogProb] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_chat_ml_message.py b/sdks/python/julep/api/types/entries_chat_ml_message.py new file mode 100644 index 000000000..f3c087f6b --- /dev/null +++ b/sdks/python/julep/api/types/entries_chat_ml_message.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .entries_chat_ml_message_content import EntriesChatMlMessageContent +from .entries_chat_ml_role import EntriesChatMlRole +from .tools_chosen_tool_call import ToolsChosenToolCall + + +class EntriesChatMlMessage(pydantic_v1.BaseModel): + role: EntriesChatMlRole = pydantic_v1.Field() + """ + The role of the message + """ + + content: EntriesChatMlMessageContent = pydantic_v1.Field() + """ + The content parts of the message + """ + + name: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Name + """ + + tool_calls: typing.List[ToolsChosenToolCall] = pydantic_v1.Field() + """ + Tool calls generated by the model. + """ + + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + id: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_chat_ml_message_content.py b/sdks/python/julep/api/types/entries_chat_ml_message_content.py new file mode 100644 index 000000000..3b80f2242 --- /dev/null +++ b/sdks/python/julep/api/types/entries_chat_ml_message_content.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .entries_chat_ml_message_content_item import EntriesChatMlMessageContentItem + +EntriesChatMlMessageContent = typing.Union[ + str, typing.List[str], typing.List[EntriesChatMlMessageContentItem] +] diff --git a/sdks/python/julep/api/types/entries_chat_ml_message_content_item.py b/sdks/python/julep/api/types/entries_chat_ml_message_content_item.py new file mode 100644 index 000000000..1af6f3b06 --- /dev/null +++ b/sdks/python/julep/api/types/entries_chat_ml_message_content_item.py @@ -0,0 +1,87 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .entries_image_url import EntriesImageUrl + + +class EntriesChatMlMessageContentItem_Text(pydantic_v1.BaseModel): + text: str + type: typing.Literal["text"] = "text" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class EntriesChatMlMessageContentItem_ImageUrl(pydantic_v1.BaseModel): + image_url: EntriesImageUrl + type: typing.Literal["image_url"] = "image_url" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +EntriesChatMlMessageContentItem = typing.Union[ + EntriesChatMlMessageContentItem_Text, EntriesChatMlMessageContentItem_ImageUrl +] diff --git a/sdks/python/julep/api/types/tools_named_function_choice.py b/sdks/python/julep/api/types/tools_named_function_choice.py new file mode 100644 index 000000000..1a482219e --- /dev/null +++ b/sdks/python/julep/api/types/tools_named_function_choice.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tools_function_call_option import ToolsFunctionCallOption + + +class ToolsNamedFunctionChoice(pydantic_v1.BaseModel): + function: ToolsFunctionCallOption = pydantic_v1.Field() + """ + The function to call + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_named_tool_choice.py b/sdks/python/julep/api/types/tools_named_tool_choice.py new file mode 100644 index 000000000..6bfb3f776 --- /dev/null +++ b/sdks/python/julep/api/types/tools_named_tool_choice.py @@ -0,0 +1,89 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tools_function_call_option import ToolsFunctionCallOption + + +class Base(pydantic_v1.BaseModel): + function: typing.Optional[ToolsFunctionCallOption] = None + integration: typing.Any + system: typing.Any + api_call: typing.Any + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class ToolsNamedToolChoice_Function(Base): + function: ToolsFunctionCallOption + type: typing.Literal["function"] = "function" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +ToolsNamedToolChoice = ToolsNamedToolChoice_Function diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index 931110e40..e18f8fe02 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -814,13 +814,13 @@ networkx = ">=2" [[package]] name = "importlib-metadata" -version = "8.1.0" +version = "8.2.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-8.1.0-py3-none-any.whl", hash = "sha256:3cd29f739ed65973840b068e3132135ce954c254d48b5b640484467ef7ab3c8c"}, - {file = "importlib_metadata-8.1.0.tar.gz", hash = "sha256:fcdcb1d5ead7bdf3dd32657bb94ebe9d2aabfe89a19782ddc32da5041d6ebfb4"}, + {file = "importlib_metadata-8.2.0-py3-none-any.whl", hash = "sha256:11901fa0c2f97919b288679932bb64febaeacf289d18ac84dd68cb2e74213369"}, + {file = "importlib_metadata-8.2.0.tar.gz", hash = "sha256:72e8d4399996132204f9a16dcc751af254a48f8d1b20b9ff0f98d4a8f901e73d"}, ] [package.dependencies] @@ -1666,13 +1666,13 @@ files = [ [[package]] name = "openai" -version = "1.37.0" +version = "1.37.1" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.37.0-py3-none-any.whl", hash = "sha256:a903245c0ecf622f2830024acdaa78683c70abb8e9d37a497b851670864c9f73"}, - {file = "openai-1.37.0.tar.gz", hash = "sha256:dc8197fc40ab9d431777b6620d962cc49f4544ffc3011f03ce0a805e6eb54adb"}, + {file = "openai-1.37.1-py3-none-any.whl", hash = "sha256:9a6adda0d6ae8fce02d235c5671c399cfa40d6a281b3628914c7ebf244888ee3"}, + {file = "openai-1.37.1.tar.gz", hash = "sha256:faf87206785a6b5d9e34555d6a3242482a6852bc802e453e2a891f68ee04ce55"}, ] [package.dependencies] @@ -2223,13 +2223,13 @@ diagrams = ["jinja2", "railroad-diagrams"] [[package]] name = "pyright" -version = "1.1.372" +version = "1.1.373" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.372-py3-none-any.whl", hash = "sha256:25b15fb8967740f0949fd35b963777187f0a0404c0bd753cc966ec139f3eaa0b"}, - {file = "pyright-1.1.372.tar.gz", hash = "sha256:a9f5e0daa955daaa17e3d1ef76d3623e75f8afd5e37b437d3ff84d5b38c15420"}, + {file = "pyright-1.1.373-py3-none-any.whl", hash = "sha256:b805413227f2c209f27b14b55da27fe5e9fb84129c9f1eb27708a5d12f6f000e"}, + {file = "pyright-1.1.373.tar.gz", hash = "sha256:f41bcfc8b9d1802b09921a394d6ae1ce19694957b628bc657629688daf8a83ff"}, ] [package.dependencies] @@ -2601,110 +2601,114 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "rpds-py" -version = "0.19.0" +version = "0.19.1" description = "Python bindings to Rust's persistent data structures (rpds)" optional = false python-versions = ">=3.8" files = [ - {file = "rpds_py-0.19.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:fb37bd599f031f1a6fb9e58ec62864ccf3ad549cf14bac527dbfa97123edcca4"}, - {file = "rpds_py-0.19.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3384d278df99ec2c6acf701d067147320b864ef6727405d6470838476e44d9e8"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e54548e0be3ac117595408fd4ca0ac9278fde89829b0b518be92863b17ff67a2"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8eb488ef928cdbc05a27245e52de73c0d7c72a34240ef4d9893fdf65a8c1a955"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a5da93debdfe27b2bfc69eefb592e1831d957b9535e0943a0ee8b97996de21b5"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:79e205c70afddd41f6ee79a8656aec738492a550247a7af697d5bd1aee14f766"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:959179efb3e4a27610e8d54d667c02a9feaa86bbabaf63efa7faa4dfa780d4f1"}, - {file = "rpds_py-0.19.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a6e605bb9edcf010f54f8b6a590dd23a4b40a8cb141255eec2a03db249bc915b"}, - {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9133d75dc119a61d1a0ded38fb9ba40a00ef41697cc07adb6ae098c875195a3f"}, - {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dd36b712d35e757e28bf2f40a71e8f8a2d43c8b026d881aa0c617b450d6865c9"}, - {file = "rpds_py-0.19.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:354f3a91718489912f2e0fc331c24eaaf6a4565c080e00fbedb6015857c00582"}, - {file = "rpds_py-0.19.0-cp310-none-win32.whl", hash = "sha256:ebcbf356bf5c51afc3290e491d3722b26aaf5b6af3c1c7f6a1b757828a46e336"}, - {file = "rpds_py-0.19.0-cp310-none-win_amd64.whl", hash = "sha256:75a6076289b2df6c8ecb9d13ff79ae0cad1d5fb40af377a5021016d58cd691ec"}, - {file = "rpds_py-0.19.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6d45080095e585f8c5097897313def60caa2046da202cdb17a01f147fb263b81"}, - {file = "rpds_py-0.19.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5c9581019c96f865483d031691a5ff1cc455feb4d84fc6920a5ffc48a794d8a"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1540d807364c84516417115c38f0119dfec5ea5c0dd9a25332dea60b1d26fc4d"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9e65489222b410f79711dc3d2d5003d2757e30874096b2008d50329ea4d0f88c"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9da6f400eeb8c36f72ef6646ea530d6d175a4f77ff2ed8dfd6352842274c1d8b"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:37f46bb11858717e0efa7893c0f7055c43b44c103e40e69442db5061cb26ed34"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:071d4adc734de562bd11d43bd134330fb6249769b2f66b9310dab7460f4bf714"}, - {file = "rpds_py-0.19.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9625367c8955e4319049113ea4f8fee0c6c1145192d57946c6ffcd8fe8bf48dd"}, - {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e19509145275d46bc4d1e16af0b57a12d227c8253655a46bbd5ec317e941279d"}, - {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d438e4c020d8c39961deaf58f6913b1bf8832d9b6f62ec35bd93e97807e9cbc"}, - {file = "rpds_py-0.19.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:90bf55d9d139e5d127193170f38c584ed3c79e16638890d2e36f23aa1630b952"}, - {file = "rpds_py-0.19.0-cp311-none-win32.whl", hash = "sha256:8d6ad132b1bc13d05ffe5b85e7a01a3998bf3a6302ba594b28d61b8c2cf13aaf"}, - {file = "rpds_py-0.19.0-cp311-none-win_amd64.whl", hash = "sha256:7ec72df7354e6b7f6eb2a17fa6901350018c3a9ad78e48d7b2b54d0412539a67"}, - {file = "rpds_py-0.19.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:5095a7c838a8647c32aa37c3a460d2c48debff7fc26e1136aee60100a8cd8f68"}, - {file = "rpds_py-0.19.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f2f78ef14077e08856e788fa482107aa602636c16c25bdf59c22ea525a785e9"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7cc6cb44f8636fbf4a934ca72f3e786ba3c9f9ba4f4d74611e7da80684e48d2"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cf902878b4af334a09de7a45badbff0389e7cf8dc2e4dcf5f07125d0b7c2656d"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:688aa6b8aa724db1596514751ffb767766e02e5c4a87486ab36b8e1ebc1aedac"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57dbc9167d48e355e2569346b5aa4077f29bf86389c924df25c0a8b9124461fb"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b4cf5a9497874822341c2ebe0d5850fed392034caadc0bad134ab6822c0925b"}, - {file = "rpds_py-0.19.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8a790d235b9d39c70a466200d506bb33a98e2ee374a9b4eec7a8ac64c2c261fa"}, - {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1d16089dfa58719c98a1c06f2daceba6d8e3fb9b5d7931af4a990a3c486241cb"}, - {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:bc9128e74fe94650367fe23f37074f121b9f796cabbd2f928f13e9661837296d"}, - {file = "rpds_py-0.19.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c8f77e661ffd96ff104bebf7d0f3255b02aa5d5b28326f5408d6284c4a8b3248"}, - {file = "rpds_py-0.19.0-cp312-none-win32.whl", hash = "sha256:5f83689a38e76969327e9b682be5521d87a0c9e5a2e187d2bc6be4765f0d4600"}, - {file = "rpds_py-0.19.0-cp312-none-win_amd64.whl", hash = "sha256:06925c50f86da0596b9c3c64c3837b2481337b83ef3519e5db2701df695453a4"}, - {file = "rpds_py-0.19.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:52e466bea6f8f3a44b1234570244b1cff45150f59a4acae3fcc5fd700c2993ca"}, - {file = "rpds_py-0.19.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e21cc693045fda7f745c790cb687958161ce172ffe3c5719ca1764e752237d16"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b31f059878eb1f5da8b2fd82480cc18bed8dcd7fb8fe68370e2e6285fa86da6"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1dd46f309e953927dd018567d6a9e2fb84783963650171f6c5fe7e5c41fd5666"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34a01a4490e170376cd79258b7f755fa13b1a6c3667e872c8e35051ae857a92b"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bcf426a8c38eb57f7bf28932e68425ba86def6e756a5b8cb4731d8e62e4e0223"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68eea5df6347d3f1378ce992d86b2af16ad7ff4dcb4a19ccdc23dea901b87fb"}, - {file = "rpds_py-0.19.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dab8d921b55a28287733263c0e4c7db11b3ee22aee158a4de09f13c93283c62d"}, - {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6fe87efd7f47266dfc42fe76dae89060038f1d9cb911f89ae7e5084148d1cc08"}, - {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:535d4b52524a961d220875688159277f0e9eeeda0ac45e766092bfb54437543f"}, - {file = "rpds_py-0.19.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:8b1a94b8afc154fbe36978a511a1f155f9bd97664e4f1f7a374d72e180ceb0ae"}, - {file = "rpds_py-0.19.0-cp38-none-win32.whl", hash = "sha256:7c98298a15d6b90c8f6e3caa6457f4f022423caa5fa1a1ca7a5e9e512bdb77a4"}, - {file = "rpds_py-0.19.0-cp38-none-win_amd64.whl", hash = "sha256:b0da31853ab6e58a11db3205729133ce0df26e6804e93079dee095be3d681dc1"}, - {file = "rpds_py-0.19.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:5039e3cef7b3e7a060de468a4a60a60a1f31786da94c6cb054e7a3c75906111c"}, - {file = "rpds_py-0.19.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab1932ca6cb8c7499a4d87cb21ccc0d3326f172cfb6a64021a889b591bb3045c"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2afd2164a1e85226fcb6a1da77a5c8896c18bfe08e82e8ceced5181c42d2179"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b1c30841f5040de47a0046c243fc1b44ddc87d1b12435a43b8edff7e7cb1e0d0"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f757f359f30ec7dcebca662a6bd46d1098f8b9fb1fcd661a9e13f2e8ce343ba1"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15e65395a59d2e0e96caf8ee5389ffb4604e980479c32742936ddd7ade914b22"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb0f6eb3a320f24b94d177e62f4074ff438f2ad9d27e75a46221904ef21a7b05"}, - {file = "rpds_py-0.19.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b228e693a2559888790936e20f5f88b6e9f8162c681830eda303bad7517b4d5a"}, - {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2575efaa5d949c9f4e2cdbe7d805d02122c16065bfb8d95c129372d65a291a0b"}, - {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5c872814b77a4e84afa293a1bee08c14daed1068b2bb1cc312edbf020bbbca2b"}, - {file = "rpds_py-0.19.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:850720e1b383df199b8433a20e02b25b72f0fded28bc03c5bd79e2ce7ef050be"}, - {file = "rpds_py-0.19.0-cp39-none-win32.whl", hash = "sha256:ce84a7efa5af9f54c0aa7692c45861c1667080814286cacb9958c07fc50294fb"}, - {file = "rpds_py-0.19.0-cp39-none-win_amd64.whl", hash = "sha256:1c26da90b8d06227d7769f34915913911222d24ce08c0ab2d60b354e2d9c7aff"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:75969cf900d7be665ccb1622a9aba225cf386bbc9c3bcfeeab9f62b5048f4a07"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:8445f23f13339da640d1be8e44e5baf4af97e396882ebbf1692aecd67f67c479"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5a7c1062ef8aea3eda149f08120f10795835fc1c8bc6ad948fb9652a113ca55"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:462b0c18fbb48fdbf980914a02ee38c423a25fcc4cf40f66bacc95a2d2d73bc8"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3208f9aea18991ac7f2b39721e947bbd752a1abbe79ad90d9b6a84a74d44409b"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3444fe52b82f122d8a99bf66777aed6b858d392b12f4c317da19f8234db4533"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88cb4bac7185a9f0168d38c01d7a00addece9822a52870eee26b8d5b61409213"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6b130bd4163c93798a6b9bb96be64a7c43e1cec81126ffa7ffaa106e1fc5cef5"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:a707b158b4410aefb6b054715545bbb21aaa5d5d0080217290131c49c2124a6e"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:dc9ac4659456bde7c567107556ab065801622396b435a3ff213daef27b495388"}, - {file = "rpds_py-0.19.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:81ea573aa46d3b6b3d890cd3c0ad82105985e6058a4baed03cf92518081eec8c"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3f148c3f47f7f29a79c38cc5d020edcb5ca780020fab94dbc21f9af95c463581"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0906357f90784a66e89ae3eadc2654f36c580a7d65cf63e6a616e4aec3a81be"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f629ecc2db6a4736b5ba95a8347b0089240d69ad14ac364f557d52ad68cf94b0"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6feacd1d178c30e5bc37184526e56740342fd2aa6371a28367bad7908d454fc"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae8b6068ee374fdfab63689be0963333aa83b0815ead5d8648389a8ded593378"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78d57546bad81e0da13263e4c9ce30e96dcbe720dbff5ada08d2600a3502e526"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8b6683a37338818646af718c9ca2a07f89787551057fae57c4ec0446dc6224b"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e8481b946792415adc07410420d6fc65a352b45d347b78fec45d8f8f0d7496f0"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:bec35eb20792ea64c3c57891bc3ca0bedb2884fbac2c8249d9b731447ecde4fa"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:aa5476c3e3a402c37779e95f7b4048db2cb5b0ed0b9d006983965e93f40fe05a"}, - {file = "rpds_py-0.19.0-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:19d02c45f2507b489fd4df7b827940f1420480b3e2e471e952af4d44a1ea8e34"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a3e2fd14c5d49ee1da322672375963f19f32b3d5953f0615b175ff7b9d38daed"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:93a91c2640645303e874eada51f4f33351b84b351a689d470f8108d0e0694210"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5b9fc03bf76a94065299d4a2ecd8dfbae4ae8e2e8098bbfa6ab6413ca267709"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5a4b07cdf3f84310c08c1de2c12ddadbb7a77568bcb16e95489f9c81074322ed"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba0ed0dc6763d8bd6e5de5cf0d746d28e706a10b615ea382ac0ab17bb7388633"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:474bc83233abdcf2124ed3f66230a1c8435896046caa4b0b5ab6013c640803cc"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329c719d31362355a96b435f4653e3b4b061fcc9eba9f91dd40804ca637d914e"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ef9101f3f7b59043a34f1dccbb385ca760467590951952d6701df0da9893ca0c"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:0121803b0f424ee2109d6e1f27db45b166ebaa4b32ff47d6aa225642636cd834"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:8344127403dea42f5970adccf6c5957a71a47f522171fafaf4c6ddb41b61703a"}, - {file = "rpds_py-0.19.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:443cec402ddd650bb2b885113e1dcedb22b1175c6be223b14246a714b61cd521"}, - {file = "rpds_py-0.19.0.tar.gz", hash = "sha256:4fdc9afadbeb393b4bbbad75481e0ea78e4469f2e1d713a90811700830b553a9"}, + {file = "rpds_py-0.19.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:aaf71f95b21f9dc708123335df22e5a2fef6307e3e6f9ed773b2e0938cc4d491"}, + {file = "rpds_py-0.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ca0dda0c5715efe2ab35bb83f813f681ebcd2840d8b1b92bfc6fe3ab382fae4a"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81db2e7282cc0487f500d4db203edc57da81acde9e35f061d69ed983228ffe3b"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1a8dfa125b60ec00c7c9baef945bb04abf8ac772d8ebefd79dae2a5f316d7850"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:271accf41b02687cef26367c775ab220372ee0f4925591c6796e7c148c50cab5"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f9bc4161bd3b970cd6a6fcda70583ad4afd10f2750609fb1f3ca9505050d4ef3"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0cf2a0dbb5987da4bd92a7ca727eadb225581dd9681365beba9accbe5308f7d"}, + {file = "rpds_py-0.19.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b5e28e56143750808c1c79c70a16519e9bc0a68b623197b96292b21b62d6055c"}, + {file = "rpds_py-0.19.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c7af6f7b80f687b33a4cdb0a785a5d4de1fb027a44c9a049d8eb67d5bfe8a687"}, + {file = "rpds_py-0.19.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e429fc517a1c5e2a70d576077231538a98d59a45dfc552d1ac45a132844e6dfb"}, + {file = "rpds_py-0.19.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d2dbd8f4990d4788cb122f63bf000357533f34860d269c1a8e90ae362090ff3a"}, + {file = "rpds_py-0.19.1-cp310-none-win32.whl", hash = "sha256:e0f9d268b19e8f61bf42a1da48276bcd05f7ab5560311f541d22557f8227b866"}, + {file = "rpds_py-0.19.1-cp310-none-win_amd64.whl", hash = "sha256:df7c841813f6265e636fe548a49664c77af31ddfa0085515326342a751a6ba51"}, + {file = "rpds_py-0.19.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:902cf4739458852fe917104365ec0efbea7d29a15e4276c96a8d33e6ed8ec137"}, + {file = "rpds_py-0.19.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f3d73022990ab0c8b172cce57c69fd9a89c24fd473a5e79cbce92df87e3d9c48"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3837c63dd6918a24de6c526277910e3766d8c2b1627c500b155f3eecad8fad65"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cdb7eb3cf3deb3dd9e7b8749323b5d970052711f9e1e9f36364163627f96da58"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:26ab43b6d65d25b1a333c8d1b1c2f8399385ff683a35ab5e274ba7b8bb7dc61c"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75130df05aae7a7ac171b3b5b24714cffeabd054ad2ebc18870b3aa4526eba23"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c34f751bf67cab69638564eee34023909380ba3e0d8ee7f6fe473079bf93f09b"}, + {file = "rpds_py-0.19.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2671cb47e50a97f419a02cd1e0c339b31de017b033186358db92f4d8e2e17d8"}, + {file = "rpds_py-0.19.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:3c73254c256081704dba0a333457e2fb815364018788f9b501efe7c5e0ada401"}, + {file = "rpds_py-0.19.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4383beb4a29935b8fa28aca8fa84c956bf545cb0c46307b091b8d312a9150e6a"}, + {file = "rpds_py-0.19.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:dbceedcf4a9329cc665452db1aaf0845b85c666e4885b92ee0cddb1dbf7e052a"}, + {file = "rpds_py-0.19.1-cp311-none-win32.whl", hash = "sha256:f0a6d4a93d2a05daec7cb885157c97bbb0be4da739d6f9dfb02e101eb40921cd"}, + {file = "rpds_py-0.19.1-cp311-none-win_amd64.whl", hash = "sha256:c149a652aeac4902ecff2dd93c3b2681c608bd5208c793c4a99404b3e1afc87c"}, + {file = "rpds_py-0.19.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:56313be667a837ff1ea3508cebb1ef6681d418fa2913a0635386cf29cff35165"}, + {file = "rpds_py-0.19.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6d1d7539043b2b31307f2c6c72957a97c839a88b2629a348ebabe5aa8b626d6b"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e1dc59a5e7bc7f44bd0c048681f5e05356e479c50be4f2c1a7089103f1621d5"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b8f78398e67a7227aefa95f876481485403eb974b29e9dc38b307bb6eb2315ea"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ef07a0a1d254eeb16455d839cef6e8c2ed127f47f014bbda64a58b5482b6c836"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8124101e92c56827bebef084ff106e8ea11c743256149a95b9fd860d3a4f331f"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08ce9c95a0b093b7aec75676b356a27879901488abc27e9d029273d280438505"}, + {file = "rpds_py-0.19.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0b02dd77a2de6e49078c8937aadabe933ceac04b41c5dde5eca13a69f3cf144e"}, + {file = "rpds_py-0.19.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4dd02e29c8cbed21a1875330b07246b71121a1c08e29f0ee3db5b4cfe16980c4"}, + {file = "rpds_py-0.19.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:9c7042488165f7251dc7894cd533a875d2875af6d3b0e09eda9c4b334627ad1c"}, + {file = "rpds_py-0.19.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f809a17cc78bd331e137caa25262b507225854073fd319e987bd216bed911b7c"}, + {file = "rpds_py-0.19.1-cp312-none-win32.whl", hash = "sha256:3ddab996807c6b4227967fe1587febade4e48ac47bb0e2d3e7858bc621b1cace"}, + {file = "rpds_py-0.19.1-cp312-none-win_amd64.whl", hash = "sha256:32e0db3d6e4f45601b58e4ac75c6f24afbf99818c647cc2066f3e4b192dabb1f"}, + {file = "rpds_py-0.19.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:747251e428406b05fc86fee3904ee19550c4d2d19258cef274e2151f31ae9d38"}, + {file = "rpds_py-0.19.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dc733d35f861f8d78abfaf54035461e10423422999b360966bf1c443cbc42705"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bbda75f245caecff8faa7e32ee94dfaa8312a3367397975527f29654cd17a6ed"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bd04d8cab16cab5b0a9ffc7d10f0779cf1120ab16c3925404428f74a0a43205a"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2d66eb41ffca6cc3c91d8387509d27ba73ad28371ef90255c50cb51f8953301"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fdf4890cda3b59170009d012fca3294c00140e7f2abe1910e6a730809d0f3f9b"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1fa67ef839bad3815124f5f57e48cd50ff392f4911a9f3cf449d66fa3df62a5"}, + {file = "rpds_py-0.19.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b82c9514c6d74b89a370c4060bdb80d2299bc6857e462e4a215b4ef7aa7b090e"}, + {file = "rpds_py-0.19.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c7b07959866a6afb019abb9564d8a55046feb7a84506c74a6f197cbcdf8a208e"}, + {file = "rpds_py-0.19.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4f580ae79d0b861dfd912494ab9d477bea535bfb4756a2269130b6607a21802e"}, + {file = "rpds_py-0.19.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c6d20c8896c00775e6f62d8373aba32956aa0b850d02b5ec493f486c88e12859"}, + {file = "rpds_py-0.19.1-cp313-none-win32.whl", hash = "sha256:afedc35fe4b9e30ab240b208bb9dc8938cb4afe9187589e8d8d085e1aacb8309"}, + {file = "rpds_py-0.19.1-cp313-none-win_amd64.whl", hash = "sha256:1d4af2eb520d759f48f1073ad3caef997d1bfd910dc34e41261a595d3f038a94"}, + {file = "rpds_py-0.19.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:34bca66e2e3eabc8a19e9afe0d3e77789733c702c7c43cd008e953d5d1463fde"}, + {file = "rpds_py-0.19.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:24f8ae92c7fae7c28d0fae9b52829235df83f34847aa8160a47eb229d9666c7b"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71157f9db7f6bc6599a852852f3389343bea34315b4e6f109e5cbc97c1fb2963"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1d494887d40dc4dd0d5a71e9d07324e5c09c4383d93942d391727e7a40ff810b"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7b3661e6d4ba63a094138032c1356d557de5b3ea6fd3cca62a195f623e381c76"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97fbb77eaeb97591efdc654b8b5f3ccc066406ccfb3175b41382f221ecc216e8"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4cc4bc73e53af8e7a42c8fd7923bbe35babacfa7394ae9240b3430b5dcf16b2a"}, + {file = "rpds_py-0.19.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:35af5e4d5448fa179fd7fff0bba0fba51f876cd55212f96c8bbcecc5c684ae5c"}, + {file = "rpds_py-0.19.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3511f6baf8438326e351097cecd137eb45c5f019944fe0fd0ae2fea2fd26be39"}, + {file = "rpds_py-0.19.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:57863d16187995c10fe9cf911b897ed443ac68189179541734502353af33e693"}, + {file = "rpds_py-0.19.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:9e318e6786b1e750a62f90c6f7fa8b542102bdcf97c7c4de2a48b50b61bd36ec"}, + {file = "rpds_py-0.19.1-cp38-none-win32.whl", hash = "sha256:53dbc35808c6faa2ce3e48571f8f74ef70802218554884787b86a30947842a14"}, + {file = "rpds_py-0.19.1-cp38-none-win_amd64.whl", hash = "sha256:8df1c283e57c9cb4d271fdc1875f4a58a143a2d1698eb0d6b7c0d7d5f49c53a1"}, + {file = "rpds_py-0.19.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e76c902d229a3aa9d5ceb813e1cbcc69bf5bda44c80d574ff1ac1fa3136dea71"}, + {file = "rpds_py-0.19.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:de1f7cd5b6b351e1afd7568bdab94934d656abe273d66cda0ceea43bbc02a0c2"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:24fc5a84777cb61692d17988989690d6f34f7f95968ac81398d67c0d0994a897"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:74129d5ffc4cde992d89d345f7f7d6758320e5d44a369d74d83493429dad2de5"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5e360188b72f8080fefa3adfdcf3618604cc8173651c9754f189fece068d2a45"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13e6d4840897d4e4e6b2aa1443e3a8eca92b0402182aafc5f4ca1f5e24f9270a"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f09529d2332264a902688031a83c19de8fda5eb5881e44233286b9c9ec91856d"}, + {file = "rpds_py-0.19.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0d4b52811dcbc1aba08fd88d475f75b4f6db0984ba12275d9bed1a04b2cae9b5"}, + {file = "rpds_py-0.19.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:dd635c2c4043222d80d80ca1ac4530a633102a9f2ad12252183bcf338c1b9474"}, + {file = "rpds_py-0.19.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f35b34a5184d5e0cc360b61664c1c06e866aab077b5a7c538a3e20c8fcdbf90b"}, + {file = "rpds_py-0.19.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d4ec0046facab83012d821b33cead742a35b54575c4edfb7ed7445f63441835f"}, + {file = "rpds_py-0.19.1-cp39-none-win32.whl", hash = "sha256:f5b8353ea1a4d7dfb59a7f45c04df66ecfd363bb5b35f33b11ea579111d4655f"}, + {file = "rpds_py-0.19.1-cp39-none-win_amd64.whl", hash = "sha256:1fb93d3486f793d54a094e2bfd9cd97031f63fcb5bc18faeb3dd4b49a1c06523"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7d5c7e32f3ee42f77d8ff1a10384b5cdcc2d37035e2e3320ded909aa192d32c3"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:89cc8921a4a5028d6dd388c399fcd2eef232e7040345af3d5b16c04b91cf3c7e"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bca34e913d27401bda2a6f390d0614049f5a95b3b11cd8eff80fe4ec340a1208"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5953391af1405f968eb5701ebbb577ebc5ced8d0041406f9052638bafe52209d"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:840e18c38098221ea6201f091fc5d4de6128961d2930fbbc96806fb43f69aec1"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6d8b735c4d162dc7d86a9cf3d717f14b6c73637a1f9cd57fe7e61002d9cb1972"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce757c7c90d35719b38fa3d4ca55654a76a40716ee299b0865f2de21c146801c"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a9421b23c85f361a133aa7c5e8ec757668f70343f4ed8fdb5a4a14abd5437244"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:3b823be829407393d84ee56dc849dbe3b31b6a326f388e171555b262e8456cc1"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:5e58b61dcbb483a442c6239c3836696b79f2cd8e7eec11e12155d3f6f2d886d1"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:39d67896f7235b2c886fb1ee77b1491b77049dcef6fbf0f401e7b4cbed86bbd4"}, + {file = "rpds_py-0.19.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:8b32cd4ab6db50c875001ba4f5a6b30c0f42151aa1fbf9c2e7e3674893fb1dc4"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:1c32e41de995f39b6b315d66c27dea3ef7f7c937c06caab4c6a79a5e09e2c415"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:1a129c02b42d46758c87faeea21a9f574e1c858b9f358b6dd0bbd71d17713175"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:346557f5b1d8fd9966059b7a748fd79ac59f5752cd0e9498d6a40e3ac1c1875f"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:31e450840f2f27699d014cfc8865cc747184286b26d945bcea6042bb6aa4d26e"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01227f8b3e6c8961490d869aa65c99653df80d2f0a7fde8c64ebddab2b9b02fd"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:69084fd29bfeff14816666c93a466e85414fe6b7d236cfc108a9c11afa6f7301"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4d2b88efe65544a7d5121b0c3b003ebba92bfede2ea3577ce548b69c5235185"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6ea961a674172ed2235d990d7edf85d15d8dfa23ab8575e48306371c070cda67"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:5beffdbe766cfe4fb04f30644d822a1080b5359df7db3a63d30fa928375b2720"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:720f3108fb1bfa32e51db58b832898372eb5891e8472a8093008010911e324c5"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:c2087dbb76a87ec2c619253e021e4fb20d1a72580feeaa6892b0b3d955175a71"}, + {file = "rpds_py-0.19.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2ddd50f18ebc05ec29a0d9271e9dbe93997536da3546677f8ca00b76d477680c"}, + {file = "rpds_py-0.19.1.tar.gz", hash = "sha256:31dd5794837f00b46f4096aa8ccaa5972f73a938982e32ed817bb520c465e520"}, ] [[package]] diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index 64cc1299a..92fedafcf 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -15,10 +15,22 @@ export type { Agents_CreateAgentRequest } from "./models/Agents_CreateAgentReque export type { Agents_CreateOrUpdateAgentRequest_id } from "./models/Agents_CreateOrUpdateAgentRequest_id"; export type { Agents_PatchAgentRequest } from "./models/Agents_PatchAgentRequest"; export type { Agents_UpdateAgentRequest } from "./models/Agents_UpdateAgentRequest"; +export type { Chat_BaseChatOutput } from "./models/Chat_BaseChatOutput"; +export type { Chat_BaseChatResponse } from "./models/Chat_BaseChatResponse"; +export type { Chat_BaseTokenLogProb } from "./models/Chat_BaseTokenLogProb"; +export type { Chat_ChatOutputChunk } from "./models/Chat_ChatOutputChunk"; +export type { Chat_ChunkChatResponse } from "./models/Chat_ChunkChatResponse"; +export type { Chat_CompetionUsage } from "./models/Chat_CompetionUsage"; export type { Chat_CompletionResponseFormat } from "./models/Chat_CompletionResponseFormat"; +export type { Chat_FinishReason } from "./models/Chat_FinishReason"; export type { Chat_GenerationPreset } from "./models/Chat_GenerationPreset"; export type { Chat_GenerationPresetSettings } from "./models/Chat_GenerationPresetSettings"; +export type { Chat_LogProbResponse } from "./models/Chat_LogProbResponse"; +export type { Chat_MessageChatResponse } from "./models/Chat_MessageChatResponse"; +export type { Chat_MultipleChatOutput } from "./models/Chat_MultipleChatOutput"; export type { Chat_OpenAISettings } from "./models/Chat_OpenAISettings"; +export type { Chat_SingleChatOutput } from "./models/Chat_SingleChatOutput"; +export type { Chat_TokenLogProb } from "./models/Chat_TokenLogProb"; export type { Chat_vLLMSettings } from "./models/Chat_vLLMSettings"; export type { Common_identifierSafeUnicode } from "./models/Common_identifierSafeUnicode"; export type { Common_limit } from "./models/Common_limit"; @@ -47,6 +59,7 @@ export type { Docs_TextOnlyDocSearchRequest } from "./models/Docs_TextOnlyDocSea export type { Docs_VectorDocSearchRequest } from "./models/Docs_VectorDocSearchRequest"; export type { Entries_BaseChatMLContentPart } from "./models/Entries_BaseChatMLContentPart"; export type { Entries_ChatMLImageContentPart } from "./models/Entries_ChatMLImageContentPart"; +export type { Entries_ChatMLMessage } from "./models/Entries_ChatMLMessage"; export type { Entries_ChatMLRole } from "./models/Entries_ChatMLRole"; export type { Entries_ChatMLTextContentPart } from "./models/Entries_ChatMLTextContentPart"; export type { Entries_Entry } from "./models/Entries_Entry"; @@ -95,6 +108,8 @@ export type { Tools_FunctionCallOption } from "./models/Tools_FunctionCallOption export type { Tools_FunctionDef } from "./models/Tools_FunctionDef"; export type { Tools_FunctionDefUpdate } from "./models/Tools_FunctionDefUpdate"; export type { Tools_FunctionTool } from "./models/Tools_FunctionTool"; +export type { Tools_NamedFunctionChoice } from "./models/Tools_NamedFunctionChoice"; +export type { Tools_NamedToolChoice } from "./models/Tools_NamedToolChoice"; export type { Tools_PatchToolRequest } from "./models/Tools_PatchToolRequest"; export type { Tools_Tool } from "./models/Tools_Tool"; export type { Tools_ToolResponse } from "./models/Tools_ToolResponse"; @@ -111,10 +126,22 @@ export { $Agents_CreateAgentRequest } from "./schemas/$Agents_CreateAgentRequest export { $Agents_CreateOrUpdateAgentRequest_id } from "./schemas/$Agents_CreateOrUpdateAgentRequest_id"; export { $Agents_PatchAgentRequest } from "./schemas/$Agents_PatchAgentRequest"; export { $Agents_UpdateAgentRequest } from "./schemas/$Agents_UpdateAgentRequest"; +export { $Chat_BaseChatOutput } from "./schemas/$Chat_BaseChatOutput"; +export { $Chat_BaseChatResponse } from "./schemas/$Chat_BaseChatResponse"; +export { $Chat_BaseTokenLogProb } from "./schemas/$Chat_BaseTokenLogProb"; +export { $Chat_ChatOutputChunk } from "./schemas/$Chat_ChatOutputChunk"; +export { $Chat_ChunkChatResponse } from "./schemas/$Chat_ChunkChatResponse"; +export { $Chat_CompetionUsage } from "./schemas/$Chat_CompetionUsage"; export { $Chat_CompletionResponseFormat } from "./schemas/$Chat_CompletionResponseFormat"; +export { $Chat_FinishReason } from "./schemas/$Chat_FinishReason"; export { $Chat_GenerationPreset } from "./schemas/$Chat_GenerationPreset"; export { $Chat_GenerationPresetSettings } from "./schemas/$Chat_GenerationPresetSettings"; +export { $Chat_LogProbResponse } from "./schemas/$Chat_LogProbResponse"; +export { $Chat_MessageChatResponse } from "./schemas/$Chat_MessageChatResponse"; +export { $Chat_MultipleChatOutput } from "./schemas/$Chat_MultipleChatOutput"; export { $Chat_OpenAISettings } from "./schemas/$Chat_OpenAISettings"; +export { $Chat_SingleChatOutput } from "./schemas/$Chat_SingleChatOutput"; +export { $Chat_TokenLogProb } from "./schemas/$Chat_TokenLogProb"; export { $Chat_vLLMSettings } from "./schemas/$Chat_vLLMSettings"; export { $Common_identifierSafeUnicode } from "./schemas/$Common_identifierSafeUnicode"; export { $Common_limit } from "./schemas/$Common_limit"; @@ -143,6 +170,7 @@ export { $Docs_TextOnlyDocSearchRequest } from "./schemas/$Docs_TextOnlyDocSearc export { $Docs_VectorDocSearchRequest } from "./schemas/$Docs_VectorDocSearchRequest"; export { $Entries_BaseChatMLContentPart } from "./schemas/$Entries_BaseChatMLContentPart"; export { $Entries_ChatMLImageContentPart } from "./schemas/$Entries_ChatMLImageContentPart"; +export { $Entries_ChatMLMessage } from "./schemas/$Entries_ChatMLMessage"; export { $Entries_ChatMLRole } from "./schemas/$Entries_ChatMLRole"; export { $Entries_ChatMLTextContentPart } from "./schemas/$Entries_ChatMLTextContentPart"; export { $Entries_Entry } from "./schemas/$Entries_Entry"; @@ -191,6 +219,8 @@ export { $Tools_FunctionCallOption } from "./schemas/$Tools_FunctionCallOption"; export { $Tools_FunctionDef } from "./schemas/$Tools_FunctionDef"; export { $Tools_FunctionDefUpdate } from "./schemas/$Tools_FunctionDefUpdate"; export { $Tools_FunctionTool } from "./schemas/$Tools_FunctionTool"; +export { $Tools_NamedFunctionChoice } from "./schemas/$Tools_NamedFunctionChoice"; +export { $Tools_NamedToolChoice } from "./schemas/$Tools_NamedToolChoice"; export { $Tools_PatchToolRequest } from "./schemas/$Tools_PatchToolRequest"; export { $Tools_Tool } from "./schemas/$Tools_Tool"; export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse"; diff --git a/sdks/ts/src/api/models/Chat_BaseChatOutput.ts b/sdks/ts/src/api/models/Chat_BaseChatOutput.ts new file mode 100644 index 000000000..6770dd5d5 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_BaseChatOutput.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_FinishReason } from "./Chat_FinishReason"; +import type { Chat_LogProbResponse } from "./Chat_LogProbResponse"; +export type Chat_BaseChatOutput = { + index: number; + /** + * The reason the model stopped generating tokens + */ + finish_reason: Chat_FinishReason; + /** + * The log probabilities of tokens + */ + logprobs: Chat_LogProbResponse | null; +}; diff --git a/sdks/ts/src/api/models/Chat_BaseChatResponse.ts b/sdks/ts/src/api/models/Chat_BaseChatResponse.ts new file mode 100644 index 000000000..781dd3838 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_BaseChatResponse.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_CompetionUsage } from "./Chat_CompetionUsage"; +import type { Common_uuid } from "./Common_uuid"; +import type { Docs_DocReference } from "./Docs_DocReference"; +export type Chat_BaseChatResponse = { + /** + * Usage statistics for the completion request + */ + usage: Chat_CompetionUsage | null; + /** + * Background job IDs that may have been spawned from this interaction. + */ + jobs: Array; + /** + * Documents referenced for this request (for citation purposes). + */ + docs: Array; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Chat_BaseTokenLogProb.ts b/sdks/ts/src/api/models/Chat_BaseTokenLogProb.ts new file mode 100644 index 000000000..41b715757 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_BaseTokenLogProb.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Chat_BaseTokenLogProb = { + token: string; + /** + * The log probability of the token + */ + logprob: number; + bytes: Array | null; +}; diff --git a/sdks/ts/src/api/models/Chat_ChatOutputChunk.ts b/sdks/ts/src/api/models/Chat_ChatOutputChunk.ts new file mode 100644 index 000000000..9d52a7fdc --- /dev/null +++ b/sdks/ts/src/api/models/Chat_ChatOutputChunk.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_BaseChatOutput } from "./Chat_BaseChatOutput"; +import type { Entries_ChatMLMessage } from "./Entries_ChatMLMessage"; +/** + * Streaming chat completion output + */ +export type Chat_ChatOutputChunk = Chat_BaseChatOutput & { + /** + * The message generated by the model + */ + delta: Entries_ChatMLMessage; +}; diff --git a/sdks/ts/src/api/models/Chat_ChunkChatResponse.ts b/sdks/ts/src/api/models/Chat_ChunkChatResponse.ts new file mode 100644 index 000000000..86e614b6f --- /dev/null +++ b/sdks/ts/src/api/models/Chat_ChunkChatResponse.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_BaseChatResponse } from "./Chat_BaseChatResponse"; +import type { Chat_ChatOutputChunk } from "./Chat_ChatOutputChunk"; +export type Chat_ChunkChatResponse = Chat_BaseChatResponse & { + /** + * The deltas generated by the model + */ + choices: Array; +}; diff --git a/sdks/ts/src/api/models/Chat_CompetionUsage.ts b/sdks/ts/src/api/models/Chat_CompetionUsage.ts new file mode 100644 index 000000000..089b474f1 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_CompetionUsage.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Usage statistics for the completion request + */ +export type Chat_CompetionUsage = { + /** + * Number of tokens in the generated completion + */ + readonly completion_tokens: number; + /** + * Number of tokens in the prompt + */ + readonly prompt_tokens: number; + /** + * Total number of tokens used in the request (prompt + completion) + */ + readonly total_tokens: number; +}; diff --git a/sdks/ts/src/api/models/Chat_FinishReason.ts b/sdks/ts/src/api/models/Chat_FinishReason.ts new file mode 100644 index 000000000..7b1c63b1c --- /dev/null +++ b/sdks/ts/src/api/models/Chat_FinishReason.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * The reason the model stopped generating tokens. This will be `stop` + * if the model hit a natural stop point or a provided stop sequence, + * `length` if the maximum number of tokens specified in the request + * was reached, `content_filter` if content was omitted due to a flag + * from our content filters, `tool_calls` if the model called a tool. + */ +export type Chat_FinishReason = + | "stop" + | "length" + | "content_filter" + | "tool_calls"; diff --git a/sdks/ts/src/api/models/Chat_LogProbResponse.ts b/sdks/ts/src/api/models/Chat_LogProbResponse.ts new file mode 100644 index 000000000..4d86294e1 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_LogProbResponse.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_TokenLogProb } from "./Chat_TokenLogProb"; +export type Chat_LogProbResponse = { + /** + * The log probabilities of the tokens + */ + content: Array | null; +}; diff --git a/sdks/ts/src/api/models/Chat_MessageChatResponse.ts b/sdks/ts/src/api/models/Chat_MessageChatResponse.ts new file mode 100644 index 000000000..32efea493 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_MessageChatResponse.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_BaseChatResponse } from "./Chat_BaseChatResponse"; +import type { Chat_ChatOutputChunk } from "./Chat_ChatOutputChunk"; +export type Chat_MessageChatResponse = Chat_BaseChatResponse & { + /** + * The deltas generated by the model + */ + choices: Array; +}; diff --git a/sdks/ts/src/api/models/Chat_MultipleChatOutput.ts b/sdks/ts/src/api/models/Chat_MultipleChatOutput.ts new file mode 100644 index 000000000..759edb0f5 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_MultipleChatOutput.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_BaseChatOutput } from "./Chat_BaseChatOutput"; +import type { Entries_ChatMLMessage } from "./Entries_ChatMLMessage"; +/** + * The output returned by the model. Note that, depending on the model provider, they might return more than one message. + */ +export type Chat_MultipleChatOutput = Chat_BaseChatOutput & { + messages: Array; +}; diff --git a/sdks/ts/src/api/models/Chat_SingleChatOutput.ts b/sdks/ts/src/api/models/Chat_SingleChatOutput.ts new file mode 100644 index 000000000..e4571c234 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_SingleChatOutput.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_BaseChatOutput } from "./Chat_BaseChatOutput"; +import type { Entries_ChatMLMessage } from "./Entries_ChatMLMessage"; +/** + * The output returned by the model. Note that, depending on the model provider, they might return more than one message. + */ +export type Chat_SingleChatOutput = Chat_BaseChatOutput & { + message: Entries_ChatMLMessage; +}; diff --git a/sdks/ts/src/api/models/Chat_TokenLogProb.ts b/sdks/ts/src/api/models/Chat_TokenLogProb.ts new file mode 100644 index 000000000..cec5f6cf7 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_TokenLogProb.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_BaseTokenLogProb } from "./Chat_BaseTokenLogProb"; +export type Chat_TokenLogProb = Chat_BaseTokenLogProb & { + top_logprobs: Array; +}; diff --git a/sdks/ts/src/api/models/Entries_ChatMLMessage.ts b/sdks/ts/src/api/models/Entries_ChatMLMessage.ts new file mode 100644 index 000000000..019cfb7db --- /dev/null +++ b/sdks/ts/src/api/models/Entries_ChatMLMessage.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Entries_ChatMLRole } from "./Entries_ChatMLRole"; +import type { Tools_ChosenToolCall } from "./Tools_ChosenToolCall"; +export type Entries_ChatMLMessage = { + /** + * The role of the message + */ + role: Entries_ChatMLRole; + /** + * The content parts of the message + */ + content: string | Array; + /** + * Name + */ + name?: string; + /** + * Tool calls generated by the model. + */ + readonly tool_calls: Array; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + readonly id: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Tools_NamedFunctionChoice.ts b/sdks/ts/src/api/models/Tools_NamedFunctionChoice.ts new file mode 100644 index 000000000..bfbe9ff87 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_NamedFunctionChoice.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tools_FunctionCallOption } from "./Tools_FunctionCallOption"; +import type { Tools_NamedToolChoice } from "./Tools_NamedToolChoice"; +export type Tools_NamedFunctionChoice = Tools_NamedToolChoice & { + function: Tools_FunctionCallOption; + type: "function"; + /** + * The function to call + */ + function: Tools_FunctionCallOption; +}; diff --git a/sdks/ts/src/api/models/Tools_NamedToolChoice.ts b/sdks/ts/src/api/models/Tools_NamedToolChoice.ts new file mode 100644 index 000000000..c489d5c21 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_NamedToolChoice.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Tools_FunctionCallOption } from "./Tools_FunctionCallOption"; +import type { Tools_ToolType } from "./Tools_ToolType"; +export type Tools_NamedToolChoice = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type: Tools_ToolType; + function?: Tools_FunctionCallOption; + integration?: any; + system?: any; + api_call?: any; +}; diff --git a/sdks/ts/src/api/models/Users_CreateUserRequest.ts b/sdks/ts/src/api/models/Users_CreateUserRequest.ts index 246c6183f..8811f8252 100644 --- a/sdks/ts/src/api/models/Users_CreateUserRequest.ts +++ b/sdks/ts/src/api/models/Users_CreateUserRequest.ts @@ -16,8 +16,4 @@ export type Users_CreateUserRequest = { * About the user */ about: string; - /** - * Documents to index for this user. (Max: 100 items) - */ - docs: Array; }; diff --git a/sdks/ts/src/api/schemas/$Chat_BaseChatOutput.ts b/sdks/ts/src/api/schemas/$Chat_BaseChatOutput.ts new file mode 100644 index 000000000..3053f6412 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_BaseChatOutput.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_BaseChatOutput = { + properties: { + index: { + type: "number", + isRequired: true, + format: "uint32", + }, + finish_reason: { + type: "all-of", + description: `The reason the model stopped generating tokens`, + contains: [ + { + type: "Chat_FinishReason", + }, + ], + isRequired: true, + }, + logprobs: { + type: "all-of", + description: `The log probabilities of tokens`, + contains: [ + { + type: "Chat_LogProbResponse", + }, + ], + isRequired: true, + isNullable: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_BaseChatResponse.ts b/sdks/ts/src/api/schemas/$Chat_BaseChatResponse.ts new file mode 100644 index 000000000..57a56bc70 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_BaseChatResponse.ts @@ -0,0 +1,50 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_BaseChatResponse = { + properties: { + usage: { + type: "all-of", + description: `Usage statistics for the completion request`, + contains: [ + { + type: "Chat_CompetionUsage", + }, + ], + isRequired: true, + isNullable: true, + }, + jobs: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + docs: { + type: "array", + contains: { + type: "Docs_DocReference", + }, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_BaseTokenLogProb.ts b/sdks/ts/src/api/schemas/$Chat_BaseTokenLogProb.ts new file mode 100644 index 000000000..e9cd03715 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_BaseTokenLogProb.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_BaseTokenLogProb = { + properties: { + token: { + type: "string", + isRequired: true, + }, + logprob: { + type: "number", + description: `The log probability of the token`, + isRequired: true, + format: "float", + }, + bytes: { + type: "array", + contains: { + type: "number", + format: "uint16", + }, + isRequired: true, + isNullable: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_ChatOutputChunk.ts b/sdks/ts/src/api/schemas/$Chat_ChatOutputChunk.ts new file mode 100644 index 000000000..2ad1c1175 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_ChatOutputChunk.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_ChatOutputChunk = { + type: "all-of", + description: `Streaming chat completion output`, + contains: [ + { + type: "Chat_BaseChatOutput", + }, + { + properties: { + delta: { + type: "all-of", + description: `The message generated by the model`, + contains: [ + { + type: "Entries_ChatMLMessage", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_ChunkChatResponse.ts b/sdks/ts/src/api/schemas/$Chat_ChunkChatResponse.ts new file mode 100644 index 000000000..07b83d11e --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_ChunkChatResponse.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_ChunkChatResponse = { + type: "all-of", + contains: [ + { + type: "Chat_BaseChatResponse", + }, + { + properties: { + choices: { + type: "array", + contains: { + type: "Chat_ChatOutputChunk", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_CompetionUsage.ts b/sdks/ts/src/api/schemas/$Chat_CompetionUsage.ts new file mode 100644 index 000000000..556114810 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_CompetionUsage.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_CompetionUsage = { + description: `Usage statistics for the completion request`, + properties: { + completion_tokens: { + type: "number", + description: `Number of tokens in the generated completion`, + isReadOnly: true, + isRequired: true, + format: "uint32", + }, + prompt_tokens: { + type: "number", + description: `Number of tokens in the prompt`, + isReadOnly: true, + isRequired: true, + format: "uint32", + }, + total_tokens: { + type: "number", + description: `Total number of tokens used in the request (prompt + completion)`, + isReadOnly: true, + isRequired: true, + format: "uint32", + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_FinishReason.ts b/sdks/ts/src/api/schemas/$Chat_FinishReason.ts new file mode 100644 index 000000000..9f4846733 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_FinishReason.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_FinishReason = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_LogProbResponse.ts b/sdks/ts/src/api/schemas/$Chat_LogProbResponse.ts new file mode 100644 index 000000000..2f3d2c095 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_LogProbResponse.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_LogProbResponse = { + properties: { + content: { + type: "array", + contains: { + type: "Chat_TokenLogProb", + }, + isRequired: true, + isNullable: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_MessageChatResponse.ts b/sdks/ts/src/api/schemas/$Chat_MessageChatResponse.ts new file mode 100644 index 000000000..e8a2a0161 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_MessageChatResponse.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_MessageChatResponse = { + type: "all-of", + contains: [ + { + type: "Chat_BaseChatResponse", + }, + { + properties: { + choices: { + type: "array", + contains: { + type: "Chat_ChatOutputChunk", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_MultipleChatOutput.ts b/sdks/ts/src/api/schemas/$Chat_MultipleChatOutput.ts new file mode 100644 index 000000000..8dc1b3bb7 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_MultipleChatOutput.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_MultipleChatOutput = { + type: "all-of", + description: `The output returned by the model. Note that, depending on the model provider, they might return more than one message.`, + contains: [ + { + type: "Chat_BaseChatOutput", + }, + { + properties: { + messages: { + type: "array", + contains: { + type: "Entries_ChatMLMessage", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_SingleChatOutput.ts b/sdks/ts/src/api/schemas/$Chat_SingleChatOutput.ts new file mode 100644 index 000000000..1cd376f3f --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_SingleChatOutput.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_SingleChatOutput = { + type: "all-of", + description: `The output returned by the model. Note that, depending on the model provider, they might return more than one message.`, + contains: [ + { + type: "Chat_BaseChatOutput", + }, + { + properties: { + message: { + type: "Entries_ChatMLMessage", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_TokenLogProb.ts b/sdks/ts/src/api/schemas/$Chat_TokenLogProb.ts new file mode 100644 index 000000000..aa4228362 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_TokenLogProb.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_TokenLogProb = { + type: "all-of", + contains: [ + { + type: "Chat_BaseTokenLogProb", + }, + { + properties: { + top_logprobs: { + type: "array", + contains: { + type: "Chat_BaseTokenLogProb", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Entries_ChatMLMessage.ts b/sdks/ts/src/api/schemas/$Entries_ChatMLMessage.ts new file mode 100644 index 000000000..a9a55cee2 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Entries_ChatMLMessage.ts @@ -0,0 +1,63 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Entries_ChatMLMessage = { + properties: { + role: { + type: "all-of", + description: `The role of the message`, + contains: [ + { + type: "Entries_ChatMLRole", + }, + ], + isRequired: true, + }, + content: { + type: "any-of", + description: `The content parts of the message`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + name: { + type: "string", + description: `Name`, + }, + tool_calls: { + type: "array", + contains: { + type: "Tools_ChosenToolCall", + }, + isReadOnly: true, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_NamedFunctionChoice.ts b/sdks/ts/src/api/schemas/$Tools_NamedFunctionChoice.ts new file mode 100644 index 000000000..e1b8df7c3 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_NamedFunctionChoice.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_NamedFunctionChoice = { + type: "all-of", + contains: [ + { + type: "Tools_NamedToolChoice", + }, + { + properties: { + function: { + type: "Tools_FunctionCallOption", + isRequired: true, + }, + type: { + type: "Enum", + isRequired: true, + }, + function: { + type: "all-of", + description: `The function to call`, + contains: [ + { + type: "Tools_FunctionCallOption", + }, + ], + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_NamedToolChoice.ts b/sdks/ts/src/api/schemas/$Tools_NamedToolChoice.ts new file mode 100644 index 000000000..32578781a --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_NamedToolChoice.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_NamedToolChoice = { + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + isRequired: true, + }, + function: { + type: "Tools_FunctionCallOption", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts index 290d1bffb..e9131ec14 100644 --- a/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts +++ b/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts @@ -26,12 +26,5 @@ export const $Users_CreateUserRequest = { description: `About the user`, isRequired: true, }, - docs: { - type: "array", - contains: { - properties: {}, - }, - isRequired: true, - }, }, } as const; diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index 50b270426..6d3d0347b 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -6,7 +6,13 @@ import type { Agents_Agent } from "../models/Agents_Agent"; import type { Agents_CreateAgentRequest } from "../models/Agents_CreateAgentRequest"; import type { Agents_PatchAgentRequest } from "../models/Agents_PatchAgentRequest"; import type { Agents_UpdateAgentRequest } from "../models/Agents_UpdateAgentRequest"; +import type { Chat_ChunkChatResponse } from "../models/Chat_ChunkChatResponse"; +import type { Chat_CompletionResponseFormat } from "../models/Chat_CompletionResponseFormat"; +import type { Chat_GenerationPreset } from "../models/Chat_GenerationPreset"; +import type { Chat_MessageChatResponse } from "../models/Chat_MessageChatResponse"; +import type { Common_identifierSafeUnicode } from "../models/Common_identifierSafeUnicode"; import type { Common_limit } from "../models/Common_limit"; +import type { Common_logit_bias } from "../models/Common_logit_bias"; import type { Common_offset } from "../models/Common_offset"; import type { Common_ResourceCreatedResponse } from "../models/Common_ResourceCreatedResponse"; import type { Common_ResourceDeletedResponse } from "../models/Common_ResourceDeletedResponse"; @@ -18,6 +24,7 @@ import type { Docs_DocSearchRequest } from "../models/Docs_DocSearchRequest"; import type { Docs_EmbedQueryRequest } from "../models/Docs_EmbedQueryRequest"; import type { Docs_EmbedQueryResponse } from "../models/Docs_EmbedQueryResponse"; import type { Entries_History } from "../models/Entries_History"; +import type { Entries_InputChatMLMessage } from "../models/Entries_InputChatMLMessage"; import type { Executions_CreateExecutionRequest } from "../models/Executions_CreateExecutionRequest"; import type { Executions_Execution } from "../models/Executions_Execution"; import type { Executions_TaskTokenResumeExecutionRequest } from "../models/Executions_TaskTokenResumeExecutionRequest"; @@ -32,6 +39,8 @@ import type { Tasks_CreateTaskRequest } from "../models/Tasks_CreateTaskRequest" import type { Tasks_PatchTaskRequest } from "../models/Tasks_PatchTaskRequest"; import type { Tasks_Task } from "../models/Tasks_Task"; import type { Tasks_UpdateTaskRequest } from "../models/Tasks_UpdateTaskRequest"; +import type { Tools_FunctionTool } from "../models/Tools_FunctionTool"; +import type { Tools_NamedToolChoice } from "../models/Tools_NamedToolChoice"; import type { Tools_PatchToolRequest } from "../models/Tools_PatchToolRequest"; import type { Tools_Tool } from "../models/Tools_Tool"; import type { Tools_UpdateToolRequest } from "../models/Tools_UpdateToolRequest"; @@ -1041,6 +1050,248 @@ export class DefaultService { }, }); } + /** + * Generate a response from the model + * @returns any The request has succeeded. + * @throws ApiError + */ + public chatRouteGenerate({ + id, + requestBody, + }: { + /** + * The session ID + */ + id: Common_uuid; + /** + * Request to generate a response from the model + */ + requestBody: + | { + /** + * A list of new input messages comprising the conversation so far. + */ + messages: Array; + /** + * (Advanced) List of tools that are provided in addition to agent's default set of tools. + */ + tools?: Array; + /** + * Can be one of existing tools given to the agent earlier or the ones provided in this request. + */ + tool_choice?: "auto" | "none" | Tools_NamedToolChoice; + /** + * Whether previous memories should be recalled or not (will be enabled in a future release) + */ + readonly recall: boolean; + /** + * Whether this interaction should form new memories or not (will be enabled in a future release) + */ + readonly remember: boolean; + /** + * Whether this interaction should be stored in the session history or not + */ + save: boolean; + /** + * Identifier of the model to be used + */ + model?: Common_identifierSafeUnicode; + /** + * Indicates if the server should stream the response as it's generated + */ + stream: boolean; + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop?: Array; + /** + * If specified, the system will make a best effort to sample deterministically for that particular seed value + */ + seed?: number; + /** + * The maximum number of tokens to generate in the chat completion + */ + max_tokens?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion + */ + logit_bias?: Record; + /** + * Response format (set to `json_object` to restrict output to JSON) + */ + response_format?: Chat_CompletionResponseFormat; + /** + * Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + */ + agent?: Common_uuid; + /** + * Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + */ + preset?: Chat_GenerationPreset; + } + | { + /** + * A list of new input messages comprising the conversation so far. + */ + messages: Array; + /** + * (Advanced) List of tools that are provided in addition to agent's default set of tools. + */ + tools?: Array; + /** + * Can be one of existing tools given to the agent earlier or the ones provided in this request. + */ + tool_choice?: "auto" | "none" | Tools_NamedToolChoice; + /** + * Whether previous memories should be recalled or not (will be enabled in a future release) + */ + readonly recall: boolean; + /** + * Whether this interaction should form new memories or not (will be enabled in a future release) + */ + readonly remember: boolean; + /** + * Whether this interaction should be stored in the session history or not + */ + save: boolean; + /** + * Identifier of the model to be used + */ + model?: Common_identifierSafeUnicode; + /** + * Indicates if the server should stream the response as it's generated + */ + stream: boolean; + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop?: Array; + /** + * If specified, the system will make a best effort to sample deterministically for that particular seed value + */ + seed?: number; + /** + * The maximum number of tokens to generate in the chat completion + */ + max_tokens?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion + */ + logit_bias?: Record; + /** + * Response format (set to `json_object` to restrict output to JSON) + */ + response_format?: Chat_CompletionResponseFormat; + /** + * Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + */ + agent?: Common_uuid; + /** + * 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. + */ + frequency_penalty?: number; + /** + * 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. + */ + presence_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; + } + | { + /** + * A list of new input messages comprising the conversation so far. + */ + messages: Array; + /** + * (Advanced) List of tools that are provided in addition to agent's default set of tools. + */ + tools?: Array; + /** + * Can be one of existing tools given to the agent earlier or the ones provided in this request. + */ + tool_choice?: "auto" | "none" | Tools_NamedToolChoice; + /** + * Whether previous memories should be recalled or not (will be enabled in a future release) + */ + readonly recall: boolean; + /** + * Whether this interaction should form new memories or not (will be enabled in a future release) + */ + readonly remember: boolean; + /** + * Whether this interaction should be stored in the session history or not + */ + save: boolean; + /** + * Identifier of the model to be used + */ + model?: Common_identifierSafeUnicode; + /** + * Indicates if the server should stream the response as it's generated + */ + stream: boolean; + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop?: Array; + /** + * If specified, the system will make a best effort to sample deterministically for that particular seed value + */ + seed?: number; + /** + * The maximum number of tokens to generate in the chat completion + */ + max_tokens?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion + */ + logit_bias?: Record; + /** + * Response format (set to `json_object` to restrict output to JSON) + */ + response_format?: Chat_CompletionResponseFormat; + /** + * Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + */ + agent?: Common_uuid; + /** + * 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. + */ + repetition_penalty?: number; + /** + * Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + */ + length_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; + /** + * Minimum probability compared to leading token to be considered + */ + min_p?: number; + }; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/sessions/{id}/chat", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } /** * Get history of a Session (paginated) * @returns any The request has succeeded. From fdfb94b44c6bf79a1e05f994a541e29d154aef2b Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Fri, 26 Jul 2024 18:10:39 -0400 Subject: [PATCH 30/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Chat.py | 71 - agents-api/agents_api/autogen/Docs.py | 83 +- agents-api/agents_api/autogen/Entries.py | 16 +- agents-api/agents_api/autogen/Tasks.py | 211 +- agents-api/agents_api/autogen/Tools.py | 94 - .../agents_api/autogen/openapi_model.py | 2 + .../models/agent/create_or_update_agent.py | 4 +- .../models/task/create_or_update_task.py | 96 + .../agents_api/models/task/create_task.py | 171 +- .../agents_api/models/task/delete_task.py | 67 + agents-api/agents_api/models/task/get_task.py | 104 +- .../agents_api/models/task/list_tasks.py | 111 +- .../agents_api/models/task/patch_task.py | 114 + .../agents_api/models/task/update_task.py | 98 +- .../agents_api/models/tools/create_tools.py | 32 +- agents-api/agents_api/models/utils.py | 2 +- ...igrate_1721609661_task_tool_ref_by_name.py | 9 +- agents-api/poetry.lock | 36 +- agents-api/pyproject.toml | 2 + sdks/python/julep/api/README.md | 44 +- sdks/python/julep/api/__init__.py | 152 +- sdks/python/julep/api/client.py | 6311 +++-------------- sdks/python/julep/api/reference.md | 3711 +--------- sdks/python/julep/api/types/__init__.py | 180 +- ...gent_tools_route_list_request_direction.py | 7 - .../agent_tools_route_list_request_sort_by.py | 7 - .../types/agent_tools_route_list_response.py | 43 - sdks/python/julep/api/types/agents_agent.py | 83 - .../types/agents_agent_default_settings.py | 11 - .../api/types/agents_agent_instructions.py | 5 - .../api/types/agents_create_agent_request.py | 79 - ...s_create_agent_request_default_settings.py | 11 - ...gents_create_agent_request_instructions.py | 5 - ...s_docs_search_route_search_request_body.py | 11 + ...ts_patch_agent_request_default_settings.py | 11 - ...agents_patch_agent_request_instructions.py | 5 - .../agents_route_list_request_direction.py | 7 - .../agents_route_list_request_sort_by.py | 7 - .../api/types/agents_route_list_response.py | 43 - .../api/types/agents_update_agent_request.py | 79 - ...s_update_agent_request_default_settings.py | 11 - ...gents_update_agent_request_instructions.py | 5 - .../types/chat_generation_preset_settings.py | 46 - .../julep/api/types/chat_open_ai_settings.py | 60 - .../julep/api/types/chat_v_llm_settings.py | 65 - ...ser.py => docs_base_doc_search_request.py} | 22 +- .../api/types/docs_doc_search_request.py | 190 - .../api/types/docs_doc_search_request_text.py | 5 - .../types/docs_doc_search_request_vector.py | 7 - .../api/types/docs_embed_query_request.py | 46 - .../types/docs_embed_query_request_text.py | 5 - .../api/types/docs_embed_query_response.py | 45 - .../types/docs_hybrid_doc_search_request.py | 13 +- .../docs_text_only_doc_search_request.py | 7 +- .../types/docs_vector_doc_search_request.py | 5 +- .../entries_base_chat_ml_content_part.py | 88 - sdks/python/julep/api/types/jobs_job_state.py | 16 - .../python/julep/api/types/jobs_job_status.py | 79 - .../types/sessions_context_overflow_type.py | 7 - .../types/sessions_create_session_request.py | 82 - ...sessions_multi_agent_multi_user_session.py | 44 - .../sessions_multi_agent_no_user_session.py | 43 - ...essions_multi_agent_single_user_session.py | 44 - .../sessions_route_list_request_direction.py | 7 - .../sessions_route_list_request_sort_by.py | 7 - .../api/types/sessions_route_list_response.py | 43 - .../julep/api/types/sessions_session.py | 325 - ...essions_single_agent_multi_user_session.py | 44 - .../sessions_single_agent_no_user_session.py | 43 - ...ssions_single_agent_single_user_session.py | 44 - .../api/types/tasks_create_task_request.py | 72 - .../tasks_create_task_request_main_item.py | 19 + .../api/types/tasks_if_else_workflow_step.py | 13 +- .../types/tasks_if_else_workflow_step_else.py | 17 + .../types/tasks_if_else_workflow_step_then.py | 17 + .../tasks_patch_task_request_main_item.py | 19 + sdks/python/julep/api/types/tasks_task.py | 9 +- .../julep/api/types/tasks_task_main_item.py | 19 + ...ate_tool_request.py => tasks_task_tool.py} | 5 +- .../tasks_update_task_request_main_item.py | 19 + .../julep/api/types/tasks_workflow_step.py | 246 - .../api/types/tools_function_def_update.py | 65 - ...r_docs_search_route_search_request_body.py | 11 + .../users_route_list_request_direction.py | 5 - .../types/users_route_list_request_sort_by.py | 7 - .../api/types/users_route_list_response.py | 43 - .../api/types/users_update_user_request.py | 56 - sdks/ts/src/api/index.ts | 78 +- sdks/ts/src/api/models/Agents_Agent.ts | 44 - .../api/models/Agents_CreateAgentRequest.ts | 37 - .../Agents_CreateOrUpdateAgentRequest_id.ts | 6 - .../api/models/Agents_PatchAgentRequest.ts | 37 - .../api/models/Agents_UpdateAgentRequest.ts | 37 - .../models/Chat_GenerationPresetSettings.ts | 11 - sdks/ts/src/api/models/Chat_OpenAISettings.ts | 22 - sdks/ts/src/api/models/Chat_vLLMSettings.ts | 26 - ...equest.ts => Docs_BaseDocSearchRequest.ts} | 8 +- .../src/api/models/Docs_EmbedQueryRequest.ts | 10 - .../src/api/models/Docs_EmbedQueryResponse.ts | 10 - .../api/models/Docs_HybridDocSearchRequest.ts | 9 +- .../models/Docs_TextOnlyDocSearchRequest.ts | 8 +- .../api/models/Docs_VectorDocSearchRequest.ts | 6 +- .../models/Entries_BaseChatMLContentPart.ts | 13 - .../models/Entries_ChatMLImageContentPart.ts | 4 +- .../models/Entries_ChatMLTextContentPart.ts | 4 +- sdks/ts/src/api/models/Jobs_JobState.ts | 15 - sdks/ts/src/api/models/Jobs_JobStatus.ts | 38 - .../models/Sessions_ContextOverflowType.ts | 5 - ...essions_CreateOrUpdateSessionRequest_id.ts | 6 - .../models/Sessions_CreateSessionRequest.ts | 38 - .../Sessions_MultiAgentMultiUserSession.ts | 10 - .../Sessions_MultiAgentNoUserSession.ts | 9 - .../Sessions_MultiAgentSingleUserSession.ts | 10 - .../models/Sessions_PatchSessionRequest.ts | 27 - sdks/ts/src/api/models/Sessions_Session.ts | 42 - .../Sessions_SingleAgentMultiUserSession.ts | 10 - .../Sessions_SingleAgentNoUserSession.ts | 9 - .../Sessions_SingleAgentSingleUserSession.ts | 10 - .../models/Sessions_UpdateSessionRequest.ts | 27 - .../Tasks_CreateOrUpdateTaskRequest_id.ts | 6 - .../src/api/models/Tasks_CreateTaskRequest.ts | 19 +- .../src/api/models/Tasks_ErrorWorkflowStep.ts | 3 +- sdks/ts/src/api/models/Tasks_EvaluateStep.ts | 3 +- .../api/models/Tasks_IfElseWorkflowStep.ts | 22 +- .../src/api/models/Tasks_PatchTaskRequest.ts | 19 +- sdks/ts/src/api/models/Tasks_PromptStep.ts | 3 +- sdks/ts/src/api/models/Tasks_Task.ts | 19 +- ...CreateToolRequest.ts => Tasks_TaskTool.ts} | 9 +- sdks/ts/src/api/models/Tasks_ToolCallStep.ts | 3 +- .../src/api/models/Tasks_UpdateTaskRequest.ts | 19 +- sdks/ts/src/api/models/Tasks_WorkflowStep.ts | 10 - sdks/ts/src/api/models/Tasks_YieldStep.ts | 3 +- .../src/api/models/Tools_FunctionDefUpdate.ts | 23 - .../src/api/models/Tools_PatchToolRequest.ts | 24 - .../src/api/models/Tools_UpdateToolRequest.ts | 24 - .../Users_CreateOrUpdateUserRequest_id.ts | 6 - .../src/api/models/Users_CreateUserRequest.ts | 19 - .../src/api/models/Users_PatchUserRequest.ts | 19 - .../src/api/models/Users_UpdateUserRequest.ts | 19 - sdks/ts/src/api/models/Users_User.ts | 26 - sdks/ts/src/api/schemas/$Agents_Agent.ts | 89 - .../api/schemas/$Agents_CreateAgentRequest.ts | 66 - .../$Agents_CreateOrUpdateAgentRequest_id.ts | 7 - .../api/schemas/$Agents_PatchAgentRequest.ts | 62 - .../api/schemas/$Agents_UpdateAgentRequest.ts | 66 - .../schemas/$Chat_GenerationPresetSettings.ts | 17 - .../src/api/schemas/$Chat_OpenAISettings.ts | 34 - sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts | 38 - ...quest.ts => $Docs_BaseDocSearchRequest.ts} | 40 +- .../api/schemas/$Docs_EmbedQueryRequest.ts | 24 - .../api/schemas/$Docs_EmbedQueryResponse.ts | 18 - .../schemas/$Docs_HybridDocSearchRequest.ts | 6 +- .../schemas/$Docs_TextOnlyDocSearchRequest.ts | 23 +- .../schemas/$Docs_VectorDocSearchRequest.ts | 27 +- .../schemas/$Entries_BaseChatMLContentPart.ts | 19 - .../$Entries_ChatMLImageContentPart.ts | 38 +- .../schemas/$Entries_ChatMLTextContentPart.ts | 28 +- sdks/ts/src/api/schemas/$Jobs_JobState.ts | 7 - sdks/ts/src/api/schemas/$Jobs_JobStatus.ts | 69 - .../schemas/$Sessions_ContextOverflowType.ts | 7 - ...essions_CreateOrUpdateSessionRequest_id.ts | 7 - .../schemas/$Sessions_CreateSessionRequest.ts | 73 - .../$Sessions_MultiAgentMultiUserSession.ts | 30 - .../$Sessions_MultiAgentNoUserSession.ts | 23 - .../$Sessions_MultiAgentSingleUserSession.ts | 27 - .../schemas/$Sessions_PatchSessionRequest.ts | 39 - sdks/ts/src/api/schemas/$Sessions_Session.ts | 77 - .../$Sessions_SingleAgentMultiUserSession.ts | 27 - .../$Sessions_SingleAgentNoUserSession.ts | 20 - .../$Sessions_SingleAgentSingleUserSession.ts | 24 - .../schemas/$Sessions_UpdateSessionRequest.ts | 43 - .../$Tasks_CreateOrUpdateTaskRequest_id.ts | 7 - .../api/schemas/$Tasks_CreateTaskRequest.ts | 22 +- .../api/schemas/$Tasks_ErrorWorkflowStep.ts | 20 +- .../ts/src/api/schemas/$Tasks_EvaluateStep.ts | 22 +- .../api/schemas/$Tasks_IfElseWorkflowStep.ts | 92 +- .../api/schemas/$Tasks_PatchTaskRequest.ts | 22 +- sdks/ts/src/api/schemas/$Tasks_PromptStep.ts | 526 +- sdks/ts/src/api/schemas/$Tasks_Task.ts | 22 +- ...pdateToolRequest.ts => $Tasks_TaskTool.ts} | 8 +- .../ts/src/api/schemas/$Tasks_ToolCallStep.ts | 40 +- .../api/schemas/$Tasks_UpdateTaskRequest.ts | 22 +- .../ts/src/api/schemas/$Tasks_WorkflowStep.ts | 12 - sdks/ts/src/api/schemas/$Tasks_YieldStep.ts | 30 +- .../api/schemas/$Tools_CreateToolRequest.ts | 41 - .../api/schemas/$Tools_FunctionDefUpdate.ts | 33 - .../api/schemas/$Tools_PatchToolRequest.ts | 39 - .../$Users_CreateOrUpdateUserRequest_id.ts | 7 - .../api/schemas/$Users_CreateUserRequest.ts | 30 - .../api/schemas/$Users_PatchUserRequest.ts | 28 - .../api/schemas/$Users_UpdateUserRequest.ts | 30 - sdks/ts/src/api/schemas/$Users_User.ts | 53 - sdks/ts/src/api/services/DefaultService.ts | 969 +-- typespec/docs/models.tsp | 28 +- typespec/entries/models.tsp | 12 +- typespec/executions/endpoints.tsp | 31 +- typespec/main.tsp | 2 +- typespec/tasks/endpoints.tsp | 33 +- typespec/tasks/models.tsp | 67 +- 199 files changed, 3318 insertions(+), 15154 deletions(-) create mode 100644 agents-api/agents_api/models/task/create_or_update_task.py create mode 100644 agents-api/agents_api/models/task/delete_task.py create mode 100644 agents-api/agents_api/models/task/patch_task.py delete mode 100644 sdks/python/julep/api/types/agent_tools_route_list_request_direction.py delete mode 100644 sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py delete mode 100644 sdks/python/julep/api/types/agent_tools_route_list_response.py delete mode 100644 sdks/python/julep/api/types/agents_agent.py delete mode 100644 sdks/python/julep/api/types/agents_agent_default_settings.py delete mode 100644 sdks/python/julep/api/types/agents_agent_instructions.py delete mode 100644 sdks/python/julep/api/types/agents_create_agent_request.py delete mode 100644 sdks/python/julep/api/types/agents_create_agent_request_default_settings.py delete mode 100644 sdks/python/julep/api/types/agents_create_agent_request_instructions.py create mode 100644 sdks/python/julep/api/types/agents_docs_search_route_search_request_body.py delete mode 100644 sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py delete mode 100644 sdks/python/julep/api/types/agents_patch_agent_request_instructions.py delete mode 100644 sdks/python/julep/api/types/agents_route_list_request_direction.py delete mode 100644 sdks/python/julep/api/types/agents_route_list_request_sort_by.py delete mode 100644 sdks/python/julep/api/types/agents_route_list_response.py delete mode 100644 sdks/python/julep/api/types/agents_update_agent_request.py delete mode 100644 sdks/python/julep/api/types/agents_update_agent_request_default_settings.py delete mode 100644 sdks/python/julep/api/types/agents_update_agent_request_instructions.py delete mode 100644 sdks/python/julep/api/types/chat_generation_preset_settings.py delete mode 100644 sdks/python/julep/api/types/chat_open_ai_settings.py delete mode 100644 sdks/python/julep/api/types/chat_v_llm_settings.py rename sdks/python/julep/api/types/{users_user.py => docs_base_doc_search_request.py} (68%) delete mode 100644 sdks/python/julep/api/types/docs_doc_search_request.py delete mode 100644 sdks/python/julep/api/types/docs_doc_search_request_text.py delete mode 100644 sdks/python/julep/api/types/docs_doc_search_request_vector.py delete mode 100644 sdks/python/julep/api/types/docs_embed_query_request.py delete mode 100644 sdks/python/julep/api/types/docs_embed_query_request_text.py delete mode 100644 sdks/python/julep/api/types/docs_embed_query_response.py delete mode 100644 sdks/python/julep/api/types/entries_base_chat_ml_content_part.py delete mode 100644 sdks/python/julep/api/types/jobs_job_state.py delete mode 100644 sdks/python/julep/api/types/jobs_job_status.py delete mode 100644 sdks/python/julep/api/types/sessions_context_overflow_type.py delete mode 100644 sdks/python/julep/api/types/sessions_create_session_request.py delete mode 100644 sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py delete mode 100644 sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py delete mode 100644 sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py delete mode 100644 sdks/python/julep/api/types/sessions_route_list_request_direction.py delete mode 100644 sdks/python/julep/api/types/sessions_route_list_request_sort_by.py delete mode 100644 sdks/python/julep/api/types/sessions_route_list_response.py delete mode 100644 sdks/python/julep/api/types/sessions_session.py delete mode 100644 sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py delete mode 100644 sdks/python/julep/api/types/sessions_single_agent_no_user_session.py delete mode 100644 sdks/python/julep/api/types/sessions_single_agent_single_user_session.py delete mode 100644 sdks/python/julep/api/types/tasks_create_task_request.py create mode 100644 sdks/python/julep/api/types/tasks_create_task_request_main_item.py create mode 100644 sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py create mode 100644 sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py create mode 100644 sdks/python/julep/api/types/tasks_patch_task_request_main_item.py create mode 100644 sdks/python/julep/api/types/tasks_task_main_item.py rename sdks/python/julep/api/types/{tools_create_tool_request.py => tasks_task_tool.py} (90%) create mode 100644 sdks/python/julep/api/types/tasks_update_task_request_main_item.py delete mode 100644 sdks/python/julep/api/types/tasks_workflow_step.py delete mode 100644 sdks/python/julep/api/types/tools_function_def_update.py create mode 100644 sdks/python/julep/api/types/user_docs_search_route_search_request_body.py delete mode 100644 sdks/python/julep/api/types/users_route_list_request_direction.py delete mode 100644 sdks/python/julep/api/types/users_route_list_request_sort_by.py delete mode 100644 sdks/python/julep/api/types/users_route_list_response.py delete mode 100644 sdks/python/julep/api/types/users_update_user_request.py delete mode 100644 sdks/ts/src/api/models/Agents_Agent.ts delete mode 100644 sdks/ts/src/api/models/Agents_CreateAgentRequest.ts delete mode 100644 sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts delete mode 100644 sdks/ts/src/api/models/Agents_PatchAgentRequest.ts delete mode 100644 sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts delete mode 100644 sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts delete mode 100644 sdks/ts/src/api/models/Chat_OpenAISettings.ts delete mode 100644 sdks/ts/src/api/models/Chat_vLLMSettings.ts rename sdks/ts/src/api/models/{Docs_DocSearchRequest.ts => Docs_BaseDocSearchRequest.ts} (75%) delete mode 100644 sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts delete mode 100644 sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts delete mode 100644 sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts delete mode 100644 sdks/ts/src/api/models/Jobs_JobState.ts delete mode 100644 sdks/ts/src/api/models/Jobs_JobStatus.ts delete mode 100644 sdks/ts/src/api/models/Sessions_ContextOverflowType.ts delete mode 100644 sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts delete mode 100644 sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts delete mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts delete mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts delete mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts delete mode 100644 sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts delete mode 100644 sdks/ts/src/api/models/Sessions_Session.ts delete mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts delete mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts delete mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts delete mode 100644 sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts delete mode 100644 sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts rename sdks/ts/src/api/models/{Tools_CreateToolRequest.ts => Tasks_TaskTool.ts} (81%) delete mode 100644 sdks/ts/src/api/models/Tasks_WorkflowStep.ts delete mode 100644 sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts delete mode 100644 sdks/ts/src/api/models/Tools_PatchToolRequest.ts delete mode 100644 sdks/ts/src/api/models/Tools_UpdateToolRequest.ts delete mode 100644 sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts delete mode 100644 sdks/ts/src/api/models/Users_CreateUserRequest.ts delete mode 100644 sdks/ts/src/api/models/Users_PatchUserRequest.ts delete mode 100644 sdks/ts/src/api/models/Users_UpdateUserRequest.ts delete mode 100644 sdks/ts/src/api/models/Users_User.ts delete mode 100644 sdks/ts/src/api/schemas/$Agents_Agent.ts delete mode 100644 sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts delete mode 100644 sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts delete mode 100644 sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts delete mode 100644 sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts rename sdks/ts/src/api/schemas/{$Docs_DocSearchRequest.ts => $Docs_BaseDocSearchRequest.ts} (52%) delete mode 100644 sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts delete mode 100644 sdks/ts/src/api/schemas/$Entries_BaseChatMLContentPart.ts delete mode 100644 sdks/ts/src/api/schemas/$Jobs_JobState.ts delete mode 100644 sdks/ts/src/api/schemas/$Jobs_JobStatus.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_Session.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts delete mode 100644 sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts rename sdks/ts/src/api/schemas/{$Tools_UpdateToolRequest.ts => $Tasks_TaskTool.ts} (81%) delete mode 100644 sdks/ts/src/api/schemas/$Tasks_WorkflowStep.ts delete mode 100644 sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts delete mode 100644 sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts delete mode 100644 sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts delete mode 100644 sdks/ts/src/api/schemas/$Users_User.ts diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index 6669fbcec..5f447909b 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -118,29 +118,6 @@ class CompletionResponseFormat(BaseModel): """ -class GenerationPresetSettings(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - preset: ( - Literal[ - "problem_solving", - "conversational", - "fun", - "prose", - "creative", - "business", - "deterministic", - "code", - "multilingual", - ] - | None - ) = None - """ - Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - """ - - class LogProbResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -166,28 +143,6 @@ class MultipleChatOutput(BaseChatOutput): messages: list[ChatMLMessage] -class OpenAISettings(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - frequency_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] - """ - 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. - """ - presence_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] - """ - 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. - """ - temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] - """ - 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] - """ - 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. - """ - - class SingleChatOutput(BaseChatOutput): """ The output returned by the model. Note that, depending on the model provider, they might return more than one message. @@ -204,29 +159,3 @@ class TokenLogProb(BaseTokenLogProb): populate_by_name=True, ) top_logprobs: list[BaseTokenLogProb] - - -class VLLMSettings(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - repetition_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] - """ - 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. - """ - length_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] - """ - Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - """ - temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] - """ - 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] - """ - 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. - """ - min_p: Annotated[float | None, Field(None, ge=0.0, le=1.0)] - """ - Minimum probability compared to leading token to be considered - """ diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py index 2f625f14b..6f7019a06 100644 --- a/agents-api/agents_api/autogen/Docs.py +++ b/agents-api/agents_api/autogen/Docs.py @@ -9,6 +9,28 @@ from pydantic import AwareDatetime, BaseModel, ConfigDict, Field +class BaseDocSearchRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)] + """ + The confidence cutoff level + """ + alpha: Annotated[float, Field(0.75, ge=0.0, le=1.0)] + """ + The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + """ + mmr: bool = False + """ + Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. + """ + lang: Literal["en-US"] = "en-US" + """ + The language to be used for text-only search. Support for other languages coming soon. + """ + + class Doc(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -62,81 +84,31 @@ class DocReference(BaseModel): snippet: str | None = None -class DocSearchRequest(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - text: str | list[str] | None = None - vector: list[float] | list[list[float]] | None = None - mode: Literal["vector", "text", "hybrid"] - """ - The search mode - """ - confidence: Annotated[float, Field(0.5, ge=0.0, le=1.0)] - """ - The confidence cutoff level - """ - alpha: Annotated[float, Field(0.75, ge=0.0, le=1.0)] - """ - The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; - """ - mmr: bool = False - """ - Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. - """ - lang: Literal["en-US"] = "en-US" - """ - The language to be used for text-only search. Support for other languages coming soon. - """ - - -class EmbedQueryRequest(BaseModel): +class HybridDocSearchRequest(BaseDocSearchRequest): model_config = ConfigDict( populate_by_name=True, ) text: str | list[str] """ - Text or texts to embed - """ - - -class EmbedQueryResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - vectors: list[list[float]] - """ - The embedded vectors - """ - - -class HybridDocSearchRequest(DocSearchRequest): - model_config = ConfigDict( - populate_by_name=True, - ) - text: str | list[str] | None = None - """ Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. """ - vector: list[float] | list[list[float]] | None = None + vector: list[float] | list[list[float]] """ Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. """ - mode: Literal["hybrid"] = "hybrid" -class TextOnlyDocSearchRequest(DocSearchRequest): +class TextOnlyDocSearchRequest(BaseDocSearchRequest): model_config = ConfigDict( populate_by_name=True, ) text: str | list[str] """ - Text or texts to use in the search. In `text` search mode, only BM25 is used. + Text or texts to use in the search. """ - mode: Literal["text"] = "text" -class VectorDocSearchRequest(DocSearchRequest): +class VectorDocSearchRequest(BaseDocSearchRequest): model_config = ConfigDict( populate_by_name=True, ) @@ -144,4 +116,3 @@ class VectorDocSearchRequest(DocSearchRequest): """ Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. """ - mode: Literal["vector"] = "vector" diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index d982f0586..b953d31c2 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -11,19 +11,7 @@ from .Tools import ChosenToolCall, Tool, ToolResponse -class BaseChatMLContentPart(BaseModel): - model_config = ConfigDict( - populate_by_name=True, - ) - type: str - """ - The type of content part - """ - text: str | None = None - image_url: ImageURL | None = None - - -class ChatMLImageContentPart(BaseChatMLContentPart): +class ChatMLImageContentPart(BaseModel): model_config = ConfigDict( populate_by_name=True, ) @@ -74,7 +62,7 @@ class ChatMLMessage(BaseModel): id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] -class ChatMLTextContentPart(BaseChatMLContentPart): +class ChatMLTextContentPart(BaseModel): model_config = ConfigDict( populate_by_name=True, ) diff --git a/agents-api/agents_api/autogen/Tasks.py b/agents-api/agents_api/autogen/Tasks.py index f739e860e..896c14f7f 100644 --- a/agents-api/agents_api/autogen/Tasks.py +++ b/agents-api/agents_api/autogen/Tasks.py @@ -11,7 +11,7 @@ from .Chat import CompletionResponseFormat from .Common import LogitBias from .Entries import InputChatMLMessage -from .Tools import CreateToolRequest +from .Tools import FunctionDef class CreateTaskRequest(BaseModel): @@ -24,7 +24,14 @@ class CreateTaskRequest(BaseModel): ) name: str description: str = "" - main: list[WorkflowStep] + main: list[ + EvaluateStep + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | IfElseWorkflowStep + ] """ The entrypoint of the task. """ @@ -32,7 +39,7 @@ class CreateTaskRequest(BaseModel): """ The schema for the input to the task. `null` means all inputs are valid. """ - tools: list[CreateToolRequest] = [] + tools: list[TaskTool] = [] """ Tools defined specifically for this task not included in the Agent itself. """ @@ -43,6 +50,47 @@ class CreateTaskRequest(BaseModel): metadata: dict[str, Any] | None = None +class ErrorWorkflowStep(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + error: str + """ + The error message + """ + + +class EvaluateStep(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + evaluate: dict[str, str] + """ + The expression to evaluate + """ + + +class IfElseWorkflowStep(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + if_: Annotated[str, Field(alias="if")] + """ + The condition to evaluate + """ + then: EvaluateStep | ToolCallStep | YieldStep | PromptStep | ErrorWorkflowStep + """ + The steps to run if the condition is true + """ + else_: Annotated[ + EvaluateStep | ToolCallStep | YieldStep | PromptStep | ErrorWorkflowStep, + Field(alias="else"), + ] + """ + The steps to run if the condition is false + """ + + class PatchTaskRequest(BaseModel): """ Payload for patching a task @@ -52,7 +100,17 @@ class PatchTaskRequest(BaseModel): populate_by_name=True, ) description: str = "" - main: list[WorkflowStep] | None = None + main: ( + list[ + EvaluateStep + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | IfElseWorkflowStep + ] + | None + ) = None """ The entrypoint of the task. """ @@ -60,7 +118,7 @@ class PatchTaskRequest(BaseModel): """ The schema for the input to the task. `null` means all inputs are valid. """ - tools: list[CreateToolRequest] = [] + tools: list[TaskTool] = [] """ Tools defined specifically for this task not included in the Agent itself. """ @@ -71,6 +129,20 @@ class PatchTaskRequest(BaseModel): metadata: dict[str, Any] | None = None +class PromptStep(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + prompt: str | list[InputChatMLMessage] + """ + The prompt to run + """ + settings: Settings | SettingsModel | SettingsModel1 + """ + Settings for the prompt + """ + + class Settings(BaseModel): """ Settings for the prompt @@ -278,7 +350,14 @@ class Task(BaseModel): ) name: str description: str = "" - main: list[WorkflowStep] + main: list[ + EvaluateStep + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | IfElseWorkflowStep + ] """ The entrypoint of the task. """ @@ -286,7 +365,7 @@ class Task(BaseModel): """ The schema for the input to the task. `null` means all inputs are valid. """ - tools: list[CreateToolRequest] = [] + tools: list[TaskTool] = [] """ Tools defined specifically for this task not included in the Agent itself. """ @@ -294,7 +373,6 @@ class Task(BaseModel): """ Whether to inherit tools from the parent agent or not. Defaults to true. """ - agent_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ @@ -307,121 +385,88 @@ class Task(BaseModel): metadata: dict[str, Any] | None = None -class UpdateTaskRequest(BaseModel): - """ - Payload for updating a task - """ - +class TaskTool(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - description: str = "" - main: list[WorkflowStep] + inherited: Annotated[bool, Field(False, json_schema_extra={"readOnly": True})] """ - The entrypoint of the task. + Read-only: Whether the tool was inherited or not. Only applies within tasks. """ - input_schema: dict[str, Any] | None = None + type: Literal["function", "integration", "system", "api_call"] """ - The schema for the input to the task. `null` means all inputs are valid. - """ - tools: list[CreateToolRequest] = [] - """ - Tools defined specifically for this task not included in the Agent itself. + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) """ - inherit_tools: bool = True + name: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] """ - Whether to inherit tools from the parent agent or not. Defaults to true. + Name of the tool (must be unique for this agent and a valid python identifier string ) """ - metadata: dict[str, Any] | None = None + function: FunctionDef | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None -class WorkflowStep(BaseModel): +class ToolCallStep(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - kind: str | None = None - """ - Discriminator property for WorkflowStep. - """ - - -class YieldStep(WorkflowStep): - model_config = ConfigDict( - populate_by_name=True, - ) - workflow: str - """ - The subworkflow to run - """ - arguments: dict[str, str] + tool: Annotated[ + str, Field(pattern="^(function|integration|system|api_call)\\.(\\w+)$") + ] """ - The input parameters for the subworkflow + The tool to run """ - - -class ErrorWorkflowStep(WorkflowStep): - model_config = ConfigDict( - populate_by_name=True, - ) - error: str + arguments: dict[str, Any] """ - The error message + The input parameters for the tool """ -class EvaluateStep(WorkflowStep): - model_config = ConfigDict( - populate_by_name=True, - ) - evaluate: dict[str, str] +class UpdateTaskRequest(BaseModel): """ - The expression to evaluate + Payload for updating a task """ - -class IfElseWorkflowStep(WorkflowStep): model_config = ConfigDict( populate_by_name=True, ) - if_: Annotated[str, Field(alias="if")] - """ - The condition to evaluate - """ - then: WorkflowStep + description: str = "" + main: list[ + EvaluateStep + | ToolCallStep + | YieldStep + | PromptStep + | ErrorWorkflowStep + | IfElseWorkflowStep + ] """ - The steps to run if the condition is true + The entrypoint of the task. """ - else_: Annotated[WorkflowStep, Field(alias="else")] + input_schema: dict[str, Any] | None = None """ - The steps to run if the condition is false + The schema for the input to the task. `null` means all inputs are valid. """ - - -class PromptStep(WorkflowStep): - model_config = ConfigDict( - populate_by_name=True, - ) - prompt: str | list[InputChatMLMessage] + tools: list[TaskTool] = [] """ - The prompt to run + Tools defined specifically for this task not included in the Agent itself. """ - settings: Settings | SettingsModel | SettingsModel1 + inherit_tools: bool = True """ - Settings for the prompt + Whether to inherit tools from the parent agent or not. Defaults to true. """ + metadata: dict[str, Any] | None = None -class ToolCallStep(WorkflowStep): +class YieldStep(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - tool: Annotated[ - str, Field(pattern="^(function|integration|system|api_call)\\.(\\w+)$") - ] + workflow: str """ - The tool to run + The subworkflow to run """ - arguments: dict[str, Any] + arguments: dict[str, str] """ - The input parameters for the tool + The input parameters for the subworkflow """ diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index 08578844f..e695d0f6b 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -28,28 +28,6 @@ class ChosenToolCall(BaseModel): id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] -class CreateToolRequest(BaseModel): - """ - Payload for creating a tool - """ - - model_config = ConfigDict( - populate_by_name=True, - ) - type: Literal["function", "integration", "system", "api_call"] - """ - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - """ - name: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] - """ - Name of the tool (must be unique for this agent and a valid python identifier string ) - """ - function: FunctionDef | None = None - integration: Any | None = None - system: Any | None = None - api_call: Any | None = None - - class FunctionCallOption(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -88,34 +66,6 @@ class FunctionDef(BaseModel): """ -class FunctionDefUpdate(BaseModel): - """ - Function definition - """ - - model_config = ConfigDict( - populate_by_name=True, - ) - name: Annotated[str, Field("overriden", pattern="^[^\\W0-9]\\w*$")] - """ - DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. - """ - description: Annotated[ - str | None, - Field( - None, - pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", - ), - ] - """ - Description of the function - """ - parameters: dict[str, Any] | None = None - """ - The parameters the function accepts - """ - - class NamedToolChoice(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -130,28 +80,6 @@ class NamedToolChoice(BaseModel): api_call: Any | None = None -class PatchToolRequest(BaseModel): - """ - Payload for patching a tool - """ - - model_config = ConfigDict( - populate_by_name=True, - ) - type: Literal["function", "integration", "system", "api_call"] | None = None - """ - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - """ - name: Annotated[str | None, Field(None, pattern="^[^\\W0-9]\\w*$")] - """ - Name of the tool (must be unique for this agent and a valid python identifier string ) - """ - function: FunctionDefUpdate | None = None - integration: Any | None = None - system: Any | None = None - api_call: Any | None = None - - class Tool(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -190,28 +118,6 @@ class ToolResponse(BaseModel): """ -class UpdateToolRequest(BaseModel): - """ - Payload for updating a tool - """ - - model_config = ConfigDict( - populate_by_name=True, - ) - type: Literal["function", "integration", "system", "api_call"] - """ - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - """ - name: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] - """ - Name of the tool (must be unique for this agent and a valid python identifier string ) - """ - function: FunctionDef | None = None - integration: Any | None = None - system: Any | None = None - api_call: Any | None = None - - class ChosenFunctionCall(ChosenToolCall): model_config = ConfigDict( populate_by_name=True, diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index 336f25c86..d04bbdedc 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -13,9 +13,11 @@ from .Tools import * from .Users import * +CreateToolRequest = UpdateToolRequest CreateOrUpdateAgentRequest = UpdateAgentRequest CreateOrUpdateUserRequest = UpdateUserRequest CreateOrUpdateSessionRequest = CreateSessionRequest +CreateOrUpdateTaskRequest = CreateTaskRequest ChatMLRole = Entry.model_fields["role"].annotation diff --git a/agents-api/agents_api/models/agent/create_or_update_agent.py b/agents-api/agents_api/models/agent/create_or_update_agent.py index fe00dd9b5..f41a76f44 100644 --- a/agents-api/agents_api/models/agent/create_or_update_agent.py +++ b/agents-api/agents_api/models/agent/create_or_update_agent.py @@ -48,9 +48,7 @@ def create_or_update_agent( if isinstance(data.instructions, list) else [data.instructions] ) - data.default_settings = ( - data.default_settings or {} - ) + data.default_settings = data.default_settings or {} agent_data = data.model_dump() default_settings = agent_data.pop("default_settings") diff --git a/agents-api/agents_api/models/task/create_or_update_task.py b/agents-api/agents_api/models/task/create_or_update_task.py new file mode 100644 index 000000000..fb889299d --- /dev/null +++ b/agents-api/agents_api/models/task/create_or_update_task.py @@ -0,0 +1,96 @@ +""" +This module contains the functionality for creating a new Task in the 'cozodb` database. +It constructs and executes a datalog query to insert Task data. +""" + +from uuid import UUID +from typing import Any + +from beartype import beartype + + +from ...autogen.openapi_model import ( + ResourceUpdatedResponse, + CreateOrUpdateTaskRequest, +) +from ...common.utils.cozo import cozo_process_mutate_data +from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +from .create_task import task_to_spec + + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: { + "id": d["task_id"], + "jobs": [], + "updated_at": d["updated_at_ms"][0] / 1000, + **d, + }, +) +@cozo_query +@beartype +def create_or_update_task( + *, + developer_id: UUID, + agent_id: UUID, + task_id: UUID, + data: CreateOrUpdateTaskRequest, +) -> tuple[str, dict]: + developer_id = str(developer_id) + agent_id = str(agent_id) + task_id = str(task_id) + + data.metadata = data.metadata or {} + data.input_schema = data.input_schema or {} + + task_data = task_to_spec(data) + task_data.pop("task_id", None) + task_data["created_at"] = utcnow().timestamp() + + columns, values = cozo_process_mutate_data(task_data) + + update_query = f""" + input[{columns}] <- $values + ids[agent_id, task_id] := + agent_id = to_uuid($agent_id), + task_id = to_uuid($task_id) + + ?[updated_at_ms, agent_id, task_id, {columns}] := + ids[agent_id, task_id], + input[{columns}], + updated_at_ms = [floor(now() * 1000), true] + + :put tasks {{ + agent_id, + task_id, + updated_at_ms, + {columns}, + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return ( + query, + { + "values": values, + "agent_id": agent_id, + "task_id": task_id, + }, + ) diff --git a/agents-api/agents_api/models/task/create_task.py b/agents-api/agents_api/models/task/create_task.py index b3a3f6493..3be925311 100644 --- a/agents-api/agents_api/models/task/create_task.py +++ b/agents-api/agents_api/models/task/create_task.py @@ -3,55 +3,158 @@ It constructs and executes a datalog query to insert Task data. """ -from uuid import UUID -from typing import List, Dict, Any +from uuid import UUID, uuid4 +import sys + +if sys.version_info < (3, 11): + from typing_extensions import TypedDict, NotRequired +else: + from typing import TypedDict, NotRequired + + from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Task, CreateTaskRequest, UpdateTaskRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +class Workflow(TypedDict): + name: str + steps: list[dict] + + +class TaskToolDef(TypedDict): + type: str + name: str + spec: dict + inherited: NotRequired[bool] + + +class TaskSpec(TypedDict): + task_id: NotRequired[str | None] + name: str + description: str + input_schema: dict + inherit_tools: bool + tools: NotRequired[list[TaskToolDef]] + metadata: dict + workflows: list[Workflow] + +def task_to_spec( + task: Task | CreateTaskRequest | UpdateTaskRequest, **model_opts +) -> TaskSpec: + task_data = task.model_dump(**model_opts) + task_id = task_data.pop("id", None) + workflows = [] + for k in list(task_data.keys()): + if k in TaskSpec.__annotations__: + continue + + steps = task_data.pop(k) + workflows.append(Workflow(name=k, steps=steps)) + + tools = task_data.pop("tools", []) + tools = [TaskToolDef(spec=tool.pop(tool["type"]), **tool) for tool in tools] + + return TaskSpec( + task_id=task_id, + workflows=workflows, + tools=tools, + **task_data, + ) + + +def spec_to_task_data(spec: dict) -> dict: + task_id = spec.pop("task_id", None) + + workflows = spec.pop("workflows") + workflows_dict = {workflow["name"]: workflow["steps"] for workflow in workflows} + + tools = spec.pop("tools", []) + tools = [{tool["type"]: tool.pop("spec"), **tool} for tool in tools] + + return { + "id": task_id, + "tools": tools, + **spec, + **workflows_dict, + } + + +def spec_to_task(**spec) -> Task | CreateTaskRequest: + if not spec.get("id"): + spec["id"] = spec.pop("task_id", None) + + if not spec.get("updated_at"): + [updated_at_ms, _] = spec.pop("updated_at_ms", None) + spec["updated_at"] = updated_at_ms and (updated_at_ms / 1000) + + cls = Task if spec["id"] else CreateTaskRequest + return cls(**spec_to_task_data(spec)) + + +@wrap_in_class(spec_to_task, one=True) @cozo_query @beartype -def create_task_query( +def create_task( + *, developer_id: UUID, agent_id: UUID, - task_id: UUID, - name: str, - description: str, - input_schema: Dict[str, Any], - tools_available: List[UUID] = [], - workflows: List[Dict[str, Any]] = [], + task_id: UUID | None = None, + data: CreateTaskRequest, ) -> tuple[str, dict]: - # TODO: Check for agent in developer ID; Assert whether dev can access agent and by relation the task - query = """ -{ - ?[agent_id, task_id, name, description, input_schema, tools_available, workflows] <- [[ - to_uuid($agent_id), to_uuid($task_id), $name, $description, $input_schema, $tools_available, $workflows - ]] - - :insert tasks { - agent_id, - task_id, - name, - description, - input_schema, - tools_available, - workflows - } + data.metadata = data.metadata or {} + data.input_schema = data.input_schema or {} + + task_id = task_id or uuid4() + task_spec = task_to_spec(data) + + # Prepares the update data by filtering out None values and adding user_id and developer_id. + columns, values = cozo_process_mutate_data( + { + **task_spec, + "task_id": str(task_id), + "agent_id": str(agent_id), + } + ) + + create_query = f""" + input[{columns}] <- $values + ?[{columns}, updated_at_ms, created_at] := + input[{columns}], + updated_at_ms = [floor(now() * 1000), true], + created_at = now(), + + :insert tasks {{ + {columns}, + updated_at_ms, + created_at, + }} :returning -} -""" + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + create_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" return ( query, { "agent_id": str(agent_id), - "task_id": str(task_id), - "name": name, - "description": description, - "input_schema": input_schema, - "tools_available": tools_available, - "workflows": workflows, + "values": values, }, ) diff --git a/agents-api/agents_api/models/task/delete_task.py b/agents-api/agents_api/models/task/delete_task.py new file mode 100644 index 000000000..7ca62d53e --- /dev/null +++ b/agents-api/agents_api/models/task/delete_task.py @@ -0,0 +1,67 @@ +from beartype import beartype + +from uuid import UUID + + +from ...autogen.openapi_model import ResourceDeletedResponse +from ...common.utils.cozo import cozo_process_mutate_data +from ...common.utils.datetime import utcnow +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@wrap_in_class( + ResourceDeletedResponse, + one=True, + transform=lambda d: { + "id": UUID(d.pop("task_id")), + "jobs": [], + "deleted_at": utcnow(), + **d, + }, +) +@cozo_query +@beartype +def delete_task( + *, + developer_id: UUID, + agent_id: UUID, + task_id: UUID, +) -> tuple[str, dict]: + delete_query = """ + input[agent_id, task_id] <- [[ + to_uuid($agent_id), + to_uuid($task_id), + ]] + + ?[agent_id, task_id, updated_at_ms] := + input[agent_id, task_id], + *tasks{ + agent_id, + task_id, + updated_at_ms, + } + + :delete tasks { + agent_id, + task_id, + updated_at_ms, + } + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + delete_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"agent_id": str(agent_id), "task_id": str(task_id)}) diff --git a/agents-api/agents_api/models/task/get_task.py b/agents-api/agents_api/models/task/get_task.py index 92968f51e..05984a413 100644 --- a/agents-api/agents_api/models/task/get_task.py +++ b/agents-api/agents_api/models/task/get_task.py @@ -1,47 +1,117 @@ +from beartype import beartype + from uuid import UUID -from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Task, CreateTaskRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + +from .create_task import spec_to_task +@wrap_in_class(spec_to_task, one=True) @cozo_query @beartype -def get_task_query( - agent_id: UUID, task_id: UUID, developer_id: UUID +def get_task( + *, + developer_id: UUID, + agent_id: UUID, + task_id: UUID, ) -> tuple[str, dict]: - # TODO: Check for agent in developer ID; Assert whether dev can access agent and by relation the task - query = """ - input[agent_id] <- [[to_uuid($agent_id)]] + get_query = """ + input[agent_id, task_id] <- [[ + to_uuid($agent_id), + to_uuid($task_id), + ]] - ?[ - id, - name, + task_data[ + task_id, agent_id, + name, description, input_schema, - tools_available, + tools, + inherit_tools, workflows, created_at, updated_at, + metadata, ] := - input[agent_id], + input[agent_id, task_id], *tasks { agent_id, - task_id: to_uuid($task_id), + task_id, updated_at_ms, name, description, input_schema, - tools_available, + tools, + inherit_tools, workflows, created_at, + metadata, @ 'NOW' }, - updated_at = to_int(updated_at_ms) / 1000, - id = to_uuid($task_id) + updated_at = to_int(updated_at_ms) / 1000 + + tool_data[collect(tool_def)] := + input[agent_id, _], + *tools { + agent_id, + type, + name, + spec, + }, tool_def = { + "type": type, + "name": name, + "spec": spec, + "inherited": true, + } + + ?[ + task_id, + agent_id, + name, + description, + input_schema, + tools, + inherit_tools, + workflows, + created_at, + updated_at, + metadata, + ] := + tool_data[inherited_tools], + task_data[ + task_id, + agent_id, + name, + description, + input_schema, + task_tools, + inherit_tools, + workflows, + created_at, + updated_at, + metadata, + ], tools = task_tools ++ if(inherit_tools, inherited_tools, []) - :limit 1 + :limit 1 """ + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + get_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + return (query, {"agent_id": str(agent_id), "task_id": str(task_id)}) diff --git a/agents-api/agents_api/models/task/list_tasks.py b/agents-api/agents_api/models/task/list_tasks.py index 2a11e1206..2e44fb5c0 100644 --- a/agents-api/agents_api/models/task/list_tasks.py +++ b/agents-api/agents_api/models/task/list_tasks.py @@ -1,58 +1,121 @@ +from typing import Literal from uuid import UUID from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Task, CreateTaskRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +from .create_task import spec_to_task + +@wrap_in_class(spec_to_task) @cozo_query @beartype -def list_tasks_query( +def list_tasks( + *, developer_id: UUID, agent_id: UUID, limit: int = 100, offset: int = 0, - # metadata_filter: dict[str, Any] = {}, + sort_by: Literal["created_at", "updated_at", "deleted_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", ) -> tuple[str, dict]: - """Lists tasks from the 'cozodb' database based on the provided filters. - - Parameters: - developer_id (UUID): The developer's ID to filter tasks by. - limit (int): The maximum number of tasks to return. - offset (int): The offset from which to start listing tasks. - Returns: - pd.DataFrame: A DataFrame containing the queried task data. - """ - # TODO: Accepts developer ID. Checks if the developer can get this agent, by relation can get the tasks. Assert that the agent exists under the developer. - query = """ + sort = f"{'-' if direction == 'desc' else ''}{sort_by}" + + list_query = f""" input[agent_id] <- [[to_uuid($agent_id)]] - ?[ - id, + task_data[ + task_id, agent_id, name, description, input_schema, - tools_available, + tools, + inherit_tools, workflows, created_at, updated_at, - ] := input[agent_id], - *tasks { + metadata, + ] := + input[agent_id], + *tasks {{ agent_id, - task_id: id, + task_id, updated_at_ms, name, description, input_schema, - tools_available, + tools, + inherit_tools, workflows, created_at, + metadata, @ 'NOW' - }, updated_at = to_int(updated_at_ms) / 1000 + }}, + updated_at = to_int(updated_at_ms) / 1000 + + tool_data[collect(tool_def)] := + input[agent_id], + *tools {{ + agent_id, + type, + name, + spec, + }}, tool_def = {{ + "type": type, + "name": name, + "spec": spec, + "inherited": true, + }} + + ?[ + task_id, + agent_id, + name, + description, + input_schema, + tools, + inherit_tools, + workflows, + created_at, + updated_at, + metadata, + ] := + tool_data[inherited_tools], + task_data[ + task_id, + agent_id, + name, + description, + input_schema, + task_tools, + inherit_tools, + workflows, + created_at, + updated_at, + metadata, + ], tools = task_tools ++ if(inherit_tools, inherited_tools, []) - :limit $limit - :offset $offset + :limit $limit + :offset $offset + :sort {sort} """ + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + list_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + return (query, {"agent_id": str(agent_id), "limit": limit, "offset": offset}) diff --git a/agents-api/agents_api/models/task/patch_task.py b/agents-api/agents_api/models/task/patch_task.py new file mode 100644 index 000000000..580d63da6 --- /dev/null +++ b/agents-api/agents_api/models/task/patch_task.py @@ -0,0 +1,114 @@ +""" +This module contains the functionality for creating a new Task in the 'cozodb` database. +It constructs and executes a datalog query to insert Task data. +""" + +from uuid import UUID +from typing import Any + +from beartype import beartype + + +from ...autogen.openapi_model import ResourceUpdatedResponse, PatchTaskRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +from .create_task import task_to_spec, TaskSpec + + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: { + "id": d["task_id"], + "jobs": [], + "updated_at": d["updated_at_ms"][0] / 1000, + **d, + }, +) +@cozo_query +@beartype +def patch_task( + *, + developer_id: UUID, + agent_id: UUID, + task_id: UUID, + data: PatchTaskRequest, +) -> tuple[str, dict]: + developer_id = str(developer_id) + agent_id = str(agent_id) + task_id = str(task_id) + + data.input_schema = data.input_schema or {} + task_data = task_to_spec(data, exclude_none=True, exclude_unset=True) + task_data.pop("task_id", None) + + assert len(task_data), "No data provided to update task" + metadata = task_data.pop("metadata", {}) + columns, values = cozo_process_mutate_data(task_data) + + all_columns = TaskSpec.__annotations__.keys() + missing_columns = ( + set(all_columns) - set(columns.split(",")) - {"metadata", "name", "task_id"} + ) + missing_columns_str = ",".join(missing_columns) + + patch_query = f""" + input[{columns}] <- $values + ids[agent_id, task_id] := + agent_id = to_uuid($agent_id), + task_id = to_uuid($task_id) + + original[created_at, name, metadata, {missing_columns_str}] := + ids[agent_id, task_id], + *tasks{{ + name, + agent_id, + task_id, + created_at, + metadata, + {missing_columns_str}, + }} + + ?[created_at, updated_at_ms, agent_id, task_id, name, metadata, {columns}, {missing_columns_str}] := + ids[agent_id, task_id], + input[{columns}], + original[created_at, name, _metadata, {missing_columns_str}], + updated_at_ms = [floor(now() * 1000), true], + metadata = _metadata ++ $metadata + + :put tasks {{ + agent_id, + task_id, + name, + created_at, + updated_at_ms, + metadata, + {columns}, {missing_columns_str} + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + patch_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return ( + query, + { + "values": values, + "agent_id": agent_id, + "task_id": task_id, + "metadata": metadata, + }, + ) diff --git a/agents-api/agents_api/models/task/update_task.py b/agents-api/agents_api/models/task/update_task.py index 3e324fc22..5c6ee6afe 100644 --- a/agents-api/agents_api/models/task/update_task.py +++ b/agents-api/agents_api/models/task/update_task.py @@ -4,24 +4,100 @@ """ from uuid import UUID -from typing import List, Dict, Any +from typing import Any from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateTaskRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +from .create_task import task_to_spec + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: { + "id": d["task_id"], + "jobs": [], + "updated_at": d["updated_at_ms"][0] / 1000, + **d, + }, +) @cozo_query @beartype -def update_task_query( - task_id: UUID, +def update_task( + *, developer_id: UUID, agent_id: UUID, - name: str, - description: str, - input_schema: Dict[str, Any], - tools_available: List[UUID] = [], - workflows: List[Dict[str, Any]] = [], + task_id: UUID, + data: UpdateTaskRequest, ) -> tuple[str, dict]: - # NOT TO IMPLEMENT FOR NOW - raise NotImplementedError("Not implemented yet") + developer_id = str(developer_id) + agent_id = str(agent_id) + task_id = str(task_id) + + data.metadata = data.metadata or {} + data.input_schema = data.input_schema or {} + + task_data = task_to_spec(data) + task_data.pop("task_id", None) + + columns, values = cozo_process_mutate_data(task_data) + + update_query = f""" + input[{columns}] <- $values + ids[agent_id, task_id] := + agent_id = to_uuid($agent_id), + task_id = to_uuid($task_id) + + original[created_at, name] := + ids[agent_id, task_id], + *tasks{{ + name, + agent_id, + task_id, + created_at, + }} + + ?[created_at, updated_at_ms, agent_id, task_id, name, {columns}] := + ids[agent_id, task_id], + input[{columns}], + original[created_at, name], + updated_at_ms = [floor(now() * 1000), true] + + :put tasks {{ + agent_id, + task_id, + name, + created_at, + updated_at_ms, + {columns}, + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query(developer_id, "agents", agent_id=agent_id), + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return ( + query, + { + "values": values, + "agent_id": agent_id, + "task_id": task_id, + }, + ) diff --git a/agents-api/agents_api/models/tools/create_tools.py b/agents-api/agents_api/models/tools/create_tools.py index 56c9bea22..09a7a7c7e 100644 --- a/agents-api/agents_api/models/tools/create_tools.py +++ b/agents-api/agents_api/models/tools/create_tools.py @@ -29,6 +29,7 @@ def create_tools( developer_id: UUID, agent_id: UUID, data: list[CreateToolRequest], + ignore_existing: bool = False, ) -> tuple[str, dict]: """ Constructs a datalog query for inserting tool records into the 'agent_functions' relation in the CozoDB. @@ -52,9 +53,32 @@ def create_tools( for tool in data ] + ensure_tool_name_unique_query = """ + input[agent_id, tool_id, type, name, spec] <- $records + ?[tool_id] := + input[agent_id, _, type, name, _], + *tools{ + agent_id: to_uuid(agent_id), + tool_id, + type, + name, + } + + :assert none + """ + # Datalog query for inserting new tool records into the 'agent_functions' relation create_query = """ - ?[agent_id, tool_id, type, name, spec] <- $records + input[agent_id, tool_id, type, name, spec] <- $records + + # Do not add duplicate + ?[agent_id, tool_id, type, name, spec] := + input[agent_id, tool_id, type, name, spec], + not *tools{ + agent_id: to_uuid(agent_id), + type, + name, + } :insert tools { agent_id, @@ -72,6 +96,12 @@ def create_tools( create_query, ] + if not ignore_existing: + queries.insert( + -1, + ensure_tool_name_unique_query, + ) + query = "}\n\n{\n".join(queries) query = f"{{ {query} }}" diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index fd427d420..e4e79c9b3 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -23,7 +23,7 @@ def verify_developer_id_query(developer_id: UUID | str) -> str: def verify_developer_owns_resource_query( - developer_id: UUID | str, resource: str, **resource_id: dict + developer_id: UUID | str, resource: str, **resource_id ) -> str: resource_id_key, resource_id_value = next(iter(resource_id.items())) diff --git a/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py b/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py index 9e19d81d3..902ec396d 100644 --- a/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py +++ b/agents-api/migrations/migrate_1721609661_task_tool_ref_by_name.py @@ -16,7 +16,6 @@ name, description, input_schema, - tools, inherit_tools, workflows, created_at, @@ -28,10 +27,10 @@ name, description, input_schema, - tools_available: tools, workflows, created_at, - }, metadata = {}, + }, + metadata = {}, inherit_tools = true :replace tasks { @@ -42,7 +41,7 @@ name: String, description: String? default null, input_schema: Json, - tools: [Uuid] default [], + tools: [Json] default [], inherit_tools: Bool default true, workflows: [Json], created_at: Float default now(), @@ -57,7 +56,6 @@ name, description, input_schema, - tools_available, workflows, created_at, ] := *tasks { @@ -67,7 +65,6 @@ name, description, input_schema, - tools: tools_available, workflows, created_at, } diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index c87eeb9e7..58f1dd6f8 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -2851,6 +2851,17 @@ files = [ {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, ] +[[package]] +name = "mergedeep" +version = "1.3.4" +description = "A deep merge function for 🐍." +optional = false +python-versions = ">=3.6" +files = [ + {file = "mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307"}, + {file = "mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8"}, +] + [[package]] name = "mistune" version = "3.0.2" @@ -4725,13 +4736,13 @@ win32 = ["pywin32"] [[package]] name = "sentry-sdk" -version = "1.45.0" +version = "1.45.1" description = "Python client for Sentry (https://sentry.io)" optional = false python-versions = "*" files = [ - {file = "sentry-sdk-1.45.0.tar.gz", hash = "sha256:509aa9678c0512344ca886281766c2e538682f8acfa50fd8d405f8c417ad0625"}, - {file = "sentry_sdk-1.45.0-py2.py3-none-any.whl", hash = "sha256:1ce29e30240cc289a027011103a8c83885b15ef2f316a60bcc7c5300afa144f1"}, + {file = "sentry_sdk-1.45.1-py2.py3-none-any.whl", hash = "sha256:608887855ccfe39032bfd03936e3a1c4f4fc99b3a4ac49ced54a4220de61c9c1"}, + {file = "sentry_sdk-1.45.1.tar.gz", hash = "sha256:a16c997c0f4e3df63c0fc5e4207ccb1ab37900433e0f72fef88315d317829a26"}, ] [package.dependencies] @@ -5394,13 +5405,13 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "transformers" -version = "4.43.2" +version = "4.43.3" description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow" optional = false python-versions = ">=3.8.0" files = [ - {file = "transformers-4.43.2-py3-none-any.whl", hash = "sha256:283c8b47cf38640c5c0caea60be0dfa948669fa48e9739b03717cbf5e8b20f11"}, - {file = "transformers-4.43.2.tar.gz", hash = "sha256:99dbbdeef9d451cdbc1c5316dce3af3dd5bb56b6cda5d0c564253e8fa7ccaf02"}, + {file = "transformers-4.43.3-py3-none-any.whl", hash = "sha256:6552beada5d826c25ff9b79139d237ab9050c6ea96b73d7fd2f8a8ba23ee76a4"}, + {file = "transformers-4.43.3.tar.gz", hash = "sha256:820c5b192bb1bf47250802901a8f0bf581e06b8fded89179d4ef08a1e903ee1c"}, ] [package.dependencies] @@ -5607,6 +5618,17 @@ pprintpp = ">=0.4.0,<0.5.0" rich = ">=12.2.0" tomli = ">=1.0.0,<3.0.0" +[[package]] +name = "wat-inspector" +version = "0.2.1" +description = "Deep inspection of Python objects" +optional = false +python-versions = ">=3.8" +files = [ + {file = "wat_inspector-0.2.1-py3-none-any.whl", hash = "sha256:4157c414de60b6675bfec0635b8c9895ca687d6ffd1194edfb2a673fec5d4d79"}, + {file = "wat_inspector-0.2.1.tar.gz", hash = "sha256:92999c4ec4efa6d669b24b794eb675ae138945f7282b59fdeaae3076a02b3fd6"}, +] + [[package]] name = "wcwidth" version = "0.2.13" @@ -5920,4 +5942,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.11" -content-hash = "e83adfdfc54731617a5b93b7e85e2551cfe1bad244cd18a3f8f60fe037d8c8fa" +content-hash = "728d58e8603503f630eea610a0d7bcbab62298b7a81c0780b8e90d00c3de05b7" diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index 78f968712..f54a9a922 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -34,6 +34,7 @@ tenacity = "^8.3.0" beartype = "^0.18.5" cel-python = "^0.1.5" +mergedeep = "^1.3.4" [tool.poetry.group.dev.dependencies] ipython = "^8.18.1" black = "^24.4.0" @@ -50,6 +51,7 @@ ipywidgets = "^8.1.2" jupyter-ai = "^2.14.1" langchain-openai = "^0.1.6" +wat-inspector = "^0.2.1" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/sdks/python/julep/api/README.md b/sdks/python/julep/api/README.md index daa4fb689..30701733f 100644 --- a/sdks/python/julep/api/README.md +++ b/sdks/python/julep/api/README.md @@ -16,17 +16,26 @@ pip install julep Instantiate and use the client with the following: ```python +from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_create( - name="name", - about="about", - model="model", - instructions="instructions", +client.agents_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), ) ``` @@ -37,6 +46,7 @@ The SDK also exports an `async` client so that you can make non-blocking calls t ```python import asyncio +from julep import DocsVectorDocSearchRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -46,11 +56,19 @@ client = AsyncJulepApi( async def main() -> None: - await client.agents_route_create( - name="name", - about="about", - model="model", - instructions="instructions", + await client.agents_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), ) @@ -66,7 +84,7 @@ will be thrown. from .api_error import ApiError try: - client.agents_route_create(...) + client.agents_docs_search_route_search(...) except ApiError as e: print(e.status_code) print(e.body) @@ -89,7 +107,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret Use the `max_retries` request option to configure this behavior. ```python -client.agents_route_create(...,{ +client.agents_docs_search_route_search(...,{ max_retries=1 }) ``` @@ -106,7 +124,7 @@ client = JulepApi(..., { timeout=20.0 }, ) # Override timeout for a specific method -client.agents_route_create(...,{ +client.agents_docs_search_route_search(...,{ timeout_in_seconds=1 }) ``` diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 4b858b9c7..9cb6f1c03 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -4,26 +4,10 @@ AgentDocsRouteListRequestDirection, AgentDocsRouteListRequestSortBy, AgentDocsRouteListResponse, - AgentToolsRouteListRequestDirection, - AgentToolsRouteListRequestSortBy, - AgentToolsRouteListResponse, - AgentsAgent, - AgentsAgentDefaultSettings, - AgentsAgentInstructions, - AgentsCreateAgentRequest, - AgentsCreateAgentRequestDefaultSettings, - AgentsCreateAgentRequestInstructions, + AgentsDocsSearchRouteSearchRequestBody, AgentsDocsSearchRouteSearchRequestDirection, AgentsDocsSearchRouteSearchRequestSortBy, AgentsDocsSearchRouteSearchResponse, - AgentsPatchAgentRequestDefaultSettings, - AgentsPatchAgentRequestInstructions, - AgentsRouteListRequestDirection, - AgentsRouteListRequestSortBy, - AgentsRouteListResponse, - AgentsUpdateAgentRequest, - AgentsUpdateAgentRequestDefaultSettings, - AgentsUpdateAgentRequestInstructions, ChatBaseChatOutput, ChatBaseChatResponse, ChatBaseTokenLogProb, @@ -34,11 +18,9 @@ ChatCompletionResponseFormatType, ChatFinishReason, ChatGenerationPreset, - ChatGenerationPresetSettings, ChatLogProbResponse, ChatMessageChatResponse, ChatMultipleChatOutput, - ChatOpenAiSettings, ChatRouteGenerateRequest, ChatRouteGenerateRequestAgent, ChatRouteGenerateRequestAgentToolChoice, @@ -49,7 +31,6 @@ ChatRouteGenerateResponse, ChatSingleChatOutput, ChatTokenLogProb, - ChatVLlmSettings, CommonIdentifierSafeUnicode, CommonLimit, CommonLogitBias, @@ -61,20 +42,12 @@ CommonToolRef, CommonUuid, CommonValidPythonIdentifier, + DocsBaseDocSearchRequest, DocsDoc, DocsDocContent, DocsDocOwner, DocsDocOwnerRole, DocsDocReference, - DocsDocSearchRequest, - DocsDocSearchRequestText, - DocsDocSearchRequestVector, - DocsDocSearchRequest_Hybrid, - DocsDocSearchRequest_Text, - DocsDocSearchRequest_Vector, - DocsEmbedQueryRequest, - DocsEmbedQueryRequestText, - DocsEmbedQueryResponse, DocsHybridDocSearchRequest, DocsHybridDocSearchRequestText, DocsHybridDocSearchRequestVector, @@ -82,8 +55,6 @@ DocsTextOnlyDocSearchRequestText, DocsVectorDocSearchRequest, DocsVectorDocSearchRequestVector, - EntriesBaseChatMlContentPart, - EntriesBaseChatMlContentPart_ImageUrl, EntriesChatMlImageContentPart, EntriesChatMlMessage, EntriesChatMlMessageContent, @@ -124,33 +95,16 @@ HistoryRouteListRequestDirection, HistoryRouteListRequestSortBy, HistoryRouteListResponse, - JobsJobState, - JobsJobStatus, - SessionsContextOverflowType, - SessionsCreateSessionRequest, - SessionsMultiAgentMultiUserSession, - SessionsMultiAgentNoUserSession, - SessionsMultiAgentSingleUserSession, - SessionsRouteListRequestDirection, - SessionsRouteListRequestSortBy, - SessionsRouteListResponse, - SessionsSession, - SessionsSession_MultiAgentMultiUser, - SessionsSession_MultiAgentNoUser, - SessionsSession_MultiAgentSingleUser, - SessionsSession_SingleAgentMultiUser, - SessionsSession_SingleAgentNoUser, - SessionsSession_SingleAgentSingleUser, - SessionsSingleAgentMultiUserSession, - SessionsSingleAgentNoUserSession, - SessionsSingleAgentSingleUserSession, TaskExecutionsRouteListRequestDirection, TaskExecutionsRouteListRequestSortBy, TaskExecutionsRouteListResponse, - TasksCreateTaskRequest, + TasksCreateTaskRequestMainItem, TasksErrorWorkflowStep, TasksEvaluateStep, TasksIfElseWorkflowStep, + TasksIfElseWorkflowStepElse, + TasksIfElseWorkflowStepThen, + TasksPatchTaskRequestMainItem, TasksPromptStep, TasksPromptStepPrompt, TasksPromptStepSettings, @@ -161,22 +115,16 @@ TasksRouteListRequestSortBy, TasksRouteListResponse, TasksTask, + TasksTaskMainItem, + TasksTaskTool, TasksToolCallStep, - TasksWorkflowStep, - TasksWorkflowStep_Error, - TasksWorkflowStep_Evaluate, - TasksWorkflowStep_IfElse, - TasksWorkflowStep_Prompt, - TasksWorkflowStep_ToolCall, - TasksWorkflowStep_Yield, + TasksUpdateTaskRequestMainItem, TasksYieldStep, ToolsChosenFunctionCall, ToolsChosenToolCall, ToolsChosenToolCall_Function, - ToolsCreateToolRequest, ToolsFunctionCallOption, ToolsFunctionDef, - ToolsFunctionDefUpdate, ToolsFunctionTool, ToolsNamedFunctionChoice, ToolsNamedToolChoice, @@ -188,14 +136,10 @@ UserDocsRouteListRequestDirection, UserDocsRouteListRequestSortBy, UserDocsRouteListResponse, + UserDocsSearchRouteSearchRequestBody, UserDocsSearchRouteSearchRequestDirection, UserDocsSearchRouteSearchRequestSortBy, UserDocsSearchRouteSearchResponse, - UsersRouteListRequestDirection, - UsersRouteListRequestSortBy, - UsersRouteListResponse, - UsersUpdateUserRequest, - UsersUser, ) from .environment import JulepApiEnvironment @@ -203,26 +147,10 @@ "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", - "AgentToolsRouteListRequestDirection", - "AgentToolsRouteListRequestSortBy", - "AgentToolsRouteListResponse", - "AgentsAgent", - "AgentsAgentDefaultSettings", - "AgentsAgentInstructions", - "AgentsCreateAgentRequest", - "AgentsCreateAgentRequestDefaultSettings", - "AgentsCreateAgentRequestInstructions", + "AgentsDocsSearchRouteSearchRequestBody", "AgentsDocsSearchRouteSearchRequestDirection", "AgentsDocsSearchRouteSearchRequestSortBy", "AgentsDocsSearchRouteSearchResponse", - "AgentsPatchAgentRequestDefaultSettings", - "AgentsPatchAgentRequestInstructions", - "AgentsRouteListRequestDirection", - "AgentsRouteListRequestSortBy", - "AgentsRouteListResponse", - "AgentsUpdateAgentRequest", - "AgentsUpdateAgentRequestDefaultSettings", - "AgentsUpdateAgentRequestInstructions", "ChatBaseChatOutput", "ChatBaseChatResponse", "ChatBaseTokenLogProb", @@ -233,11 +161,9 @@ "ChatCompletionResponseFormatType", "ChatFinishReason", "ChatGenerationPreset", - "ChatGenerationPresetSettings", "ChatLogProbResponse", "ChatMessageChatResponse", "ChatMultipleChatOutput", - "ChatOpenAiSettings", "ChatRouteGenerateRequest", "ChatRouteGenerateRequestAgent", "ChatRouteGenerateRequestAgentToolChoice", @@ -248,7 +174,6 @@ "ChatRouteGenerateResponse", "ChatSingleChatOutput", "ChatTokenLogProb", - "ChatVLlmSettings", "CommonIdentifierSafeUnicode", "CommonLimit", "CommonLogitBias", @@ -260,20 +185,12 @@ "CommonToolRef", "CommonUuid", "CommonValidPythonIdentifier", + "DocsBaseDocSearchRequest", "DocsDoc", "DocsDocContent", "DocsDocOwner", "DocsDocOwnerRole", "DocsDocReference", - "DocsDocSearchRequest", - "DocsDocSearchRequestText", - "DocsDocSearchRequestVector", - "DocsDocSearchRequest_Hybrid", - "DocsDocSearchRequest_Text", - "DocsDocSearchRequest_Vector", - "DocsEmbedQueryRequest", - "DocsEmbedQueryRequestText", - "DocsEmbedQueryResponse", "DocsHybridDocSearchRequest", "DocsHybridDocSearchRequestText", "DocsHybridDocSearchRequestVector", @@ -281,8 +198,6 @@ "DocsTextOnlyDocSearchRequestText", "DocsVectorDocSearchRequest", "DocsVectorDocSearchRequestVector", - "EntriesBaseChatMlContentPart", - "EntriesBaseChatMlContentPart_ImageUrl", "EntriesChatMlImageContentPart", "EntriesChatMlMessage", "EntriesChatMlMessageContent", @@ -323,34 +238,17 @@ "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", - "JobsJobState", - "JobsJobStatus", "JulepApiEnvironment", - "SessionsContextOverflowType", - "SessionsCreateSessionRequest", - "SessionsMultiAgentMultiUserSession", - "SessionsMultiAgentNoUserSession", - "SessionsMultiAgentSingleUserSession", - "SessionsRouteListRequestDirection", - "SessionsRouteListRequestSortBy", - "SessionsRouteListResponse", - "SessionsSession", - "SessionsSession_MultiAgentMultiUser", - "SessionsSession_MultiAgentNoUser", - "SessionsSession_MultiAgentSingleUser", - "SessionsSession_SingleAgentMultiUser", - "SessionsSession_SingleAgentNoUser", - "SessionsSession_SingleAgentSingleUser", - "SessionsSingleAgentMultiUserSession", - "SessionsSingleAgentNoUserSession", - "SessionsSingleAgentSingleUserSession", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", - "TasksCreateTaskRequest", + "TasksCreateTaskRequestMainItem", "TasksErrorWorkflowStep", "TasksEvaluateStep", "TasksIfElseWorkflowStep", + "TasksIfElseWorkflowStepElse", + "TasksIfElseWorkflowStepThen", + "TasksPatchTaskRequestMainItem", "TasksPromptStep", "TasksPromptStepPrompt", "TasksPromptStepSettings", @@ -361,22 +259,16 @@ "TasksRouteListRequestSortBy", "TasksRouteListResponse", "TasksTask", + "TasksTaskMainItem", + "TasksTaskTool", "TasksToolCallStep", - "TasksWorkflowStep", - "TasksWorkflowStep_Error", - "TasksWorkflowStep_Evaluate", - "TasksWorkflowStep_IfElse", - "TasksWorkflowStep_Prompt", - "TasksWorkflowStep_ToolCall", - "TasksWorkflowStep_Yield", + "TasksUpdateTaskRequestMainItem", "TasksYieldStep", "ToolsChosenFunctionCall", "ToolsChosenToolCall", "ToolsChosenToolCall_Function", - "ToolsCreateToolRequest", "ToolsFunctionCallOption", "ToolsFunctionDef", - "ToolsFunctionDefUpdate", "ToolsFunctionTool", "ToolsNamedFunctionChoice", "ToolsNamedToolChoice", @@ -388,12 +280,8 @@ "UserDocsRouteListRequestDirection", "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", + "UserDocsSearchRouteSearchRequestBody", "UserDocsSearchRouteSearchRequestDirection", "UserDocsSearchRouteSearchRequestSortBy", "UserDocsSearchRouteSearchResponse", - "UsersRouteListRequestDirection", - "UsersRouteListRequestSortBy", - "UsersRouteListResponse", - "UsersUpdateUserRequest", - "UsersUser", ] diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index ae9b4e3ba..6b5addb67 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -16,19 +16,8 @@ ) from .types.agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy from .types.agent_docs_route_list_response import AgentDocsRouteListResponse -from .types.agent_tools_route_list_request_direction import ( - AgentToolsRouteListRequestDirection, -) -from .types.agent_tools_route_list_request_sort_by import ( - AgentToolsRouteListRequestSortBy, -) -from .types.agent_tools_route_list_response import AgentToolsRouteListResponse -from .types.agents_agent import AgentsAgent -from .types.agents_create_agent_request_default_settings import ( - AgentsCreateAgentRequestDefaultSettings, -) -from .types.agents_create_agent_request_instructions import ( - AgentsCreateAgentRequestInstructions, +from .types.agents_docs_search_route_search_request_body import ( + AgentsDocsSearchRouteSearchRequestBody, ) from .types.agents_docs_search_route_search_request_direction import ( AgentsDocsSearchRouteSearchRequestDirection, @@ -39,35 +28,15 @@ from .types.agents_docs_search_route_search_response import ( AgentsDocsSearchRouteSearchResponse, ) -from .types.agents_patch_agent_request_default_settings import ( - AgentsPatchAgentRequestDefaultSettings, -) -from .types.agents_patch_agent_request_instructions import ( - AgentsPatchAgentRequestInstructions, -) -from .types.agents_route_list_request_direction import AgentsRouteListRequestDirection -from .types.agents_route_list_request_sort_by import AgentsRouteListRequestSortBy -from .types.agents_route_list_response import AgentsRouteListResponse -from .types.agents_update_agent_request_default_settings import ( - AgentsUpdateAgentRequestDefaultSettings, -) -from .types.agents_update_agent_request_instructions import ( - AgentsUpdateAgentRequestInstructions, -) from .types.chat_route_generate_request import ChatRouteGenerateRequest from .types.chat_route_generate_response import ChatRouteGenerateResponse -from .types.common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .types.common_limit import CommonLimit from .types.common_offset import CommonOffset from .types.common_resource_created_response import CommonResourceCreatedResponse from .types.common_resource_deleted_response import CommonResourceDeletedResponse from .types.common_resource_updated_response import CommonResourceUpdatedResponse from .types.common_uuid import CommonUuid -from .types.common_valid_python_identifier import CommonValidPythonIdentifier from .types.docs_doc import DocsDoc -from .types.docs_doc_search_request import DocsDocSearchRequest -from .types.docs_embed_query_request import DocsEmbedQueryRequest -from .types.docs_embed_query_response import DocsEmbedQueryResponse from .types.execution_transitions_route_list_request_direction import ( ExecutionTransitionsRouteListRequestDirection, ) @@ -82,14 +51,6 @@ from .types.history_route_list_request_direction import HistoryRouteListRequestDirection from .types.history_route_list_request_sort_by import HistoryRouteListRequestSortBy from .types.history_route_list_response import HistoryRouteListResponse -from .types.jobs_job_status import JobsJobStatus -from .types.sessions_context_overflow_type import SessionsContextOverflowType -from .types.sessions_route_list_request_direction import ( - SessionsRouteListRequestDirection, -) -from .types.sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy -from .types.sessions_route_list_response import SessionsRouteListResponse -from .types.sessions_session import SessionsSession from .types.task_executions_route_list_request_direction import ( TaskExecutionsRouteListRequestDirection, ) @@ -97,19 +58,21 @@ TaskExecutionsRouteListRequestSortBy, ) from .types.task_executions_route_list_response import TaskExecutionsRouteListResponse +from .types.tasks_create_task_request_main_item import TasksCreateTaskRequestMainItem +from .types.tasks_patch_task_request_main_item import TasksPatchTaskRequestMainItem from .types.tasks_route_list_request_direction import TasksRouteListRequestDirection from .types.tasks_route_list_request_sort_by import TasksRouteListRequestSortBy from .types.tasks_route_list_response import TasksRouteListResponse -from .types.tasks_workflow_step import TasksWorkflowStep -from .types.tools_create_tool_request import ToolsCreateToolRequest -from .types.tools_function_def import ToolsFunctionDef -from .types.tools_function_def_update import ToolsFunctionDefUpdate -from .types.tools_tool_type import ToolsToolType +from .types.tasks_task_tool import TasksTaskTool +from .types.tasks_update_task_request_main_item import TasksUpdateTaskRequestMainItem from .types.user_docs_route_list_request_direction import ( UserDocsRouteListRequestDirection, ) from .types.user_docs_route_list_request_sort_by import UserDocsRouteListRequestSortBy from .types.user_docs_route_list_response import UserDocsRouteListResponse +from .types.user_docs_search_route_search_request_body import ( + UserDocsSearchRouteSearchRequestBody, +) from .types.user_docs_search_route_search_request_direction import ( UserDocsSearchRouteSearchRequestDirection, ) @@ -119,10 +82,6 @@ from .types.user_docs_search_route_search_response import ( UserDocsSearchRouteSearchResponse, ) -from .types.users_route_list_request_direction import UsersRouteListRequestDirection -from .types.users_route_list_request_sort_by import UsersRouteListRequestSortBy -from .types.users_route_list_response import UsersRouteListResponse -from .types.users_user import UsersUser # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -199,31 +158,35 @@ def __init__( timeout=_defaulted_timeout, ) - def agents_route_list( + def agent_docs_route_list( self, + id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: AgentsRouteListRequestSortBy, - direction: AgentsRouteListRequestDirection, + sort_by: AgentDocsRouteListRequestSortBy, + direction: AgentDocsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteListResponse: + ) -> AgentDocsRouteListResponse: """ - List Agents (paginated) + List Docs owned by an Agent Parameters ---------- + id : CommonUuid + ID of parent + limit : CommonLimit Limit the number of items returned offset : CommonOffset Offset the items returned - sort_by : AgentsRouteListRequestSortBy + sort_by : AgentDocsRouteListRequestSortBy Sort by a field - direction : AgentsRouteListRequestDirection + direction : AgentDocsRouteListRequestDirection Sort direction metadata_filter : str @@ -234,7 +197,7 @@ def agents_route_list( Returns ------- - AgentsRouteListResponse + AgentDocsRouteListResponse The request has succeeded. Examples @@ -245,7 +208,8 @@ def agents_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_route_list( + client.agent_docs_route_list( + id="id", limit=1, offset=1, sort_by="created_at", @@ -254,7 +218,7 @@ def agents_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - "agents", + f"agents/{jsonable_encoder(id)}/docs", method="GET", params={ "limit": limit, @@ -267,109 +231,143 @@ def agents_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_create( + def agents_docs_search_route_search( self, + id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsCreateAgentRequestInstructions, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsCreateAgentRequestDefaultSettings - ] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsDocsSearchRouteSearchRequestSortBy, + direction: AgentsDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: AgentsDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + ) -> AgentsDocsSearchRouteSearchResponse: """ - Create a new Agent + Search Docs owned by an Agent Parameters ---------- - name : CommonIdentifierSafeUnicode - Name of the agent + id : CommonUuid + ID of the parent + + limit : CommonLimit + Limit the number of items returned - about : str - About the agent + offset : CommonOffset + Offset the items returned - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) + sort_by : AgentsDocsSearchRouteSearchRequestSortBy + Sort by a field - instructions : AgentsCreateAgentRequestInstructions - Instructions for the agent + direction : AgentsDocsSearchRouteSearchRequestDirection + Sort direction - metadata : typing.Optional[typing.Dict[str, typing.Any]] + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + body : AgentsDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + AgentsDocsSearchRouteSearchResponse + The request has succeeded. Examples -------- + from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_route_create( - name="name", - about="about", - model="model", - instructions="instructions", + client.agents_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), ) """ _response = self._client_wrapper.httpx_client.request( - "agents", + f"agents/{jsonable_encoder(id)}/search", method="POST", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, + json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> AgentsAgent: + def tasks_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> TasksRouteListResponse: """ - Get an Agent by id + List tasks (paginated) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : TasksRouteListRequestSortBy + Sort by a field + + direction : TasksRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsAgent + TasksRouteListResponse The request has succeeded. Examples @@ -380,145 +378,171 @@ def agents_route_get( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_route_get( + client.tasks_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/tasks", method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_create_or_update( + def tasks_route_create( self, id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsUpdateAgentRequestInstructions, + name: str, + description: str, + main: typing.Sequence[TasksCreateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsUpdateAgentRequestDefaultSettings - ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> CommonResourceCreatedResponse: """ - Create or update an Agent + Create a new task Parameters ---------- id : CommonUuid + ID of parent resource + + name : str - name : CommonIdentifierSafeUnicode - Name of the agent + description : str - about : str - About the agent + main : typing.Sequence[TasksCreateTaskRequestMainItem] + The entrypoint of the task. - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. - instructions : AgentsUpdateAgentRequestInstructions - Instructions for the agent + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - metadata : typing.Optional[typing.Dict[str, typing.Any]] + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- + from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_route_create_or_update( + client.tasks_route_create( id="id", name="name", - about="about", - model="model", - instructions="instructions", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/tasks", method="POST", json={ - "metadata": metadata, "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_update( + def tasks_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsUpdateAgentRequestInstructions, + description: str, + main: typing.Sequence[TasksUpdateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsUpdateAgentRequestDefaultSettings - ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + Update an existing task (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource - name : CommonIdentifierSafeUnicode - Name of the agent + child_id : CommonUuid + ID of the resource to be updated - about : str - About the agent + description : str - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) + main : typing.Sequence[TasksUpdateTaskRequestMainItem] + The entrypoint of the task. - instructions : AgentsUpdateAgentRequestInstructions - Instructions for the agent + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. - metadata : typing.Optional[typing.Dict[str, typing.Any]] + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -530,30 +554,41 @@ def agents_route_update( Examples -------- + from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_route_update( + client.tasks_route_update( id="id", - name="name", - about="about", - model="model", - instructions="instructions", + child_id="child_id", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", method="PUT", json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, }, request_options=request_options, omit=OMIT, @@ -566,16 +601,23 @@ def agents_route_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + def tasks_route_delete( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceDeletedResponse: """ - Delete Agent by id + Delete a task by its id Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + child_id : CommonUuid + ID of the resource to be deleted request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -593,12 +635,13 @@ def agents_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_route_delete( + client.tasks_route_delete( id="id", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", method="DELETE", request_options=request_options, ) @@ -610,44 +653,45 @@ def agents_route_delete( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_route_patch( + def tasks_route_patch( self, id: CommonUuid, + child_id: CommonUuid, *, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.Sequence[TasksTaskTool]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, - about: typing.Optional[str] = OMIT, - model: typing.Optional[str] = OMIT, - instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, - default_settings: typing.Optional[ - AgentsPatchAgentRequestDefaultSettings - ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing Agent by id (merges with existing values) + Update an existing task (merges with existing values) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource - metadata : typing.Optional[typing.Dict[str, typing.Any]] + child_id : CommonUuid + ID of the resource to be patched - name : typing.Optional[CommonIdentifierSafeUnicode] - Name of the agent + description : typing.Optional[str] + + main : typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] + The entrypoint of the task. - about : typing.Optional[str] - About the agent + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - model : typing.Optional[str] - Model name to use (gpt-4-turbo, gemini-nano etc) + tools : typing.Optional[typing.Sequence[TasksTaskTool]] + Tools defined specifically for this task not included in the Agent itself. - instructions : typing.Optional[AgentsPatchAgentRequestInstructions] - Instructions for the agent + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. - default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] - Default settings for all sessions created by this agent + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -665,20 +709,21 @@ def agents_route_patch( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_route_patch( + client.tasks_route_patch( id="id", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", method="PATCH", json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, }, request_options=request_options, omit=OMIT, @@ -691,46 +736,23 @@ def agents_route_patch( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agent_docs_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentDocsRouteListRequestSortBy, - direction: AgentDocsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> AgentDocsRouteListResponse: + def individual_docs_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> DocsDoc: """ - List Docs owned by an Agent + Get Doc by id Parameters ---------- id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentDocsRouteListRequestSortBy - Sort by a field - - direction : AgentDocsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentDocsRouteListResponse + DocsDoc The request has succeeded. Examples @@ -741,141 +763,124 @@ def agent_docs_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_docs_route_list( + client.individual_docs_route_get( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/docs", + f"docs/{jsonable_encoder(id)}", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_docs_search_route_search( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsDocsSearchRouteSearchRequestSortBy, - direction: AgentsDocsSearchRouteSearchRequestDirection, - metadata_filter: str, - body: DocsDocSearchRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsDocsSearchRouteSearchResponse: + def individual_docs_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Search Docs owned by an Agent + Delete an existing Doc by id Parameters ---------- id : CommonUuid - ID of the parent + ID of the resource - limit : CommonLimit - Limit the number of items returned + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - offset : CommonOffset - Offset the items returned + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. - sort_by : AgentsDocsSearchRouteSearchRequestSortBy - Sort by a field + Examples + -------- + from julep.client import JulepApi - direction : AgentsDocsSearchRouteSearchRequestDirection - Sort direction + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.individual_docs_route_delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"docs/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + def executions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExecutionsExecution: + """ + Get an Execution by id - body : DocsDocSearchRequest + Parameters + ---------- + id : CommonUuid + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsDocsSearchRouteSearchResponse + ExecutionsExecution The request has succeeded. Examples -------- - from julep import DocsDocSearchRequest_Vector from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_docs_search_route_search( - id="string", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="string", - body=DocsDocSearchRequest_Vector( - text="string", - vector=[1.1], - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), + client.executions_route_get( + id="id", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/search", - method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - json={"body": body}, + f"executions/{jsonable_encoder(id)}", + method="GET", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_list( + def execution_transitions_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: TasksRouteListRequestSortBy, - direction: TasksRouteListRequestDirection, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteListResponse: + ) -> ExecutionTransitionsRouteListResponse: """ - List tasks (paginated) + List the Transitions of an Execution by id Parameters ---------- @@ -888,10 +893,10 @@ def tasks_route_list( offset : CommonOffset Offset the items returned - sort_by : TasksRouteListRequestSortBy + sort_by : ExecutionTransitionsRouteListRequestSortBy Sort by a field - direction : TasksRouteListRequestDirection + direction : ExecutionTransitionsRouteListRequestDirection Sort direction metadata_filter : str @@ -902,7 +907,7 @@ def tasks_route_list( Returns ------- - TasksRouteListResponse + ExecutionTransitionsRouteListResponse The request has succeeded. Examples @@ -913,7 +918,7 @@ def tasks_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_list( + client.execution_transitions_route_list( id="id", limit=1, offset=1, @@ -923,7 +928,7 @@ def tasks_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", + f"executions/{jsonable_encoder(id)}/transitions", method="GET", params={ "limit": limit, @@ -936,215 +941,166 @@ def tasks_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_create( + def chat_route_generate( self, id: CommonUuid, *, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request: ChatRouteGenerateRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + ) -> ChatRouteGenerateResponse: """ - Create a new task + Generate a response from the model Parameters ---------- id : CommonUuid - ID of parent resource - - name : str - - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. - - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + The session ID - metadata : typing.Optional[typing.Dict[str, typing.Any]] + request : ChatRouteGenerateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + ChatRouteGenerateResponse + The request has succeeded. Examples -------- - from julep import ToolsCreateToolRequest + from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_create( + client.chat_route_generate( id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", + f"sessions/{jsonable_encoder(id)}/chat", method="POST", - json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, + json=request, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_update( + def history_route_list( self, id: CommonUuid, - child_id: CommonUuid, *, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> HistoryRouteListResponse: """ - Update an existing task (overwrite existing values) + Get history of a Session (paginated) Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated - - description : str + ID of parent - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. + limit : CommonLimit + Limit the number of items returned - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. + offset : CommonOffset + Offset the items returned - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + sort_by : HistoryRouteListRequestSortBy + Sort by a field - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + direction : HistoryRouteListRequestDirection + Sort direction - metadata : typing.Optional[typing.Dict[str, typing.Any]] + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + HistoryRouteListResponse The request has succeeded. Examples -------- - from julep import ToolsCreateToolRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_update( + client.history_route_list( id="id", - child_id="child_id", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="PUT", - json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, + f"sessions/{jsonable_encoder(id)}/history", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_delete( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - request_options: typing.Optional[RequestOptions] = None, + def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> CommonResourceDeletedResponse: """ - Delete a task by its id + Clear the history of a Session (resets the Session) Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be deleted + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1162,13 +1118,12 @@ def tasks_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_delete( + client.history_route_delete( id="id", - child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + f"sessions/{jsonable_encoder(id)}/history", method="DELETE", request_options=request_options, ) @@ -1180,102 +1135,19 @@ def tasks_route_delete( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_patch( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, - inherit_tools: typing.Optional[bool] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing task (merges with existing values) - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be patched - - description : typing.Optional[str] - - main : typing.Optional[typing.Sequence[TasksWorkflowStep]] - The entrypoint of the task. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : typing.Optional[bool] - Whether to inherit tools from the parent agent or not. Defaults to true. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.tasks_route_patch( - id="id", - child_id="child_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="PATCH", - json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def agent_tools_route_list( + def task_executions_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: AgentToolsRouteListRequestSortBy, - direction: AgentToolsRouteListRequestDirection, + sort_by: TaskExecutionsRouteListRequestSortBy, + direction: TaskExecutionsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentToolsRouteListResponse: + ) -> TaskExecutionsRouteListResponse: """ - List tools of the given agent + List executions of the given task Parameters ---------- @@ -1288,10 +1160,10 @@ def agent_tools_route_list( offset : CommonOffset Offset the items returned - sort_by : AgentToolsRouteListRequestSortBy + sort_by : TaskExecutionsRouteListRequestSortBy Sort by a field - direction : AgentToolsRouteListRequestDirection + direction : TaskExecutionsRouteListRequestDirection Sort direction metadata_filter : str @@ -1302,7 +1174,7 @@ def agent_tools_route_list( Returns ------- - AgentToolsRouteListResponse + TaskExecutionsRouteListResponse The request has succeeded. Examples @@ -1313,7 +1185,7 @@ def agent_tools_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_tools_route_list( + client.task_executions_route_list( id="id", limit=1, offset=1, @@ -1323,7 +1195,7 @@ def agent_tools_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools", + f"tasks/{jsonable_encoder(id)}/executions", method="GET", params={ "limit": limit, @@ -1336,51 +1208,33 @@ def agent_tools_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agent_tools_route_create( + def task_executions_route_create( self, id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsCreateAgentRequestInstructions, + input: typing.Dict[str, typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsCreateAgentRequestDefaultSettings - ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceCreatedResponse: """ - Create a new tool for this agent + Create an execution for the given task Parameters ---------- id : CommonUuid ID of parent resource - name : CommonIdentifierSafeUnicode - Name of the agent - - about : str - About the agent - - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) - - instructions : AgentsCreateAgentRequestInstructions - Instructions for the agent + input : typing.Dict[str, typing.Any] + The input to the execution metadata : typing.Optional[typing.Dict[str, typing.Any]] - default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1397,25 +1251,15 @@ def agent_tools_route_create( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_tools_route_create( + client.task_executions_route_create( id="id", - name="name", - about="about", - model="model", - instructions="instructions", + input={"key": "value"}, ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools", + f"tasks/{jsonable_encoder(id)}/executions", method="POST", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, - }, + json={"input": input, "metadata": metadata}, request_options=request_options, omit=OMIT, ) @@ -1427,43 +1271,27 @@ def agent_tools_route_create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agent_tools_route_update( + def task_executions_route_resume_with_task_token( self, id: CommonUuid, - child_id: CommonUuid, *, - type: ToolsToolType, - name: CommonValidPythonIdentifier, - function: typing.Optional[ToolsFunctionDef] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, + task_token: str, + input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing tool (overwrite existing values) + Resume an execution with a task token Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated - - type : ToolsToolType - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : CommonValidPythonIdentifier - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDef] - - integration : typing.Optional[typing.Any] + ID of parent Task - system : typing.Optional[typing.Any] + task_token : str + A Task Token is a unique identifier for a specific Task Execution. - api_call : typing.Optional[typing.Any] + input : typing.Optional[typing.Dict[str, typing.Any]] + The input to resume the execution with request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1481,24 +1309,15 @@ def agent_tools_route_update( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_tools_route_update( + client.task_executions_route_resume_with_task_token( id="id", - child_id="child_id", - type="function", - name="name", + task_token="task_token", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + f"tasks/{jsonable_encoder(id)}/executions", method="PUT", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, + json={"task_token": task_token, "input": input, "status": "running"}, request_options=request_options, omit=OMIT, ) @@ -1510,15 +1329,16 @@ def agent_tools_route_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agent_tools_route_delete( + def task_executions_route_update( self, id: CommonUuid, child_id: CommonUuid, *, + request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceDeletedResponse: + ) -> CommonResourceUpdatedResponse: """ - Delete an existing tool by id + Update an existing Execution Parameters ---------- @@ -1526,4038 +1346,63 @@ def agent_tools_route_delete( ID of parent resource child_id : CommonUuid - ID of the resource to be deleted + ID of the resource to be updated + + request : ExecutionsUpdateExecutionRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- + from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_tools_route_delete( - id="id", - child_id="child_id", + client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", - method="DELETE", + f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", + method="PUT", + json=request, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agent_tools_route_patch( + def user_docs_route_list( self, id: CommonUuid, - child_id: CommonUuid, *, - type: typing.Optional[ToolsToolType] = OMIT, - name: typing.Optional[CommonValidPythonIdentifier] = OMIT, - function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UserDocsRouteListRequestSortBy, + direction: UserDocsRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> UserDocsRouteListResponse: """ - Update an existing tool (merges with existing values) - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be patched - - type : typing.Optional[ToolsToolType] - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : typing.Optional[CommonValidPythonIdentifier] - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDefUpdate] - - integration : typing.Optional[typing.Any] - - system : typing.Optional[typing.Any] - - api_call : typing.Optional[typing.Any] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.agent_tools_route_patch( - id="id", - child_id="child_id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", - method="PATCH", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def tasks_create_or_update_route_create_or_update( - self, - parent_id: CommonUuid, - id: CommonUuid, - *, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Create or update a task - - Parameters - ---------- - parent_id : CommonUuid - ID of parent resource - - id : CommonUuid - - name : str - - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. - - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep import ToolsCreateToolRequest - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.tasks_create_or_update_route_create_or_update( - parent_id="parent_id", - id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(parent_id)}/tasks/{jsonable_encoder(id)}", - method="POST", - json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def individual_docs_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> DocsDoc: - """ - Get Doc by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DocsDoc - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.individual_docs_route_get( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def individual_docs_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete an existing Doc by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.individual_docs_route_delete( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def embed_route_embed( - self, - *, - body: DocsEmbedQueryRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> DocsEmbedQueryResponse: - """ - Embed a query for search - - Parameters - ---------- - body : DocsEmbedQueryRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DocsEmbedQueryResponse - The request has succeeded. - - Examples - -------- - from julep import DocsEmbedQueryRequest - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.embed_route_embed( - body=DocsEmbedQueryRequest( - text="text", - ), - ) - """ - _response = self._client_wrapper.httpx_client.request( - "embed", - method="POST", - json={"body": body}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def executions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ExecutionsExecution: - """ - Get an Execution by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ExecutionsExecution - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.executions_route_get( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def execution_transitions_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: ExecutionTransitionsRouteListRequestSortBy, - direction: ExecutionTransitionsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionTransitionsRouteListResponse: - """ - List the Transitions of an Execution by id - - Parameters - ---------- - id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : ExecutionTransitionsRouteListRequestSortBy - Sort by a field - - direction : ExecutionTransitionsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ExecutionTransitionsRouteListResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.execution_transitions_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}/transitions", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def job_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> JobsJobStatus: - """ - Get the status of an existing Job by its id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - JobsJobStatus - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.job_route_get( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"jobs/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def sessions_route_list( - self, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: SessionsRouteListRequestSortBy, - direction: SessionsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteListResponse: - """ - List sessions (paginated) - - Parameters - ---------- - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : SessionsRouteListRequestSortBy - Sort by a field - - direction : SessionsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SessionsRouteListResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.sessions_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - """ - _response = self._client_wrapper.httpx_client.request( - "sessions", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def sessions_route_create( - self, - *, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create a new session - - Parameters - ---------- - situation : str - A specific situation that sets the background for this session - - render_templates : bool - Render system and assistant message content as jinja templates - - user : typing.Optional[CommonUuid] - User ID of user associated with this session - - users : typing.Optional[typing.Sequence[CommonUuid]] - - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session - - agents : typing.Optional[typing.Sequence[CommonUuid]] - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.sessions_route_create( - situation="situation", - render_templates=True, - ) - """ - _response = self._client_wrapper.httpx_client.request( - "sessions", - method="POST", - json={ - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def sessions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsSession: - """ - Get a session by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SessionsSession - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.sessions_route_get( - id="string", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def sessions_route_create_or_update( - self, - id: CommonUuid, - *, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Create or update a session - - Parameters - ---------- - id : CommonUuid - - situation : str - A specific situation that sets the background for this session - - render_templates : bool - Render system and assistant message content as jinja templates - - user : typing.Optional[CommonUuid] - User ID of user associated with this session - - users : typing.Optional[typing.Sequence[CommonUuid]] - - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session - - agents : typing.Optional[typing.Sequence[CommonUuid]] - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.sessions_route_create_or_update( - id="id", - situation="situation", - render_templates=True, - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="POST", - json={ - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def sessions_route_update( - self, - id: CommonUuid, - *, - situation: str, - render_templates: bool, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing session by its id (overwrites all existing values) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - situation : str - A specific situation that sets the background for this session - - render_templates : bool - Render system and assistant message content as jinja templates - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.sessions_route_update( - id="id", - situation="situation", - render_templates=True, - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PUT", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def sessions_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete a session by its id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.sessions_route_delete( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def sessions_route_patch( - self, - id: CommonUuid, - *, - situation: typing.Optional[str] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing session by its id (merges with existing values) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - situation : typing.Optional[str] - A specific situation that sets the background for this session - - render_templates : typing.Optional[bool] - Render system and assistant message content as jinja templates - - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.sessions_route_patch( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PATCH", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def chat_route_generate( - self, - id: CommonUuid, - *, - request: ChatRouteGenerateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> ChatRouteGenerateResponse: - """ - Generate a response from the model - - Parameters - ---------- - id : CommonUuid - The session ID - - request : ChatRouteGenerateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ChatRouteGenerateResponse - The request has succeeded. - - Examples - -------- - from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.chat_route_generate( - id="id", - request=ChatRouteGenerateRequestPreset( - messages=[ - EntriesInputChatMlMessage( - role="user", - content="content", - ) - ], - recall=True, - remember=True, - save=True, - stream=True, - ), - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/chat", - method="POST", - json=request, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def history_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: - """ - Get history of a Session (paginated) - - Parameters - ---------- - id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : HistoryRouteListRequestSortBy - Sort by a field - - direction : HistoryRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HistoryRouteListResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def history_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Clear the history of a Session (resets the Session) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.history_route_delete( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def task_executions_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: TaskExecutionsRouteListRequestSortBy, - direction: TaskExecutionsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteListResponse: - """ - List executions of the given task - - Parameters - ---------- - id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : TaskExecutionsRouteListRequestSortBy - Sort by a field - - direction : TaskExecutionsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TaskExecutionsRouteListResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.task_executions_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def task_executions_route_create( - self, - id: CommonUuid, - *, - input: typing.Dict[str, typing.Any], - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create an execution for the given task - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - input : typing.Dict[str, typing.Any] - The input to the execution - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.task_executions_route_create( - id="id", - input={"key": "value"}, - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", - method="POST", - json={"input": input, "metadata": metadata}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def task_executions_route_resume_with_task_token( - self, - id: CommonUuid, - *, - task_token: str, - input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Resume an execution with a task token - - Parameters - ---------- - id : CommonUuid - ID of parent Task - - task_token : str - A Task Token is a unique identifier for a specific Task Execution. - - input : typing.Optional[typing.Dict[str, typing.Any]] - The input to resume the execution with - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.task_executions_route_resume_with_task_token( - id="id", - task_token="task_token", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", - method="PUT", - json={"task_token": task_token, "input": input, "status": "running"}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def task_executions_route_update( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - request: ExecutionsUpdateExecutionRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing Execution - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated - - request : ExecutionsUpdateExecutionRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep import ExecutionsUpdateExecutionRequest_Cancelled - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.task_executions_route_update( - id="string", - child_id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", - method="PUT", - json=request, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def users_route_list( - self, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: UsersRouteListRequestSortBy, - direction: UsersRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteListResponse: - """ - List users (paginated) - - Parameters - ---------- - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : UsersRouteListRequestSortBy - Sort by a field - - direction : UsersRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - UsersRouteListResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.users_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - """ - _response = self._client_wrapper.httpx_client.request( - "users", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def users_route_create( - self, - *, - name: CommonIdentifierSafeUnicode, - about: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create a new user - - Parameters - ---------- - name : CommonIdentifierSafeUnicode - Name of the user - - about : str - About the user - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.users_route_create( - name="name", - about="about", - ) - """ - _response = self._client_wrapper.httpx_client.request( - "users", - method="POST", - json={"metadata": metadata, "name": name, "about": about}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def users_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> UsersUser: - """ - Get a user by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - UsersUser - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.users_route_get( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def users_route_create_or_update( - self, - id: CommonUuid, - *, - name: CommonIdentifierSafeUnicode, - about: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Create or update a user - - Parameters - ---------- - id : CommonUuid - - name : CommonIdentifierSafeUnicode - Name of the user - - about : str - About the user - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.users_route_create_or_update( - id="id", - name="name", - about="about", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", - method="POST", - json={"metadata": metadata, "name": name, "about": about}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def users_route_update( - self, - id: CommonUuid, - *, - name: CommonIdentifierSafeUnicode, - about: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing user by id (overwrite existing values) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - name : CommonIdentifierSafeUnicode - Name of the user - - about : str - About the user - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.users_route_update( - id="id", - name="name", - about="about", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", - method="PUT", - json={"metadata": metadata, "name": name, "about": about}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def users_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete a user by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.users_route_delete( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def users_route_patch( - self, - id: CommonUuid, - *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, - about: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing user by id (merge with existing values) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - name : typing.Optional[CommonIdentifierSafeUnicode] - Name of the user - - about : typing.Optional[str] - About the user - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.users_route_patch( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", - method="PATCH", - json={"metadata": metadata, "name": name, "about": about}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def user_docs_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: UserDocsRouteListRequestSortBy, - direction: UserDocsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> UserDocsRouteListResponse: - """ - List Docs owned by a User - - Parameters - ---------- - id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : UserDocsRouteListRequestSortBy - Sort by a field - - direction : UserDocsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - UserDocsRouteListResponse - The request has succeeded. - - Examples - -------- - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.user_docs_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}/docs", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - def user_docs_search_route_search( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: UserDocsSearchRouteSearchRequestSortBy, - direction: UserDocsSearchRouteSearchRequestDirection, - metadata_filter: str, - body: DocsDocSearchRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> UserDocsSearchRouteSearchResponse: - """ - Search Docs owned by a User - - Parameters - ---------- - id : CommonUuid - ID of the parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : UserDocsSearchRouteSearchRequestSortBy - Sort by a field - - direction : UserDocsSearchRouteSearchRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - body : DocsDocSearchRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - UserDocsSearchRouteSearchResponse - The request has succeeded. - - Examples - -------- - from julep import DocsDocSearchRequest_Vector - from julep.client import JulepApi - - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.user_docs_search_route_search( - id="string", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="string", - body=DocsDocSearchRequest_Vector( - text="string", - vector=[1.1], - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}/search", - method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - json={"body": body}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - -class AsyncJulepApi: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : typing.Optional[str] - The base url to use for requests from the client. - - environment : JulepApiEnvironment - The environment to use for requests from the client. from .environment import JulepApiEnvironment - - - - Defaults to JulepApiEnvironment.DEFAULT - - - - auth_key : str - api_key : str - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 300 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.AsyncClient] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - Examples - -------- - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - """ - - def __init__( - self, - *, - base_url: typing.Optional[str] = None, - environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, - auth_key: str, - api_key: str, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.AsyncClient] = None, - ): - _defaulted_timeout = ( - timeout if timeout is not None else 300 if httpx_client is None else None - ) - self._client_wrapper = AsyncClientWrapper( - base_url=_get_base_url(base_url=base_url, environment=environment), - auth_key=auth_key, - api_key=api_key, - httpx_client=( - httpx_client - if httpx_client is not None - else ( - httpx.AsyncClient( - timeout=_defaulted_timeout, follow_redirects=follow_redirects - ) - if follow_redirects is not None - else httpx.AsyncClient(timeout=_defaulted_timeout) - ) - ), - timeout=_defaulted_timeout, - ) - - async def agents_route_list( - self, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsRouteListRequestSortBy, - direction: AgentsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsRouteListResponse: - """ - List Agents (paginated) - - Parameters - ---------- - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentsRouteListRequestSortBy - Sort by a field - - direction : AgentsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AgentsRouteListResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "agents", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agents_route_create( - self, - *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsCreateAgentRequestInstructions, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsCreateAgentRequestDefaultSettings - ] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create a new Agent - - Parameters - ---------- - name : CommonIdentifierSafeUnicode - Name of the agent - - about : str - About the agent - - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) - - instructions : AgentsCreateAgentRequestInstructions - Instructions for the agent - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_route_create( - name="name", - about="about", - model="model", - instructions="instructions", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "agents", - method="POST", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agents_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> AgentsAgent: - """ - Get an Agent by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AgentsAgent - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_route_get( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agents_route_create_or_update( - self, - id: CommonUuid, - *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsUpdateAgentRequestInstructions, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsUpdateAgentRequestDefaultSettings - ] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Create or update an Agent - - Parameters - ---------- - id : CommonUuid - - name : CommonIdentifierSafeUnicode - Name of the agent - - about : str - About the agent - - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) - - instructions : AgentsUpdateAgentRequestInstructions - Instructions for the agent - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_route_create_or_update( - id="id", - name="name", - about="about", - model="model", - instructions="instructions", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="POST", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agents_route_update( - self, - id: CommonUuid, - *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsUpdateAgentRequestInstructions, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsUpdateAgentRequestDefaultSettings - ] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - name : CommonIdentifierSafeUnicode - Name of the agent - - about : str - About the agent - - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) - - instructions : AgentsUpdateAgentRequestInstructions - Instructions for the agent - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_route_update( - id="id", - name="name", - about="about", - model="model", - instructions="instructions", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="PUT", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agents_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete Agent by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_route_delete( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agents_route_patch( - self, - id: CommonUuid, - *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, - about: typing.Optional[str] = OMIT, - model: typing.Optional[str] = OMIT, - instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, - default_settings: typing.Optional[ - AgentsPatchAgentRequestDefaultSettings - ] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing Agent by id (merges with existing values) - - Parameters - ---------- - id : CommonUuid - ID of the resource - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - name : typing.Optional[CommonIdentifierSafeUnicode] - Name of the agent - - about : typing.Optional[str] - About the agent - - model : typing.Optional[str] - Model name to use (gpt-4-turbo, gemini-nano etc) - - instructions : typing.Optional[AgentsPatchAgentRequestInstructions] - Instructions for the agent - - default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] - Default settings for all sessions created by this agent - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_route_patch( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}", - method="PATCH", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agent_docs_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentDocsRouteListRequestSortBy, - direction: AgentDocsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> AgentDocsRouteListResponse: - """ - List Docs owned by an Agent - - Parameters - ---------- - id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentDocsRouteListRequestSortBy - Sort by a field - - direction : AgentDocsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AgentDocsRouteListResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agent_docs_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/docs", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agents_docs_search_route_search( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsDocsSearchRouteSearchRequestSortBy, - direction: AgentsDocsSearchRouteSearchRequestDirection, - metadata_filter: str, - body: DocsDocSearchRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsDocsSearchRouteSearchResponse: - """ - Search Docs owned by an Agent - - Parameters - ---------- - id : CommonUuid - ID of the parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentsDocsSearchRouteSearchRequestSortBy - Sort by a field - - direction : AgentsDocsSearchRouteSearchRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - body : DocsDocSearchRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AgentsDocsSearchRouteSearchResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep import DocsDocSearchRequest_Vector - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agents_docs_search_route_search( - id="string", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="string", - body=DocsDocSearchRequest_Vector( - text="string", - vector=[1.1], - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/search", - method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - json={"body": body}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tasks_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: TasksRouteListRequestSortBy, - direction: TasksRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteListResponse: - """ - List tasks (paginated) - - Parameters - ---------- - id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : TasksRouteListRequestSortBy - Sort by a field - - direction : TasksRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TasksRouteListResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tasks_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tasks_route_create( - self, - id: CommonUuid, - *, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create a new task - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - name : str - - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. - - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. - - Examples - -------- - import asyncio - - from julep import ToolsCreateToolRequest - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tasks_route_create( - id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", - method="POST", - json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tasks_route_update( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing task (overwrite existing values) - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated - - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. - - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep import ToolsCreateToolRequest - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tasks_route_update( - id="id", - child_id="child_id", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="PUT", - json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tasks_route_delete( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceDeletedResponse: - """ - Delete a task by its id - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be deleted - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tasks_route_delete( - id="id", - child_id="child_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tasks_route_patch( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.Sequence[TasksWorkflowStep]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.Sequence[ToolsCreateToolRequest]] = OMIT, - inherit_tools: typing.Optional[bool] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing task (merges with existing values) - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be patched - - description : typing.Optional[str] - - main : typing.Optional[typing.Sequence[TasksWorkflowStep]] - The entrypoint of the task. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - tools : typing.Optional[typing.Sequence[ToolsCreateToolRequest]] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : typing.Optional[bool] - Whether to inherit tools from the parent agent or not. Defaults to true. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tasks_route_patch( - id="id", - child_id="child_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="PATCH", - json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agent_tools_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentToolsRouteListRequestSortBy, - direction: AgentToolsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> AgentToolsRouteListResponse: - """ - List tools of the given agent - - Parameters - ---------- - id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : AgentToolsRouteListRequestSortBy - Sort by a field - - direction : AgentToolsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AgentToolsRouteListResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agent_tools_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agent_tools_route_create( - self, - id: CommonUuid, - *, - name: CommonIdentifierSafeUnicode, - about: str, - model: str, - instructions: AgentsCreateAgentRequestInstructions, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - default_settings: typing.Optional[ - AgentsCreateAgentRequestDefaultSettings - ] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create a new tool for this agent - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - name : CommonIdentifierSafeUnicode - Name of the agent - - about : str - About the agent - - model : str - Model name to use (gpt-4-turbo, gemini-nano etc) - - instructions : AgentsCreateAgentRequestInstructions - Instructions for the agent - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] - Default settings for all sessions created by this agent - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agent_tools_route_create( - id="id", - name="name", - about="about", - model="model", - instructions="instructions", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools", - method="POST", - json={ - "metadata": metadata, - "name": name, - "about": about, - "model": model, - "instructions": instructions, - "default_settings": default_settings, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agent_tools_route_update( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - type: ToolsToolType, - name: CommonValidPythonIdentifier, - function: typing.Optional[ToolsFunctionDef] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing tool (overwrite existing values) - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated - - type : ToolsToolType - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : CommonValidPythonIdentifier - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDef] - - integration : typing.Optional[typing.Any] - - system : typing.Optional[typing.Any] - - api_call : typing.Optional[typing.Any] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agent_tools_route_update( - id="id", - child_id="child_id", - type="function", - name="name", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", - method="PUT", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agent_tools_route_delete( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceDeletedResponse: - """ - Delete an existing tool by id - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be deleted - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agent_tools_route_delete( - id="id", - child_id="child_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def agent_tools_route_patch( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - type: typing.Optional[ToolsToolType] = OMIT, - name: typing.Optional[CommonValidPythonIdentifier] = OMIT, - function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, - integration: typing.Optional[typing.Any] = OMIT, - system: typing.Optional[typing.Any] = OMIT, - api_call: typing.Optional[typing.Any] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Update an existing tool (merges with existing values) - - Parameters - ---------- - id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be patched - - type : typing.Optional[ToolsToolType] - Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - - name : typing.Optional[CommonValidPythonIdentifier] - Name of the tool (must be unique for this agent and a valid python identifier string ) - - function : typing.Optional[ToolsFunctionDefUpdate] - - integration : typing.Optional[typing.Any] - - system : typing.Optional[typing.Any] - - api_call : typing.Optional[typing.Any] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.agent_tools_route_patch( - id="id", - child_id="child_id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", - method="PATCH", - json={ - "type": type, - "name": name, - "function": function, - "integration": integration, - "system": system, - "api_call": api_call, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def tasks_create_or_update_route_create_or_update( - self, - parent_id: CommonUuid, - id: CommonUuid, - *, - name: str, - description: str, - main: typing.Sequence[TasksWorkflowStep], - tools: typing.Sequence[ToolsCreateToolRequest], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: - """ - Create or update a task - - Parameters - ---------- - parent_id : CommonUuid - ID of parent resource - - id : CommonUuid - - name : str - - description : str - - main : typing.Sequence[TasksWorkflowStep] - The entrypoint of the task. - - tools : typing.Sequence[ToolsCreateToolRequest] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceUpdatedResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep import ToolsCreateToolRequest - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.tasks_create_or_update_route_create_or_update( - parent_id="parent_id", - id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(parent_id)}/tasks/{jsonable_encoder(id)}", - method="POST", - json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def individual_docs_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> DocsDoc: - """ - Get Doc by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DocsDoc - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.individual_docs_route_get( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def individual_docs_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete an existing Doc by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.individual_docs_route_delete( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def embed_route_embed( - self, - *, - body: DocsEmbedQueryRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> DocsEmbedQueryResponse: - """ - Embed a query for search - - Parameters - ---------- - body : DocsEmbedQueryRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - DocsEmbedQueryResponse - The request has succeeded. - - Examples - -------- - import asyncio - - from julep import DocsEmbedQueryRequest - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.embed_route_embed( - body=DocsEmbedQueryRequest( - text="text", - ), - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "embed", - method="POST", - json={"body": body}, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def executions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ExecutionsExecution: - """ - Get an Execution by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ExecutionsExecution - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.executions_route_get( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def execution_transitions_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: ExecutionTransitionsRouteListRequestSortBy, - direction: ExecutionTransitionsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionTransitionsRouteListResponse: - """ - List the Transitions of an Execution by id + List Docs owned by a User Parameters ---------- @@ -5570,10 +1415,10 @@ async def execution_transitions_route_list( offset : CommonOffset Offset the items returned - sort_by : ExecutionTransitionsRouteListRequestSortBy + sort_by : UserDocsRouteListRequestSortBy Sort by a field - direction : ExecutionTransitionsRouteListRequestDirection + direction : UserDocsRouteListRequestDirection Sort direction metadata_filter : str @@ -5584,36 +1429,28 @@ async def execution_transitions_route_list( Returns ------- - ExecutionTransitionsRouteListResponse + UserDocsRouteListResponse The request has succeeded. Examples -------- - import asyncio - - from julep.client import AsyncJulepApi + from julep.client import JulepApi - client = AsyncJulepApi( + client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - - - async def main() -> None: - await client.execution_transitions_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - - - asyncio.run(main()) + client.user_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) """ - _response = await self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}/transitions", + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}/docs", method="GET", params={ "limit": limit, @@ -5626,129 +1463,84 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def job_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> JobsJobStatus: - """ - Get the status of an existing Job by its id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - JobsJobStatus - The request has succeeded. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.job_route_get( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"jobs/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_list( + def user_docs_search_route_search( self, + id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: SessionsRouteListRequestSortBy, - direction: SessionsRouteListRequestDirection, + sort_by: UserDocsSearchRouteSearchRequestSortBy, + direction: UserDocsSearchRouteSearchRequestDirection, metadata_filter: str, + body: UserDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, - ) -> SessionsRouteListResponse: + ) -> UserDocsSearchRouteSearchResponse: """ - List sessions (paginated) + Search Docs owned by a User Parameters ---------- + id : CommonUuid + ID of the parent + limit : CommonLimit Limit the number of items returned offset : CommonOffset Offset the items returned - sort_by : SessionsRouteListRequestSortBy + sort_by : UserDocsSearchRouteSearchRequestSortBy Sort by a field - direction : SessionsRouteListRequestDirection + direction : UserDocsSearchRouteSearchRequestDirection Sort direction metadata_filter : str JSON string of object that should be used to filter objects by metadata + body : UserDocsSearchRouteSearchRequestBody + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsRouteListResponse + UserDocsSearchRouteSearchResponse The request has succeeded. Examples -------- - import asyncio - - from julep.client import AsyncJulepApi + from julep import DocsVectorDocSearchRequest + from julep.client import JulepApi - client = AsyncJulepApi( + client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - - - async def main() -> None: - await client.sessions_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - - - asyncio.run(main()) + client.user_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), + ) """ - _response = await self._client_wrapper.httpx_client.request( - "sessions", - method="GET", + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}/search", + method="POST", params={ "limit": limit, "offset": offset, @@ -5756,130 +1548,130 @@ async def main() -> None: "direction": direction, "metadata_filter": metadata_filter, }, + json={"body": body}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_create( - self, - *, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: - """ - Create a new session - Parameters - ---------- - situation : str - A specific situation that sets the background for this session +class AsyncJulepApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - render_templates : bool - Render system and assistant message content as jinja templates + Parameters + ---------- + base_url : typing.Optional[str] + The base url to use for requests from the client. - user : typing.Optional[CommonUuid] - User ID of user associated with this session + environment : JulepApiEnvironment + The environment to use for requests from the client. from .environment import JulepApiEnvironment - users : typing.Optional[typing.Sequence[CommonUuid]] - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session - agents : typing.Optional[typing.Sequence[CommonUuid]] + Defaults to JulepApiEnvironment.DEFAULT - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow - metadata : typing.Optional[typing.Dict[str, typing.Any]] + auth_key : str + api_key : str + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 300 seconds, unless a custom httpx client is used, in which case this default is not enforced. - request_options : typing.Optional[RequestOptions] - Request-specific configuration. + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - Returns - ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - Examples - -------- - import asyncio + Examples + -------- + from julep.client import AsyncJulepApi - from julep.client import AsyncJulepApi + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + """ - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", + def __init__( + self, + *, + base_url: typing.Optional[str] = None, + environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, + auth_key: str, + api_key: str, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.AsyncClient] = None, + ): + _defaulted_timeout = ( + timeout if timeout is not None else 300 if httpx_client is None else None ) - - - async def main() -> None: - await client.sessions_route_create( - situation="situation", - render_templates=True, - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "sessions", - method="POST", - json={ - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, - }, - request_options=request_options, - omit=OMIT, + self._client_wrapper = AsyncClientWrapper( + base_url=_get_base_url(base_url=base_url, environment=environment), + auth_key=auth_key, + api_key=api_key, + httpx_client=( + httpx_client + if httpx_client is not None + else ( + httpx.AsyncClient( + timeout=_defaulted_timeout, follow_redirects=follow_redirects + ) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout) + ) + ), + timeout=_defaulted_timeout, ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> SessionsSession: + async def agent_docs_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentDocsRouteListRequestSortBy, + direction: AgentDocsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentDocsRouteListResponse: """ - Get a session by id + List Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of the resource + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : AgentDocsRouteListRequestSortBy + Sort by a field + + direction : AgentDocsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - SessionsSession + AgentDocsRouteListResponse The request has succeeded. Examples @@ -5895,84 +1687,88 @@ async def sessions_route_get( async def main() -> None: - await client.sessions_route_get( - id="string", + await client.agent_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/docs", method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_create_or_update( + async def agents_docs_search_route_search( self, id: CommonUuid, *, - situation: str, - render_templates: bool, - user: typing.Optional[CommonUuid] = OMIT, - users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - agent: typing.Optional[CommonUuid] = OMIT, - agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsDocsSearchRouteSearchRequestSortBy, + direction: AgentsDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: AgentsDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> AgentsDocsSearchRouteSearchResponse: """ - Create or update a session + Search Docs owned by an Agent Parameters ---------- id : CommonUuid + ID of the parent - situation : str - A specific situation that sets the background for this session - - render_templates : bool - Render system and assistant message content as jinja templates - - user : typing.Optional[CommonUuid] - User ID of user associated with this session - - users : typing.Optional[typing.Sequence[CommonUuid]] + limit : CommonLimit + Limit the number of items returned - agent : typing.Optional[CommonUuid] - Agent ID of agent associated with this session + offset : CommonOffset + Offset the items returned - agents : typing.Optional[typing.Sequence[CommonUuid]] + sort_by : AgentsDocsSearchRouteSearchRequestSortBy + Sort by a field - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + direction : AgentsDocsSearchRouteSearchRequestDirection + Sort direction - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - metadata : typing.Optional[typing.Dict[str, typing.Any]] + body : AgentsDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + AgentsDocsSearchRouteSearchResponse The request has succeeded. Examples -------- import asyncio + from julep import DocsVectorDocSearchRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -5982,79 +1778,86 @@ async def sessions_route_create_or_update( async def main() -> None: - await client.sessions_route_create_or_update( + await client.agents_docs_search_route_search( id="id", - situation="situation", - render_templates=True, + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/search", method="POST", - json={ - "user": user, - "users": users, - "agent": agent, - "agents": agents, - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, + json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_update( + async def tasks_route_list( self, id: CommonUuid, *, - situation: str, - render_templates: bool, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> TasksRouteListResponse: """ - Update an existing session by its id (overwrites all existing values) + List tasks (paginated) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent - situation : str - A specific situation that sets the background for this session + limit : CommonLimit + Limit the number of items returned - render_templates : bool - Render system and assistant message content as jinja templates + offset : CommonOffset + Offset the items returned - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + sort_by : TasksRouteListRequestSortBy + Sort by a field - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + direction : TasksRouteListRequestDirection + Sort direction - metadata : typing.Optional[typing.Dict[str, typing.Any]] + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + TasksRouteListResponse The request has succeeded. Examples @@ -6070,59 +1873,90 @@ async def sessions_route_update( async def main() -> None: - await client.sessions_route_update( + await client.tasks_route_list( id="id", - situation="situation", - render_templates=True, + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PUT", - json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, - "metadata": metadata, + f"agents/{jsonable_encoder(id)}/tasks", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + async def tasks_route_create( + self, + id: CommonUuid, + *, + name: str, + description: str, + main: typing.Sequence[TasksCreateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: """ - Delete a session by its id + Create a new task Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + name : str + + description : str + + main : typing.Sequence[TasksCreateTaskRequestMainItem] + The entrypoint of the task. + + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- import asyncio + from julep import TasksEvaluateStep, TasksTaskTool from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -6132,56 +1966,87 @@ async def sessions_route_delete( async def main() -> None: - await client.sessions_route_delete( + await client.tasks_route_create( id="id", + name="name", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="DELETE", + f"agents/{jsonable_encoder(id)}/tasks", + method="POST", + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def sessions_route_patch( + async def tasks_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - situation: typing.Optional[str] = OMIT, - render_templates: typing.Optional[bool] = OMIT, - token_budget: typing.Optional[int] = OMIT, - context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + description: str, + main: typing.Sequence[TasksUpdateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing session by its id (merges with existing values) + Update an existing task (overwrite existing values) Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + child_id : CommonUuid + ID of the resource to be updated - situation : typing.Optional[str] - A specific situation that sets the background for this session + description : str + + main : typing.Sequence[TasksUpdateTaskRequestMainItem] + The entrypoint of the task. - render_templates : typing.Optional[bool] - Render system and assistant message content as jinja templates + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. - token_budget : typing.Optional[int] - Threshold value for the adaptive context functionality + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - context_overflow : typing.Optional[SessionsContextOverflowType] - Action to start on context window overflow + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -6197,6 +2062,7 @@ async def sessions_route_patch( -------- import asyncio + from julep import TasksEvaluateStep, TasksTaskTool from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -6206,21 +2072,36 @@ async def sessions_route_patch( async def main() -> None: - await client.sessions_route_patch( + await client.tasks_route_update( id="id", + child_id="child_id", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}", - method="PATCH", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PUT", json={ - "situation": situation, - "render_templates": render_templates, - "token_budget": token_budget, - "context_overflow": context_overflow, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, "metadata": metadata, }, request_options=request_options, @@ -6234,36 +2115,36 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def chat_route_generate( + async def tasks_route_delete( self, id: CommonUuid, + child_id: CommonUuid, *, - request: ChatRouteGenerateRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> ChatRouteGenerateResponse: + ) -> CommonResourceDeletedResponse: """ - Generate a response from the model + Delete a task by its id Parameters ---------- id : CommonUuid - The session ID + ID of parent resource - request : ChatRouteGenerateRequest + child_id : CommonUuid + ID of the resource to be deleted request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ChatRouteGenerateResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- import asyncio - from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -6273,80 +2154,73 @@ async def chat_route_generate( async def main() -> None: - await client.chat_route_generate( + await client.tasks_route_delete( id="id", - request=ChatRouteGenerateRequestPreset( - messages=[ - EntriesInputChatMlMessage( - role="user", - content="content", - ) - ], - recall=True, - remember=True, - save=True, - stream=True, - ), + child_id="child_id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/chat", - method="POST", - json=request, + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_list( + async def tasks_route_patch( self, id: CommonUuid, + child_id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.Sequence[TasksTaskTool]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - Get history of a Session (paginated) + Update an existing task (merges with existing values) Parameters ---------- id : CommonUuid - ID of parent + ID of parent resource - limit : CommonLimit - Limit the number of items returned + child_id : CommonUuid + ID of the resource to be patched - offset : CommonOffset - Offset the items returned + description : typing.Optional[str] - sort_by : HistoryRouteListRequestSortBy - Sort by a field + main : typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] + The entrypoint of the task. - direction : HistoryRouteListRequestDirection - Sort direction + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + tools : typing.Optional[typing.Sequence[TasksTaskTool]] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -6362,43 +2236,41 @@ async def history_route_list( async def main() -> None: - await client.history_route_list( + await client.tasks_route_patch( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + child_id="child_id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_delete( + async def individual_docs_route_get( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + ) -> DocsDoc: """ - Clear the history of a Session (resets the Session) + Get Doc by id Parameters ---------- @@ -6410,8 +2282,8 @@ async def history_route_delete( Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + DocsDoc + The request has succeeded. Examples -------- @@ -6426,7 +2298,7 @@ async def history_route_delete( async def main() -> None: - await client.history_route_delete( + await client.individual_docs_route_get( id="id", ) @@ -6434,59 +2306,36 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="DELETE", + f"docs/{jsonable_encoder(id)}", + method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: TaskExecutionsRouteListRequestSortBy, - direction: TaskExecutionsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteListResponse: + async def individual_docs_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - List executions of the given task + Delete an existing Doc by id Parameters ---------- id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : TaskExecutionsRouteListRequestSortBy - Sort by a field - - direction : TaskExecutionsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TaskExecutionsRouteListResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -6501,66 +2350,44 @@ async def task_executions_route_list( async def main() -> None: - await client.task_executions_route_list( + await client.individual_docs_route_delete( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, + f"docs/{jsonable_encoder(id)}", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_create( - self, - id: CommonUuid, - *, - input: typing.Dict[str, typing.Any], - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + async def executions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExecutionsExecution: """ - Create an execution for the given task + Get an Execution by id Parameters ---------- id : CommonUuid - ID of parent resource - - input : typing.Dict[str, typing.Any] - The input to the execution - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + ExecutionsExecution + The request has succeeded. Examples -------- @@ -6575,57 +2402,66 @@ async def task_executions_route_create( async def main() -> None: - await client.task_executions_route_create( + await client.executions_route_get( id="id", - input={"key": "value"}, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", - method="POST", - json={"input": input, "metadata": metadata}, + f"executions/{jsonable_encoder(id)}", + method="GET", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_resume_with_task_token( + async def execution_transitions_route_list( self, id: CommonUuid, *, - task_token: str, - input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> ExecutionTransitionsRouteListResponse: """ - Resume an execution with a task token + List the Transitions of an Execution by id Parameters ---------- id : CommonUuid - ID of parent Task + ID of parent - task_token : str - A Task Token is a unique identifier for a specific Task Execution. + limit : CommonLimit + Limit the number of items returned - input : typing.Optional[typing.Dict[str, typing.Any]] - The input to resume the execution with + offset : CommonOffset + Offset the items returned + + sort_by : ExecutionTransitionsRouteListRequestSortBy + Sort by a field + + direction : ExecutionTransitionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + ExecutionTransitionsRouteListResponse The request has succeeded. Examples @@ -6641,63 +2477,68 @@ async def task_executions_route_resume_with_task_token( async def main() -> None: - await client.task_executions_route_resume_with_task_token( + await client.execution_transitions_route_list( id="id", - task_token="task_token", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", - method="PUT", - json={"task_token": task_token, "input": input, "status": "running"}, + f"executions/{jsonable_encoder(id)}/transitions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_update( + async def chat_route_generate( self, id: CommonUuid, - child_id: CommonUuid, *, - request: ExecutionsUpdateExecutionRequest, + request: ChatRouteGenerateRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> ChatRouteGenerateResponse: """ - Update an existing Execution + Generate a response from the model Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated + The session ID - request : ExecutionsUpdateExecutionRequest + request : ChatRouteGenerateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + ChatRouteGenerateResponse The request has succeeded. Examples -------- import asyncio - from julep import ExecutionsUpdateExecutionRequest_Cancelled + from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -6707,11 +2548,19 @@ async def task_executions_route_update( async def main() -> None: - await client.task_executions_route_update( - id="string", - child_id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", + await client.chat_route_generate( + id="id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, ), ) @@ -6719,45 +2568,49 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", - method="PUT", + f"sessions/{jsonable_encoder(id)}/chat", + method="POST", json=request, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_list( + async def history_route_list( self, + id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: UsersRouteListRequestSortBy, - direction: UsersRouteListRequestDirection, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> UsersRouteListResponse: + ) -> HistoryRouteListResponse: """ - List users (paginated) + Get history of a Session (paginated) Parameters ---------- + id : CommonUuid + ID of parent + limit : CommonLimit Limit the number of items returned offset : CommonOffset Offset the items returned - sort_by : UsersRouteListRequestSortBy + sort_by : HistoryRouteListRequestSortBy Sort by a field - direction : UsersRouteListRequestDirection + direction : HistoryRouteListRequestDirection Sort direction metadata_filter : str @@ -6768,7 +2621,7 @@ async def users_route_list( Returns ------- - UsersRouteListResponse + HistoryRouteListResponse The request has succeeded. Examples @@ -6784,7 +2637,8 @@ async def users_route_list( async def main() -> None: - await client.users_route_list( + await client.history_route_list( + id="id", limit=1, offset=1, sort_by="created_at", @@ -6796,7 +2650,7 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "users", + f"sessions/{jsonable_encoder(id)}/history", method="GET", params={ "limit": limit, @@ -6809,40 +2663,30 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_create( - self, - *, - name: CommonIdentifierSafeUnicode, - about: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + async def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Create a new user + Clear the history of a Session (resets the Session) Parameters ---------- - name : CommonIdentifierSafeUnicode - Name of the user - - about : str - About the user - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + id : CommonUuid + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -6857,46 +2701,66 @@ async def users_route_create( async def main() -> None: - await client.users_route_create( - name="name", - about="about", + await client.history_route_delete( + id="id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "users", - method="POST", - json={"metadata": metadata, "name": name, "about": about}, + f"sessions/{jsonable_encoder(id)}/history", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> UsersUser: + async def task_executions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TaskExecutionsRouteListRequestSortBy, + direction: TaskExecutionsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> TaskExecutionsRouteListResponse: """ - Get a user by id + List executions of the given task Parameters ---------- id : CommonUuid - ID of the resource + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : TaskExecutionsRouteListRequestSortBy + Sort by a field + + direction : TaskExecutionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - UsersUser + TaskExecutionsRouteListResponse The request has succeeded. Examples @@ -6912,47 +2776,56 @@ async def users_route_get( async def main() -> None: - await client.users_route_get( + await client.task_executions_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", + f"tasks/{jsonable_encoder(id)}/executions", method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_create_or_update( + async def task_executions_route_create( self, id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, + input: typing.Dict[str, typing.Any], metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> CommonResourceCreatedResponse: """ - Create or update a user + Create an execution for the given task Parameters ---------- id : CommonUuid + ID of parent resource - name : CommonIdentifierSafeUnicode - Name of the user - - about : str - About the user + input : typing.Dict[str, typing.Any] + The input to the execution metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -6961,8 +2834,8 @@ async def users_route_create_or_update( Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- @@ -6977,54 +2850,50 @@ async def users_route_create_or_update( async def main() -> None: - await client.users_route_create_or_update( + await client.task_executions_route_create( id="id", - name="name", - about="about", + input={"key": "value"}, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", + f"tasks/{jsonable_encoder(id)}/executions", method="POST", - json={"metadata": metadata, "name": name, "about": about}, + json={"input": input, "metadata": metadata}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_update( + async def task_executions_route_resume_with_task_token( self, id: CommonUuid, *, - name: CommonIdentifierSafeUnicode, - about: str, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + task_token: str, + input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing user by id (overwrite existing values) + Resume an execution with a task token Parameters ---------- id : CommonUuid - ID of the resource - - name : CommonIdentifierSafeUnicode - Name of the user + ID of parent Task - about : str - About the user + task_token : str + A Task Token is a unique identifier for a specific Task Execution. - metadata : typing.Optional[typing.Dict[str, typing.Any]] + input : typing.Optional[typing.Dict[str, typing.Any]] + The input to resume the execution with request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -7047,19 +2916,18 @@ async def users_route_update( async def main() -> None: - await client.users_route_update( + await client.task_executions_route_resume_with_task_token( id="id", - name="name", - about="about", + task_token="task_token", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", + f"tasks/{jsonable_encoder(id)}/executions", method="PUT", - json={"metadata": metadata, "name": name, "about": about}, + json={"task_token": task_token, "input": input, "status": "running"}, request_options=request_options, omit=OMIT, ) @@ -7071,82 +2939,26 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def users_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: - """ - Delete a user by id - - Parameters - ---------- - id : CommonUuid - ID of the resource - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. - - Examples - -------- - import asyncio - - from julep.client import AsyncJulepApi - - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.users_route_delete( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - async def users_route_patch( + async def task_executions_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, - about: typing.Optional[str] = OMIT, + request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing user by id (merge with existing values) + Update an existing Execution Parameters ---------- id : CommonUuid - ID of the resource - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of parent resource - name : typing.Optional[CommonIdentifierSafeUnicode] - Name of the user + child_id : CommonUuid + ID of the resource to be updated - about : typing.Optional[str] - About the user + request : ExecutionsUpdateExecutionRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -7160,6 +2972,7 @@ async def users_route_patch( -------- import asyncio + from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -7169,17 +2982,21 @@ async def users_route_patch( async def main() -> None: - await client.users_route_patch( - id="id", + await client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}", - method="PATCH", - json={"metadata": metadata, "name": name, "about": about}, + f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", + method="PUT", + json=request, request_options=request_options, omit=OMIT, ) @@ -7287,7 +3104,7 @@ async def user_docs_search_route_search( sort_by: UserDocsSearchRouteSearchRequestSortBy, direction: UserDocsSearchRouteSearchRequestDirection, metadata_filter: str, - body: DocsDocSearchRequest, + body: UserDocsSearchRouteSearchRequestBody, request_options: typing.Optional[RequestOptions] = None, ) -> UserDocsSearchRouteSearchResponse: """ @@ -7313,7 +3130,7 @@ async def user_docs_search_route_search( metadata_filter : str JSON string of object that should be used to filter objects by metadata - body : DocsDocSearchRequest + body : UserDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -7327,7 +3144,7 @@ async def user_docs_search_route_search( -------- import asyncio - from julep import DocsDocSearchRequest_Vector + from julep import DocsVectorDocSearchRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -7338,15 +3155,13 @@ async def user_docs_search_route_search( async def main() -> None: await client.user_docs_search_route_search( - id="string", + id="id", limit=1, offset=1, sort_by="created_at", direction="asc", - metadata_filter="string", - body=DocsDocSearchRequest_Vector( - text="string", - vector=[1.1], + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( confidence=1.1, alpha=1.1, mmr=True, diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index 84b18b9d1..d442e909d 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -1,5 +1,5 @@ # Reference -
client.agents_route_list(...) +
client.agent_docs_route_list(...)
@@ -11,7 +11,7 @@
-List Agents (paginated) +List Docs owned by an Agent
@@ -32,7 +32,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_list( +client.agent_docs_route_list( + id="id", limit=1, offset=1, sort_by="created_at", @@ -54,6 +55,14 @@ client.agents_route_list(
+**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ **limit:** `CommonLimit` — Limit the number of items returned
@@ -70,7 +79,7 @@ client.agents_route_list(
-**sort_by:** `AgentsRouteListRequestSortBy` — Sort by a field +**sort_by:** `AgentDocsRouteListRequestSortBy` — Sort by a field
@@ -78,7 +87,7 @@ client.agents_route_list(
-**direction:** `AgentsRouteListRequestDirection` — Sort direction +**direction:** `AgentDocsRouteListRequestDirection` — Sort direction
@@ -106,7 +115,7 @@ client.agents_route_list(
-
client.agents_route_create(...) +
client.agents_docs_search_route_search(...)
@@ -118,7 +127,7 @@ client.agents_route_list(
-Create a new Agent +Search Docs owned by an Agent
@@ -133,17 +142,26 @@ Create a new Agent
```python +from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_create( - name="name", - about="about", - model="model", - instructions="instructions", +client.agents_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), ) ``` @@ -160,7 +178,15 @@ client.agents_route_create(
-**name:** `CommonIdentifierSafeUnicode` — Name of the agent +**id:** `CommonUuid` — ID of the parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned
@@ -168,7 +194,7 @@ client.agents_route_create(
-**about:** `str` — About the agent +**offset:** `CommonOffset` — Offset the items returned
@@ -176,7 +202,7 @@ client.agents_route_create(
-**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) +**sort_by:** `AgentsDocsSearchRouteSearchRequestSortBy` — Sort by a field
@@ -184,7 +210,7 @@ client.agents_route_create(
-**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent +**direction:** `AgentsDocsSearchRouteSearchRequestDirection` — Sort direction
@@ -192,7 +218,7 @@ client.agents_route_create(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -200,7 +226,7 @@ client.agents_route_create(
-**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent +**body:** `AgentsDocsSearchRouteSearchRequestBody`
@@ -220,7 +246,7 @@ client.agents_route_create(
-
client.agents_route_get(...) +
client.tasks_route_list(...)
@@ -232,7 +258,7 @@ client.agents_route_create(
-Get an Agent by id +List tasks (paginated)
@@ -253,8 +279,13 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_get( +client.tasks_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -271,7 +302,47 @@ client.agents_route_get(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `TasksRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `TasksRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -291,7 +362,7 @@ client.agents_route_get(
-
client.agents_route_create_or_update(...) +
client.tasks_route_create(...)
@@ -303,7 +374,7 @@ client.agents_route_get(
-Create or update an Agent +Create a new task
@@ -318,18 +389,29 @@ Create or update an Agent
```python +from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_create_or_update( +client.tasks_route_create( id="id", name="name", - about="about", - model="model", - instructions="instructions", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) ``` @@ -346,7 +428,7 @@ client.agents_route_create_or_update(
-**id:** `CommonUuid` +**id:** `CommonUuid` — ID of parent resource
@@ -354,7 +436,7 @@ client.agents_route_create_or_update(
-**name:** `CommonIdentifierSafeUnicode` — Name of the agent +**name:** `str`
@@ -362,7 +444,7 @@ client.agents_route_create_or_update(
-**about:** `str` — About the agent +**description:** `str`
@@ -370,7 +452,7 @@ client.agents_route_create_or_update(
-**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) +**main:** `typing.Sequence[TasksCreateTaskRequestMainItem]` — The entrypoint of the task.
@@ -378,7 +460,7 @@ client.agents_route_create_or_update(
-**instructions:** `AgentsUpdateAgentRequestInstructions` — Instructions for the agent +**tools:** `typing.Sequence[TasksTaskTool]` — Tools defined specifically for this task not included in the Agent itself.
@@ -386,7 +468,15 @@ client.agents_route_create_or_update(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid.
@@ -394,7 +484,7 @@ client.agents_route_create_or_update(
-**default_settings:** `typing.Optional[AgentsUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -414,7 +504,7 @@ client.agents_route_create_or_update(
-
client.agents_route_update(...) +
client.tasks_route_update(...)
@@ -426,7 +516,7 @@ client.agents_route_create_or_update(
-Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) +Update an existing task (overwrite existing values)
@@ -441,18 +531,29 @@ Update an existing Agent by id (overwrites existing values; use PATCH for mergin
```python +from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_update( +client.tasks_route_update( id="id", - name="name", - about="about", - model="model", - instructions="instructions", + child_id="child_id", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) ``` @@ -469,7 +570,7 @@ client.agents_route_update(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent resource
@@ -477,7 +578,7 @@ client.agents_route_update(
-**name:** `CommonIdentifierSafeUnicode` — Name of the agent +**child_id:** `CommonUuid` — ID of the resource to be updated
@@ -485,7 +586,7 @@ client.agents_route_update(
-**about:** `str` — About the agent +**description:** `str`
@@ -493,7 +594,7 @@ client.agents_route_update(
-**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) +**main:** `typing.Sequence[TasksUpdateTaskRequestMainItem]` — The entrypoint of the task.
@@ -501,7 +602,7 @@ client.agents_route_update(
-**instructions:** `AgentsUpdateAgentRequestInstructions` — Instructions for the agent +**tools:** `typing.Sequence[TasksTaskTool]` — Tools defined specifically for this task not included in the Agent itself.
@@ -509,7 +610,15 @@ client.agents_route_update(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid.
@@ -517,7 +626,7 @@ client.agents_route_update(
-**default_settings:** `typing.Optional[AgentsUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -537,7 +646,7 @@ client.agents_route_update(
-
client.agents_route_delete(...) +
client.tasks_route_delete(...)
@@ -549,7 +658,7 @@ client.agents_route_update(
-Delete Agent by id +Delete a task by its id
@@ -570,8 +679,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_delete( +client.tasks_route_delete( id="id", + child_id="child_id", ) ``` @@ -588,7 +698,15 @@ client.agents_route_delete(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be deleted
@@ -608,7 +726,7 @@ client.agents_route_delete(
-
client.agents_route_patch(...) +
client.tasks_route_patch(...)
@@ -620,7 +738,7 @@ client.agents_route_delete(
-Update an existing Agent by id (merges with existing values) +Update an existing task (merges with existing values)
@@ -641,8 +759,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_route_patch( +client.tasks_route_patch( id="id", + child_id="child_id", ) ``` @@ -659,7 +778,7 @@ client.agents_route_patch(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent resource
@@ -667,7 +786,15 @@ client.agents_route_patch(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**child_id:** `CommonUuid` — ID of the resource to be patched + +
+
+ +
+
+ +**description:** `typing.Optional[str]`
@@ -675,7 +802,7 @@ client.agents_route_patch(
-**name:** `typing.Optional[CommonIdentifierSafeUnicode]` — Name of the agent +**main:** `typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]]` — The entrypoint of the task.
@@ -683,7 +810,7 @@ client.agents_route_patch(
-**about:** `typing.Optional[str]` — About the agent +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid.
@@ -691,7 +818,7 @@ client.agents_route_patch(
-**model:** `typing.Optional[str]` — Model name to use (gpt-4-turbo, gemini-nano etc) +**tools:** `typing.Optional[typing.Sequence[TasksTaskTool]]` — Tools defined specifically for this task not included in the Agent itself.
@@ -699,7 +826,7 @@ client.agents_route_patch(
-**instructions:** `typing.Optional[AgentsPatchAgentRequestInstructions]` — Instructions for the agent +**inherit_tools:** `typing.Optional[bool]` — Whether to inherit tools from the parent agent or not. Defaults to true.
@@ -707,7 +834,7 @@ client.agents_route_patch(
-**default_settings:** `typing.Optional[AgentsPatchAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -727,7 +854,7 @@ client.agents_route_patch(
-
client.agent_docs_route_list(...) +
client.individual_docs_route_get(...)
@@ -739,7 +866,7 @@ client.agents_route_patch(
-List Docs owned by an Agent +Get Doc by id
@@ -760,13 +887,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agent_docs_route_list( +client.individual_docs_route_get( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) ``` @@ -783,47 +905,7 @@ client.agent_docs_route_list(
-**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `AgentDocsRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `AgentDocsRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**id:** `CommonUuid` — ID of the resource
@@ -843,7 +925,7 @@ client.agent_docs_route_list(
-
client.agents_docs_search_route_search(...) +
client.individual_docs_route_delete(...)
@@ -855,7 +937,7 @@ client.agent_docs_route_list(
-Search Docs owned by an Agent +Delete an existing Doc by id
@@ -870,28 +952,14 @@ Search Docs owned by an Agent
```python -from julep import DocsDocSearchRequest_Vector from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_docs_search_route_search( - id="string", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="string", - body=DocsDocSearchRequest_Vector( - text="string", - vector=[1.1], - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), +client.individual_docs_route_delete( + id="id", ) ``` @@ -908,3090 +976,7 @@ client.agents_docs_search_route_search(
-**id:** `CommonUuid` — ID of the parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `AgentsDocsSearchRouteSearchRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `AgentsDocsSearchRouteSearchRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- -**body:** `DocsDocSearchRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - - -
-
- -
client.tasks_route_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -List tasks (paginated) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.tasks_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `TasksRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `TasksRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.tasks_route_create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a new task -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep import ToolsCreateToolRequest -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.tasks_route_create( - id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**name:** `str` - -
-
- -
-
- -**description:** `str` - -
-
- -
-
- -**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. - -
-
- -
-
- -**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. - -
-
- -
-
- -**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. - -
-
- -
-
- -**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.tasks_route_update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update an existing task (overwrite existing values) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep import ToolsCreateToolRequest -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.tasks_route_update( - id="id", - child_id="child_id", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be updated - -
-
- -
-
- -**description:** `str` - -
-
- -
-
- -**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. - -
-
- -
-
- -**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. - -
-
- -
-
- -**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. - -
-
- -
-
- -**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.tasks_route_delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a task by its id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.tasks_route_delete( - id="id", - child_id="child_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be deleted - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.tasks_route_patch(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update an existing task (merges with existing values) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.tasks_route_patch( - id="id", - child_id="child_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be patched - -
-
- -
-
- -**description:** `typing.Optional[str]` - -
-
- -
-
- -**main:** `typing.Optional[typing.Sequence[TasksWorkflowStep]]` — The entrypoint of the task. - -
-
- -
-
- -**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. - -
-
- -
-
- -**tools:** `typing.Optional[typing.Sequence[ToolsCreateToolRequest]]` — Tools defined specifically for this task not included in the Agent itself. - -
-
- -
-
- -**inherit_tools:** `typing.Optional[bool]` — Whether to inherit tools from the parent agent or not. Defaults to true. - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.agent_tools_route_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -List tools of the given agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.agent_tools_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `AgentToolsRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `AgentToolsRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.agent_tools_route_create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a new tool for this agent -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.agent_tools_route_create( - id="id", - name="name", - about="about", - model="model", - instructions="instructions", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**name:** `CommonIdentifierSafeUnicode` — Name of the agent - -
-
- -
-
- -**about:** `str` — About the agent - -
-
- -
-
- -**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) - -
-
- -
-
- -**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.agent_tools_route_update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update an existing tool (overwrite existing values) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.agent_tools_route_update( - id="id", - child_id="child_id", - type="function", - name="name", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be updated - -
-
- -
-
- -**type:** `ToolsToolType` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - -
-
- -
-
- -**name:** `CommonValidPythonIdentifier` — Name of the tool (must be unique for this agent and a valid python identifier string ) - -
-
- -
-
- -**function:** `typing.Optional[ToolsFunctionDef]` - -
-
- -
-
- -**integration:** `typing.Optional[typing.Any]` - -
-
- -
-
- -**system:** `typing.Optional[typing.Any]` - -
-
- -
-
- -**api_call:** `typing.Optional[typing.Any]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.agent_tools_route_delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete an existing tool by id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.agent_tools_route_delete( - id="id", - child_id="child_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be deleted - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.agent_tools_route_patch(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update an existing tool (merges with existing values) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.agent_tools_route_patch( - id="id", - child_id="child_id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be patched - -
-
- -
-
- -**type:** `typing.Optional[ToolsToolType]` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - -
-
- -
-
- -**name:** `typing.Optional[CommonValidPythonIdentifier]` — Name of the tool (must be unique for this agent and a valid python identifier string ) - -
-
- -
-
- -**function:** `typing.Optional[ToolsFunctionDefUpdate]` - -
-
- -
-
- -**integration:** `typing.Optional[typing.Any]` - -
-
- -
-
- -**system:** `typing.Optional[typing.Any]` - -
-
- -
-
- -**api_call:** `typing.Optional[typing.Any]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.tasks_create_or_update_route_create_or_update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create or update a task -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep import ToolsCreateToolRequest -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.tasks_create_or_update_route_create_or_update( - parent_id="parent_id", - id="id", - name="name", - description="description", - main=[], - tools=[ - ToolsCreateToolRequest( - type="function", - name="name", - ) - ], - inherit_tools=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**parent_id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**id:** `CommonUuid` - -
-
- -
-
- -**name:** `str` - -
-
- -
-
- -**description:** `str` - -
-
- -
-
- -**main:** `typing.Sequence[TasksWorkflowStep]` — The entrypoint of the task. - -
-
- -
-
- -**tools:** `typing.Sequence[ToolsCreateToolRequest]` — Tools defined specifically for this task not included in the Agent itself. - -
-
- -
-
- -**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. - -
-
- -
-
- -**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.individual_docs_route_get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get Doc by id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.individual_docs_route_get( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.individual_docs_route_delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete an existing Doc by id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.individual_docs_route_delete( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.embed_route_embed(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Embed a query for search -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep import DocsEmbedQueryRequest -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.embed_route_embed( - body=DocsEmbedQueryRequest( - text="text", - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**body:** `DocsEmbedQueryRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.executions_route_get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get an Execution by id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.executions_route_get( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.execution_transitions_route_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -List the Transitions of an Execution by id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.execution_transitions_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `ExecutionTransitionsRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `ExecutionTransitionsRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.job_route_get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get the status of an existing Job by its id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.job_route_get( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions_route_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -List sessions (paginated) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.sessions_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `SessionsRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `SessionsRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions_route_create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create a new session -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.sessions_route_create( - situation="situation", - render_templates=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**situation:** `str` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `bool` — Render system and assistant message content as jinja templates - -
-
- -
-
- -**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session - -
-
- -
-
- -**users:** `typing.Optional[typing.Sequence[CommonUuid]]` - -
-
- -
-
- -**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session - -
-
- -
-
- -**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` - -
-
- -
-
- -**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality - -
-
- -
-
- -**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions_route_get(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get a session by id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.sessions_route_get( - id="string", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions_route_create_or_update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create or update a session -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.sessions_route_create_or_update( - id="id", - situation="situation", - render_templates=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` - -
-
- -
-
- -**situation:** `str` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `bool` — Render system and assistant message content as jinja templates - -
-
- -
-
- -**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session - -
-
- -
-
- -**users:** `typing.Optional[typing.Sequence[CommonUuid]]` - -
-
- -
-
- -**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session - -
-
- -
-
- -**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` - -
-
- -
-
- -**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality - -
-
- -
-
- -**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions_route_update(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update an existing session by its id (overwrites all existing values) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.sessions_route_update( - id="id", - situation="situation", - render_templates=True, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**situation:** `str` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `bool` — Render system and assistant message content as jinja templates - -
-
- -
-
- -**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality - -
-
- -
-
- -**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions_route_delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Delete a session by its id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.sessions_route_delete( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions_route_patch(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Update an existing session by its id (merges with existing values) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.sessions_route_patch( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**situation:** `typing.Optional[str]` — A specific situation that sets the background for this session - -
-
- -
-
- -**render_templates:** `typing.Optional[bool]` — Render system and assistant message content as jinja templates - -
-
- -
-
- -**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality - -
-
- -
-
- -**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.chat_route_generate(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Generate a response from the model -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.chat_route_generate( - id="id", - request=ChatRouteGenerateRequestPreset( - messages=[ - EntriesInputChatMlMessage( - role="user", - content="content", - ) - ], - recall=True, - remember=True, - save=True, - stream=True, - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — The session ID - -
-
- -
-
- -**request:** `ChatRouteGenerateRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.history_route_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get history of a Session (paginated) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `HistoryRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.history_route_delete(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Clear the history of a Session (resets the Session) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.history_route_delete( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.task_executions_route_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -List executions of the given task -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.task_executions_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `TaskExecutionsRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `TaskExecutionsRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.task_executions_route_create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Create an execution for the given task -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from julep.client import JulepApi - -client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) -client.task_executions_route_create( - id="id", - input={"key": "value"}, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**input:** `typing.Dict[str, typing.Any]` — The input to the execution - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**id:** `CommonUuid` — ID of the resource
@@ -4011,7 +996,7 @@ client.task_executions_route_create(
-
client.task_executions_route_resume_with_task_token(...) +
client.executions_route_get(...)
@@ -4023,7 +1008,7 @@ client.task_executions_route_create(
-Resume an execution with a task token +Get an Execution by id
@@ -4044,9 +1029,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_resume_with_task_token( +client.executions_route_get( id="id", - task_token="task_token", ) ``` @@ -4063,23 +1047,7 @@ client.task_executions_route_resume_with_task_token(
-**id:** `CommonUuid` — ID of parent Task - -
-
- -
-
- -**task_token:** `str` — A Task Token is a unique identifier for a specific Task Execution. - -
-
- -
-
- -**input:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input to resume the execution with +**id:** `CommonUuid` — ID of the resource
@@ -4099,7 +1067,7 @@ client.task_executions_route_resume_with_task_token(
-
client.task_executions_route_update(...) +
client.execution_transitions_route_list(...)
@@ -4111,7 +1079,7 @@ client.task_executions_route_resume_with_task_token(
-Update an existing Execution +List the Transitions of an Execution by id
@@ -4126,19 +1094,19 @@ Update an existing Execution
```python -from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_update( - id="string", - child_id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), +client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -4155,7 +1123,7 @@ client.task_executions_route_update(
-**id:** `CommonUuid` — ID of parent resource +**id:** `CommonUuid` — ID of parent
@@ -4163,7 +1131,7 @@ client.task_executions_route_update(
-**child_id:** `CommonUuid` — ID of the resource to be updated +**limit:** `CommonLimit` — Limit the number of items returned
@@ -4171,7 +1139,31 @@ client.task_executions_route_update(
-**request:** `ExecutionsUpdateExecutionRequest` +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `ExecutionTransitionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `ExecutionTransitionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -4191,7 +1183,7 @@ client.task_executions_route_update(
-
client.users_route_list(...) +
client.chat_route_generate(...)
@@ -4203,7 +1195,7 @@ client.task_executions_route_update(
-List users (paginated) +Generate a response from the model
@@ -4218,18 +1210,27 @@ List users (paginated)
```python +from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_list( - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", +client.chat_route_generate( + id="id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), ) ``` @@ -4246,31 +1247,7 @@ client.users_route_list(
-**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `UsersRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `UsersRouteListRequestDirection` — Sort direction +**id:** `CommonUuid` — The session ID
@@ -4278,7 +1255,7 @@ client.users_route_list(
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**request:** `ChatRouteGenerateRequest`
@@ -4298,7 +1275,7 @@ client.users_route_list(
-
client.users_route_create(...) +
client.history_route_list(...)
@@ -4310,7 +1287,7 @@ client.users_route_list(
-Create a new user +Get history of a Session (paginated)
@@ -4331,9 +1308,13 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_create( - name="name", - about="about", +client.history_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -4350,7 +1331,7 @@ client.users_route_create(
-**name:** `CommonIdentifierSafeUnicode` — Name of the user +**id:** `CommonUuid` — ID of parent
@@ -4358,7 +1339,7 @@ client.users_route_create(
-**about:** `str` — About the user +**limit:** `CommonLimit` — Limit the number of items returned
@@ -4366,7 +1347,31 @@ client.users_route_create(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `HistoryRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -4386,7 +1391,7 @@ client.users_route_create(
-
client.users_route_get(...) +
client.history_route_delete(...)
@@ -4398,7 +1403,7 @@ client.users_route_create(
-Get a user by id +Clear the history of a Session (resets the Session)
@@ -4419,7 +1424,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_get( +client.history_route_delete( id="id", ) @@ -4457,7 +1462,7 @@ client.users_route_get(
-
client.users_route_create_or_update(...) +
client.task_executions_route_list(...)
@@ -4469,7 +1474,7 @@ client.users_route_get(
-Create or update a user +List executions of the given task
@@ -4490,10 +1495,13 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_create_or_update( +client.task_executions_route_list( id="id", - name="name", - about="about", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -4510,7 +1518,7 @@ client.users_route_create_or_update(
-**id:** `CommonUuid` +**id:** `CommonUuid` — ID of parent
@@ -4518,7 +1526,7 @@ client.users_route_create_or_update(
-**name:** `CommonIdentifierSafeUnicode` — Name of the user +**limit:** `CommonLimit` — Limit the number of items returned
@@ -4526,7 +1534,7 @@ client.users_route_create_or_update(
-**about:** `str` — About the user +**offset:** `CommonOffset` — Offset the items returned
@@ -4534,7 +1542,23 @@ client.users_route_create_or_update(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**sort_by:** `TaskExecutionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `TaskExecutionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -4554,7 +1578,7 @@ client.users_route_create_or_update(
-
client.users_route_update(...) +
client.task_executions_route_create(...)
@@ -4566,7 +1590,7 @@ client.users_route_create_or_update(
-Update an existing user by id (overwrite existing values) +Create an execution for the given task
@@ -4587,10 +1611,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_update( +client.task_executions_route_create( id="id", - name="name", - about="about", + input={"key": "value"}, ) ``` @@ -4607,15 +1630,7 @@ client.users_route_update(
-**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**name:** `CommonIdentifierSafeUnicode` — Name of the user +**id:** `CommonUuid` — ID of parent resource
@@ -4623,7 +1638,7 @@ client.users_route_update(
-**about:** `str` — About the user +**input:** `typing.Dict[str, typing.Any]` — The input to the execution
@@ -4651,7 +1666,7 @@ client.users_route_update(
-
client.users_route_delete(...) +
client.task_executions_route_resume_with_task_token(...)
@@ -4663,7 +1678,7 @@ client.users_route_update(
-Delete a user by id +Resume an execution with a task token
@@ -4684,8 +1699,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_delete( +client.task_executions_route_resume_with_task_token( id="id", + task_token="task_token", ) ``` @@ -4702,7 +1718,23 @@ client.users_route_delete(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent Task + +
+
+ +
+
+ +**task_token:** `str` — A Task Token is a unique identifier for a specific Task Execution. + +
+
+ +
+
+ +**input:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input to resume the execution with
@@ -4722,7 +1754,7 @@ client.users_route_delete(
-
client.users_route_patch(...) +
client.task_executions_route_update(...)
@@ -4734,7 +1766,7 @@ client.users_route_delete(
-Update an existing user by id (merge with existing values) +Update an existing Execution
@@ -4749,14 +1781,19 @@ Update an existing user by id (merge with existing values)
```python +from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.users_route_patch( - id="id", +client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), ) ``` @@ -4773,15 +1810,7 @@ client.users_route_patch(
-**id:** `CommonUuid` — ID of the resource - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**id:** `CommonUuid` — ID of parent resource
@@ -4789,7 +1818,7 @@ client.users_route_patch(
-**name:** `typing.Optional[CommonIdentifierSafeUnicode]` — Name of the user +**child_id:** `CommonUuid` — ID of the resource to be updated
@@ -4797,7 +1826,7 @@ client.users_route_patch(
-**about:** `typing.Optional[str]` — About the user +**request:** `ExecutionsUpdateExecutionRequest`
@@ -4960,7 +1989,7 @@ Search Docs owned by a User
```python -from julep import DocsDocSearchRequest_Vector +from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( @@ -4968,15 +1997,13 @@ client = JulepApi( api_key="YOUR_API_KEY", ) client.user_docs_search_route_search( - id="string", + id="id", limit=1, offset=1, sort_by="created_at", direction="asc", - metadata_filter="string", - body=DocsDocSearchRequest_Vector( - text="string", - vector=[1.1], + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( confidence=1.1, alpha=1.1, mmr=True, @@ -5046,7 +2073,7 @@ client.user_docs_search_route_search(
-**body:** `DocsDocSearchRequest` +**body:** `UserDocsSearchRouteSearchRequestBody`
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index d8b836a4b..7f926084b 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -3,20 +3,8 @@ from .agent_docs_route_list_request_direction import AgentDocsRouteListRequestDirection from .agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy from .agent_docs_route_list_response import AgentDocsRouteListResponse -from .agent_tools_route_list_request_direction import ( - AgentToolsRouteListRequestDirection, -) -from .agent_tools_route_list_request_sort_by import AgentToolsRouteListRequestSortBy -from .agent_tools_route_list_response import AgentToolsRouteListResponse -from .agents_agent import AgentsAgent -from .agents_agent_default_settings import AgentsAgentDefaultSettings -from .agents_agent_instructions import AgentsAgentInstructions -from .agents_create_agent_request import AgentsCreateAgentRequest -from .agents_create_agent_request_default_settings import ( - AgentsCreateAgentRequestDefaultSettings, -) -from .agents_create_agent_request_instructions import ( - AgentsCreateAgentRequestInstructions, +from .agents_docs_search_route_search_request_body import ( + AgentsDocsSearchRouteSearchRequestBody, ) from .agents_docs_search_route_search_request_direction import ( AgentsDocsSearchRouteSearchRequestDirection, @@ -27,20 +15,6 @@ from .agents_docs_search_route_search_response import ( AgentsDocsSearchRouteSearchResponse, ) -from .agents_patch_agent_request_default_settings import ( - AgentsPatchAgentRequestDefaultSettings, -) -from .agents_patch_agent_request_instructions import AgentsPatchAgentRequestInstructions -from .agents_route_list_request_direction import AgentsRouteListRequestDirection -from .agents_route_list_request_sort_by import AgentsRouteListRequestSortBy -from .agents_route_list_response import AgentsRouteListResponse -from .agents_update_agent_request import AgentsUpdateAgentRequest -from .agents_update_agent_request_default_settings import ( - AgentsUpdateAgentRequestDefaultSettings, -) -from .agents_update_agent_request_instructions import ( - AgentsUpdateAgentRequestInstructions, -) from .chat_base_chat_output import ChatBaseChatOutput from .chat_base_chat_response import ChatBaseChatResponse from .chat_base_token_log_prob import ChatBaseTokenLogProb @@ -51,11 +25,9 @@ from .chat_completion_response_format_type import ChatCompletionResponseFormatType from .chat_finish_reason import ChatFinishReason from .chat_generation_preset import ChatGenerationPreset -from .chat_generation_preset_settings import ChatGenerationPresetSettings from .chat_log_prob_response import ChatLogProbResponse from .chat_message_chat_response import ChatMessageChatResponse from .chat_multiple_chat_output import ChatMultipleChatOutput -from .chat_open_ai_settings import ChatOpenAiSettings from .chat_route_generate_request import ChatRouteGenerateRequest from .chat_route_generate_request_agent import ChatRouteGenerateRequestAgent from .chat_route_generate_request_agent_tool_choice import ( @@ -74,7 +46,6 @@ from .chat_route_generate_response import ChatRouteGenerateResponse from .chat_single_chat_output import ChatSingleChatOutput from .chat_token_log_prob import ChatTokenLogProb -from .chat_v_llm_settings import ChatVLlmSettings from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_limit import CommonLimit from .common_logit_bias import CommonLogitBias @@ -86,22 +57,12 @@ from .common_tool_ref import CommonToolRef from .common_uuid import CommonUuid from .common_valid_python_identifier import CommonValidPythonIdentifier +from .docs_base_doc_search_request import DocsBaseDocSearchRequest from .docs_doc import DocsDoc from .docs_doc_content import DocsDocContent from .docs_doc_owner import DocsDocOwner from .docs_doc_owner_role import DocsDocOwnerRole from .docs_doc_reference import DocsDocReference -from .docs_doc_search_request import ( - DocsDocSearchRequest, - DocsDocSearchRequest_Hybrid, - DocsDocSearchRequest_Text, - DocsDocSearchRequest_Vector, -) -from .docs_doc_search_request_text import DocsDocSearchRequestText -from .docs_doc_search_request_vector import DocsDocSearchRequestVector -from .docs_embed_query_request import DocsEmbedQueryRequest -from .docs_embed_query_request_text import DocsEmbedQueryRequestText -from .docs_embed_query_response import DocsEmbedQueryResponse from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector @@ -109,10 +70,6 @@ from .docs_text_only_doc_search_request_text import DocsTextOnlyDocSearchRequestText from .docs_vector_doc_search_request import DocsVectorDocSearchRequest from .docs_vector_doc_search_request_vector import DocsVectorDocSearchRequestVector -from .entries_base_chat_ml_content_part import ( - EntriesBaseChatMlContentPart, - EntriesBaseChatMlContentPart_ImageUrl, -) from .entries_chat_ml_image_content_part import EntriesChatMlImageContentPart from .entries_chat_ml_message import EntriesChatMlMessage from .entries_chat_ml_message_content import EntriesChatMlMessageContent @@ -169,34 +126,6 @@ from .history_route_list_request_direction import HistoryRouteListRequestDirection from .history_route_list_request_sort_by import HistoryRouteListRequestSortBy from .history_route_list_response import HistoryRouteListResponse -from .jobs_job_state import JobsJobState -from .jobs_job_status import JobsJobStatus -from .sessions_context_overflow_type import SessionsContextOverflowType -from .sessions_create_session_request import SessionsCreateSessionRequest -from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession -from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession -from .sessions_multi_agent_single_user_session import ( - SessionsMultiAgentSingleUserSession, -) -from .sessions_route_list_request_direction import SessionsRouteListRequestDirection -from .sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy -from .sessions_route_list_response import SessionsRouteListResponse -from .sessions_session import ( - SessionsSession, - SessionsSession_MultiAgentMultiUser, - SessionsSession_MultiAgentNoUser, - SessionsSession_MultiAgentSingleUser, - SessionsSession_SingleAgentMultiUser, - SessionsSession_SingleAgentNoUser, - SessionsSession_SingleAgentSingleUser, -) -from .sessions_single_agent_multi_user_session import ( - SessionsSingleAgentMultiUserSession, -) -from .sessions_single_agent_no_user_session import SessionsSingleAgentNoUserSession -from .sessions_single_agent_single_user_session import ( - SessionsSingleAgentSingleUserSession, -) from .task_executions_route_list_request_direction import ( TaskExecutionsRouteListRequestDirection, ) @@ -204,10 +133,13 @@ TaskExecutionsRouteListRequestSortBy, ) from .task_executions_route_list_response import TaskExecutionsRouteListResponse -from .tasks_create_task_request import TasksCreateTaskRequest +from .tasks_create_task_request_main_item import TasksCreateTaskRequestMainItem from .tasks_error_workflow_step import TasksErrorWorkflowStep from .tasks_evaluate_step import TasksEvaluateStep from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep +from .tasks_if_else_workflow_step_else import TasksIfElseWorkflowStepElse +from .tasks_if_else_workflow_step_then import TasksIfElseWorkflowStepThen +from .tasks_patch_task_request_main_item import TasksPatchTaskRequestMainItem from .tasks_prompt_step import TasksPromptStep from .tasks_prompt_step_prompt import TasksPromptStepPrompt from .tasks_prompt_step_settings import TasksPromptStepSettings @@ -220,23 +152,15 @@ from .tasks_route_list_request_sort_by import TasksRouteListRequestSortBy from .tasks_route_list_response import TasksRouteListResponse from .tasks_task import TasksTask +from .tasks_task_main_item import TasksTaskMainItem +from .tasks_task_tool import TasksTaskTool from .tasks_tool_call_step import TasksToolCallStep -from .tasks_workflow_step import ( - TasksWorkflowStep, - TasksWorkflowStep_Error, - TasksWorkflowStep_Evaluate, - TasksWorkflowStep_IfElse, - TasksWorkflowStep_Prompt, - TasksWorkflowStep_ToolCall, - TasksWorkflowStep_Yield, -) +from .tasks_update_task_request_main_item import TasksUpdateTaskRequestMainItem from .tasks_yield_step import TasksYieldStep from .tools_chosen_function_call import ToolsChosenFunctionCall from .tools_chosen_tool_call import ToolsChosenToolCall, ToolsChosenToolCall_Function -from .tools_create_tool_request import ToolsCreateToolRequest from .tools_function_call_option import ToolsFunctionCallOption from .tools_function_def import ToolsFunctionDef -from .tools_function_def_update import ToolsFunctionDefUpdate from .tools_function_tool import ToolsFunctionTool from .tools_named_function_choice import ToolsNamedFunctionChoice from .tools_named_tool_choice import ToolsNamedToolChoice, ToolsNamedToolChoice_Function @@ -246,6 +170,9 @@ from .user_docs_route_list_request_direction import UserDocsRouteListRequestDirection from .user_docs_route_list_request_sort_by import UserDocsRouteListRequestSortBy from .user_docs_route_list_response import UserDocsRouteListResponse +from .user_docs_search_route_search_request_body import ( + UserDocsSearchRouteSearchRequestBody, +) from .user_docs_search_route_search_request_direction import ( UserDocsSearchRouteSearchRequestDirection, ) @@ -253,36 +180,15 @@ UserDocsSearchRouteSearchRequestSortBy, ) from .user_docs_search_route_search_response import UserDocsSearchRouteSearchResponse -from .users_route_list_request_direction import UsersRouteListRequestDirection -from .users_route_list_request_sort_by import UsersRouteListRequestSortBy -from .users_route_list_response import UsersRouteListResponse -from .users_update_user_request import UsersUpdateUserRequest -from .users_user import UsersUser __all__ = [ "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", - "AgentToolsRouteListRequestDirection", - "AgentToolsRouteListRequestSortBy", - "AgentToolsRouteListResponse", - "AgentsAgent", - "AgentsAgentDefaultSettings", - "AgentsAgentInstructions", - "AgentsCreateAgentRequest", - "AgentsCreateAgentRequestDefaultSettings", - "AgentsCreateAgentRequestInstructions", + "AgentsDocsSearchRouteSearchRequestBody", "AgentsDocsSearchRouteSearchRequestDirection", "AgentsDocsSearchRouteSearchRequestSortBy", "AgentsDocsSearchRouteSearchResponse", - "AgentsPatchAgentRequestDefaultSettings", - "AgentsPatchAgentRequestInstructions", - "AgentsRouteListRequestDirection", - "AgentsRouteListRequestSortBy", - "AgentsRouteListResponse", - "AgentsUpdateAgentRequest", - "AgentsUpdateAgentRequestDefaultSettings", - "AgentsUpdateAgentRequestInstructions", "ChatBaseChatOutput", "ChatBaseChatResponse", "ChatBaseTokenLogProb", @@ -293,11 +199,9 @@ "ChatCompletionResponseFormatType", "ChatFinishReason", "ChatGenerationPreset", - "ChatGenerationPresetSettings", "ChatLogProbResponse", "ChatMessageChatResponse", "ChatMultipleChatOutput", - "ChatOpenAiSettings", "ChatRouteGenerateRequest", "ChatRouteGenerateRequestAgent", "ChatRouteGenerateRequestAgentToolChoice", @@ -308,7 +212,6 @@ "ChatRouteGenerateResponse", "ChatSingleChatOutput", "ChatTokenLogProb", - "ChatVLlmSettings", "CommonIdentifierSafeUnicode", "CommonLimit", "CommonLogitBias", @@ -320,20 +223,12 @@ "CommonToolRef", "CommonUuid", "CommonValidPythonIdentifier", + "DocsBaseDocSearchRequest", "DocsDoc", "DocsDocContent", "DocsDocOwner", "DocsDocOwnerRole", "DocsDocReference", - "DocsDocSearchRequest", - "DocsDocSearchRequestText", - "DocsDocSearchRequestVector", - "DocsDocSearchRequest_Hybrid", - "DocsDocSearchRequest_Text", - "DocsDocSearchRequest_Vector", - "DocsEmbedQueryRequest", - "DocsEmbedQueryRequestText", - "DocsEmbedQueryResponse", "DocsHybridDocSearchRequest", "DocsHybridDocSearchRequestText", "DocsHybridDocSearchRequestVector", @@ -341,8 +236,6 @@ "DocsTextOnlyDocSearchRequestText", "DocsVectorDocSearchRequest", "DocsVectorDocSearchRequestVector", - "EntriesBaseChatMlContentPart", - "EntriesBaseChatMlContentPart_ImageUrl", "EntriesChatMlImageContentPart", "EntriesChatMlMessage", "EntriesChatMlMessageContent", @@ -383,33 +276,16 @@ "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", - "JobsJobState", - "JobsJobStatus", - "SessionsContextOverflowType", - "SessionsCreateSessionRequest", - "SessionsMultiAgentMultiUserSession", - "SessionsMultiAgentNoUserSession", - "SessionsMultiAgentSingleUserSession", - "SessionsRouteListRequestDirection", - "SessionsRouteListRequestSortBy", - "SessionsRouteListResponse", - "SessionsSession", - "SessionsSession_MultiAgentMultiUser", - "SessionsSession_MultiAgentNoUser", - "SessionsSession_MultiAgentSingleUser", - "SessionsSession_SingleAgentMultiUser", - "SessionsSession_SingleAgentNoUser", - "SessionsSession_SingleAgentSingleUser", - "SessionsSingleAgentMultiUserSession", - "SessionsSingleAgentNoUserSession", - "SessionsSingleAgentSingleUserSession", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", - "TasksCreateTaskRequest", + "TasksCreateTaskRequestMainItem", "TasksErrorWorkflowStep", "TasksEvaluateStep", "TasksIfElseWorkflowStep", + "TasksIfElseWorkflowStepElse", + "TasksIfElseWorkflowStepThen", + "TasksPatchTaskRequestMainItem", "TasksPromptStep", "TasksPromptStepPrompt", "TasksPromptStepSettings", @@ -420,22 +296,16 @@ "TasksRouteListRequestSortBy", "TasksRouteListResponse", "TasksTask", + "TasksTaskMainItem", + "TasksTaskTool", "TasksToolCallStep", - "TasksWorkflowStep", - "TasksWorkflowStep_Error", - "TasksWorkflowStep_Evaluate", - "TasksWorkflowStep_IfElse", - "TasksWorkflowStep_Prompt", - "TasksWorkflowStep_ToolCall", - "TasksWorkflowStep_Yield", + "TasksUpdateTaskRequestMainItem", "TasksYieldStep", "ToolsChosenFunctionCall", "ToolsChosenToolCall", "ToolsChosenToolCall_Function", - "ToolsCreateToolRequest", "ToolsFunctionCallOption", "ToolsFunctionDef", - "ToolsFunctionDefUpdate", "ToolsFunctionTool", "ToolsNamedFunctionChoice", "ToolsNamedToolChoice", @@ -447,12 +317,8 @@ "UserDocsRouteListRequestDirection", "UserDocsRouteListRequestSortBy", "UserDocsRouteListResponse", + "UserDocsSearchRouteSearchRequestBody", "UserDocsSearchRouteSearchRequestDirection", "UserDocsSearchRouteSearchRequestSortBy", "UserDocsSearchRouteSearchResponse", - "UsersRouteListRequestDirection", - "UsersRouteListRequestSortBy", - "UsersRouteListResponse", - "UsersUpdateUserRequest", - "UsersUser", ] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py b/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py deleted file mode 100644 index b968f7b7c..000000000 --- a/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentToolsRouteListRequestDirection = typing.Union[ - typing.Literal["asc", "desc"], typing.Any -] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py b/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py deleted file mode 100644 index 5584ba780..000000000 --- a/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentToolsRouteListRequestSortBy = typing.Union[ - typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any -] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_response.py b/sdks/python/julep/api/types/agent_tools_route_list_response.py deleted file mode 100644 index 9e56ed1a1..000000000 --- a/sdks/python/julep/api/types/agent_tools_route_list_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .tools_tool import ToolsTool - - -class AgentToolsRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[ToolsTool] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_agent.py b/sdks/python/julep/api/types/agents_agent.py deleted file mode 100644 index 04827f31f..000000000 --- a/sdks/python/julep/api/types/agents_agent.py +++ /dev/null @@ -1,83 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .agents_agent_default_settings import AgentsAgentDefaultSettings -from .agents_agent_instructions import AgentsAgentInstructions -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid - - -class AgentsAgent(pydantic_v1.BaseModel): - id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the agent - """ - - about: str = pydantic_v1.Field() - """ - About the agent - """ - - model: str = pydantic_v1.Field() - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - - instructions: AgentsAgentInstructions = pydantic_v1.Field() - """ - Instructions for the agent - """ - - default_settings: typing.Optional[AgentsAgentDefaultSettings] = pydantic_v1.Field( - default=None - ) - """ - Default settings for all sessions created by this agent - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_agent_default_settings.py b/sdks/python/julep/api/types/agents_agent_default_settings.py deleted file mode 100644 index 71b82cfc2..000000000 --- a/sdks/python/julep/api/types/agents_agent_default_settings.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_generation_preset_settings import ChatGenerationPresetSettings -from .chat_open_ai_settings import ChatOpenAiSettings -from .chat_v_llm_settings import ChatVLlmSettings - -AgentsAgentDefaultSettings = typing.Union[ - ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings -] diff --git a/sdks/python/julep/api/types/agents_agent_instructions.py b/sdks/python/julep/api/types/agents_agent_instructions.py deleted file mode 100644 index b69d41f6f..000000000 --- a/sdks/python/julep/api/types/agents_agent_instructions.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsAgentInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_create_agent_request.py b/sdks/python/julep/api/types/agents_create_agent_request.py deleted file mode 100644 index 2a545c6dc..000000000 --- a/sdks/python/julep/api/types/agents_create_agent_request.py +++ /dev/null @@ -1,79 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .agents_create_agent_request_default_settings import ( - AgentsCreateAgentRequestDefaultSettings, -) -from .agents_create_agent_request_instructions import ( - AgentsCreateAgentRequestInstructions, -) -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode - - -class AgentsCreateAgentRequest(pydantic_v1.BaseModel): - """ - Payload for creating a agent (and associated documents) - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the agent - """ - - about: str = pydantic_v1.Field() - """ - About the agent - """ - - model: str = pydantic_v1.Field() - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - - instructions: AgentsCreateAgentRequestInstructions = pydantic_v1.Field() - """ - Instructions for the agent - """ - - default_settings: typing.Optional[AgentsCreateAgentRequestDefaultSettings] = ( - pydantic_v1.Field(default=None) - ) - """ - Default settings for all sessions created by this agent - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py deleted file mode 100644 index da2d239bf..000000000 --- a/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_generation_preset_settings import ChatGenerationPresetSettings -from .chat_open_ai_settings import ChatOpenAiSettings -from .chat_v_llm_settings import ChatVLlmSettings - -AgentsCreateAgentRequestDefaultSettings = typing.Union[ - ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings -] diff --git a/sdks/python/julep/api/types/agents_create_agent_request_instructions.py b/sdks/python/julep/api/types/agents_create_agent_request_instructions.py deleted file mode 100644 index 70ec8cac1..000000000 --- a/sdks/python/julep/api/types/agents_create_agent_request_instructions.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsCreateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_docs_search_route_search_request_body.py b/sdks/python/julep/api/types/agents_docs_search_route_search_request_body.py new file mode 100644 index 000000000..1c321d56d --- /dev/null +++ b/sdks/python/julep/api/types/agents_docs_search_route_search_request_body.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest +from .docs_text_only_doc_search_request import DocsTextOnlyDocSearchRequest +from .docs_vector_doc_search_request import DocsVectorDocSearchRequest + +AgentsDocsSearchRouteSearchRequestBody = typing.Union[ + DocsVectorDocSearchRequest, DocsTextOnlyDocSearchRequest, DocsHybridDocSearchRequest +] diff --git a/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py deleted file mode 100644 index 2ce2b4fc3..000000000 --- a/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_generation_preset_settings import ChatGenerationPresetSettings -from .chat_open_ai_settings import ChatOpenAiSettings -from .chat_v_llm_settings import ChatVLlmSettings - -AgentsPatchAgentRequestDefaultSettings = typing.Union[ - ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings -] diff --git a/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py b/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py deleted file mode 100644 index 9df431bc5..000000000 --- a/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsPatchAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_route_list_request_direction.py b/sdks/python/julep/api/types/agents_route_list_request_direction.py deleted file mode 100644 index c2c39fb15..000000000 --- a/sdks/python/julep/api/types/agents_route_list_request_direction.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsRouteListRequestDirection = typing.Union[ - typing.Literal["asc", "desc"], typing.Any -] diff --git a/sdks/python/julep/api/types/agents_route_list_request_sort_by.py b/sdks/python/julep/api/types/agents_route_list_request_sort_by.py deleted file mode 100644 index 88dcc2fcf..000000000 --- a/sdks/python/julep/api/types/agents_route_list_request_sort_by.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsRouteListRequestSortBy = typing.Union[ - typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any -] diff --git a/sdks/python/julep/api/types/agents_route_list_response.py b/sdks/python/julep/api/types/agents_route_list_response.py deleted file mode 100644 index 98362162e..000000000 --- a/sdks/python/julep/api/types/agents_route_list_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .agents_agent import AgentsAgent - - -class AgentsRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[AgentsAgent] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_update_agent_request.py b/sdks/python/julep/api/types/agents_update_agent_request.py deleted file mode 100644 index 1b7a648a7..000000000 --- a/sdks/python/julep/api/types/agents_update_agent_request.py +++ /dev/null @@ -1,79 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .agents_update_agent_request_default_settings import ( - AgentsUpdateAgentRequestDefaultSettings, -) -from .agents_update_agent_request_instructions import ( - AgentsUpdateAgentRequestInstructions, -) -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode - - -class AgentsUpdateAgentRequest(pydantic_v1.BaseModel): - """ - Payload for updating a agent - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the agent - """ - - about: str = pydantic_v1.Field() - """ - About the agent - """ - - model: str = pydantic_v1.Field() - """ - Model name to use (gpt-4-turbo, gemini-nano etc) - """ - - instructions: AgentsUpdateAgentRequestInstructions = pydantic_v1.Field() - """ - Instructions for the agent - """ - - default_settings: typing.Optional[AgentsUpdateAgentRequestDefaultSettings] = ( - pydantic_v1.Field(default=None) - ) - """ - Default settings for all sessions created by this agent - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py deleted file mode 100644 index dc6ff15ab..000000000 --- a/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .chat_generation_preset_settings import ChatGenerationPresetSettings -from .chat_open_ai_settings import ChatOpenAiSettings -from .chat_v_llm_settings import ChatVLlmSettings - -AgentsUpdateAgentRequestDefaultSettings = typing.Union[ - ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings -] diff --git a/sdks/python/julep/api/types/agents_update_agent_request_instructions.py b/sdks/python/julep/api/types/agents_update_agent_request_instructions.py deleted file mode 100644 index aecd60481..000000000 --- a/sdks/python/julep/api/types/agents_update_agent_request_instructions.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -AgentsUpdateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/chat_generation_preset_settings.py b/sdks/python/julep/api/types/chat_generation_preset_settings.py deleted file mode 100644 index 7ce09ceff..000000000 --- a/sdks/python/julep/api/types/chat_generation_preset_settings.py +++ /dev/null @@ -1,46 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .chat_generation_preset import ChatGenerationPreset - - -class ChatGenerationPresetSettings(pydantic_v1.BaseModel): - preset: typing.Optional[ChatGenerationPreset] = pydantic_v1.Field(default=None) - """ - Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_open_ai_settings.py b/sdks/python/julep/api/types/chat_open_ai_settings.py deleted file mode 100644 index 0bb5a0799..000000000 --- a/sdks/python/julep/api/types/chat_open_ai_settings.py +++ /dev/null @@ -1,60 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 - - -class ChatOpenAiSettings(pydantic_v1.BaseModel): - frequency_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) - """ - 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. - """ - - presence_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) - """ - 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. - """ - - temperature: typing.Optional[float] = pydantic_v1.Field(default=None) - """ - 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] = pydantic_v1.Field(default=None) - """ - 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. - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_v_llm_settings.py b/sdks/python/julep/api/types/chat_v_llm_settings.py deleted file mode 100644 index 897c25b2f..000000000 --- a/sdks/python/julep/api/types/chat_v_llm_settings.py +++ /dev/null @@ -1,65 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 - - -class ChatVLlmSettings(pydantic_v1.BaseModel): - repetition_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) - """ - 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. - """ - - length_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) - """ - Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - """ - - temperature: typing.Optional[float] = pydantic_v1.Field(default=None) - """ - 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] = pydantic_v1.Field(default=None) - """ - 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. - """ - - min_p: typing.Optional[float] = pydantic_v1.Field(default=None) - """ - Minimum probability compared to leading token to be considered - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_user.py b/sdks/python/julep/api/types/docs_base_doc_search_request.py similarity index 68% rename from sdks/python/julep/api/types/users_user.py rename to sdks/python/julep/api/types/docs_base_doc_search_request.py index 9b6c519de..f7c1ecfa2 100644 --- a/sdks/python/julep/api/types/users_user.py +++ b/sdks/python/julep/api/types/docs_base_doc_search_request.py @@ -5,31 +5,27 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid -class UsersUser(pydantic_v1.BaseModel): - id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - created_at: dt.datetime = pydantic_v1.Field() +class DocsBaseDocSearchRequest(pydantic_v1.BaseModel): + confidence: float = pydantic_v1.Field() """ - When this resource was created as UTC date-time + The confidence cutoff level """ - updated_at: dt.datetime = pydantic_v1.Field() + alpha: float = pydantic_v1.Field() """ - When this resource was updated as UTC date-time + The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; """ - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + mmr: bool = pydantic_v1.Field() """ - Name of the user + Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. """ - about: str = pydantic_v1.Field() + lang: typing.Literal["en-US"] = pydantic_v1.Field(default="en-US") """ - About the user + The language to be used for text-only search. Support for other languages coming soon. """ def json(self, **kwargs: typing.Any) -> str: diff --git a/sdks/python/julep/api/types/docs_doc_search_request.py b/sdks/python/julep/api/types/docs_doc_search_request.py deleted file mode 100644 index 6b6ef5b85..000000000 --- a/sdks/python/julep/api/types/docs_doc_search_request.py +++ /dev/null @@ -1,190 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .docs_doc_search_request_text import DocsDocSearchRequestText -from .docs_doc_search_request_vector import DocsDocSearchRequestVector -from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText -from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector -from .docs_text_only_doc_search_request_text import DocsTextOnlyDocSearchRequestText -from .docs_vector_doc_search_request_vector import DocsVectorDocSearchRequestVector - - -class Base(pydantic_v1.BaseModel): - text: typing.Optional[DocsDocSearchRequestText] = None - vector: typing.Optional[DocsDocSearchRequestVector] = None - confidence: float = pydantic_v1.Field() - """ - The confidence cutoff level - """ - - alpha: float = pydantic_v1.Field() - """ - The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; - """ - - mmr: bool = pydantic_v1.Field() - """ - Whether to include the MMR algorithm in the search. Optimizes for diversity in search results. - """ - - lang: typing.Literal["en-US"] = pydantic_v1.Field(default="en-US") - """ - The language to be used for text-only search. Support for other languages coming soon. - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class DocsDocSearchRequest_Vector(Base): - vector: DocsVectorDocSearchRequestVector - mode: typing.Literal["vector"] = "vector" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class DocsDocSearchRequest_Text(Base): - text: DocsTextOnlyDocSearchRequestText - mode: typing.Literal["text"] = "text" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class DocsDocSearchRequest_Hybrid(Base): - text: typing.Optional[DocsHybridDocSearchRequestText] = None - vector: typing.Optional[DocsHybridDocSearchRequestVector] = None - mode: typing.Literal["hybrid"] = "hybrid" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -DocsDocSearchRequest = typing.Union[ - DocsDocSearchRequest_Vector, DocsDocSearchRequest_Text, DocsDocSearchRequest_Hybrid -] diff --git a/sdks/python/julep/api/types/docs_doc_search_request_text.py b/sdks/python/julep/api/types/docs_doc_search_request_text.py deleted file mode 100644 index 9eeaec434..000000000 --- a/sdks/python/julep/api/types/docs_doc_search_request_text.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DocsDocSearchRequestText = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/docs_doc_search_request_vector.py b/sdks/python/julep/api/types/docs_doc_search_request_vector.py deleted file mode 100644 index fc8a55e86..000000000 --- a/sdks/python/julep/api/types/docs_doc_search_request_vector.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DocsDocSearchRequestVector = typing.Union[ - typing.List[float], typing.List[typing.List[float]] -] diff --git a/sdks/python/julep/api/types/docs_embed_query_request.py b/sdks/python/julep/api/types/docs_embed_query_request.py deleted file mode 100644 index 21d49b706..000000000 --- a/sdks/python/julep/api/types/docs_embed_query_request.py +++ /dev/null @@ -1,46 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .docs_embed_query_request_text import DocsEmbedQueryRequestText - - -class DocsEmbedQueryRequest(pydantic_v1.BaseModel): - text: DocsEmbedQueryRequestText = pydantic_v1.Field() - """ - Text or texts to embed - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_embed_query_request_text.py b/sdks/python/julep/api/types/docs_embed_query_request_text.py deleted file mode 100644 index 6462dd057..000000000 --- a/sdks/python/julep/api/types/docs_embed_query_request_text.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -DocsEmbedQueryRequestText = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/docs_embed_query_response.py b/sdks/python/julep/api/types/docs_embed_query_response.py deleted file mode 100644 index acf7907ae..000000000 --- a/sdks/python/julep/api/types/docs_embed_query_response.py +++ /dev/null @@ -1,45 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 - - -class DocsEmbedQueryResponse(pydantic_v1.BaseModel): - vectors: typing.List[typing.List[float]] = pydantic_v1.Field() - """ - The embedded vectors - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py index 5413e101b..faaccc53b 100644 --- a/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_hybrid_doc_search_request.py @@ -5,21 +5,18 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .docs_base_doc_search_request import DocsBaseDocSearchRequest from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector -class DocsHybridDocSearchRequest(pydantic_v1.BaseModel): - text: typing.Optional[DocsHybridDocSearchRequestText] = pydantic_v1.Field( - default=None - ) +class DocsHybridDocSearchRequest(DocsBaseDocSearchRequest): + text: DocsHybridDocSearchRequestText = pydantic_v1.Field() """ Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. """ - vector: typing.Optional[DocsHybridDocSearchRequestVector] = pydantic_v1.Field( - default=None - ) + vector: DocsHybridDocSearchRequestVector = pydantic_v1.Field() """ Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. """ @@ -52,5 +49,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + populate_by_name = True extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_text_only_doc_search_request.py b/sdks/python/julep/api/types/docs_text_only_doc_search_request.py index d22329b16..5f43e1b04 100644 --- a/sdks/python/julep/api/types/docs_text_only_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_text_only_doc_search_request.py @@ -5,13 +5,14 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .docs_base_doc_search_request import DocsBaseDocSearchRequest from .docs_text_only_doc_search_request_text import DocsTextOnlyDocSearchRequestText -class DocsTextOnlyDocSearchRequest(pydantic_v1.BaseModel): +class DocsTextOnlyDocSearchRequest(DocsBaseDocSearchRequest): text: DocsTextOnlyDocSearchRequestText = pydantic_v1.Field() """ - Text or texts to use in the search. In `text` search mode, only BM25 is used. + Text or texts to use in the search. """ def json(self, **kwargs: typing.Any) -> str: @@ -42,5 +43,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + populate_by_name = True extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_vector_doc_search_request.py b/sdks/python/julep/api/types/docs_vector_doc_search_request.py index 428b223c3..1401f7535 100644 --- a/sdks/python/julep/api/types/docs_vector_doc_search_request.py +++ b/sdks/python/julep/api/types/docs_vector_doc_search_request.py @@ -5,10 +5,11 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .docs_base_doc_search_request import DocsBaseDocSearchRequest from .docs_vector_doc_search_request_vector import DocsVectorDocSearchRequestVector -class DocsVectorDocSearchRequest(pydantic_v1.BaseModel): +class DocsVectorDocSearchRequest(DocsBaseDocSearchRequest): vector: DocsVectorDocSearchRequestVector = pydantic_v1.Field() """ Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. @@ -42,5 +43,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + populate_by_name = True extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py b/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py deleted file mode 100644 index 26ab046d0..000000000 --- a/sdks/python/julep/api/types/entries_base_chat_ml_content_part.py +++ /dev/null @@ -1,88 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .entries_image_detail import EntriesImageDetail -from .entries_image_url import EntriesImageUrl - - -class Base(pydantic_v1.BaseModel): - text: typing.Optional[str] = None - image_url: typing.Optional[EntriesImageUrl] = None - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class EntriesBaseChatMlContentPart_ImageUrl(Base): - image_url: EntriesImageUrl - type: typing.Literal["image_url"] = "image_url" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -EntriesBaseChatMlContentPart = EntriesBaseChatMlContentPart_ImageUrl diff --git a/sdks/python/julep/api/types/jobs_job_state.py b/sdks/python/julep/api/types/jobs_job_state.py deleted file mode 100644 index 5dbc9903b..000000000 --- a/sdks/python/julep/api/types/jobs_job_state.py +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -JobsJobState = typing.Union[ - typing.Literal[ - "pending", - "in_progress", - "retrying", - "succeeded", - "aborted", - "failed", - "unknown", - ], - typing.Any, -] diff --git a/sdks/python/julep/api/types/jobs_job_status.py b/sdks/python/julep/api/types/jobs_job_status.py deleted file mode 100644 index cc29891d8..000000000 --- a/sdks/python/julep/api/types/jobs_job_status.py +++ /dev/null @@ -1,79 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_uuid import CommonUuid -from .jobs_job_state import JobsJobState - - -class JobsJobStatus(pydantic_v1.BaseModel): - id: CommonUuid - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the job - """ - - reason: str = pydantic_v1.Field() - """ - Reason for the current state of the job - """ - - has_progress: bool = pydantic_v1.Field() - """ - Whether this Job supports progress updates - """ - - progress: float = pydantic_v1.Field() - """ - Progress percentage - """ - - state: JobsJobState = pydantic_v1.Field() - """ - Current state of the job - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_context_overflow_type.py b/sdks/python/julep/api/types/sessions_context_overflow_type.py deleted file mode 100644 index 85006c98b..000000000 --- a/sdks/python/julep/api/types/sessions_context_overflow_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -SessionsContextOverflowType = typing.Union[ - typing.Literal["truncate", "adaptive"], typing.Any -] diff --git a/sdks/python/julep/api/types/sessions_create_session_request.py b/sdks/python/julep/api/types/sessions_create_session_request.py deleted file mode 100644 index e6570309d..000000000 --- a/sdks/python/julep/api/types/sessions_create_session_request.py +++ /dev/null @@ -1,82 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .sessions_context_overflow_type import SessionsContextOverflowType - - -class SessionsCreateSessionRequest(pydantic_v1.BaseModel): - """ - Payload for creating a session - """ - - user: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) - """ - User ID of user associated with this session - """ - - users: typing.Optional[typing.List[CommonUuid]] = None - agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) - """ - Agent ID of agent associated with this session - """ - - agents: typing.Optional[typing.List[CommonUuid]] = None - situation: str = pydantic_v1.Field() - """ - A specific situation that sets the background for this session - """ - - render_templates: bool = pydantic_v1.Field() - """ - Render system and assistant message content as jinja templates - """ - - token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) - """ - Threshold value for the adaptive context functionality - """ - - context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( - default=None - ) - """ - Action to start on context window overflow - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py deleted file mode 100644 index 057c70ebf..000000000 --- a/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsMultiAgentMultiUserSession(pydantic_v1.BaseModel): - agents: typing.List[CommonUuid] - users: typing.List[CommonUuid] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py deleted file mode 100644 index 8814b09f3..000000000 --- a/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsMultiAgentNoUserSession(pydantic_v1.BaseModel): - agents: typing.List[CommonUuid] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py deleted file mode 100644 index cda61b7a1..000000000 --- a/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsMultiAgentSingleUserSession(pydantic_v1.BaseModel): - agents: typing.List[CommonUuid] - user: CommonUuid - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_list_request_direction.py b/sdks/python/julep/api/types/sessions_route_list_request_direction.py deleted file mode 100644 index c419b7e2b..000000000 --- a/sdks/python/julep/api/types/sessions_route_list_request_direction.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -SessionsRouteListRequestDirection = typing.Union[ - typing.Literal["asc", "desc"], typing.Any -] diff --git a/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py b/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py deleted file mode 100644 index add82a7be..000000000 --- a/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -SessionsRouteListRequestSortBy = typing.Union[ - typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any -] diff --git a/sdks/python/julep/api/types/sessions_route_list_response.py b/sdks/python/julep/api/types/sessions_route_list_response.py deleted file mode 100644 index 874d1bd1e..000000000 --- a/sdks/python/julep/api/types/sessions_route_list_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .sessions_session import SessionsSession - - -class SessionsRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[SessionsSession] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_session.py b/sdks/python/julep/api/types/sessions_session.py deleted file mode 100644 index d610040c0..000000000 --- a/sdks/python/julep/api/types/sessions_session.py +++ /dev/null @@ -1,325 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid -from .sessions_context_overflow_type import SessionsContextOverflowType - - -class Base(pydantic_v1.BaseModel): - situation: str = pydantic_v1.Field() - """ - A specific situation that sets the background for this session - """ - - summary: typing.Optional[str] = pydantic_v1.Field(default=None) - """ - Summary (null at the beginning) - generated automatically after every interaction - """ - - render_templates: bool = pydantic_v1.Field() - """ - Render system and assistant message content as jinja templates - """ - - token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) - """ - Threshold value for the adaptive context functionality - """ - - context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( - default=None - ) - """ - Action to start on context window overflow - """ - - id: CommonUuid - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - created_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was created as UTC date-time - """ - - updated_at: dt.datetime = pydantic_v1.Field() - """ - When this resource was updated as UTC date-time - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class SessionsSession_SingleAgentNoUser(Base): - agent: CommonUuid - kind: typing.Literal["single_agent_no_user"] = "single_agent_no_user" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class SessionsSession_SingleAgentSingleUser(Base): - agent: CommonUuid - user: CommonUuid - kind: typing.Literal["single_agent_single_user"] = "single_agent_single_user" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class SessionsSession_SingleAgentMultiUser(Base): - agent: CommonUuid - users: typing.List[CommonUuid] - kind: typing.Literal["single_agent_multi_user"] = "single_agent_multi_user" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class SessionsSession_MultiAgentNoUser(Base): - agents: typing.List[CommonUuid] - kind: typing.Literal["multi_agent_no_user"] = "multi_agent_no_user" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class SessionsSession_MultiAgentSingleUser(Base): - agents: typing.List[CommonUuid] - user: CommonUuid - kind: typing.Literal["multi_agent_single_user"] = "multi_agent_single_user" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class SessionsSession_MultiAgentMultiUser(Base): - agents: typing.List[CommonUuid] - users: typing.List[CommonUuid] - kind: typing.Literal["multi_agent_multi_user"] = "multi_agent_multi_user" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -SessionsSession = typing.Union[ - SessionsSession_SingleAgentNoUser, - SessionsSession_SingleAgentSingleUser, - SessionsSession_SingleAgentMultiUser, - SessionsSession_MultiAgentNoUser, - SessionsSession_MultiAgentSingleUser, - SessionsSession_MultiAgentMultiUser, -] diff --git a/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py deleted file mode 100644 index 66d652b02..000000000 --- a/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsSingleAgentMultiUserSession(pydantic_v1.BaseModel): - agent: CommonUuid - users: typing.List[CommonUuid] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py deleted file mode 100644 index 8b7866b62..000000000 --- a/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsSingleAgentNoUserSession(pydantic_v1.BaseModel): - agent: CommonUuid - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py deleted file mode 100644 index 9ba35bb4b..000000000 --- a/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py +++ /dev/null @@ -1,44 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_uuid import CommonUuid - - -class SessionsSingleAgentSingleUserSession(pydantic_v1.BaseModel): - agent: CommonUuid - user: CommonUuid - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_create_task_request.py b/sdks/python/julep/api/types/tasks_create_task_request.py deleted file mode 100644 index c5c0ecb54..000000000 --- a/sdks/python/julep/api/types/tasks_create_task_request.py +++ /dev/null @@ -1,72 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .tasks_workflow_step import TasksWorkflowStep -from .tools_create_tool_request import ToolsCreateToolRequest - - -class TasksCreateTaskRequest(pydantic_v1.BaseModel): - """ - Payload for creating a task - """ - - name: str - description: str - main: typing.List[TasksWorkflowStep] = pydantic_v1.Field() - """ - The entrypoint of the task. - """ - - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( - default=None - ) - """ - The schema for the input to the task. `null` means all inputs are valid. - """ - - tools: typing.List[ToolsCreateToolRequest] = pydantic_v1.Field() - """ - Tools defined specifically for this task not included in the Agent itself. - """ - - inherit_tools: bool = pydantic_v1.Field() - """ - Whether to inherit tools from the parent agent or not. Defaults to true. - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_create_task_request_main_item.py b/sdks/python/julep/api/types/tasks_create_task_request_main_item.py new file mode 100644 index 000000000..c7ee695c7 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_create_task_request_main_item.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_yield_step import TasksYieldStep + +TasksCreateTaskRequestMainItem = typing.Union[ + TasksEvaluateStep, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, + TasksIfElseWorkflowStep, +] diff --git a/sdks/python/julep/api/types/tasks_if_else_workflow_step.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py index 1059cce69..cc3670431 100644 --- a/sdks/python/julep/api/types/tasks_if_else_workflow_step.py +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step.py @@ -1,13 +1,13 @@ # This file was auto-generated by Fern from our API Definition. -from __future__ import annotations - import datetime as dt import typing from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_py_expression import CommonPyExpression +from .tasks_if_else_workflow_step_else import TasksIfElseWorkflowStepElse +from .tasks_if_else_workflow_step_then import TasksIfElseWorkflowStepThen class TasksIfElseWorkflowStep(pydantic_v1.BaseModel): @@ -16,12 +16,12 @@ class TasksIfElseWorkflowStep(pydantic_v1.BaseModel): The condition to evaluate """ - then: TasksWorkflowStep = pydantic_v1.Field() + then: TasksIfElseWorkflowStepThen = pydantic_v1.Field() """ The steps to run if the condition is true """ - else_: TasksWorkflowStep = pydantic_v1.Field(alias="else") + else_: TasksIfElseWorkflowStepElse = pydantic_v1.Field(alias="else") """ The steps to run if the condition is false """ @@ -58,8 +58,3 @@ class Config: populate_by_name = True extra = pydantic_v1.Extra.allow json_encoders = {dt.datetime: serialize_datetime} - - -from .tasks_workflow_step import TasksWorkflowStep # noqa: E402 - -TasksIfElseWorkflowStep.update_forward_refs() diff --git a/sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py new file mode 100644 index 000000000..1d7133f87 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step_else.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_yield_step import TasksYieldStep + +TasksIfElseWorkflowStepElse = typing.Union[ + TasksEvaluateStep, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, +] diff --git a/sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py b/sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py new file mode 100644 index 000000000..c5753871e --- /dev/null +++ b/sdks/python/julep/api/types/tasks_if_else_workflow_step_then.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_yield_step import TasksYieldStep + +TasksIfElseWorkflowStepThen = typing.Union[ + TasksEvaluateStep, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, +] diff --git a/sdks/python/julep/api/types/tasks_patch_task_request_main_item.py b/sdks/python/julep/api/types/tasks_patch_task_request_main_item.py new file mode 100644 index 000000000..6716459b8 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_patch_task_request_main_item.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_yield_step import TasksYieldStep + +TasksPatchTaskRequestMainItem = typing.Union[ + TasksEvaluateStep, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, + TasksIfElseWorkflowStep, +] diff --git a/sdks/python/julep/api/types/tasks_task.py b/sdks/python/julep/api/types/tasks_task.py index af4b36adb..b6f0f0e4f 100644 --- a/sdks/python/julep/api/types/tasks_task.py +++ b/sdks/python/julep/api/types/tasks_task.py @@ -6,8 +6,8 @@ from ..core.datetime_utils import serialize_datetime from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 from .common_uuid import CommonUuid -from .tasks_workflow_step import TasksWorkflowStep -from .tools_create_tool_request import ToolsCreateToolRequest +from .tasks_task_main_item import TasksTaskMainItem +from .tasks_task_tool import TasksTaskTool class TasksTask(pydantic_v1.BaseModel): @@ -17,7 +17,7 @@ class TasksTask(pydantic_v1.BaseModel): name: str description: str - main: typing.List[TasksWorkflowStep] = pydantic_v1.Field() + main: typing.List[TasksTaskMainItem] = pydantic_v1.Field() """ The entrypoint of the task. """ @@ -29,7 +29,7 @@ class TasksTask(pydantic_v1.BaseModel): The schema for the input to the task. `null` means all inputs are valid. """ - tools: typing.List[ToolsCreateToolRequest] = pydantic_v1.Field() + tools: typing.List[TasksTaskTool] = pydantic_v1.Field() """ Tools defined specifically for this task not included in the Agent itself. """ @@ -39,7 +39,6 @@ class TasksTask(pydantic_v1.BaseModel): Whether to inherit tools from the parent agent or not. Defaults to true. """ - agent_id: CommonUuid id: CommonUuid created_at: dt.datetime = pydantic_v1.Field() """ diff --git a/sdks/python/julep/api/types/tasks_task_main_item.py b/sdks/python/julep/api/types/tasks_task_main_item.py new file mode 100644 index 000000000..21974fa90 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_task_main_item.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_yield_step import TasksYieldStep + +TasksTaskMainItem = typing.Union[ + TasksEvaluateStep, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, + TasksIfElseWorkflowStep, +] diff --git a/sdks/python/julep/api/types/tools_create_tool_request.py b/sdks/python/julep/api/types/tasks_task_tool.py similarity index 90% rename from sdks/python/julep/api/types/tools_create_tool_request.py rename to sdks/python/julep/api/types/tasks_task_tool.py index cb54b8434..56a891988 100644 --- a/sdks/python/julep/api/types/tools_create_tool_request.py +++ b/sdks/python/julep/api/types/tasks_task_tool.py @@ -10,9 +10,10 @@ from .tools_tool_type import ToolsToolType -class ToolsCreateToolRequest(pydantic_v1.BaseModel): +class TasksTaskTool(pydantic_v1.BaseModel): + inherited: typing.Optional[bool] = pydantic_v1.Field(default=None) """ - Payload for creating a tool + Read-only: Whether the tool was inherited or not. Only applies within tasks. """ type: ToolsToolType = pydantic_v1.Field() diff --git a/sdks/python/julep/api/types/tasks_update_task_request_main_item.py b/sdks/python/julep/api/types/tasks_update_task_request_main_item.py new file mode 100644 index 000000000..526487cee --- /dev/null +++ b/sdks/python/julep/api/types/tasks_update_task_request_main_item.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tasks_error_workflow_step import TasksErrorWorkflowStep +from .tasks_evaluate_step import TasksEvaluateStep +from .tasks_if_else_workflow_step import TasksIfElseWorkflowStep +from .tasks_prompt_step import TasksPromptStep +from .tasks_tool_call_step import TasksToolCallStep +from .tasks_yield_step import TasksYieldStep + +TasksUpdateTaskRequestMainItem = typing.Union[ + TasksEvaluateStep, + TasksToolCallStep, + TasksYieldStep, + TasksPromptStep, + TasksErrorWorkflowStep, + TasksIfElseWorkflowStep, +] diff --git a/sdks/python/julep/api/types/tasks_workflow_step.py b/sdks/python/julep/api/types/tasks_workflow_step.py deleted file mode 100644 index eea9d5660..000000000 --- a/sdks/python/julep/api/types/tasks_workflow_step.py +++ /dev/null @@ -1,246 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_py_expression import CommonPyExpression -from .common_tool_ref import CommonToolRef -from .tasks_prompt_step_prompt import TasksPromptStepPrompt -from .tasks_prompt_step_settings import TasksPromptStepSettings - - -class TasksWorkflowStep_ToolCall(pydantic_v1.BaseModel): - tool: CommonToolRef - arguments: typing.Dict[str, typing.Any] - kind: typing.Literal["tool_call"] = "tool_call" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class TasksWorkflowStep_Yield(pydantic_v1.BaseModel): - workflow: str - arguments: typing.Dict[str, CommonPyExpression] - kind: typing.Literal["yield"] = "yield" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class TasksWorkflowStep_Prompt(pydantic_v1.BaseModel): - prompt: TasksPromptStepPrompt - settings: TasksPromptStepSettings - kind: typing.Literal["prompt"] = "prompt" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class TasksWorkflowStep_Evaluate(pydantic_v1.BaseModel): - evaluate: typing.Dict[str, CommonPyExpression] - kind: typing.Literal["evaluate"] = "evaluate" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class TasksWorkflowStep_IfElse(pydantic_v1.BaseModel): - if_: CommonPyExpression = pydantic_v1.Field(alias="if") - then: TasksWorkflowStep - else_: TasksWorkflowStep = pydantic_v1.Field(alias="else") - kind: typing.Literal["if_else"] = "if_else" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - allow_population_by_field_name = True - populate_by_name = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -class TasksWorkflowStep_Error(pydantic_v1.BaseModel): - error: str - kind: typing.Literal["error"] = "error" - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} - - -TasksWorkflowStep = typing.Union[ - TasksWorkflowStep_ToolCall, - TasksWorkflowStep_Yield, - TasksWorkflowStep_Prompt, - TasksWorkflowStep_Evaluate, - TasksWorkflowStep_IfElse, - TasksWorkflowStep_Error, -] diff --git a/sdks/python/julep/api/types/tools_function_def_update.py b/sdks/python/julep/api/types/tools_function_def_update.py deleted file mode 100644 index 9cfc3bd81..000000000 --- a/sdks/python/julep/api/types/tools_function_def_update.py +++ /dev/null @@ -1,65 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode -from .common_valid_python_identifier import CommonValidPythonIdentifier - - -class ToolsFunctionDefUpdate(pydantic_v1.BaseModel): - """ - Function definition - """ - - name: typing.Optional[CommonValidPythonIdentifier] = pydantic_v1.Field(default=None) - """ - DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. - """ - - description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( - default=None - ) - """ - Description of the function - """ - - parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( - default=None - ) - """ - The parameters the function accepts - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/user_docs_search_route_search_request_body.py b/sdks/python/julep/api/types/user_docs_search_route_search_request_body.py new file mode 100644 index 000000000..07f5cbc97 --- /dev/null +++ b/sdks/python/julep/api/types/user_docs_search_route_search_request_body.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest +from .docs_text_only_doc_search_request import DocsTextOnlyDocSearchRequest +from .docs_vector_doc_search_request import DocsVectorDocSearchRequest + +UserDocsSearchRouteSearchRequestBody = typing.Union[ + DocsVectorDocSearchRequest, DocsTextOnlyDocSearchRequest, DocsHybridDocSearchRequest +] diff --git a/sdks/python/julep/api/types/users_route_list_request_direction.py b/sdks/python/julep/api/types/users_route_list_request_direction.py deleted file mode 100644 index 0bd478d82..000000000 --- a/sdks/python/julep/api/types/users_route_list_request_direction.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UsersRouteListRequestDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] diff --git a/sdks/python/julep/api/types/users_route_list_request_sort_by.py b/sdks/python/julep/api/types/users_route_list_request_sort_by.py deleted file mode 100644 index 2e45a9857..000000000 --- a/sdks/python/julep/api/types/users_route_list_request_sort_by.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -UsersRouteListRequestSortBy = typing.Union[ - typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any -] diff --git a/sdks/python/julep/api/types/users_route_list_response.py b/sdks/python/julep/api/types/users_route_list_response.py deleted file mode 100644 index 7cb75ac18..000000000 --- a/sdks/python/julep/api/types/users_route_list_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .users_user import UsersUser - - -class UsersRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[UsersUser] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_update_user_request.py b/sdks/python/julep/api/types/users_update_user_request.py deleted file mode 100644 index f747a2093..000000000 --- a/sdks/python/julep/api/types/users_update_user_request.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode - - -class UsersUpdateUserRequest(pydantic_v1.BaseModel): - """ - Payload for updating a user - """ - - metadata: typing.Optional[typing.Dict[str, typing.Any]] = None - name: CommonIdentifierSafeUnicode = pydantic_v1.Field() - """ - Name of the user - """ - - about: str = pydantic_v1.Field() - """ - About the user - """ - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index 92fedafcf..ccaf9a0ab 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -10,11 +10,6 @@ export { CancelablePromise, CancelError } from "./core/CancelablePromise"; export { OpenAPI } from "./core/OpenAPI"; export type { OpenAPIConfig } from "./core/OpenAPI"; -export type { Agents_Agent } from "./models/Agents_Agent"; -export type { Agents_CreateAgentRequest } from "./models/Agents_CreateAgentRequest"; -export type { Agents_CreateOrUpdateAgentRequest_id } from "./models/Agents_CreateOrUpdateAgentRequest_id"; -export type { Agents_PatchAgentRequest } from "./models/Agents_PatchAgentRequest"; -export type { Agents_UpdateAgentRequest } from "./models/Agents_UpdateAgentRequest"; export type { Chat_BaseChatOutput } from "./models/Chat_BaseChatOutput"; export type { Chat_BaseChatResponse } from "./models/Chat_BaseChatResponse"; export type { Chat_BaseTokenLogProb } from "./models/Chat_BaseTokenLogProb"; @@ -24,14 +19,11 @@ export type { Chat_CompetionUsage } from "./models/Chat_CompetionUsage"; export type { Chat_CompletionResponseFormat } from "./models/Chat_CompletionResponseFormat"; export type { Chat_FinishReason } from "./models/Chat_FinishReason"; export type { Chat_GenerationPreset } from "./models/Chat_GenerationPreset"; -export type { Chat_GenerationPresetSettings } from "./models/Chat_GenerationPresetSettings"; export type { Chat_LogProbResponse } from "./models/Chat_LogProbResponse"; export type { Chat_MessageChatResponse } from "./models/Chat_MessageChatResponse"; export type { Chat_MultipleChatOutput } from "./models/Chat_MultipleChatOutput"; -export type { Chat_OpenAISettings } from "./models/Chat_OpenAISettings"; export type { Chat_SingleChatOutput } from "./models/Chat_SingleChatOutput"; export type { Chat_TokenLogProb } from "./models/Chat_TokenLogProb"; -export type { Chat_vLLMSettings } from "./models/Chat_vLLMSettings"; export type { Common_identifierSafeUnicode } from "./models/Common_identifierSafeUnicode"; export type { Common_limit } from "./models/Common_limit"; export type { Common_logit_bias } from "./models/Common_logit_bias"; @@ -48,16 +40,13 @@ export type { Common_ResourceUpdatedResponse } from "./models/Common_ResourceUpd export type { Common_toolRef } from "./models/Common_toolRef"; export type { Common_uuid } from "./models/Common_uuid"; export type { Common_validPythonIdentifier } from "./models/Common_validPythonIdentifier"; +export type { Docs_BaseDocSearchRequest } from "./models/Docs_BaseDocSearchRequest"; export type { Docs_Doc } from "./models/Docs_Doc"; export type { Docs_DocOwner } from "./models/Docs_DocOwner"; export type { Docs_DocReference } from "./models/Docs_DocReference"; -export type { Docs_DocSearchRequest } from "./models/Docs_DocSearchRequest"; -export type { Docs_EmbedQueryRequest } from "./models/Docs_EmbedQueryRequest"; -export type { Docs_EmbedQueryResponse } from "./models/Docs_EmbedQueryResponse"; export type { Docs_HybridDocSearchRequest } from "./models/Docs_HybridDocSearchRequest"; export type { Docs_TextOnlyDocSearchRequest } from "./models/Docs_TextOnlyDocSearchRequest"; export type { Docs_VectorDocSearchRequest } from "./models/Docs_VectorDocSearchRequest"; -export type { Entries_BaseChatMLContentPart } from "./models/Entries_BaseChatMLContentPart"; export type { Entries_ChatMLImageContentPart } from "./models/Entries_ChatMLImageContentPart"; export type { Entries_ChatMLMessage } from "./models/Entries_ChatMLMessage"; export type { Entries_ChatMLRole } from "./models/Entries_ChatMLRole"; @@ -75,21 +64,6 @@ export type { Executions_StopExecutionRequest } from "./models/Executions_StopEx export type { Executions_TaskTokenResumeExecutionRequest } from "./models/Executions_TaskTokenResumeExecutionRequest"; export type { Executions_Transition } from "./models/Executions_Transition"; export type { Executions_UpdateExecutionRequest } from "./models/Executions_UpdateExecutionRequest"; -export type { Jobs_JobState } from "./models/Jobs_JobState"; -export type { Jobs_JobStatus } from "./models/Jobs_JobStatus"; -export type { Sessions_ContextOverflowType } from "./models/Sessions_ContextOverflowType"; -export type { Sessions_CreateOrUpdateSessionRequest_id } from "./models/Sessions_CreateOrUpdateSessionRequest_id"; -export type { Sessions_CreateSessionRequest } from "./models/Sessions_CreateSessionRequest"; -export type { Sessions_MultiAgentMultiUserSession } from "./models/Sessions_MultiAgentMultiUserSession"; -export type { Sessions_MultiAgentNoUserSession } from "./models/Sessions_MultiAgentNoUserSession"; -export type { Sessions_MultiAgentSingleUserSession } from "./models/Sessions_MultiAgentSingleUserSession"; -export type { Sessions_PatchSessionRequest } from "./models/Sessions_PatchSessionRequest"; -export type { Sessions_Session } from "./models/Sessions_Session"; -export type { Sessions_SingleAgentMultiUserSession } from "./models/Sessions_SingleAgentMultiUserSession"; -export type { Sessions_SingleAgentNoUserSession } from "./models/Sessions_SingleAgentNoUserSession"; -export type { Sessions_SingleAgentSingleUserSession } from "./models/Sessions_SingleAgentSingleUserSession"; -export type { Sessions_UpdateSessionRequest } from "./models/Sessions_UpdateSessionRequest"; -export type { Tasks_CreateOrUpdateTaskRequest_id } from "./models/Tasks_CreateOrUpdateTaskRequest_id"; export type { Tasks_CreateTaskRequest } from "./models/Tasks_CreateTaskRequest"; export type { Tasks_ErrorWorkflowStep } from "./models/Tasks_ErrorWorkflowStep"; export type { Tasks_EvaluateStep } from "./models/Tasks_EvaluateStep"; @@ -97,35 +71,21 @@ export type { Tasks_IfElseWorkflowStep } from "./models/Tasks_IfElseWorkflowStep export type { Tasks_PatchTaskRequest } from "./models/Tasks_PatchTaskRequest"; export type { Tasks_PromptStep } from "./models/Tasks_PromptStep"; export type { Tasks_Task } from "./models/Tasks_Task"; +export type { Tasks_TaskTool } from "./models/Tasks_TaskTool"; export type { Tasks_ToolCallStep } from "./models/Tasks_ToolCallStep"; export type { Tasks_UpdateTaskRequest } from "./models/Tasks_UpdateTaskRequest"; -export type { Tasks_WorkflowStep } from "./models/Tasks_WorkflowStep"; export type { Tasks_YieldStep } from "./models/Tasks_YieldStep"; export type { Tools_ChosenFunctionCall } from "./models/Tools_ChosenFunctionCall"; export type { Tools_ChosenToolCall } from "./models/Tools_ChosenToolCall"; -export type { Tools_CreateToolRequest } from "./models/Tools_CreateToolRequest"; export type { Tools_FunctionCallOption } from "./models/Tools_FunctionCallOption"; export type { Tools_FunctionDef } from "./models/Tools_FunctionDef"; -export type { Tools_FunctionDefUpdate } from "./models/Tools_FunctionDefUpdate"; export type { Tools_FunctionTool } from "./models/Tools_FunctionTool"; export type { Tools_NamedFunctionChoice } from "./models/Tools_NamedFunctionChoice"; export type { Tools_NamedToolChoice } from "./models/Tools_NamedToolChoice"; -export type { Tools_PatchToolRequest } from "./models/Tools_PatchToolRequest"; export type { Tools_Tool } from "./models/Tools_Tool"; export type { Tools_ToolResponse } from "./models/Tools_ToolResponse"; export type { Tools_ToolType } from "./models/Tools_ToolType"; -export type { Tools_UpdateToolRequest } from "./models/Tools_UpdateToolRequest"; -export type { Users_CreateOrUpdateUserRequest_id } from "./models/Users_CreateOrUpdateUserRequest_id"; -export type { Users_CreateUserRequest } from "./models/Users_CreateUserRequest"; -export type { Users_PatchUserRequest } from "./models/Users_PatchUserRequest"; -export type { Users_UpdateUserRequest } from "./models/Users_UpdateUserRequest"; -export type { Users_User } from "./models/Users_User"; -export { $Agents_Agent } from "./schemas/$Agents_Agent"; -export { $Agents_CreateAgentRequest } from "./schemas/$Agents_CreateAgentRequest"; -export { $Agents_CreateOrUpdateAgentRequest_id } from "./schemas/$Agents_CreateOrUpdateAgentRequest_id"; -export { $Agents_PatchAgentRequest } from "./schemas/$Agents_PatchAgentRequest"; -export { $Agents_UpdateAgentRequest } from "./schemas/$Agents_UpdateAgentRequest"; export { $Chat_BaseChatOutput } from "./schemas/$Chat_BaseChatOutput"; export { $Chat_BaseChatResponse } from "./schemas/$Chat_BaseChatResponse"; export { $Chat_BaseTokenLogProb } from "./schemas/$Chat_BaseTokenLogProb"; @@ -135,14 +95,11 @@ export { $Chat_CompetionUsage } from "./schemas/$Chat_CompetionUsage"; export { $Chat_CompletionResponseFormat } from "./schemas/$Chat_CompletionResponseFormat"; export { $Chat_FinishReason } from "./schemas/$Chat_FinishReason"; export { $Chat_GenerationPreset } from "./schemas/$Chat_GenerationPreset"; -export { $Chat_GenerationPresetSettings } from "./schemas/$Chat_GenerationPresetSettings"; export { $Chat_LogProbResponse } from "./schemas/$Chat_LogProbResponse"; export { $Chat_MessageChatResponse } from "./schemas/$Chat_MessageChatResponse"; export { $Chat_MultipleChatOutput } from "./schemas/$Chat_MultipleChatOutput"; -export { $Chat_OpenAISettings } from "./schemas/$Chat_OpenAISettings"; export { $Chat_SingleChatOutput } from "./schemas/$Chat_SingleChatOutput"; export { $Chat_TokenLogProb } from "./schemas/$Chat_TokenLogProb"; -export { $Chat_vLLMSettings } from "./schemas/$Chat_vLLMSettings"; export { $Common_identifierSafeUnicode } from "./schemas/$Common_identifierSafeUnicode"; export { $Common_limit } from "./schemas/$Common_limit"; export { $Common_logit_bias } from "./schemas/$Common_logit_bias"; @@ -159,16 +116,13 @@ export { $Common_ResourceUpdatedResponse } from "./schemas/$Common_ResourceUpdat export { $Common_toolRef } from "./schemas/$Common_toolRef"; export { $Common_uuid } from "./schemas/$Common_uuid"; export { $Common_validPythonIdentifier } from "./schemas/$Common_validPythonIdentifier"; +export { $Docs_BaseDocSearchRequest } from "./schemas/$Docs_BaseDocSearchRequest"; export { $Docs_Doc } from "./schemas/$Docs_Doc"; export { $Docs_DocOwner } from "./schemas/$Docs_DocOwner"; export { $Docs_DocReference } from "./schemas/$Docs_DocReference"; -export { $Docs_DocSearchRequest } from "./schemas/$Docs_DocSearchRequest"; -export { $Docs_EmbedQueryRequest } from "./schemas/$Docs_EmbedQueryRequest"; -export { $Docs_EmbedQueryResponse } from "./schemas/$Docs_EmbedQueryResponse"; export { $Docs_HybridDocSearchRequest } from "./schemas/$Docs_HybridDocSearchRequest"; export { $Docs_TextOnlyDocSearchRequest } from "./schemas/$Docs_TextOnlyDocSearchRequest"; export { $Docs_VectorDocSearchRequest } from "./schemas/$Docs_VectorDocSearchRequest"; -export { $Entries_BaseChatMLContentPart } from "./schemas/$Entries_BaseChatMLContentPart"; export { $Entries_ChatMLImageContentPart } from "./schemas/$Entries_ChatMLImageContentPart"; export { $Entries_ChatMLMessage } from "./schemas/$Entries_ChatMLMessage"; export { $Entries_ChatMLRole } from "./schemas/$Entries_ChatMLRole"; @@ -186,21 +140,6 @@ export { $Executions_StopExecutionRequest } from "./schemas/$Executions_StopExec export { $Executions_TaskTokenResumeExecutionRequest } from "./schemas/$Executions_TaskTokenResumeExecutionRequest"; export { $Executions_Transition } from "./schemas/$Executions_Transition"; export { $Executions_UpdateExecutionRequest } from "./schemas/$Executions_UpdateExecutionRequest"; -export { $Jobs_JobState } from "./schemas/$Jobs_JobState"; -export { $Jobs_JobStatus } from "./schemas/$Jobs_JobStatus"; -export { $Sessions_ContextOverflowType } from "./schemas/$Sessions_ContextOverflowType"; -export { $Sessions_CreateOrUpdateSessionRequest_id } from "./schemas/$Sessions_CreateOrUpdateSessionRequest_id"; -export { $Sessions_CreateSessionRequest } from "./schemas/$Sessions_CreateSessionRequest"; -export { $Sessions_MultiAgentMultiUserSession } from "./schemas/$Sessions_MultiAgentMultiUserSession"; -export { $Sessions_MultiAgentNoUserSession } from "./schemas/$Sessions_MultiAgentNoUserSession"; -export { $Sessions_MultiAgentSingleUserSession } from "./schemas/$Sessions_MultiAgentSingleUserSession"; -export { $Sessions_PatchSessionRequest } from "./schemas/$Sessions_PatchSessionRequest"; -export { $Sessions_Session } from "./schemas/$Sessions_Session"; -export { $Sessions_SingleAgentMultiUserSession } from "./schemas/$Sessions_SingleAgentMultiUserSession"; -export { $Sessions_SingleAgentNoUserSession } from "./schemas/$Sessions_SingleAgentNoUserSession"; -export { $Sessions_SingleAgentSingleUserSession } from "./schemas/$Sessions_SingleAgentSingleUserSession"; -export { $Sessions_UpdateSessionRequest } from "./schemas/$Sessions_UpdateSessionRequest"; -export { $Tasks_CreateOrUpdateTaskRequest_id } from "./schemas/$Tasks_CreateOrUpdateTaskRequest_id"; export { $Tasks_CreateTaskRequest } from "./schemas/$Tasks_CreateTaskRequest"; export { $Tasks_ErrorWorkflowStep } from "./schemas/$Tasks_ErrorWorkflowStep"; export { $Tasks_EvaluateStep } from "./schemas/$Tasks_EvaluateStep"; @@ -208,28 +147,19 @@ export { $Tasks_IfElseWorkflowStep } from "./schemas/$Tasks_IfElseWorkflowStep"; export { $Tasks_PatchTaskRequest } from "./schemas/$Tasks_PatchTaskRequest"; export { $Tasks_PromptStep } from "./schemas/$Tasks_PromptStep"; export { $Tasks_Task } from "./schemas/$Tasks_Task"; +export { $Tasks_TaskTool } from "./schemas/$Tasks_TaskTool"; export { $Tasks_ToolCallStep } from "./schemas/$Tasks_ToolCallStep"; export { $Tasks_UpdateTaskRequest } from "./schemas/$Tasks_UpdateTaskRequest"; -export { $Tasks_WorkflowStep } from "./schemas/$Tasks_WorkflowStep"; export { $Tasks_YieldStep } from "./schemas/$Tasks_YieldStep"; export { $Tools_ChosenFunctionCall } from "./schemas/$Tools_ChosenFunctionCall"; export { $Tools_ChosenToolCall } from "./schemas/$Tools_ChosenToolCall"; -export { $Tools_CreateToolRequest } from "./schemas/$Tools_CreateToolRequest"; export { $Tools_FunctionCallOption } from "./schemas/$Tools_FunctionCallOption"; export { $Tools_FunctionDef } from "./schemas/$Tools_FunctionDef"; -export { $Tools_FunctionDefUpdate } from "./schemas/$Tools_FunctionDefUpdate"; export { $Tools_FunctionTool } from "./schemas/$Tools_FunctionTool"; export { $Tools_NamedFunctionChoice } from "./schemas/$Tools_NamedFunctionChoice"; export { $Tools_NamedToolChoice } from "./schemas/$Tools_NamedToolChoice"; -export { $Tools_PatchToolRequest } from "./schemas/$Tools_PatchToolRequest"; export { $Tools_Tool } from "./schemas/$Tools_Tool"; export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse"; export { $Tools_ToolType } from "./schemas/$Tools_ToolType"; -export { $Tools_UpdateToolRequest } from "./schemas/$Tools_UpdateToolRequest"; -export { $Users_CreateOrUpdateUserRequest_id } from "./schemas/$Users_CreateOrUpdateUserRequest_id"; -export { $Users_CreateUserRequest } from "./schemas/$Users_CreateUserRequest"; -export { $Users_PatchUserRequest } from "./schemas/$Users_PatchUserRequest"; -export { $Users_UpdateUserRequest } from "./schemas/$Users_UpdateUserRequest"; -export { $Users_User } from "./schemas/$Users_User"; export { DefaultService } from "./services/DefaultService"; diff --git a/sdks/ts/src/api/models/Agents_Agent.ts b/sdks/ts/src/api/models/Agents_Agent.ts deleted file mode 100644 index c92c84c33..000000000 --- a/sdks/ts/src/api/models/Agents_Agent.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; -import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; -import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -export type Agents_Agent = { - readonly id: Common_uuid; - metadata?: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Name of the agent - */ - name: Common_identifierSafeUnicode; - /** - * About the agent - */ - about: string; - /** - * Model name to use (gpt-4-turbo, gemini-nano etc) - */ - model: string; - /** - * Instructions for the agent - */ - instructions: string | Array; - /** - * Default settings for all sessions created by this agent - */ - default_settings?: - | Chat_GenerationPresetSettings - | Chat_OpenAISettings - | Chat_vLLMSettings; -}; diff --git a/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts b/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts deleted file mode 100644 index c9c95127b..000000000 --- a/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; -import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; -import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -/** - * Payload for creating a agent (and associated documents) - */ -export type Agents_CreateAgentRequest = { - metadata?: Record; - /** - * Name of the agent - */ - name: Common_identifierSafeUnicode; - /** - * About the agent - */ - about: string; - /** - * Model name to use (gpt-4-turbo, gemini-nano etc) - */ - model: string; - /** - * Instructions for the agent - */ - instructions: string | Array; - /** - * Default settings for all sessions created by this agent - */ - default_settings?: - | Chat_GenerationPresetSettings - | Chat_OpenAISettings - | Chat_vLLMSettings; -}; diff --git a/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts deleted file mode 100644 index a0b127a69..000000000 --- a/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -export type Agents_CreateOrUpdateAgentRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts b/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts deleted file mode 100644 index 52f60bb04..000000000 --- a/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; -import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; -import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -/** - * Payload for patching a agent - */ -export type Agents_PatchAgentRequest = { - metadata?: Record; - /** - * Name of the agent - */ - name?: Common_identifierSafeUnicode; - /** - * About the agent - */ - about?: string; - /** - * Model name to use (gpt-4-turbo, gemini-nano etc) - */ - model?: string; - /** - * Instructions for the agent - */ - instructions?: string | Array; - /** - * Default settings for all sessions created by this agent - */ - default_settings?: - | Chat_GenerationPresetSettings - | Chat_OpenAISettings - | Chat_vLLMSettings; -}; diff --git a/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts b/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts deleted file mode 100644 index 1b5aa4c23..000000000 --- a/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; -import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; -import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -/** - * Payload for updating a agent - */ -export type Agents_UpdateAgentRequest = { - metadata?: Record; - /** - * Name of the agent - */ - name: Common_identifierSafeUnicode; - /** - * About the agent - */ - about: string; - /** - * Model name to use (gpt-4-turbo, gemini-nano etc) - */ - model: string; - /** - * Instructions for the agent - */ - instructions: string | Array; - /** - * Default settings for all sessions created by this agent - */ - default_settings?: - | Chat_GenerationPresetSettings - | Chat_OpenAISettings - | Chat_vLLMSettings; -}; diff --git a/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts b/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts deleted file mode 100644 index 230124c0a..000000000 --- a/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Chat_GenerationPreset } from "./Chat_GenerationPreset"; -export type Chat_GenerationPresetSettings = { - /** - * Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) - */ - preset?: Chat_GenerationPreset; -}; diff --git a/sdks/ts/src/api/models/Chat_OpenAISettings.ts b/sdks/ts/src/api/models/Chat_OpenAISettings.ts deleted file mode 100644 index 2ab230a6f..000000000 --- a/sdks/ts/src/api/models/Chat_OpenAISettings.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Chat_OpenAISettings = { - /** - * 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. - */ - frequency_penalty?: number; - /** - * 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. - */ - presence_penalty?: number; - /** - * 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. - */ - temperature?: number; - /** - * 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. - */ - top_p?: number; -}; diff --git a/sdks/ts/src/api/models/Chat_vLLMSettings.ts b/sdks/ts/src/api/models/Chat_vLLMSettings.ts deleted file mode 100644 index 8973da946..000000000 --- a/sdks/ts/src/api/models/Chat_vLLMSettings.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Chat_vLLMSettings = { - /** - * 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. - */ - repetition_penalty?: number; - /** - * Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. - */ - length_penalty?: number; - /** - * 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. - */ - temperature?: number; - /** - * 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. - */ - top_p?: number; - /** - * Minimum probability compared to leading token to be considered - */ - min_p?: number; -}; diff --git a/sdks/ts/src/api/models/Docs_DocSearchRequest.ts b/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts similarity index 75% rename from sdks/ts/src/api/models/Docs_DocSearchRequest.ts rename to sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts index a5be8f355..d99eefaf9 100644 --- a/sdks/ts/src/api/models/Docs_DocSearchRequest.ts +++ b/sdks/ts/src/api/models/Docs_BaseDocSearchRequest.ts @@ -2,13 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type Docs_DocSearchRequest = { - text?: string | Array; - vector?: Array | Array>; - /** - * The search mode - */ - mode: "vector" | "text" | "hybrid"; +export type Docs_BaseDocSearchRequest = { /** * The confidence cutoff level */ diff --git a/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts b/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts deleted file mode 100644 index 37b3cfe85..000000000 --- a/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Docs_EmbedQueryRequest = { - /** - * Text or texts to embed - */ - text: string | Array; -}; diff --git a/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts b/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts deleted file mode 100644 index 042d22084..000000000 --- a/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Docs_EmbedQueryResponse = { - /** - * The embedded vectors - */ - vectors: Array>; -}; diff --git a/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts index 578ef02c7..1049e733d 100644 --- a/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts +++ b/sdks/ts/src/api/models/Docs_HybridDocSearchRequest.ts @@ -2,15 +2,14 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Docs_DocSearchRequest } from "./Docs_DocSearchRequest"; -export type Docs_HybridDocSearchRequest = Docs_DocSearchRequest & { +import type { Docs_BaseDocSearchRequest } from "./Docs_BaseDocSearchRequest"; +export type Docs_HybridDocSearchRequest = Docs_BaseDocSearchRequest & { /** * Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. */ - text?: string | Array; + text: string | Array; /** * Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ - vector?: Array | Array>; - mode: "hybrid"; + vector: Array | Array>; }; diff --git a/sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts index dc6a24b85..9a15040c4 100644 --- a/sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts +++ b/sdks/ts/src/api/models/Docs_TextOnlyDocSearchRequest.ts @@ -2,12 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Docs_DocSearchRequest } from "./Docs_DocSearchRequest"; -export type Docs_TextOnlyDocSearchRequest = Docs_DocSearchRequest & { - text: string | Array; +import type { Docs_BaseDocSearchRequest } from "./Docs_BaseDocSearchRequest"; +export type Docs_TextOnlyDocSearchRequest = Docs_BaseDocSearchRequest & { /** - * Text or texts to use in the search. In `text` search mode, only BM25 is used. + * Text or texts to use in the search. */ text: string | Array; - mode: "text"; }; diff --git a/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts index 9d63ba1c6..949e87cbd 100644 --- a/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts +++ b/sdks/ts/src/api/models/Docs_VectorDocSearchRequest.ts @@ -2,12 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Docs_DocSearchRequest } from "./Docs_DocSearchRequest"; -export type Docs_VectorDocSearchRequest = Docs_DocSearchRequest & { - vector: Array | Array>; +import type { Docs_BaseDocSearchRequest } from "./Docs_BaseDocSearchRequest"; +export type Docs_VectorDocSearchRequest = Docs_BaseDocSearchRequest & { /** * Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ vector: Array | Array>; - mode: "vector"; }; diff --git a/sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts b/sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts deleted file mode 100644 index 477a3b93c..000000000 --- a/sdks/ts/src/api/models/Entries_BaseChatMLContentPart.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Entries_ImageURL } from "./Entries_ImageURL"; -export type Entries_BaseChatMLContentPart = { - /** - * The type of content part - */ - type: string; - text?: string; - image_url?: Entries_ImageURL; -}; diff --git a/sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts b/sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts index 6d871a960..ab07c9df2 100644 --- a/sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts +++ b/sdks/ts/src/api/models/Entries_ChatMLImageContentPart.ts @@ -2,10 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Entries_BaseChatMLContentPart } from "./Entries_BaseChatMLContentPart"; import type { Entries_ImageURL } from "./Entries_ImageURL"; -export type Entries_ChatMLImageContentPart = Entries_BaseChatMLContentPart & { - image_url: Entries_ImageURL; +export type Entries_ChatMLImageContentPart = { /** * The image URL */ diff --git a/sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts b/sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts index 1b48ec707..26e266d4e 100644 --- a/sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts +++ b/sdks/ts/src/api/models/Entries_ChatMLTextContentPart.ts @@ -2,9 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Entries_BaseChatMLContentPart } from "./Entries_BaseChatMLContentPart"; -export type Entries_ChatMLTextContentPart = Entries_BaseChatMLContentPart & { - text: string; +export type Entries_ChatMLTextContentPart = { text: string; /** * The type (fixed to 'text') diff --git a/sdks/ts/src/api/models/Jobs_JobState.ts b/sdks/ts/src/api/models/Jobs_JobState.ts deleted file mode 100644 index 886df5653..000000000 --- a/sdks/ts/src/api/models/Jobs_JobState.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) - */ -export type Jobs_JobState = - | "pending" - | "in_progress" - | "retrying" - | "succeeded" - | "aborted" - | "failed" - | "unknown"; diff --git a/sdks/ts/src/api/models/Jobs_JobStatus.ts b/sdks/ts/src/api/models/Jobs_JobStatus.ts deleted file mode 100644 index 9ec75c8c7..000000000 --- a/sdks/ts/src/api/models/Jobs_JobStatus.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -import type { Jobs_JobState } from "./Jobs_JobState"; -export type Jobs_JobStatus = { - readonly id: Common_uuid; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Name of the job - */ - name: Common_identifierSafeUnicode; - /** - * Reason for the current state of the job - */ - reason: string; - /** - * Whether this Job supports progress updates - */ - has_progress: boolean; - /** - * Progress percentage - */ - progress: number; - /** - * Current state of the job - */ - state: Jobs_JobState; -}; diff --git a/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts b/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts deleted file mode 100644 index 87de87a34..000000000 --- a/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Sessions_ContextOverflowType = "truncate" | "adaptive"; diff --git a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts deleted file mode 100644 index e668e6ee3..000000000 --- a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -export type Sessions_CreateOrUpdateSessionRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts deleted file mode 100644 index b2b09c9d3..000000000 --- a/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; -/** - * Payload for creating a session - */ -export type Sessions_CreateSessionRequest = { - /** - * User ID of user associated with this session - */ - user?: Common_uuid; - users?: Array; - /** - * Agent ID of agent associated with this session - */ - agent?: Common_uuid; - agents?: Array; - /** - * A specific situation that sets the background for this session - */ - situation: string; - /** - * Render system and assistant message content as jinja templates - */ - render_templates: boolean; - /** - * Threshold value for the adaptive context functionality - */ - token_budget: number | null; - /** - * Action to start on context window overflow - */ - context_overflow: Sessions_ContextOverflowType | null; - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts deleted file mode 100644 index 8437427fc..000000000 --- a/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_Session } from "./Sessions_Session"; -export type Sessions_MultiAgentMultiUserSession = Sessions_Session & { - agents: Array; - users: Array; -}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts deleted file mode 100644 index a684f2dc2..000000000 --- a/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_Session } from "./Sessions_Session"; -export type Sessions_MultiAgentNoUserSession = Sessions_Session & { - agents: Array; -}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts deleted file mode 100644 index 7a39383c8..000000000 --- a/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_Session } from "./Sessions_Session"; -export type Sessions_MultiAgentSingleUserSession = Sessions_Session & { - agents: Array; - user: Common_uuid; -}; diff --git a/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts b/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts deleted file mode 100644 index 589c01379..000000000 --- a/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; -/** - * Payload for patching a session - */ -export type Sessions_PatchSessionRequest = { - /** - * A specific situation that sets the background for this session - */ - situation?: string; - /** - * Render system and assistant message content as jinja templates - */ - render_templates?: boolean; - /** - * Threshold value for the adaptive context functionality - */ - token_budget?: number | null; - /** - * Action to start on context window overflow - */ - context_overflow?: Sessions_ContextOverflowType | null; - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/Sessions_Session.ts b/sdks/ts/src/api/models/Sessions_Session.ts deleted file mode 100644 index d8e89604b..000000000 --- a/sdks/ts/src/api/models/Sessions_Session.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; -export type Sessions_Session = { - /** - * A specific situation that sets the background for this session - */ - situation: string; - /** - * Summary (null at the beginning) - generated automatically after every interaction - */ - readonly summary: string | null; - /** - * Render system and assistant message content as jinja templates - */ - render_templates: boolean; - /** - * Threshold value for the adaptive context functionality - */ - token_budget: number | null; - /** - * Action to start on context window overflow - */ - context_overflow: Sessions_ContextOverflowType | null; - readonly id: Common_uuid; - metadata?: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Discriminator property for Session. - */ - kind?: string; -}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts deleted file mode 100644 index 2fb9ce705..000000000 --- a/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_Session } from "./Sessions_Session"; -export type Sessions_SingleAgentMultiUserSession = Sessions_Session & { - agent: Common_uuid; - users: Array; -}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts deleted file mode 100644 index 5454c6265..000000000 --- a/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_Session } from "./Sessions_Session"; -export type Sessions_SingleAgentNoUserSession = Sessions_Session & { - agent: Common_uuid; -}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts deleted file mode 100644 index b4636829b..000000000 --- a/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -import type { Sessions_Session } from "./Sessions_Session"; -export type Sessions_SingleAgentSingleUserSession = Sessions_Session & { - agent: Common_uuid; - user: Common_uuid; -}; diff --git a/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts deleted file mode 100644 index cd28f9783..000000000 --- a/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; -/** - * Payload for updating a session - */ -export type Sessions_UpdateSessionRequest = { - /** - * A specific situation that sets the background for this session - */ - situation: string; - /** - * Render system and assistant message content as jinja templates - */ - render_templates: boolean; - /** - * Threshold value for the adaptive context functionality - */ - token_budget: number | null; - /** - * Action to start on context window overflow - */ - context_overflow: Sessions_ContextOverflowType | null; - metadata?: Record; -}; diff --git a/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts deleted file mode 100644 index aa19b3598..000000000 --- a/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -export type Tasks_CreateOrUpdateTaskRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts index 194742149..427ac8550 100644 --- a/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts +++ b/sdks/ts/src/api/models/Tasks_CreateTaskRequest.ts @@ -2,8 +2,23 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; /** * Payload for creating a task */ -export type Tasks_CreateTaskRequest = Record>; +export type Tasks_CreateTaskRequest = Record< + string, + Array< + | Tasks_EvaluateStep + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep + | Tasks_IfElseWorkflowStep + > +>; diff --git a/sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts index 45972ed2b..136dedfd6 100644 --- a/sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts +++ b/sdks/ts/src/api/models/Tasks_ErrorWorkflowStep.ts @@ -2,8 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -export type Tasks_ErrorWorkflowStep = Tasks_WorkflowStep & { +export type Tasks_ErrorWorkflowStep = { /** * The error message */ diff --git a/sdks/ts/src/api/models/Tasks_EvaluateStep.ts b/sdks/ts/src/api/models/Tasks_EvaluateStep.ts index 0a5331af1..c54d685c1 100644 --- a/sdks/ts/src/api/models/Tasks_EvaluateStep.ts +++ b/sdks/ts/src/api/models/Tasks_EvaluateStep.ts @@ -3,8 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_PyExpression } from "./Common_PyExpression"; -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -export type Tasks_EvaluateStep = Tasks_WorkflowStep & { +export type Tasks_EvaluateStep = { /** * The expression to evaluate */ diff --git a/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts index cd83e1760..d9147739c 100644 --- a/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts +++ b/sdks/ts/src/api/models/Tasks_IfElseWorkflowStep.ts @@ -3,8 +3,12 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_PyExpression } from "./Common_PyExpression"; -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -export type Tasks_IfElseWorkflowStep = Tasks_WorkflowStep & { +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; +export type Tasks_IfElseWorkflowStep = { /** * The condition to evaluate */ @@ -12,9 +16,19 @@ export type Tasks_IfElseWorkflowStep = Tasks_WorkflowStep & { /** * The steps to run if the condition is true */ - then: Tasks_WorkflowStep; + then: + | Tasks_EvaluateStep + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep; /** * The steps to run if the condition is false */ - else: Tasks_WorkflowStep; + else: + | Tasks_EvaluateStep + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep; }; diff --git a/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts b/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts index c35f3de4b..43e86642f 100644 --- a/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts +++ b/sdks/ts/src/api/models/Tasks_PatchTaskRequest.ts @@ -2,8 +2,23 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; /** * Payload for patching a task */ -export type Tasks_PatchTaskRequest = Record>; +export type Tasks_PatchTaskRequest = Record< + string, + Array< + | Tasks_EvaluateStep + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep + | Tasks_IfElseWorkflowStep + > +>; diff --git a/sdks/ts/src/api/models/Tasks_PromptStep.ts b/sdks/ts/src/api/models/Tasks_PromptStep.ts index 8256dad50..3528d4fb0 100644 --- a/sdks/ts/src/api/models/Tasks_PromptStep.ts +++ b/sdks/ts/src/api/models/Tasks_PromptStep.ts @@ -8,8 +8,7 @@ import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicod import type { Common_logit_bias } from "./Common_logit_bias"; import type { Common_uuid } from "./Common_uuid"; import type { Entries_InputChatMLMessage } from "./Entries_InputChatMLMessage"; -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -export type Tasks_PromptStep = Tasks_WorkflowStep & { +export type Tasks_PromptStep = { /** * The prompt to run */ diff --git a/sdks/ts/src/api/models/Tasks_Task.ts b/sdks/ts/src/api/models/Tasks_Task.ts index d325f6bff..feae9d101 100644 --- a/sdks/ts/src/api/models/Tasks_Task.ts +++ b/sdks/ts/src/api/models/Tasks_Task.ts @@ -2,8 +2,23 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; /** * Object describing a Task */ -export type Tasks_Task = Record>; +export type Tasks_Task = Record< + string, + Array< + | Tasks_EvaluateStep + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep + | Tasks_IfElseWorkflowStep + > +>; diff --git a/sdks/ts/src/api/models/Tools_CreateToolRequest.ts b/sdks/ts/src/api/models/Tasks_TaskTool.ts similarity index 81% rename from sdks/ts/src/api/models/Tools_CreateToolRequest.ts rename to sdks/ts/src/api/models/Tasks_TaskTool.ts index 51024282c..815d7f61b 100644 --- a/sdks/ts/src/api/models/Tools_CreateToolRequest.ts +++ b/sdks/ts/src/api/models/Tasks_TaskTool.ts @@ -5,10 +5,11 @@ import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; import type { Tools_FunctionDef } from "./Tools_FunctionDef"; import type { Tools_ToolType } from "./Tools_ToolType"; -/** - * Payload for creating a tool - */ -export type Tools_CreateToolRequest = { +export type Tasks_TaskTool = { + /** + * Read-only: Whether the tool was inherited or not. Only applies within tasks. + */ + readonly inherited?: boolean; /** * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) */ diff --git a/sdks/ts/src/api/models/Tasks_ToolCallStep.ts b/sdks/ts/src/api/models/Tasks_ToolCallStep.ts index d750ca78a..d7041c3c6 100644 --- a/sdks/ts/src/api/models/Tasks_ToolCallStep.ts +++ b/sdks/ts/src/api/models/Tasks_ToolCallStep.ts @@ -3,8 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_toolRef } from "./Common_toolRef"; -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -export type Tasks_ToolCallStep = Tasks_WorkflowStep & { +export type Tasks_ToolCallStep = { /** * The tool to run */ diff --git a/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts b/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts index 7d8778e36..c0d879f56 100644 --- a/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts +++ b/sdks/ts/src/api/models/Tasks_UpdateTaskRequest.ts @@ -2,8 +2,23 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; +import type { Tasks_ErrorWorkflowStep } from "./Tasks_ErrorWorkflowStep"; +import type { Tasks_EvaluateStep } from "./Tasks_EvaluateStep"; +import type { Tasks_IfElseWorkflowStep } from "./Tasks_IfElseWorkflowStep"; +import type { Tasks_PromptStep } from "./Tasks_PromptStep"; +import type { Tasks_ToolCallStep } from "./Tasks_ToolCallStep"; +import type { Tasks_YieldStep } from "./Tasks_YieldStep"; /** * Payload for updating a task */ -export type Tasks_UpdateTaskRequest = Record>; +export type Tasks_UpdateTaskRequest = Record< + string, + Array< + | Tasks_EvaluateStep + | Tasks_ToolCallStep + | Tasks_YieldStep + | Tasks_PromptStep + | Tasks_ErrorWorkflowStep + | Tasks_IfElseWorkflowStep + > +>; diff --git a/sdks/ts/src/api/models/Tasks_WorkflowStep.ts b/sdks/ts/src/api/models/Tasks_WorkflowStep.ts deleted file mode 100644 index 1042d7ab4..000000000 --- a/sdks/ts/src/api/models/Tasks_WorkflowStep.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Tasks_WorkflowStep = { - /** - * Discriminator property for WorkflowStep. - */ - kind?: string; -}; diff --git a/sdks/ts/src/api/models/Tasks_YieldStep.ts b/sdks/ts/src/api/models/Tasks_YieldStep.ts index 56670a2ef..34d25b471 100644 --- a/sdks/ts/src/api/models/Tasks_YieldStep.ts +++ b/sdks/ts/src/api/models/Tasks_YieldStep.ts @@ -3,8 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { Common_PyExpression } from "./Common_PyExpression"; -import type { Tasks_WorkflowStep } from "./Tasks_WorkflowStep"; -export type Tasks_YieldStep = Tasks_WorkflowStep & { +export type Tasks_YieldStep = { /** * The subworkflow to run */ diff --git a/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts deleted file mode 100644 index 7f4417abd..000000000 --- a/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; -/** - * Function definition - */ -export type Tools_FunctionDefUpdate = { - /** - * DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. - */ - name?: Common_validPythonIdentifier; - /** - * Description of the function - */ - description?: Common_identifierSafeUnicode; - /** - * The parameters the function accepts - */ - parameters?: Record; -}; diff --git a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts deleted file mode 100644 index 0957c8db2..000000000 --- a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; -import type { Tools_FunctionDefUpdate } from "./Tools_FunctionDefUpdate"; -import type { Tools_ToolType } from "./Tools_ToolType"; -/** - * Payload for patching a tool - */ -export type Tools_PatchToolRequest = { - /** - * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - */ - type?: Tools_ToolType; - /** - * Name of the tool (must be unique for this agent and a valid python identifier string ) - */ - name?: Common_validPythonIdentifier; - function?: Tools_FunctionDefUpdate; - integration?: any; - system?: any; - api_call?: any; -}; diff --git a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts deleted file mode 100644 index 6a964fc8c..000000000 --- a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; -import type { Tools_FunctionDef } from "./Tools_FunctionDef"; -import type { Tools_ToolType } from "./Tools_ToolType"; -/** - * Payload for updating a tool - */ -export type Tools_UpdateToolRequest = { - /** - * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - */ - type: Tools_ToolType; - /** - * Name of the tool (must be unique for this agent and a valid python identifier string ) - */ - name: Common_validPythonIdentifier; - function?: Tools_FunctionDef; - integration?: any; - system?: any; - api_call?: any; -}; diff --git a/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts deleted file mode 100644 index 7338d9bed..000000000 --- a/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_uuid } from "./Common_uuid"; -export type Users_CreateOrUpdateUserRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Users_CreateUserRequest.ts b/sdks/ts/src/api/models/Users_CreateUserRequest.ts deleted file mode 100644 index 8811f8252..000000000 --- a/sdks/ts/src/api/models/Users_CreateUserRequest.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -/** - * Payload for creating a user (and associated documents) - */ -export type Users_CreateUserRequest = { - metadata?: Record; - /** - * Name of the user - */ - name: Common_identifierSafeUnicode; - /** - * About the user - */ - about: string; -}; diff --git a/sdks/ts/src/api/models/Users_PatchUserRequest.ts b/sdks/ts/src/api/models/Users_PatchUserRequest.ts deleted file mode 100644 index 1fe03611b..000000000 --- a/sdks/ts/src/api/models/Users_PatchUserRequest.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -/** - * Payload for patching a user - */ -export type Users_PatchUserRequest = { - metadata?: Record; - /** - * Name of the user - */ - name?: Common_identifierSafeUnicode; - /** - * About the user - */ - about?: string; -}; diff --git a/sdks/ts/src/api/models/Users_UpdateUserRequest.ts b/sdks/ts/src/api/models/Users_UpdateUserRequest.ts deleted file mode 100644 index d9094acf4..000000000 --- a/sdks/ts/src/api/models/Users_UpdateUserRequest.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -/** - * Payload for updating a user - */ -export type Users_UpdateUserRequest = { - metadata?: Record; - /** - * Name of the user - */ - name: Common_identifierSafeUnicode; - /** - * About the user - */ - about: string; -}; diff --git a/sdks/ts/src/api/models/Users_User.ts b/sdks/ts/src/api/models/Users_User.ts deleted file mode 100644 index eb42b433e..000000000 --- a/sdks/ts/src/api/models/Users_User.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; -import type { Common_uuid } from "./Common_uuid"; -export type Users_User = { - readonly id: Common_uuid; - metadata?: Record; - /** - * When this resource was created as UTC date-time - */ - readonly created_at: string; - /** - * When this resource was updated as UTC date-time - */ - readonly updated_at: string; - /** - * Name of the user - */ - name: Common_identifierSafeUnicode; - /** - * About the user - */ - about: string; -}; diff --git a/sdks/ts/src/api/schemas/$Agents_Agent.ts b/sdks/ts/src/api/schemas/$Agents_Agent.ts deleted file mode 100644 index 72bb0e2b3..000000000 --- a/sdks/ts/src/api/schemas/$Agents_Agent.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Agents_Agent = { - properties: { - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - name: { - type: "all-of", - description: `Name of the agent`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the agent`, - isRequired: true, - }, - model: { - type: "string", - description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, - isRequired: true, - }, - instructions: { - type: "any-of", - description: `Instructions for the agent`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - default_settings: { - type: "any-of", - description: `Default settings for all sessions created by this agent`, - contains: [ - { - type: "Chat_GenerationPresetSettings", - }, - { - type: "Chat_OpenAISettings", - }, - { - type: "Chat_vLLMSettings", - }, - ], - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts deleted file mode 100644 index 035b10261..000000000 --- a/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Agents_CreateAgentRequest = { - description: `Payload for creating a agent (and associated documents)`, - properties: { - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the agent`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the agent`, - isRequired: true, - }, - model: { - type: "string", - description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, - isRequired: true, - }, - instructions: { - type: "any-of", - description: `Instructions for the agent`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - default_settings: { - type: "any-of", - description: `Default settings for all sessions created by this agent`, - contains: [ - { - type: "Chat_GenerationPresetSettings", - }, - { - type: "Chat_OpenAISettings", - }, - { - type: "Chat_vLLMSettings", - }, - ], - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts deleted file mode 100644 index e5db88f15..000000000 --- a/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Agents_CreateOrUpdateAgentRequest_id = { - type: "Common_uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts deleted file mode 100644 index 903376a1a..000000000 --- a/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Agents_PatchAgentRequest = { - description: `Payload for patching a agent`, - properties: { - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the agent`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - }, - about: { - type: "string", - description: `About the agent`, - }, - model: { - type: "string", - description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, - }, - instructions: { - type: "any-of", - description: `Instructions for the agent`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - }, - default_settings: { - type: "any-of", - description: `Default settings for all sessions created by this agent`, - contains: [ - { - type: "Chat_GenerationPresetSettings", - }, - { - type: "Chat_OpenAISettings", - }, - { - type: "Chat_vLLMSettings", - }, - ], - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts deleted file mode 100644 index 6591bc329..000000000 --- a/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Agents_UpdateAgentRequest = { - description: `Payload for updating a agent`, - properties: { - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the agent`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the agent`, - isRequired: true, - }, - model: { - type: "string", - description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, - isRequired: true, - }, - instructions: { - type: "any-of", - description: `Instructions for the agent`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - default_settings: { - type: "any-of", - description: `Default settings for all sessions created by this agent`, - contains: [ - { - type: "Chat_GenerationPresetSettings", - }, - { - type: "Chat_OpenAISettings", - }, - { - type: "Chat_vLLMSettings", - }, - ], - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts b/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts deleted file mode 100644 index fd8b68db1..000000000 --- a/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Chat_GenerationPresetSettings = { - properties: { - preset: { - type: "all-of", - description: `Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)`, - contains: [ - { - type: "Chat_GenerationPreset", - }, - ], - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts b/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts deleted file mode 100644 index 61a12ed7e..000000000 --- a/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Chat_OpenAISettings = { - properties: { - frequency_penalty: { - type: "number", - description: `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.`, - format: "float", - maximum: 2, - minimum: -2, - }, - presence_penalty: { - type: "number", - description: `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.`, - format: "float", - maximum: 2, - minimum: -2, - }, - temperature: { - type: "number", - description: `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.`, - format: "float", - maximum: 5, - }, - top_p: { - type: "number", - description: `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.`, - format: "float", - maximum: 1, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts b/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts deleted file mode 100644 index 5006b6775..000000000 --- a/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Chat_vLLMSettings = { - properties: { - repetition_penalty: { - type: "number", - description: `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.`, - format: "float", - maximum: 2, - }, - length_penalty: { - type: "number", - description: `Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.`, - format: "float", - maximum: 2, - }, - temperature: { - type: "number", - description: `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.`, - format: "float", - maximum: 5, - }, - top_p: { - type: "number", - description: `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.`, - format: "float", - maximum: 1, - }, - min_p: { - type: "number", - description: `Minimum probability compared to leading token to be considered`, - format: "float", - maximum: 1, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_DocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts similarity index 52% rename from sdks/ts/src/api/schemas/$Docs_DocSearchRequest.ts rename to sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts index 63a425045..00b992770 100644 --- a/sdks/ts/src/api/schemas/$Docs_DocSearchRequest.ts +++ b/sdks/ts/src/api/schemas/$Docs_BaseDocSearchRequest.ts @@ -2,46 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Docs_DocSearchRequest = { +export const $Docs_BaseDocSearchRequest = { properties: { - text: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - }, - vector: { - type: "any-of", - contains: [ - { - type: "array", - contains: { - type: "number", - }, - }, - { - type: "array", - contains: { - type: "array", - contains: { - type: "number", - }, - }, - }, - ], - }, - mode: { - type: "Enum", - isRequired: true, - }, confidence: { type: "number", description: `The confidence cutoff level`, diff --git a/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts b/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts deleted file mode 100644 index 1cf18ee0e..000000000 --- a/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Docs_EmbedQueryRequest = { - properties: { - text: { - type: "any-of", - description: `Text or texts to embed`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts b/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts deleted file mode 100644 index 381f37709..000000000 --- a/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Docs_EmbedQueryResponse = { - properties: { - vectors: { - type: "array", - contains: { - type: "array", - contains: { - type: "number", - }, - }, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts index 05ee4a403..a6e9dfcad 100644 --- a/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts +++ b/sdks/ts/src/api/schemas/$Docs_HybridDocSearchRequest.ts @@ -6,7 +6,7 @@ export const $Docs_HybridDocSearchRequest = { type: "all-of", contains: [ { - type: "Docs_DocSearchRequest", + type: "Docs_BaseDocSearchRequest", }, { properties: { @@ -24,6 +24,7 @@ export const $Docs_HybridDocSearchRequest = { }, }, ], + isRequired: true, }, vector: { type: "any-of", @@ -45,9 +46,6 @@ export const $Docs_HybridDocSearchRequest = { }, }, ], - }, - mode: { - type: "Enum", isRequired: true, }, }, diff --git a/sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts index 73e03f171..94a19e134 100644 --- a/sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts +++ b/sdks/ts/src/api/schemas/$Docs_TextOnlyDocSearchRequest.ts @@ -6,12 +6,13 @@ export const $Docs_TextOnlyDocSearchRequest = { type: "all-of", contains: [ { - type: "Docs_DocSearchRequest", + type: "Docs_BaseDocSearchRequest", }, { properties: { text: { type: "any-of", + description: `Text or texts to use in the search.`, contains: [ { type: "string", @@ -25,26 +26,6 @@ export const $Docs_TextOnlyDocSearchRequest = { ], isRequired: true, }, - text: { - type: "any-of", - description: `Text or texts to use in the search. In \`text\` search mode, only BM25 is used.`, - contains: [ - { - type: "string", - }, - { - type: "array", - contains: { - type: "string", - }, - }, - ], - isRequired: true, - }, - mode: { - type: "Enum", - isRequired: true, - }, }, }, ], diff --git a/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts index da3c88e4c..cceba2263 100644 --- a/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts +++ b/sdks/ts/src/api/schemas/$Docs_VectorDocSearchRequest.ts @@ -6,31 +6,10 @@ export const $Docs_VectorDocSearchRequest = { type: "all-of", contains: [ { - type: "Docs_DocSearchRequest", + type: "Docs_BaseDocSearchRequest", }, { properties: { - vector: { - type: "any-of", - contains: [ - { - type: "array", - contains: { - type: "number", - }, - }, - { - type: "array", - contains: { - type: "array", - contains: { - type: "number", - }, - }, - }, - ], - isRequired: true, - }, vector: { type: "any-of", description: `Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown.`, @@ -53,10 +32,6 @@ export const $Docs_VectorDocSearchRequest = { ], isRequired: true, }, - mode: { - type: "Enum", - isRequired: true, - }, }, }, ], diff --git a/sdks/ts/src/api/schemas/$Entries_BaseChatMLContentPart.ts b/sdks/ts/src/api/schemas/$Entries_BaseChatMLContentPart.ts deleted file mode 100644 index 2925d2116..000000000 --- a/sdks/ts/src/api/schemas/$Entries_BaseChatMLContentPart.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Entries_BaseChatMLContentPart = { - properties: { - type: { - type: "string", - description: `The type of content part`, - isRequired: true, - }, - text: { - type: "string", - }, - image_url: { - type: "Entries_ImageURL", - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts b/sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts index 032a0fc55..28026a78b 100644 --- a/sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts +++ b/sdks/ts/src/api/schemas/$Entries_ChatMLImageContentPart.ts @@ -3,32 +3,20 @@ /* tslint:disable */ /* eslint-disable */ export const $Entries_ChatMLImageContentPart = { - type: "all-of", - contains: [ - { - type: "Entries_BaseChatMLContentPart", - }, - { - properties: { - image_url: { + properties: { + image_url: { + type: "all-of", + description: `The image URL`, + contains: [ + { type: "Entries_ImageURL", - isRequired: true, - }, - image_url: { - type: "all-of", - description: `The image URL`, - contains: [ - { - type: "Entries_ImageURL", - }, - ], - isRequired: true, }, - type: { - type: "Enum", - isRequired: true, - }, - }, + ], + isRequired: true, + }, + type: { + type: "Enum", + isRequired: true, }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts b/sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts index 9ebd87cc2..1701225c5 100644 --- a/sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts +++ b/sdks/ts/src/api/schemas/$Entries_ChatMLTextContentPart.ts @@ -3,26 +3,14 @@ /* tslint:disable */ /* eslint-disable */ export const $Entries_ChatMLTextContentPart = { - type: "all-of", - contains: [ - { - type: "Entries_BaseChatMLContentPart", + properties: { + text: { + type: "string", + isRequired: true, }, - { - properties: { - text: { - type: "string", - isRequired: true, - }, - text: { - type: "string", - isRequired: true, - }, - type: { - type: "Enum", - isRequired: true, - }, - }, + type: { + type: "Enum", + isRequired: true, }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Jobs_JobState.ts b/sdks/ts/src/api/schemas/$Jobs_JobState.ts deleted file mode 100644 index 651b0849f..000000000 --- a/sdks/ts/src/api/schemas/$Jobs_JobState.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Jobs_JobState = { - type: "Enum", -} as const; diff --git a/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts b/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts deleted file mode 100644 index 3fe2f032b..000000000 --- a/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Jobs_JobStatus = { - properties: { - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - name: { - type: "all-of", - description: `Name of the job`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - reason: { - type: "string", - description: `Reason for the current state of the job`, - isRequired: true, - }, - has_progress: { - type: "boolean", - description: `Whether this Job supports progress updates`, - isRequired: true, - }, - progress: { - type: "number", - description: `Progress percentage`, - isRequired: true, - format: "float", - maximum: 100, - }, - state: { - type: "all-of", - description: `Current state of the job`, - contains: [ - { - type: "Jobs_JobState", - }, - ], - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts b/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts deleted file mode 100644 index 1a4cd0f7d..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_ContextOverflowType = { - type: "Enum", -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts deleted file mode 100644 index 56cc353a0..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_CreateOrUpdateSessionRequest_id = { - type: "Common_uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts deleted file mode 100644 index 3f21c4996..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_CreateSessionRequest = { - description: `Payload for creating a session`, - properties: { - user: { - type: "all-of", - description: `User ID of user associated with this session`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - users: { - type: "array", - contains: { - type: "Common_uuid", - }, - }, - agent: { - type: "all-of", - description: `Agent ID of agent associated with this session`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - agents: { - type: "array", - contains: { - type: "Common_uuid", - }, - }, - situation: { - type: "string", - description: `A specific situation that sets the background for this session`, - isRequired: true, - }, - render_templates: { - type: "boolean", - description: `Render system and assistant message content as jinja templates`, - isRequired: true, - }, - token_budget: { - type: "number", - description: `Threshold value for the adaptive context functionality`, - isRequired: true, - isNullable: true, - format: "uint16", - }, - context_overflow: { - type: "one-of", - description: `Action to start on context window overflow`, - contains: [ - { - type: "Sessions_ContextOverflowType", - }, - ], - isRequired: true, - isNullable: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts deleted file mode 100644 index 846bf8b92..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_MultiAgentMultiUserSession = { - type: "all-of", - contains: [ - { - type: "Sessions_Session", - }, - { - properties: { - agents: { - type: "array", - contains: { - type: "Common_uuid", - }, - isRequired: true, - }, - users: { - type: "array", - contains: { - type: "Common_uuid", - }, - isRequired: true, - }, - }, - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts deleted file mode 100644 index 36f2ada1d..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_MultiAgentNoUserSession = { - type: "all-of", - contains: [ - { - type: "Sessions_Session", - }, - { - properties: { - agents: { - type: "array", - contains: { - type: "Common_uuid", - }, - isRequired: true, - }, - }, - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts deleted file mode 100644 index 17146caa9..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_MultiAgentSingleUserSession = { - type: "all-of", - contains: [ - { - type: "Sessions_Session", - }, - { - properties: { - agents: { - type: "array", - contains: { - type: "Common_uuid", - }, - isRequired: true, - }, - user: { - type: "Common_uuid", - isRequired: true, - }, - }, - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts deleted file mode 100644 index ec0f8ebed..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_PatchSessionRequest = { - description: `Payload for patching a session`, - properties: { - situation: { - type: "string", - description: `A specific situation that sets the background for this session`, - }, - render_templates: { - type: "boolean", - description: `Render system and assistant message content as jinja templates`, - }, - token_budget: { - type: "number", - description: `Threshold value for the adaptive context functionality`, - isNullable: true, - format: "uint16", - }, - context_overflow: { - type: "one-of", - description: `Action to start on context window overflow`, - contains: [ - { - type: "Sessions_ContextOverflowType", - }, - ], - isNullable: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_Session.ts b/sdks/ts/src/api/schemas/$Sessions_Session.ts deleted file mode 100644 index 27b368494..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_Session.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_Session = { - properties: { - situation: { - type: "string", - description: `A specific situation that sets the background for this session`, - isRequired: true, - }, - summary: { - type: "string", - description: `Summary (null at the beginning) - generated automatically after every interaction`, - isReadOnly: true, - isRequired: true, - isNullable: true, - }, - render_templates: { - type: "boolean", - description: `Render system and assistant message content as jinja templates`, - isRequired: true, - }, - token_budget: { - type: "number", - description: `Threshold value for the adaptive context functionality`, - isRequired: true, - isNullable: true, - format: "uint16", - }, - context_overflow: { - type: "one-of", - description: `Action to start on context window overflow`, - contains: [ - { - type: "Sessions_ContextOverflowType", - }, - ], - isRequired: true, - isNullable: true, - }, - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - kind: { - type: "string", - description: `Discriminator property for Session.`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts deleted file mode 100644 index 25e5a0f92..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_SingleAgentMultiUserSession = { - type: "all-of", - contains: [ - { - type: "Sessions_Session", - }, - { - properties: { - agent: { - type: "Common_uuid", - isRequired: true, - }, - users: { - type: "array", - contains: { - type: "Common_uuid", - }, - isRequired: true, - }, - }, - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts deleted file mode 100644 index e234326b9..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_SingleAgentNoUserSession = { - type: "all-of", - contains: [ - { - type: "Sessions_Session", - }, - { - properties: { - agent: { - type: "Common_uuid", - isRequired: true, - }, - }, - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts deleted file mode 100644 index 943fd645d..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_SingleAgentSingleUserSession = { - type: "all-of", - contains: [ - { - type: "Sessions_Session", - }, - { - properties: { - agent: { - type: "Common_uuid", - isRequired: true, - }, - user: { - type: "Common_uuid", - isRequired: true, - }, - }, - }, - ], -} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts deleted file mode 100644 index ceada4666..000000000 --- a/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Sessions_UpdateSessionRequest = { - description: `Payload for updating a session`, - properties: { - situation: { - type: "string", - description: `A specific situation that sets the background for this session`, - isRequired: true, - }, - render_templates: { - type: "boolean", - description: `Render system and assistant message content as jinja templates`, - isRequired: true, - }, - token_budget: { - type: "number", - description: `Threshold value for the adaptive context functionality`, - isRequired: true, - isNullable: true, - format: "uint16", - }, - context_overflow: { - type: "one-of", - description: `Action to start on context window overflow`, - contains: [ - { - type: "Sessions_ContextOverflowType", - }, - ], - isRequired: true, - isNullable: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts deleted file mode 100644 index 54aca71b6..000000000 --- a/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tasks_CreateOrUpdateTaskRequest_id = { - type: "Common_uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts index 25e99372f..69089bef8 100644 --- a/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_CreateTaskRequest.ts @@ -7,7 +7,27 @@ export const $Tasks_CreateTaskRequest = { contains: { type: "array", contains: { - type: "Tasks_WorkflowStep", + type: "any-of", + contains: [ + { + type: "Tasks_EvaluateStep", + }, + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + { + type: "Tasks_IfElseWorkflowStep", + }, + ], }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts index dedf2f52b..9dabe3422 100644 --- a/sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_ErrorWorkflowStep.ts @@ -3,19 +3,11 @@ /* tslint:disable */ /* eslint-disable */ export const $Tasks_ErrorWorkflowStep = { - type: "all-of", - contains: [ - { - type: "Tasks_WorkflowStep", + properties: { + error: { + type: "string", + description: `The error message`, + isRequired: true, }, - { - properties: { - error: { - type: "string", - description: `The error message`, - isRequired: true, - }, - }, - }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts b/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts index 90a3e6fe7..d1788a823 100644 --- a/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_EvaluateStep.ts @@ -3,21 +3,13 @@ /* tslint:disable */ /* eslint-disable */ export const $Tasks_EvaluateStep = { - type: "all-of", - contains: [ - { - type: "Tasks_WorkflowStep", - }, - { - properties: { - evaluate: { - type: "dictionary", - contains: { - type: "Common_PyExpression", - }, - isRequired: true, - }, + properties: { + evaluate: { + type: "dictionary", + contains: { + type: "Common_PyExpression", }, + isRequired: true, }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts index 4b3775cf7..9ab48ac7b 100644 --- a/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_IfElseWorkflowStep.ts @@ -3,44 +3,60 @@ /* tslint:disable */ /* eslint-disable */ export const $Tasks_IfElseWorkflowStep = { - type: "all-of", - contains: [ - { - type: "Tasks_WorkflowStep", + properties: { + if: { + type: "all-of", + description: `The condition to evaluate`, + contains: [ + { + type: "Common_PyExpression", + }, + ], + isRequired: true, + }, + then: { + type: "any-of", + description: `The steps to run if the condition is true`, + contains: [ + { + type: "Tasks_EvaluateStep", + }, + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + ], + isRequired: true, }, - { - properties: { - if: { - type: "all-of", - description: `The condition to evaluate`, - contains: [ - { - type: "Common_PyExpression", - }, - ], - isRequired: true, - }, - then: { - type: "all-of", - description: `The steps to run if the condition is true`, - contains: [ - { - type: "Tasks_WorkflowStep", - }, - ], - isRequired: true, - }, - else: { - type: "all-of", - description: `The steps to run if the condition is false`, - contains: [ - { - type: "Tasks_WorkflowStep", - }, - ], - isRequired: true, - }, - }, + else: { + type: "any-of", + description: `The steps to run if the condition is false`, + contains: [ + { + type: "Tasks_EvaluateStep", + }, + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + ], + isRequired: true, }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts index 4cecc3538..bf47f0ed9 100644 --- a/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_PatchTaskRequest.ts @@ -7,7 +7,27 @@ export const $Tasks_PatchTaskRequest = { contains: { type: "array", contains: { - type: "Tasks_WorkflowStep", + type: "any-of", + contains: [ + { + type: "Tasks_EvaluateStep", + }, + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + { + type: "Tasks_IfElseWorkflowStep", + }, + ], }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts b/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts index 9defb553e..f5f9ba9e4 100644 --- a/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_PromptStep.ts @@ -3,285 +3,277 @@ /* tslint:disable */ /* eslint-disable */ export const $Tasks_PromptStep = { - type: "all-of", - contains: [ - { - type: "Tasks_WorkflowStep", + properties: { + prompt: { + type: "any-of", + description: `The prompt to run`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "Entries_InputChatMLMessage", + }, + }, + ], + isRequired: true, }, - { - properties: { - prompt: { - type: "any-of", - description: `The prompt to run`, - contains: [ - { - type: "string", - }, - { + settings: { + type: "any-of", + description: `Settings for the prompt`, + contains: [ + { + properties: { + model: { + type: "all-of", + description: `Identifier of the model to be used`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + stream: { + type: "boolean", + description: `Indicates if the server should stream the response as it's generated`, + isRequired: true, + }, + stop: { type: "array", contains: { - type: "Entries_InputChatMLMessage", + type: "string", + }, + }, + seed: { + type: "number", + description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, + format: "int16", + maximum: 1000, + minimum: -1, + }, + max_tokens: { + type: "number", + description: `The maximum number of tokens to generate in the chat completion`, + format: "uint32", + minimum: 1, + }, + logit_bias: { + type: "dictionary", + contains: { + type: "Common_logit_bias", }, }, - ], - isRequired: true, + response_format: { + type: "all-of", + description: `Response format (set to \`json_object\` to restrict output to JSON)`, + contains: [ + { + type: "Chat_CompletionResponseFormat", + }, + ], + }, + agent: { + type: "all-of", + description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + preset: { + type: "all-of", + description: `Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)`, + contains: [ + { + type: "Chat_GenerationPreset", + }, + ], + }, + }, }, - settings: { - type: "any-of", - description: `Settings for the prompt`, - contains: [ - { - properties: { - model: { - type: "all-of", - description: `Identifier of the model to be used`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - }, - stream: { - type: "boolean", - description: `Indicates if the server should stream the response as it's generated`, - isRequired: true, - }, - stop: { - type: "array", - contains: { - type: "string", - }, - }, - seed: { - type: "number", - description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, - format: "int16", - maximum: 1000, - minimum: -1, - }, - max_tokens: { - type: "number", - description: `The maximum number of tokens to generate in the chat completion`, - format: "uint32", - minimum: 1, - }, - logit_bias: { - type: "dictionary", - contains: { - type: "Common_logit_bias", - }, - }, - response_format: { - type: "all-of", - description: `Response format (set to \`json_object\` to restrict output to JSON)`, - contains: [ - { - type: "Chat_CompletionResponseFormat", - }, - ], - }, - agent: { - type: "all-of", - description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - preset: { - type: "all-of", - description: `Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)`, - contains: [ - { - type: "Chat_GenerationPreset", - }, - ], - }, + { + properties: { + model: { + type: "all-of", + description: `Identifier of the model to be used`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + stream: { + type: "boolean", + description: `Indicates if the server should stream the response as it's generated`, + isRequired: true, + }, + stop: { + type: "array", + contains: { + type: "string", }, }, - { - properties: { - model: { - type: "all-of", - description: `Identifier of the model to be used`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - }, - stream: { - type: "boolean", - description: `Indicates if the server should stream the response as it's generated`, - isRequired: true, - }, - stop: { - type: "array", - contains: { - type: "string", - }, - }, - seed: { - type: "number", - description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, - format: "int16", - maximum: 1000, - minimum: -1, - }, - max_tokens: { - type: "number", - description: `The maximum number of tokens to generate in the chat completion`, - format: "uint32", - minimum: 1, - }, - logit_bias: { - type: "dictionary", - contains: { - type: "Common_logit_bias", - }, - }, - response_format: { - type: "all-of", - description: `Response format (set to \`json_object\` to restrict output to JSON)`, - contains: [ - { - type: "Chat_CompletionResponseFormat", - }, - ], - }, - agent: { - type: "all-of", - description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - frequency_penalty: { - type: "number", - description: `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.`, - format: "float", - maximum: 2, - minimum: -2, - }, - presence_penalty: { - type: "number", - description: `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.`, - format: "float", - maximum: 2, - minimum: -2, - }, - temperature: { - type: "number", - description: `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.`, - format: "float", - maximum: 5, - }, - top_p: { - type: "number", - description: `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.`, - format: "float", - maximum: 1, - }, + seed: { + type: "number", + description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, + format: "int16", + maximum: 1000, + minimum: -1, + }, + max_tokens: { + type: "number", + description: `The maximum number of tokens to generate in the chat completion`, + format: "uint32", + minimum: 1, + }, + logit_bias: { + type: "dictionary", + contains: { + type: "Common_logit_bias", }, }, - { - properties: { - model: { - type: "all-of", - description: `Identifier of the model to be used`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - }, - stream: { - type: "boolean", - description: `Indicates if the server should stream the response as it's generated`, - isRequired: true, - }, - stop: { - type: "array", - contains: { - type: "string", - }, - }, - seed: { - type: "number", - description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, - format: "int16", - maximum: 1000, - minimum: -1, - }, - max_tokens: { - type: "number", - description: `The maximum number of tokens to generate in the chat completion`, - format: "uint32", - minimum: 1, - }, - logit_bias: { - type: "dictionary", - contains: { - type: "Common_logit_bias", - }, - }, - response_format: { - type: "all-of", - description: `Response format (set to \`json_object\` to restrict output to JSON)`, - contains: [ - { - type: "Chat_CompletionResponseFormat", - }, - ], - }, - agent: { - type: "all-of", - description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, - contains: [ - { - type: "Common_uuid", - }, - ], - }, - repetition_penalty: { - type: "number", - description: `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.`, - format: "float", - maximum: 2, - }, - length_penalty: { - type: "number", - description: `Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.`, - format: "float", - maximum: 2, - }, - temperature: { - type: "number", - description: `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.`, - format: "float", - maximum: 5, - }, - top_p: { - type: "number", - description: `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.`, - format: "float", - maximum: 1, - }, - min_p: { - type: "number", - description: `Minimum probability compared to leading token to be considered`, - format: "float", - maximum: 1, - }, + response_format: { + type: "all-of", + description: `Response format (set to \`json_object\` to restrict output to JSON)`, + contains: [ + { + type: "Chat_CompletionResponseFormat", + }, + ], + }, + agent: { + type: "all-of", + description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + frequency_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + presence_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + }, + }, + { + properties: { + model: { + type: "all-of", + description: `Identifier of the model to be used`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + stream: { + type: "boolean", + description: `Indicates if the server should stream the response as it's generated`, + isRequired: true, + }, + stop: { + type: "array", + contains: { + type: "string", }, }, - ], - isRequired: true, + seed: { + type: "number", + description: `If specified, the system will make a best effort to sample deterministically for that particular seed value`, + format: "int16", + maximum: 1000, + minimum: -1, + }, + max_tokens: { + type: "number", + description: `The maximum number of tokens to generate in the chat completion`, + format: "uint32", + minimum: 1, + }, + logit_bias: { + type: "dictionary", + contains: { + type: "Common_logit_bias", + }, + }, + response_format: { + type: "all-of", + description: `Response format (set to \`json_object\` to restrict output to JSON)`, + contains: [ + { + type: "Chat_CompletionResponseFormat", + }, + ], + }, + agent: { + type: "all-of", + description: `Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions)`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + repetition_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + }, + length_penalty: { + type: "number", + description: `Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.`, + format: "float", + maximum: 2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + min_p: { + type: "number", + description: `Minimum probability compared to leading token to be considered`, + format: "float", + maximum: 1, + }, + }, }, - }, + ], + isRequired: true, }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_Task.ts b/sdks/ts/src/api/schemas/$Tasks_Task.ts index 2de09403a..c9cb57de0 100644 --- a/sdks/ts/src/api/schemas/$Tasks_Task.ts +++ b/sdks/ts/src/api/schemas/$Tasks_Task.ts @@ -7,7 +7,27 @@ export const $Tasks_Task = { contains: { type: "array", contains: { - type: "Tasks_WorkflowStep", + type: "any-of", + contains: [ + { + type: "Tasks_EvaluateStep", + }, + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + { + type: "Tasks_IfElseWorkflowStep", + }, + ], }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts b/sdks/ts/src/api/schemas/$Tasks_TaskTool.ts similarity index 81% rename from sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts rename to sdks/ts/src/api/schemas/$Tasks_TaskTool.ts index 4e8373fbf..f13fe0486 100644 --- a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_TaskTool.ts @@ -2,9 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Tools_UpdateToolRequest = { - description: `Payload for updating a tool`, +export const $Tasks_TaskTool = { properties: { + inherited: { + type: "boolean", + description: `Read-only: Whether the tool was inherited or not. Only applies within tasks.`, + isReadOnly: true, + }, type: { type: "all-of", description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, diff --git a/sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts b/sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts index 3e07ea532..3049f4de1 100644 --- a/sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_ToolCallStep.ts @@ -3,31 +3,23 @@ /* tslint:disable */ /* eslint-disable */ export const $Tasks_ToolCallStep = { - type: "all-of", - contains: [ - { - type: "Tasks_WorkflowStep", - }, - { - properties: { - tool: { - type: "all-of", - description: `The tool to run`, - contains: [ - { - type: "Common_toolRef", - }, - ], - isRequired: true, - }, - arguments: { - type: "dictionary", - contains: { - properties: {}, - }, - isRequired: true, + properties: { + tool: { + type: "all-of", + description: `The tool to run`, + contains: [ + { + type: "Common_toolRef", }, + ], + isRequired: true, + }, + arguments: { + type: "dictionary", + contains: { + properties: {}, }, + isRequired: true, }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts index 5e77093f7..c65447265 100644 --- a/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts +++ b/sdks/ts/src/api/schemas/$Tasks_UpdateTaskRequest.ts @@ -7,7 +7,27 @@ export const $Tasks_UpdateTaskRequest = { contains: { type: "array", contains: { - type: "Tasks_WorkflowStep", + type: "any-of", + contains: [ + { + type: "Tasks_EvaluateStep", + }, + { + type: "Tasks_ToolCallStep", + }, + { + type: "Tasks_YieldStep", + }, + { + type: "Tasks_PromptStep", + }, + { + type: "Tasks_ErrorWorkflowStep", + }, + { + type: "Tasks_IfElseWorkflowStep", + }, + ], }, }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_WorkflowStep.ts b/sdks/ts/src/api/schemas/$Tasks_WorkflowStep.ts deleted file mode 100644 index 68ac08931..000000000 --- a/sdks/ts/src/api/schemas/$Tasks_WorkflowStep.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tasks_WorkflowStep = { - properties: { - kind: { - type: "string", - description: `Discriminator property for WorkflowStep.`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts b/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts index 43bdbba58..c67fb06da 100644 --- a/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts +++ b/sdks/ts/src/api/schemas/$Tasks_YieldStep.ts @@ -3,26 +3,18 @@ /* tslint:disable */ /* eslint-disable */ export const $Tasks_YieldStep = { - type: "all-of", - contains: [ - { - type: "Tasks_WorkflowStep", + properties: { + workflow: { + type: "string", + description: `The subworkflow to run`, + isRequired: true, }, - { - properties: { - workflow: { - type: "string", - description: `The subworkflow to run`, - isRequired: true, - }, - arguments: { - type: "dictionary", - contains: { - type: "Common_PyExpression", - }, - isRequired: true, - }, + arguments: { + type: "dictionary", + contains: { + type: "Common_PyExpression", }, + isRequired: true, }, - ], + }, } as const; diff --git a/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts deleted file mode 100644 index bea3b4740..000000000 --- a/sdks/ts/src/api/schemas/$Tools_CreateToolRequest.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tools_CreateToolRequest = { - description: `Payload for creating a tool`, - properties: { - type: { - type: "all-of", - description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, - contains: [ - { - type: "Tools_ToolType", - }, - ], - isRequired: true, - }, - name: { - type: "all-of", - description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, - contains: [ - { - type: "Common_validPythonIdentifier", - }, - ], - isRequired: true, - }, - function: { - type: "Tools_FunctionDef", - }, - integration: { - properties: {}, - }, - system: { - properties: {}, - }, - api_call: { - properties: {}, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts deleted file mode 100644 index c79a3478e..000000000 --- a/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tools_FunctionDefUpdate = { - description: `Function definition`, - properties: { - name: { - type: "all-of", - description: `DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons.`, - contains: [ - { - type: "Common_validPythonIdentifier", - }, - ], - }, - description: { - type: "all-of", - description: `Description of the function`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - }, - parameters: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts deleted file mode 100644 index 4170be793..000000000 --- a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Tools_PatchToolRequest = { - description: `Payload for patching a tool`, - properties: { - type: { - type: "all-of", - description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, - contains: [ - { - type: "Tools_ToolType", - }, - ], - }, - name: { - type: "all-of", - description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, - contains: [ - { - type: "Common_validPythonIdentifier", - }, - ], - }, - function: { - type: "Tools_FunctionDefUpdate", - }, - integration: { - properties: {}, - }, - system: { - properties: {}, - }, - api_call: { - properties: {}, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts deleted file mode 100644 index 47f504e4c..000000000 --- a/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Users_CreateOrUpdateUserRequest_id = { - type: "Common_uuid", -} as const; diff --git a/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts deleted file mode 100644 index e9131ec14..000000000 --- a/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Users_CreateUserRequest = { - description: `Payload for creating a user (and associated documents)`, - properties: { - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the user`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the user`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts b/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts deleted file mode 100644 index 060855d65..000000000 --- a/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Users_PatchUserRequest = { - description: `Payload for patching a user`, - properties: { - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the user`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - }, - about: { - type: "string", - description: `About the user`, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts deleted file mode 100644 index cef57aa63..000000000 --- a/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Users_UpdateUserRequest = { - description: `Payload for updating a user`, - properties: { - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - name: { - type: "all-of", - description: `Name of the user`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the user`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/schemas/$Users_User.ts b/sdks/ts/src/api/schemas/$Users_User.ts deleted file mode 100644 index 232c618c3..000000000 --- a/sdks/ts/src/api/schemas/$Users_User.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Users_User = { - properties: { - id: { - type: "all-of", - contains: [ - { - type: "Common_uuid", - }, - ], - isReadOnly: true, - isRequired: true, - }, - metadata: { - type: "dictionary", - contains: { - properties: {}, - }, - }, - created_at: { - type: "string", - description: `When this resource was created as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - updated_at: { - type: "string", - description: `When this resource was updated as UTC date-time`, - isReadOnly: true, - isRequired: true, - format: "date-time", - }, - name: { - type: "all-of", - description: `Name of the user`, - contains: [ - { - type: "Common_identifierSafeUnicode", - }, - ], - isRequired: true, - }, - about: { - type: "string", - description: `About the user`, - isRequired: true, - }, - }, -} as const; diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index 6d3d0347b..babe0e845 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -2,10 +2,6 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Agents_Agent } from "../models/Agents_Agent"; -import type { Agents_CreateAgentRequest } from "../models/Agents_CreateAgentRequest"; -import type { Agents_PatchAgentRequest } from "../models/Agents_PatchAgentRequest"; -import type { Agents_UpdateAgentRequest } from "../models/Agents_UpdateAgentRequest"; import type { Chat_ChunkChatResponse } from "../models/Chat_ChunkChatResponse"; import type { Chat_CompletionResponseFormat } from "../models/Chat_CompletionResponseFormat"; import type { Chat_GenerationPreset } from "../models/Chat_GenerationPreset"; @@ -20,9 +16,9 @@ import type { Common_ResourceUpdatedResponse } from "../models/Common_ResourceUp import type { Common_uuid } from "../models/Common_uuid"; import type { Docs_Doc } from "../models/Docs_Doc"; import type { Docs_DocReference } from "../models/Docs_DocReference"; -import type { Docs_DocSearchRequest } from "../models/Docs_DocSearchRequest"; -import type { Docs_EmbedQueryRequest } from "../models/Docs_EmbedQueryRequest"; -import type { Docs_EmbedQueryResponse } from "../models/Docs_EmbedQueryResponse"; +import type { Docs_HybridDocSearchRequest } from "../models/Docs_HybridDocSearchRequest"; +import type { Docs_TextOnlyDocSearchRequest } from "../models/Docs_TextOnlyDocSearchRequest"; +import type { Docs_VectorDocSearchRequest } from "../models/Docs_VectorDocSearchRequest"; import type { Entries_History } from "../models/Entries_History"; import type { Entries_InputChatMLMessage } from "../models/Entries_InputChatMLMessage"; import type { Executions_CreateExecutionRequest } from "../models/Executions_CreateExecutionRequest"; @@ -30,206 +26,16 @@ import type { Executions_Execution } from "../models/Executions_Execution"; import type { Executions_TaskTokenResumeExecutionRequest } from "../models/Executions_TaskTokenResumeExecutionRequest"; import type { Executions_Transition } from "../models/Executions_Transition"; import type { Executions_UpdateExecutionRequest } from "../models/Executions_UpdateExecutionRequest"; -import type { Jobs_JobStatus } from "../models/Jobs_JobStatus"; -import type { Sessions_CreateSessionRequest } from "../models/Sessions_CreateSessionRequest"; -import type { Sessions_PatchSessionRequest } from "../models/Sessions_PatchSessionRequest"; -import type { Sessions_Session } from "../models/Sessions_Session"; -import type { Sessions_UpdateSessionRequest } from "../models/Sessions_UpdateSessionRequest"; import type { Tasks_CreateTaskRequest } from "../models/Tasks_CreateTaskRequest"; import type { Tasks_PatchTaskRequest } from "../models/Tasks_PatchTaskRequest"; import type { Tasks_Task } from "../models/Tasks_Task"; import type { Tasks_UpdateTaskRequest } from "../models/Tasks_UpdateTaskRequest"; import type { Tools_FunctionTool } from "../models/Tools_FunctionTool"; import type { Tools_NamedToolChoice } from "../models/Tools_NamedToolChoice"; -import type { Tools_PatchToolRequest } from "../models/Tools_PatchToolRequest"; -import type { Tools_Tool } from "../models/Tools_Tool"; -import type { Tools_UpdateToolRequest } from "../models/Tools_UpdateToolRequest"; -import type { Users_CreateUserRequest } from "../models/Users_CreateUserRequest"; -import type { Users_PatchUserRequest } from "../models/Users_PatchUserRequest"; -import type { Users_UpdateUserRequest } from "../models/Users_UpdateUserRequest"; -import type { Users_User } from "../models/Users_User"; import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class DefaultService { constructor(public readonly httpRequest: BaseHttpRequest) {} - /** - * List Agents (paginated) - * @returns any The request has succeeded. - * @throws ApiError - */ - public agentsRouteList({ - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", - }: { - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/agents", - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, - }); - } - /** - * Create a new Agent - * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. - * @throws ApiError - */ - public agentsRouteCreate({ - requestBody, - }: { - requestBody: Agents_CreateAgentRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/agents", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Create or update an Agent - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public agentsRouteCreateOrUpdate({ - id, - requestBody, - }: { - id: Common_uuid; - requestBody: Agents_UpdateAgentRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/agents/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public agentsRouteUpdate({ - id, - requestBody, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - requestBody: Agents_UpdateAgentRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/agents/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing Agent by id (merges with existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public agentsRoutePatch({ - id, - requestBody, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - requestBody: Agents_PatchAgentRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PATCH", - url: "/agents/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete Agent by id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. - * @throws ApiError - */ - public agentsRouteDelete({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/agents/{id}", - path: { - id: id, - }, - }); - } - /** - * Get an Agent by id - * @returns Agents_Agent The request has succeeded. - * @throws ApiError - */ - public agentsRouteGet({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/agents/{id}", - path: { - id: id, - }, - }); - } /** * List Docs owned by an Agent * @returns any The request has succeeded. @@ -304,7 +110,10 @@ export class DefaultService { */ id: Common_uuid; requestBody: { - body: Docs_DocSearchRequest; + body: + | Docs_VectorDocSearchRequest + | Docs_TextOnlyDocSearchRequest + | Docs_HybridDocSearchRequest; }; /** * Limit the number of items returned @@ -475,579 +284,164 @@ export class DefaultService { * ID of the resource to be patched */ childId: Common_uuid; - requestBody: Tasks_PatchTaskRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PATCH", - url: "/agents/{id}/tasks/{child_id}", - path: { - id: id, - child_id: childId, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete a task by its id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. - * @throws ApiError - */ - public tasksRouteDelete({ - id, - childId, - }: { - /** - * ID of parent resource - */ - id: Common_uuid; - /** - * ID of the resource to be deleted - */ - childId: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/agents/{id}/tasks/{child_id}", - path: { - id: id, - child_id: childId, - }, - }); - } - /** - * List tools of the given agent - * @returns any The request has succeeded. - * @throws ApiError - */ - public agentToolsRouteList({ - id, - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", - }: { - /** - * ID of parent - */ - id: Common_uuid; - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/agents/{id}/tools", - path: { - id: id, - }, - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, - }); - } - /** - * Create a new tool for this agent - * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. - * @throws ApiError - */ - public agentToolsRouteCreate({ - id, - requestBody, - }: { - /** - * ID of parent resource - */ - id: Common_uuid; - requestBody: Agents_CreateAgentRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/agents/{id}/tools", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing tool (overwrite existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public agentToolsRouteUpdate({ - id, - childId, - requestBody, - }: { - /** - * ID of parent resource - */ - id: Common_uuid; - /** - * ID of the resource to be updated - */ - childId: Common_uuid; - requestBody: Tools_UpdateToolRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/agents/{id}/tools/{child_id}", - path: { - id: id, - child_id: childId, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing tool (merges with existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public agentToolsRoutePatch({ - id, - childId, - requestBody, - }: { - /** - * ID of parent resource - */ - id: Common_uuid; - /** - * ID of the resource to be patched - */ - childId: Common_uuid; - requestBody: Tools_PatchToolRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PATCH", - url: "/agents/{id}/tools/{child_id}", - path: { - id: id, - child_id: childId, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete an existing tool by id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. - * @throws ApiError - */ - public agentToolsRouteDelete({ - id, - childId, - }: { - /** - * ID of parent resource - */ - id: Common_uuid; - /** - * ID of the resource to be deleted - */ - childId: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/agents/{id}/tools/{child_id}", - path: { - id: id, - child_id: childId, - }, - }); - } - /** - * Create or update a task - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public tasksCreateOrUpdateRouteCreateOrUpdate({ - parentId, - id, - requestBody, - }: { - /** - * ID of parent resource - */ - parentId: Common_uuid; - id: Common_uuid; - requestBody: Tasks_CreateTaskRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/agents/{parent_id}/tasks/{id}", - path: { - parent_id: parentId, - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Get Doc by id - * @returns Docs_Doc The request has succeeded. - * @throws ApiError - */ - public individualDocsRouteGet({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/docs/{id}", - path: { - id: id, - }, - }); - } - /** - * Delete an existing Doc by id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. - * @throws ApiError - */ - public individualDocsRouteDelete({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/docs/{id}", - path: { - id: id, - }, - }); - } - /** - * Embed a query for search - * @returns Docs_EmbedQueryResponse The request has succeeded. - * @throws ApiError - */ - public embedRouteEmbed({ - requestBody, - }: { - requestBody: { - body: Docs_EmbedQueryRequest; - }; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/embed", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Get an Execution by id - * @returns Executions_Execution The request has succeeded. - * @throws ApiError - */ - public executionsRouteGet({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/executions/{id}", - path: { - id: id, - }, - }); - } - /** - * List the Transitions of an Execution by id - * @returns any The request has succeeded. - * @throws ApiError - */ - public executionTransitionsRouteList({ - id, - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", - }: { - /** - * ID of parent - */ - id: Common_uuid; - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array<{ - transitions: Array; - }>; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/executions/{id}/transitions", - path: { - id: id, - }, - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, - }); - } - /** - * Get the status of an existing Job by its id - * @returns Jobs_JobStatus The request has succeeded. - * @throws ApiError - */ - public jobRouteGet({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/jobs/{id}", - path: { - id: id, - }, - }); - } - /** - * List sessions (paginated) - * @returns any The request has succeeded. - * @throws ApiError - */ - public sessionsRouteList({ - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", - }: { - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/sessions", - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, - }); - } - /** - * Create a new session - * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. - * @throws ApiError - */ - public sessionsRouteCreate({ - requestBody, - }: { - requestBody: Sessions_CreateSessionRequest; - }): CancelablePromise { + requestBody: Tasks_PatchTaskRequest; + }): CancelablePromise { return this.httpRequest.request({ - method: "POST", - url: "/sessions", + method: "PATCH", + url: "/agents/{id}/tasks/{child_id}", + path: { + id: id, + child_id: childId, + }, body: requestBody, mediaType: "application/json", }); } /** - * Create or update a session - * @returns Common_ResourceUpdatedResponse The request has succeeded. + * Delete a task by its id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public sessionsRouteCreateOrUpdate({ + public tasksRouteDelete({ id, - requestBody, + childId, }: { + /** + * ID of parent resource + */ id: Common_uuid; - requestBody: Sessions_CreateSessionRequest; - }): CancelablePromise { + /** + * ID of the resource to be deleted + */ + childId: Common_uuid; + }): CancelablePromise { return this.httpRequest.request({ - method: "POST", - url: "/sessions/{id}", + method: "DELETE", + url: "/agents/{id}/tasks/{child_id}", path: { id: id, + child_id: childId, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Update an existing session by its id (overwrites all existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. + * Get Doc by id + * @returns Docs_Doc The request has succeeded. * @throws ApiError */ - public sessionsRouteUpdate({ + public individualDocsRouteGet({ id, - requestBody, }: { /** * ID of the resource */ id: Common_uuid; - requestBody: Sessions_UpdateSessionRequest; - }): CancelablePromise { + }): CancelablePromise { return this.httpRequest.request({ - method: "PUT", - url: "/sessions/{id}", + method: "GET", + url: "/docs/{id}", path: { id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Update an existing session by its id (merges with existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. + * Delete an existing Doc by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public sessionsRoutePatch({ + public individualDocsRouteDelete({ id, - requestBody, }: { /** * ID of the resource */ id: Common_uuid; - requestBody: Sessions_PatchSessionRequest; - }): CancelablePromise { + }): CancelablePromise { return this.httpRequest.request({ - method: "PATCH", - url: "/sessions/{id}", + method: "DELETE", + url: "/docs/{id}", path: { id: id, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Delete a session by its id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * Get an Execution by id + * @returns Executions_Execution The request has succeeded. * @throws ApiError */ - public sessionsRouteDelete({ + public executionsRouteGet({ id, }: { /** * ID of the resource */ id: Common_uuid; - }): CancelablePromise { + }): CancelablePromise { return this.httpRequest.request({ - method: "DELETE", - url: "/sessions/{id}", + method: "GET", + url: "/executions/{id}", path: { id: id, }, }); } /** - * Get a session by id - * @returns Sessions_Session The request has succeeded. + * List the Transitions of an Execution by id + * @returns any The request has succeeded. * @throws ApiError */ - public sessionsRouteGet({ + public executionTransitionsRouteList({ id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", }: { /** - * ID of the resource + * ID of parent */ id: Common_uuid; - }): CancelablePromise { + /** + * Limit the number of items returned + */ + limit?: Common_limit; + /** + * Offset the items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array<{ + transitions: Array; + }>; + }> { return this.httpRequest.request({ method: "GET", - url: "/sessions/{id}", + url: "/executions/{id}/transitions", path: { id: id, }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, }); } /** @@ -1507,184 +901,6 @@ export class DefaultService { mediaType: "application/json", }); } - /** - * List users (paginated) - * @returns any The request has succeeded. - * @throws ApiError - */ - public usersRouteList({ - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", - }: { - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { - return this.httpRequest.request({ - method: "GET", - url: "/users", - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, - }); - } - /** - * Create a new user - * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. - * @throws ApiError - */ - public usersRouteCreate({ - requestBody, - }: { - requestBody: Users_CreateUserRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/users", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Create or update a user - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public usersRouteCreateOrUpdate({ - id, - requestBody, - }: { - id: Common_uuid; - requestBody: Users_UpdateUserRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "POST", - url: "/users/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing user by id (overwrite existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public usersRouteUpdate({ - id, - requestBody, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - requestBody: Users_UpdateUserRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PUT", - url: "/users/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an existing user by id (merge with existing values) - * @returns Common_ResourceUpdatedResponse The request has succeeded. - * @throws ApiError - */ - public usersRoutePatch({ - id, - requestBody, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - requestBody: Users_PatchUserRequest; - }): CancelablePromise { - return this.httpRequest.request({ - method: "PATCH", - url: "/users/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete a user by id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. - * @throws ApiError - */ - public usersRouteDelete({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "DELETE", - url: "/users/{id}", - path: { - id: id, - }, - }); - } - /** - * Get a user by id - * @returns Users_User The request has succeeded. - * @throws ApiError - */ - public usersRouteGet({ - id, - }: { - /** - * ID of the resource - */ - id: Common_uuid; - }): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/users/{id}", - path: { - id: id, - }, - }); - } /** * List Docs owned by a User * @returns any The request has succeeded. @@ -1759,7 +975,10 @@ export class DefaultService { */ id: Common_uuid; requestBody: { - body: Docs_DocSearchRequest; + body: + | Docs_VectorDocSearchRequest + | Docs_TextOnlyDocSearchRequest + | Docs_HybridDocSearchRequest; }; /** * Limit the number of items returned diff --git a/typespec/docs/models.tsp b/typespec/docs/models.tsp index 6795822a4..8f92c7956 100644 --- a/typespec/docs/models.tsp +++ b/typespec/docs/models.tsp @@ -60,14 +60,7 @@ model EmbedQueryResponse { vectors: float[][]; } -@discriminator("mode") -model DocSearchRequest { - text?: string | string[]; - vector?: float[] | float[][]; - - /** The search mode */ - mode: "vector" | "text" | "hybrid"; - +model BaseDocSearchRequest { /** The confidence cutoff level */ @minValue(0) @maxValue(1) @@ -85,27 +78,26 @@ model DocSearchRequest { lang: "en-US" = "en-US"; } -model VectorDocSearchRequest extends DocSearchRequest { +model VectorDocSearchRequest extends BaseDocSearchRequest { /** Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ vector: float[] | float[][]; text?: never; - mode: "vector" = "vector"; } -model TextOnlyDocSearchRequest extends DocSearchRequest { - /** Text or texts to use in the search. In `text` search mode, only BM25 is used. */ +model TextOnlyDocSearchRequest extends BaseDocSearchRequest { + /** Text or texts to use in the search. */ text: string | string[]; vector?: never; - mode: "text" = "text"; } -model HybridDocSearchRequest extends DocSearchRequest { +model HybridDocSearchRequest extends BaseDocSearchRequest { /** Text or texts to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. */ - text?: string | string[]; + text: string | string[]; /** Vector or vectors to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. */ - vector?: float[] | float[][]; - mode: "hybrid" = "hybrid"; -} \ No newline at end of file + vector: float[] | float[][]; +} + +alias DocSearchRequest = VectorDocSearchRequest | TextOnlyDocSearchRequest | HybridDocSearchRequest; \ No newline at end of file diff --git a/typespec/entries/models.tsp b/typespec/entries/models.tsp index b6a09b53b..12608869a 100644 --- a/typespec/entries/models.tsp +++ b/typespec/entries/models.tsp @@ -39,22 +39,14 @@ model ImageURL { detail: ImageDetail = ImageDetail.auto; } -@discriminator("type") -model BaseChatMLContentPart { - /** The type of content part */ - type: string; - text?: string; - image_url?: ImageURL; -} - -model ChatMLTextContentPart extends BaseChatMLContentPart { +model ChatMLTextContentPart { text: string; /** The type (fixed to 'text') */ type: "text" = "text"; } -model ChatMLImageContentPart extends BaseChatMLContentPart { +model ChatMLImageContentPart { /** The image URL */ image_url: ImageURL; diff --git a/typespec/executions/endpoints.tsp b/typespec/executions/endpoints.tsp index 8869b7022..46ec49286 100644 --- a/typespec/executions/endpoints.tsp +++ b/typespec/executions/endpoints.tsp @@ -1,6 +1,10 @@ +import "@typespec/http"; + import "../common"; import "./models.tsp"; +using TypeSpec.Http; + using Common; namespace Executions; @@ -16,7 +20,32 @@ interface TaskEndpoints extends ChildUpdateEndpoint< UpdateExecutionRequest, "Update an existing Execution" - > {} + >, + ChildCreateEndpoint< + CreateExecutionRequest, + "Create an execution for the given task" + >, + ChildLimitOffsetPagination { + @put + @doc("Resume an execution with a task token") + resumeWithTaskToken( + @header contentType: yaml | json, + + @path + @doc("ID of parent Task") + id: uuid, + + @body + @doc("Request to resume an execution with a task token") + body: TaskTokenResumeExecutionRequest, + ): { + @statusCode _: "200"; + + @body + @doc("Response of resuming the execution with the ID found") + body: ResourceUpdatedResponse; + }; +} interface TransitionEndpoints extends ChildLimitOffsetPagination< diff --git a/typespec/main.tsp b/typespec/main.tsp index c7585a3d7..b6213871e 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -102,7 +102,7 @@ namespace Api { interface TasksCreateOrUpdateRoute extends Tasks.CreateOrUpdateEndpoints {} @route("/tasks/{id}/executions") - interface TaskExecutionsRoute extends Tasks.ExecutionEndpoints, Executions.TaskEndpoints {} + interface TaskExecutionsRoute extends Executions.TaskEndpoints {} @route("/executions") interface ExecutionsRoute extends Executions.Endpoints {} diff --git a/typespec/tasks/endpoints.tsp b/typespec/tasks/endpoints.tsp index 5d656c78a..73f50e457 100644 --- a/typespec/tasks/endpoints.tsp +++ b/typespec/tasks/endpoints.tsp @@ -1,11 +1,7 @@ -import "@typespec/http"; - import "../common"; import "../executions"; import "./models.tsp"; -using TypeSpec.Http; - using Common; using Executions; @@ -32,31 +28,4 @@ interface Endpoints >, ChildDeleteEndpoint<"Delete a task by its id">, ChildLimitOffsetPagination, - ChildCreateEndpoint {} - -interface ExecutionEndpoints - extends ChildCreateEndpoint< - CreateExecutionRequest, - "Create an execution for the given task" - >, - ChildLimitOffsetPagination { - @put - @doc("Resume an execution with a task token") - resumeWithTaskToken( - @header contentType: yaml | json, - - @path - @doc("ID of parent Task") - id: uuid, - - @body - @doc("Request to resume an execution with a task token") - body: TaskTokenResumeExecutionRequest, - ): { - @statusCode _: "200"; - - @body - @doc("Response of resuming the execution with the ID found") - body: ResourceUpdatedResponse; - }; -} + ChildCreateEndpoint {} \ No newline at end of file diff --git a/typespec/tasks/models.tsp b/typespec/tasks/models.tsp index 7e7aab2ed..918135575 100644 --- a/typespec/tasks/models.tsp +++ b/typespec/tasks/models.tsp @@ -44,16 +44,7 @@ alias WorkflowStepKind = ( | "error" ); -@discriminator("kind") -model WorkflowStep { - @visibility("none") - kind?: WorkflowStepKind; -} - -model ToolCallStep extends WorkflowStep { - @visibility("none") - kind: "tool_call" = "tool_call"; - +model ToolCallStep { /** The tool to run */ tool: toolRef; @@ -64,10 +55,7 @@ model ToolCallStep extends WorkflowStep { /** An object where values are strings in the Common Expression Language that get evaluated before being passed downstream */ alias ExpressionObject = Record; -model YieldStep extends WorkflowStep { - @visibility("none") - kind: "yield" = "yield"; - +model YieldStep { /** The subworkflow to run */ workflow: string; @@ -75,10 +63,7 @@ model YieldStep extends WorkflowStep { arguments: ExpressionObject; } -model PromptStep extends WorkflowStep { - @visibility("none") - kind: "prompt" = "prompt"; - +model PromptStep { /** The prompt to run */ prompt: string | InputChatMLMessage[]; @@ -86,40 +71,31 @@ model PromptStep extends WorkflowStep { settings: ChatSettings; } -model EvaluateStep extends WorkflowStep { - @visibility("none") - kind: "evaluate" = "evaluate"; - +model EvaluateStep { /** The expression to evaluate */ evaluate: ExpressionObject; } -model IfElseWorkflowStep extends WorkflowStep { - @visibility("none") - kind: "if_else" = "if_else"; +model ErrorWorkflowStep { + /** The error message */ + error: string; +} +alias NonConditionalWorkflowStep = EvaluateStep | ToolCallStep | YieldStep | PromptStep | ErrorWorkflowStep; + +model IfElseWorkflowStep { /** The condition to evaluate */ `if`: PyExpression; /** The steps to run if the condition is true */ - then: WorkflowStep; + then: NonConditionalWorkflowStep; /** The steps to run if the condition is false */ - `else`: WorkflowStep; + `else`: NonConditionalWorkflowStep; } -model ErrorWorkflowStep extends WorkflowStep { - @visibility("none") - kind: "error" = "error"; - - /** The error message */ - error: string; -} - -@withVisibility("create") -model CreateWorkflowStep { - ...WorkflowStep; -} +alias WorkflowStep = NonConditionalWorkflowStep | IfElseWorkflowStep; +alias CreateWorkflowStep = WorkflowStep; model Workflow { @key name: validPythonIdentifier; @@ -128,6 +104,14 @@ model Workflow { steps: WorkflowStep[]; } +model TaskTool { + /** Read-only: Whether the tool was inherited or not. Only applies within tasks. */ + @visibility("read") + inherited?: boolean = false; + + ...CreateToolRequest; +} + /** Object describing a Task */ model Task { @visibility("read", "create") @@ -142,14 +126,11 @@ model Task { input_schema: Record | null = null; /** Tools defined specifically for this task not included in the Agent itself. */ - tools: CreateToolRequest[] = #[]; + tools: TaskTool[] = #[]; /** Whether to inherit tools from the parent agent or not. Defaults to true. */ inherit_tools: boolean = true; - @visibility("read") - agent_id: Agent.id; - ...HasId; ...HasTimestamps; ...HasMetadata; From c4bac6c54408c1c69fcbebd0f08820980cf17fef Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Fri, 26 Jul 2024 18:14:39 -0400 Subject: [PATCH 31/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Chat.py | 71 + agents-api/agents_api/autogen/Docs.py | 20 + agents-api/agents_api/autogen/Tools.py | 72 + sdks/python/julep/api/README.md | 44 +- sdks/python/julep/api/__init__.py | 100 + sdks/python/julep/api/client.py | 6298 ++++++++++++++--- sdks/python/julep/api/reference.md | 3725 +++++++++- sdks/python/julep/api/types/__init__.py | 120 + ...gent_tools_route_list_request_direction.py | 7 + .../agent_tools_route_list_request_sort_by.py | 7 + .../types/agent_tools_route_list_response.py | 43 + sdks/python/julep/api/types/agents_agent.py | 83 + .../types/agents_agent_default_settings.py | 11 + .../api/types/agents_agent_instructions.py | 5 + .../api/types/agents_create_agent_request.py | 79 + ...s_create_agent_request_default_settings.py | 11 + ...gents_create_agent_request_instructions.py | 5 + ...ts_patch_agent_request_default_settings.py | 11 + ...agents_patch_agent_request_instructions.py | 5 + .../agents_route_list_request_direction.py | 7 + .../agents_route_list_request_sort_by.py | 7 + .../api/types/agents_route_list_response.py | 43 + .../api/types/agents_update_agent_request.py | 79 + ...s_update_agent_request_default_settings.py | 11 + ...gents_update_agent_request_instructions.py | 5 + .../types/chat_generation_preset_settings.py | 46 + .../julep/api/types/chat_open_ai_settings.py | 60 + .../julep/api/types/chat_v_llm_settings.py | 65 + .../api/types/docs_embed_query_request.py | 46 + .../types/docs_embed_query_request_text.py | 5 + .../api/types/docs_embed_query_response.py | 45 + sdks/python/julep/api/types/jobs_job_state.py | 16 + .../python/julep/api/types/jobs_job_status.py | 79 + .../types/sessions_context_overflow_type.py | 7 + .../types/sessions_create_session_request.py | 82 + ...sessions_multi_agent_multi_user_session.py | 44 + .../sessions_multi_agent_no_user_session.py | 43 + ...essions_multi_agent_single_user_session.py | 44 + .../sessions_route_list_request_direction.py | 7 + .../sessions_route_list_request_sort_by.py | 7 + .../api/types/sessions_route_list_response.py | 43 + .../julep/api/types/sessions_session.py | 325 + ...essions_single_agent_multi_user_session.py | 44 + .../sessions_single_agent_no_user_session.py | 43 + ...ssions_single_agent_single_user_session.py | 44 + .../api/types/tasks_create_task_request.py | 72 + .../api/types/tools_function_def_update.py | 65 + .../users_route_list_request_direction.py | 5 + .../types/users_route_list_request_sort_by.py | 7 + .../api/types/users_route_list_response.py | 43 + .../api/types/users_update_user_request.py | 56 + sdks/python/julep/api/types/users_user.py | 64 + sdks/ts/src/api/index.ts | 66 + sdks/ts/src/api/models/Agents_Agent.ts | 44 + .../api/models/Agents_CreateAgentRequest.ts | 37 + .../Agents_CreateOrUpdateAgentRequest_id.ts | 6 + .../api/models/Agents_PatchAgentRequest.ts | 37 + .../api/models/Agents_UpdateAgentRequest.ts | 37 + .../models/Chat_GenerationPresetSettings.ts | 11 + sdks/ts/src/api/models/Chat_OpenAISettings.ts | 22 + sdks/ts/src/api/models/Chat_vLLMSettings.ts | 26 + .../src/api/models/Docs_EmbedQueryRequest.ts | 10 + .../src/api/models/Docs_EmbedQueryResponse.ts | 10 + sdks/ts/src/api/models/Jobs_JobState.ts | 15 + sdks/ts/src/api/models/Jobs_JobStatus.ts | 38 + .../models/Sessions_ContextOverflowType.ts | 5 + ...essions_CreateOrUpdateSessionRequest_id.ts | 6 + .../models/Sessions_CreateSessionRequest.ts | 38 + .../Sessions_MultiAgentMultiUserSession.ts | 10 + .../Sessions_MultiAgentNoUserSession.ts | 9 + .../Sessions_MultiAgentSingleUserSession.ts | 10 + .../models/Sessions_PatchSessionRequest.ts | 27 + sdks/ts/src/api/models/Sessions_Session.ts | 42 + .../Sessions_SingleAgentMultiUserSession.ts | 10 + .../Sessions_SingleAgentNoUserSession.ts | 9 + .../Sessions_SingleAgentSingleUserSession.ts | 10 + .../models/Sessions_UpdateSessionRequest.ts | 27 + .../Tasks_CreateOrUpdateTaskRequest_id.ts | 6 + .../src/api/models/Tools_FunctionDefUpdate.ts | 23 + .../src/api/models/Tools_PatchToolRequest.ts | 24 + .../src/api/models/Tools_UpdateToolRequest.ts | 24 + .../Users_CreateOrUpdateUserRequest_id.ts | 6 + .../src/api/models/Users_CreateUserRequest.ts | 19 + .../src/api/models/Users_PatchUserRequest.ts | 19 + .../src/api/models/Users_UpdateUserRequest.ts | 19 + sdks/ts/src/api/models/Users_User.ts | 26 + sdks/ts/src/api/schemas/$Agents_Agent.ts | 89 + .../api/schemas/$Agents_CreateAgentRequest.ts | 66 + .../$Agents_CreateOrUpdateAgentRequest_id.ts | 7 + .../api/schemas/$Agents_PatchAgentRequest.ts | 62 + .../api/schemas/$Agents_UpdateAgentRequest.ts | 66 + .../schemas/$Chat_GenerationPresetSettings.ts | 17 + .../src/api/schemas/$Chat_OpenAISettings.ts | 34 + sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts | 38 + .../api/schemas/$Docs_EmbedQueryRequest.ts | 24 + .../api/schemas/$Docs_EmbedQueryResponse.ts | 18 + sdks/ts/src/api/schemas/$Jobs_JobState.ts | 7 + sdks/ts/src/api/schemas/$Jobs_JobStatus.ts | 69 + .../schemas/$Sessions_ContextOverflowType.ts | 7 + ...essions_CreateOrUpdateSessionRequest_id.ts | 7 + .../schemas/$Sessions_CreateSessionRequest.ts | 73 + .../$Sessions_MultiAgentMultiUserSession.ts | 30 + .../$Sessions_MultiAgentNoUserSession.ts | 23 + .../$Sessions_MultiAgentSingleUserSession.ts | 27 + .../schemas/$Sessions_PatchSessionRequest.ts | 39 + sdks/ts/src/api/schemas/$Sessions_Session.ts | 77 + .../$Sessions_SingleAgentMultiUserSession.ts | 27 + .../$Sessions_SingleAgentNoUserSession.ts | 20 + .../$Sessions_SingleAgentSingleUserSession.ts | 24 + .../schemas/$Sessions_UpdateSessionRequest.ts | 43 + .../$Tasks_CreateOrUpdateTaskRequest_id.ts | 7 + .../api/schemas/$Tools_FunctionDefUpdate.ts | 33 + .../api/schemas/$Tools_PatchToolRequest.ts | 39 + .../api/schemas/$Tools_UpdateToolRequest.ts | 41 + .../$Users_CreateOrUpdateUserRequest_id.ts | 7 + .../api/schemas/$Users_CreateUserRequest.ts | 30 + .../api/schemas/$Users_PatchUserRequest.ts | 28 + .../api/schemas/$Users_UpdateUserRequest.ts | 30 + sdks/ts/src/api/schemas/$Users_User.ts | 53 + sdks/ts/src/api/services/DefaultService.ts | 951 ++- 120 files changed, 13588 insertions(+), 1529 deletions(-) create mode 100644 sdks/python/julep/api/types/agent_tools_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py create mode 100644 sdks/python/julep/api/types/agent_tools_route_list_response.py create mode 100644 sdks/python/julep/api/types/agents_agent.py create mode 100644 sdks/python/julep/api/types/agents_agent_default_settings.py create mode 100644 sdks/python/julep/api/types/agents_agent_instructions.py create mode 100644 sdks/python/julep/api/types/agents_create_agent_request.py create mode 100644 sdks/python/julep/api/types/agents_create_agent_request_default_settings.py create mode 100644 sdks/python/julep/api/types/agents_create_agent_request_instructions.py create mode 100644 sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py create mode 100644 sdks/python/julep/api/types/agents_patch_agent_request_instructions.py create mode 100644 sdks/python/julep/api/types/agents_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/agents_route_list_request_sort_by.py create mode 100644 sdks/python/julep/api/types/agents_route_list_response.py create mode 100644 sdks/python/julep/api/types/agents_update_agent_request.py create mode 100644 sdks/python/julep/api/types/agents_update_agent_request_default_settings.py create mode 100644 sdks/python/julep/api/types/agents_update_agent_request_instructions.py create mode 100644 sdks/python/julep/api/types/chat_generation_preset_settings.py create mode 100644 sdks/python/julep/api/types/chat_open_ai_settings.py create mode 100644 sdks/python/julep/api/types/chat_v_llm_settings.py create mode 100644 sdks/python/julep/api/types/docs_embed_query_request.py create mode 100644 sdks/python/julep/api/types/docs_embed_query_request_text.py create mode 100644 sdks/python/julep/api/types/docs_embed_query_response.py create mode 100644 sdks/python/julep/api/types/jobs_job_state.py create mode 100644 sdks/python/julep/api/types/jobs_job_status.py create mode 100644 sdks/python/julep/api/types/sessions_context_overflow_type.py create mode 100644 sdks/python/julep/api/types/sessions_create_session_request.py create mode 100644 sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/sessions_route_list_request_sort_by.py create mode 100644 sdks/python/julep/api/types/sessions_route_list_response.py create mode 100644 sdks/python/julep/api/types/sessions_session.py create mode 100644 sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_single_agent_no_user_session.py create mode 100644 sdks/python/julep/api/types/sessions_single_agent_single_user_session.py create mode 100644 sdks/python/julep/api/types/tasks_create_task_request.py create mode 100644 sdks/python/julep/api/types/tools_function_def_update.py create mode 100644 sdks/python/julep/api/types/users_route_list_request_direction.py create mode 100644 sdks/python/julep/api/types/users_route_list_request_sort_by.py create mode 100644 sdks/python/julep/api/types/users_route_list_response.py create mode 100644 sdks/python/julep/api/types/users_update_user_request.py create mode 100644 sdks/python/julep/api/types/users_user.py create mode 100644 sdks/ts/src/api/models/Agents_Agent.ts create mode 100644 sdks/ts/src/api/models/Agents_CreateAgentRequest.ts create mode 100644 sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts create mode 100644 sdks/ts/src/api/models/Agents_PatchAgentRequest.ts create mode 100644 sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts create mode 100644 sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts create mode 100644 sdks/ts/src/api/models/Chat_OpenAISettings.ts create mode 100644 sdks/ts/src/api/models/Chat_vLLMSettings.ts create mode 100644 sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts create mode 100644 sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts create mode 100644 sdks/ts/src/api/models/Jobs_JobState.ts create mode 100644 sdks/ts/src/api/models/Jobs_JobStatus.ts create mode 100644 sdks/ts/src/api/models/Sessions_ContextOverflowType.ts create mode 100644 sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts create mode 100644 sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts create mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts create mode 100644 sdks/ts/src/api/models/Sessions_Session.ts create mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts create mode 100644 sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts create mode 100644 sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts create mode 100644 sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts create mode 100644 sdks/ts/src/api/models/Tools_PatchToolRequest.ts create mode 100644 sdks/ts/src/api/models/Tools_UpdateToolRequest.ts create mode 100644 sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts create mode 100644 sdks/ts/src/api/models/Users_CreateUserRequest.ts create mode 100644 sdks/ts/src/api/models/Users_PatchUserRequest.ts create mode 100644 sdks/ts/src/api/models/Users_UpdateUserRequest.ts create mode 100644 sdks/ts/src/api/models/Users_User.ts create mode 100644 sdks/ts/src/api/schemas/$Agents_Agent.ts create mode 100644 sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts create mode 100644 sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts create mode 100644 sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts create mode 100644 sdks/ts/src/api/schemas/$Jobs_JobState.ts create mode 100644 sdks/ts/src/api/schemas/$Jobs_JobStatus.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_Session.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts create mode 100644 sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts create mode 100644 sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts create mode 100644 sdks/ts/src/api/schemas/$Users_User.ts diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index 5f447909b..6669fbcec 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -118,6 +118,29 @@ class CompletionResponseFormat(BaseModel): """ +class GenerationPresetSettings(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + preset: ( + Literal[ + "problem_solving", + "conversational", + "fun", + "prose", + "creative", + "business", + "deterministic", + "code", + "multilingual", + ] + | None + ) = None + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ + + class LogProbResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -143,6 +166,28 @@ class MultipleChatOutput(BaseChatOutput): messages: list[ChatMLMessage] +class OpenAISettings(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + frequency_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + presence_penalty: Annotated[float | None, Field(None, ge=-2.0, le=2.0)] + """ + 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. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + + class SingleChatOutput(BaseChatOutput): """ The output returned by the model. Note that, depending on the model provider, they might return more than one message. @@ -159,3 +204,29 @@ class TokenLogProb(BaseTokenLogProb): populate_by_name=True, ) top_logprobs: list[BaseTokenLogProb] + + +class VLLMSettings(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + repetition_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + 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. + """ + length_penalty: Annotated[float | None, Field(None, ge=0.0, le=2.0)] + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + temperature: Annotated[float | None, Field(None, ge=0.0, le=5.0)] + """ + 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: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + 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. + """ + min_p: Annotated[float | None, Field(None, ge=0.0, le=1.0)] + """ + Minimum probability compared to leading token to be considered + """ diff --git a/agents-api/agents_api/autogen/Docs.py b/agents-api/agents_api/autogen/Docs.py index 6f7019a06..7c4c3b446 100644 --- a/agents-api/agents_api/autogen/Docs.py +++ b/agents-api/agents_api/autogen/Docs.py @@ -84,6 +84,26 @@ class DocReference(BaseModel): snippet: str | None = None +class EmbedQueryRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + text: str | list[str] + """ + Text or texts to embed + """ + + +class EmbedQueryResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + ) + vectors: list[list[float]] + """ + The embedded vectors + """ + + class HybridDocSearchRequest(BaseDocSearchRequest): model_config = ConfigDict( populate_by_name=True, diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index e695d0f6b..16fbaeb7b 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -66,6 +66,34 @@ class FunctionDef(BaseModel): """ +class FunctionDefUpdate(BaseModel): + """ + Function definition + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + name: Annotated[str, Field("overriden", pattern="^[^\\W0-9]\\w*$")] + """ + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + """ + description: Annotated[ + str | None, + Field( + None, + pattern="^[\\p{L}\\p{Nl}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]+[\\p{ID_Start}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\p{Pattern_Syntax}\\p{Pattern_White_Space}]*$", + ), + ] + """ + Description of the function + """ + parameters: dict[str, Any] | None = None + """ + The parameters the function accepts + """ + + class NamedToolChoice(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -80,6 +108,28 @@ class NamedToolChoice(BaseModel): api_call: Any | None = None +class PatchToolRequest(BaseModel): + """ + Payload for patching a tool + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function", "integration", "system", "api_call"] | None = None + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + name: Annotated[str | None, Field(None, pattern="^[^\\W0-9]\\w*$")] + """ + Name of the tool (must be unique for this agent and a valid python identifier string ) + """ + function: FunctionDefUpdate | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + class Tool(BaseModel): model_config = ConfigDict( populate_by_name=True, @@ -118,6 +168,28 @@ class ToolResponse(BaseModel): """ +class UpdateToolRequest(BaseModel): + """ + Payload for updating a tool + """ + + model_config = ConfigDict( + populate_by_name=True, + ) + type: Literal["function", "integration", "system", "api_call"] + """ + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + """ + name: Annotated[str, Field(pattern="^[^\\W0-9]\\w*$")] + """ + Name of the tool (must be unique for this agent and a valid python identifier string ) + """ + function: FunctionDef | None = None + integration: Any | None = None + system: Any | None = None + api_call: Any | None = None + + class ChosenFunctionCall(ChosenToolCall): model_config = ConfigDict( populate_by_name=True, diff --git a/sdks/python/julep/api/README.md b/sdks/python/julep/api/README.md index 30701733f..daa4fb689 100644 --- a/sdks/python/julep/api/README.md +++ b/sdks/python/julep/api/README.md @@ -16,26 +16,17 @@ pip install julep Instantiate and use the client with the following: ```python -from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_docs_search_route_search( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - body=DocsVectorDocSearchRequest( - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), +client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", ) ``` @@ -46,7 +37,6 @@ The SDK also exports an `async` client so that you can make non-blocking calls t ```python import asyncio -from julep import DocsVectorDocSearchRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -56,19 +46,11 @@ client = AsyncJulepApi( async def main() -> None: - await client.agents_docs_search_route_search( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - body=DocsVectorDocSearchRequest( - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), + await client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", ) @@ -84,7 +66,7 @@ will be thrown. from .api_error import ApiError try: - client.agents_docs_search_route_search(...) + client.agents_route_create(...) except ApiError as e: print(e.status_code) print(e.body) @@ -107,7 +89,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret Use the `max_retries` request option to configure this behavior. ```python -client.agents_docs_search_route_search(...,{ +client.agents_route_create(...,{ max_retries=1 }) ``` @@ -124,7 +106,7 @@ client = JulepApi(..., { timeout=20.0 }, ) # Override timeout for a specific method -client.agents_docs_search_route_search(...,{ +client.agents_route_create(...,{ timeout_in_seconds=1 }) ``` diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 9cb6f1c03..2c2b3a3cc 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -4,10 +4,27 @@ AgentDocsRouteListRequestDirection, AgentDocsRouteListRequestSortBy, AgentDocsRouteListResponse, + AgentToolsRouteListRequestDirection, + AgentToolsRouteListRequestSortBy, + AgentToolsRouteListResponse, + AgentsAgent, + AgentsAgentDefaultSettings, + AgentsAgentInstructions, + AgentsCreateAgentRequest, + AgentsCreateAgentRequestDefaultSettings, + AgentsCreateAgentRequestInstructions, AgentsDocsSearchRouteSearchRequestBody, AgentsDocsSearchRouteSearchRequestDirection, AgentsDocsSearchRouteSearchRequestSortBy, AgentsDocsSearchRouteSearchResponse, + AgentsPatchAgentRequestDefaultSettings, + AgentsPatchAgentRequestInstructions, + AgentsRouteListRequestDirection, + AgentsRouteListRequestSortBy, + AgentsRouteListResponse, + AgentsUpdateAgentRequest, + AgentsUpdateAgentRequestDefaultSettings, + AgentsUpdateAgentRequestInstructions, ChatBaseChatOutput, ChatBaseChatResponse, ChatBaseTokenLogProb, @@ -18,9 +35,11 @@ ChatCompletionResponseFormatType, ChatFinishReason, ChatGenerationPreset, + ChatGenerationPresetSettings, ChatLogProbResponse, ChatMessageChatResponse, ChatMultipleChatOutput, + ChatOpenAiSettings, ChatRouteGenerateRequest, ChatRouteGenerateRequestAgent, ChatRouteGenerateRequestAgentToolChoice, @@ -31,6 +50,7 @@ ChatRouteGenerateResponse, ChatSingleChatOutput, ChatTokenLogProb, + ChatVLlmSettings, CommonIdentifierSafeUnicode, CommonLimit, CommonLogitBias, @@ -48,6 +68,9 @@ DocsDocOwner, DocsDocOwnerRole, DocsDocReference, + DocsEmbedQueryRequest, + DocsEmbedQueryRequestText, + DocsEmbedQueryResponse, DocsHybridDocSearchRequest, DocsHybridDocSearchRequestText, DocsHybridDocSearchRequestVector, @@ -95,9 +118,30 @@ HistoryRouteListRequestDirection, HistoryRouteListRequestSortBy, HistoryRouteListResponse, + JobsJobState, + JobsJobStatus, + SessionsContextOverflowType, + SessionsCreateSessionRequest, + SessionsMultiAgentMultiUserSession, + SessionsMultiAgentNoUserSession, + SessionsMultiAgentSingleUserSession, + SessionsRouteListRequestDirection, + SessionsRouteListRequestSortBy, + SessionsRouteListResponse, + SessionsSession, + SessionsSession_MultiAgentMultiUser, + SessionsSession_MultiAgentNoUser, + SessionsSession_MultiAgentSingleUser, + SessionsSession_SingleAgentMultiUser, + SessionsSession_SingleAgentNoUser, + SessionsSession_SingleAgentSingleUser, + SessionsSingleAgentMultiUserSession, + SessionsSingleAgentNoUserSession, + SessionsSingleAgentSingleUserSession, TaskExecutionsRouteListRequestDirection, TaskExecutionsRouteListRequestSortBy, TaskExecutionsRouteListResponse, + TasksCreateTaskRequest, TasksCreateTaskRequestMainItem, TasksErrorWorkflowStep, TasksEvaluateStep, @@ -125,6 +169,7 @@ ToolsChosenToolCall_Function, ToolsFunctionCallOption, ToolsFunctionDef, + ToolsFunctionDefUpdate, ToolsFunctionTool, ToolsNamedFunctionChoice, ToolsNamedToolChoice, @@ -140,6 +185,11 @@ UserDocsSearchRouteSearchRequestDirection, UserDocsSearchRouteSearchRequestSortBy, UserDocsSearchRouteSearchResponse, + UsersRouteListRequestDirection, + UsersRouteListRequestSortBy, + UsersRouteListResponse, + UsersUpdateUserRequest, + UsersUser, ) from .environment import JulepApiEnvironment @@ -147,10 +197,27 @@ "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", + "AgentToolsRouteListRequestDirection", + "AgentToolsRouteListRequestSortBy", + "AgentToolsRouteListResponse", + "AgentsAgent", + "AgentsAgentDefaultSettings", + "AgentsAgentInstructions", + "AgentsCreateAgentRequest", + "AgentsCreateAgentRequestDefaultSettings", + "AgentsCreateAgentRequestInstructions", "AgentsDocsSearchRouteSearchRequestBody", "AgentsDocsSearchRouteSearchRequestDirection", "AgentsDocsSearchRouteSearchRequestSortBy", "AgentsDocsSearchRouteSearchResponse", + "AgentsPatchAgentRequestDefaultSettings", + "AgentsPatchAgentRequestInstructions", + "AgentsRouteListRequestDirection", + "AgentsRouteListRequestSortBy", + "AgentsRouteListResponse", + "AgentsUpdateAgentRequest", + "AgentsUpdateAgentRequestDefaultSettings", + "AgentsUpdateAgentRequestInstructions", "ChatBaseChatOutput", "ChatBaseChatResponse", "ChatBaseTokenLogProb", @@ -161,9 +228,11 @@ "ChatCompletionResponseFormatType", "ChatFinishReason", "ChatGenerationPreset", + "ChatGenerationPresetSettings", "ChatLogProbResponse", "ChatMessageChatResponse", "ChatMultipleChatOutput", + "ChatOpenAiSettings", "ChatRouteGenerateRequest", "ChatRouteGenerateRequestAgent", "ChatRouteGenerateRequestAgentToolChoice", @@ -174,6 +243,7 @@ "ChatRouteGenerateResponse", "ChatSingleChatOutput", "ChatTokenLogProb", + "ChatVLlmSettings", "CommonIdentifierSafeUnicode", "CommonLimit", "CommonLogitBias", @@ -191,6 +261,9 @@ "DocsDocOwner", "DocsDocOwnerRole", "DocsDocReference", + "DocsEmbedQueryRequest", + "DocsEmbedQueryRequestText", + "DocsEmbedQueryResponse", "DocsHybridDocSearchRequest", "DocsHybridDocSearchRequestText", "DocsHybridDocSearchRequestVector", @@ -238,10 +311,31 @@ "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", + "JobsJobState", + "JobsJobStatus", "JulepApiEnvironment", + "SessionsContextOverflowType", + "SessionsCreateSessionRequest", + "SessionsMultiAgentMultiUserSession", + "SessionsMultiAgentNoUserSession", + "SessionsMultiAgentSingleUserSession", + "SessionsRouteListRequestDirection", + "SessionsRouteListRequestSortBy", + "SessionsRouteListResponse", + "SessionsSession", + "SessionsSession_MultiAgentMultiUser", + "SessionsSession_MultiAgentNoUser", + "SessionsSession_MultiAgentSingleUser", + "SessionsSession_SingleAgentMultiUser", + "SessionsSession_SingleAgentNoUser", + "SessionsSession_SingleAgentSingleUser", + "SessionsSingleAgentMultiUserSession", + "SessionsSingleAgentNoUserSession", + "SessionsSingleAgentSingleUserSession", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", + "TasksCreateTaskRequest", "TasksCreateTaskRequestMainItem", "TasksErrorWorkflowStep", "TasksEvaluateStep", @@ -269,6 +363,7 @@ "ToolsChosenToolCall_Function", "ToolsFunctionCallOption", "ToolsFunctionDef", + "ToolsFunctionDefUpdate", "ToolsFunctionTool", "ToolsNamedFunctionChoice", "ToolsNamedToolChoice", @@ -284,4 +379,9 @@ "UserDocsSearchRouteSearchRequestDirection", "UserDocsSearchRouteSearchRequestSortBy", "UserDocsSearchRouteSearchResponse", + "UsersRouteListRequestDirection", + "UsersRouteListRequestSortBy", + "UsersRouteListResponse", + "UsersUpdateUserRequest", + "UsersUser", ] diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index 6b5addb67..f085735e8 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -16,6 +16,20 @@ ) from .types.agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy from .types.agent_docs_route_list_response import AgentDocsRouteListResponse +from .types.agent_tools_route_list_request_direction import ( + AgentToolsRouteListRequestDirection, +) +from .types.agent_tools_route_list_request_sort_by import ( + AgentToolsRouteListRequestSortBy, +) +from .types.agent_tools_route_list_response import AgentToolsRouteListResponse +from .types.agents_agent import AgentsAgent +from .types.agents_create_agent_request_default_settings import ( + AgentsCreateAgentRequestDefaultSettings, +) +from .types.agents_create_agent_request_instructions import ( + AgentsCreateAgentRequestInstructions, +) from .types.agents_docs_search_route_search_request_body import ( AgentsDocsSearchRouteSearchRequestBody, ) @@ -28,15 +42,34 @@ from .types.agents_docs_search_route_search_response import ( AgentsDocsSearchRouteSearchResponse, ) +from .types.agents_patch_agent_request_default_settings import ( + AgentsPatchAgentRequestDefaultSettings, +) +from .types.agents_patch_agent_request_instructions import ( + AgentsPatchAgentRequestInstructions, +) +from .types.agents_route_list_request_direction import AgentsRouteListRequestDirection +from .types.agents_route_list_request_sort_by import AgentsRouteListRequestSortBy +from .types.agents_route_list_response import AgentsRouteListResponse +from .types.agents_update_agent_request_default_settings import ( + AgentsUpdateAgentRequestDefaultSettings, +) +from .types.agents_update_agent_request_instructions import ( + AgentsUpdateAgentRequestInstructions, +) from .types.chat_route_generate_request import ChatRouteGenerateRequest from .types.chat_route_generate_response import ChatRouteGenerateResponse +from .types.common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .types.common_limit import CommonLimit from .types.common_offset import CommonOffset from .types.common_resource_created_response import CommonResourceCreatedResponse from .types.common_resource_deleted_response import CommonResourceDeletedResponse from .types.common_resource_updated_response import CommonResourceUpdatedResponse from .types.common_uuid import CommonUuid +from .types.common_valid_python_identifier import CommonValidPythonIdentifier from .types.docs_doc import DocsDoc +from .types.docs_embed_query_request import DocsEmbedQueryRequest +from .types.docs_embed_query_response import DocsEmbedQueryResponse from .types.execution_transitions_route_list_request_direction import ( ExecutionTransitionsRouteListRequestDirection, ) @@ -51,6 +84,14 @@ from .types.history_route_list_request_direction import HistoryRouteListRequestDirection from .types.history_route_list_request_sort_by import HistoryRouteListRequestSortBy from .types.history_route_list_response import HistoryRouteListResponse +from .types.jobs_job_status import JobsJobStatus +from .types.sessions_context_overflow_type import SessionsContextOverflowType +from .types.sessions_route_list_request_direction import ( + SessionsRouteListRequestDirection, +) +from .types.sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy +from .types.sessions_route_list_response import SessionsRouteListResponse +from .types.sessions_session import SessionsSession from .types.task_executions_route_list_request_direction import ( TaskExecutionsRouteListRequestDirection, ) @@ -65,6 +106,9 @@ from .types.tasks_route_list_response import TasksRouteListResponse from .types.tasks_task_tool import TasksTaskTool from .types.tasks_update_task_request_main_item import TasksUpdateTaskRequestMainItem +from .types.tools_function_def import ToolsFunctionDef +from .types.tools_function_def_update import ToolsFunctionDefUpdate +from .types.tools_tool_type import ToolsToolType from .types.user_docs_route_list_request_direction import ( UserDocsRouteListRequestDirection, ) @@ -82,6 +126,10 @@ from .types.user_docs_search_route_search_response import ( UserDocsSearchRouteSearchResponse, ) +from .types.users_route_list_request_direction import UsersRouteListRequestDirection +from .types.users_route_list_request_sort_by import UsersRouteListRequestSortBy +from .types.users_route_list_response import UsersRouteListResponse +from .types.users_user import UsersUser # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -158,35 +206,31 @@ def __init__( timeout=_defaulted_timeout, ) - def agent_docs_route_list( + def agents_route_list( self, - id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: AgentDocsRouteListRequestSortBy, - direction: AgentDocsRouteListRequestDirection, + sort_by: AgentsRouteListRequestSortBy, + direction: AgentsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentDocsRouteListResponse: + ) -> AgentsRouteListResponse: """ - List Docs owned by an Agent + List Agents (paginated) Parameters ---------- - id : CommonUuid - ID of parent - limit : CommonLimit Limit the number of items returned offset : CommonOffset Offset the items returned - sort_by : AgentDocsRouteListRequestSortBy + sort_by : AgentsRouteListRequestSortBy Sort by a field - direction : AgentDocsRouteListRequestDirection + direction : AgentsRouteListRequestDirection Sort direction metadata_filter : str @@ -197,7 +241,7 @@ def agent_docs_route_list( Returns ------- - AgentDocsRouteListResponse + AgentsRouteListResponse The request has succeeded. Examples @@ -208,8 +252,7 @@ def agent_docs_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agent_docs_route_list( - id="id", + client.agents_route_list( limit=1, offset=1, sort_by="created_at", @@ -218,7 +261,7 @@ def agent_docs_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/docs", + "agents", method="GET", params={ "limit": limit, @@ -231,143 +274,109 @@ def agent_docs_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def agents_docs_search_route_search( + def agents_route_create( self, - id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsDocsSearchRouteSearchRequestSortBy, - direction: AgentsDocsSearchRouteSearchRequestDirection, - metadata_filter: str, - body: AgentsDocsSearchRouteSearchRequestBody, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsDocsSearchRouteSearchResponse: + ) -> CommonResourceCreatedResponse: """ - Search Docs owned by an Agent + Create a new Agent Parameters ---------- - id : CommonUuid - ID of the parent - - limit : CommonLimit - Limit the number of items returned + name : CommonIdentifierSafeUnicode + Name of the agent - offset : CommonOffset - Offset the items returned + about : str + About the agent - sort_by : AgentsDocsSearchRouteSearchRequestSortBy - Sort by a field + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - direction : AgentsDocsSearchRouteSearchRequestDirection - Sort direction + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + metadata : typing.Optional[typing.Dict[str, typing.Any]] - body : AgentsDocsSearchRouteSearchRequestBody + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsDocsSearchRouteSearchResponse - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- - from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.agents_docs_search_route_search( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - body=DocsVectorDocSearchRequest( - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), + client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/search", + "agents", method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, }, - json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: TasksRouteListRequestSortBy, - direction: TasksRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteListResponse: + def agents_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsAgent: """ - List tasks (paginated) + Get an Agent by id Parameters ---------- id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : TasksRouteListRequestSortBy - Sort by a field - - direction : TasksRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteListResponse + AgentsAgent The request has succeeded. Examples @@ -378,172 +387,146 @@ def tasks_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_list( + client.agents_route_get( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", + f"agents/{jsonable_encoder(id)}", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_create( + def agents_route_create_or_update( self, id: CommonUuid, *, - name: str, - description: str, - main: typing.Sequence[TasksCreateTaskRequestMainItem], - tools: typing.Sequence[TasksTaskTool], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + ) -> CommonResourceUpdatedResponse: """ - Create a new task + Create or update an Agent Parameters ---------- id : CommonUuid - ID of parent resource - - name : str - - description : str - main : typing.Sequence[TasksCreateTaskRequestMainItem] - The entrypoint of the task. + name : CommonIdentifierSafeUnicode + Name of the agent - tools : typing.Sequence[TasksTaskTool] - Tools defined specifically for this task not included in the Agent itself. + about : str + About the agent - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent metadata : typing.Optional[typing.Dict[str, typing.Any]] + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- - from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_create( + client.agents_route_create_or_update( id="id", name="name", - description="description", - main=[ - TasksEvaluateStep( - evaluate={"key": "value"}, - ) - ], - tools=[ - TasksTaskTool( - type="function", - name="name", - ) - ], - inherit_tools=True, + about="about", + model="model", + instructions="instructions", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", + f"agents/{jsonable_encoder(id)}", method="POST", json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_update( + def agents_route_update( self, id: CommonUuid, - child_id: CommonUuid, *, - description: str, - main: typing.Sequence[TasksUpdateTaskRequestMainItem], - tools: typing.Sequence[TasksTaskTool], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing task (overwrite existing values) + Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated - - description : str + ID of the resource - main : typing.Sequence[TasksUpdateTaskRequestMainItem] - The entrypoint of the task. + name : CommonIdentifierSafeUnicode + Name of the agent - tools : typing.Sequence[TasksTaskTool] - Tools defined specifically for this task not included in the Agent itself. + about : str + About the agent - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent metadata : typing.Optional[typing.Dict[str, typing.Any]] + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -554,41 +537,30 @@ def tasks_route_update( Examples -------- - from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_update( + client.agents_route_update( id="id", - child_id="child_id", - description="description", - main=[ - TasksEvaluateStep( - evaluate={"key": "value"}, - ) - ], - tools=[ - TasksTaskTool( - type="function", - name="name", - ) - ], - inherit_tools=True, + name="name", + about="about", + model="model", + instructions="instructions", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + f"agents/{jsonable_encoder(id)}", method="PUT", json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, }, request_options=request_options, omit=OMIT, @@ -601,23 +573,16 @@ def tasks_route_update( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_delete( - self, - id: CommonUuid, - child_id: CommonUuid, - *, - request_options: typing.Optional[RequestOptions] = None, + def agents_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None ) -> CommonResourceDeletedResponse: """ - Delete a task by its id + Delete Agent by id Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be deleted + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -635,13 +600,12 @@ def tasks_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_delete( + client.agents_route_delete( id="id", - child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + f"agents/{jsonable_encoder(id)}", method="DELETE", request_options=request_options, ) @@ -653,45 +617,44 @@ def tasks_route_delete( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def tasks_route_patch( + def agents_route_patch( self, id: CommonUuid, - child_id: CommonUuid, *, - description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.Sequence[TasksTaskTool]] = OMIT, - inherit_tools: typing.Optional[bool] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, + model: typing.Optional[str] = OMIT, + instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, + default_settings: typing.Optional[ + AgentsPatchAgentRequestDefaultSettings + ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing task (merges with existing values) + Update an existing Agent by id (merges with existing values) Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be patched + ID of the resource - description : typing.Optional[str] + metadata : typing.Optional[typing.Dict[str, typing.Any]] - main : typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] - The entrypoint of the task. + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the agent - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + about : typing.Optional[str] + About the agent - tools : typing.Optional[typing.Sequence[TasksTaskTool]] - Tools defined specifically for this task not included in the Agent itself. + model : typing.Optional[str] + Model name to use (gpt-4-turbo, gemini-nano etc) - inherit_tools : typing.Optional[bool] - Whether to inherit tools from the parent agent or not. Defaults to true. + instructions : typing.Optional[AgentsPatchAgentRequestInstructions] + Instructions for the agent - metadata : typing.Optional[typing.Dict[str, typing.Any]] + default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] + Default settings for all sessions created by this agent request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -709,21 +672,20 @@ def tasks_route_patch( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.tasks_route_patch( + client.agents_route_patch( id="id", - child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + f"agents/{jsonable_encoder(id)}", method="PATCH", json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, }, request_options=request_options, omit=OMIT, @@ -736,23 +698,46 @@ def tasks_route_patch( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def individual_docs_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> DocsDoc: + def agent_docs_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentDocsRouteListRequestSortBy, + direction: AgentDocsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentDocsRouteListResponse: """ - Get Doc by id + List Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of the resource + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : AgentDocsRouteListRequestSortBy + Sort by a field + + direction : AgentDocsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - DocsDoc + AgentDocsRouteListResponse The request has succeeded. Examples @@ -763,124 +748,139 @@ def individual_docs_route_get( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.individual_docs_route_get( + client.agent_docs_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", + f"agents/{jsonable_encoder(id)}/docs", method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def individual_docs_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + def agents_docs_search_route_search( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsDocsSearchRouteSearchRequestSortBy, + direction: AgentsDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: AgentsDocsSearchRouteSearchRequestBody, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentsDocsSearchRouteSearchResponse: """ - Delete an existing Doc by id + Search Docs owned by an Agent Parameters ---------- id : CommonUuid - ID of the resource + ID of the parent - request_options : typing.Optional[RequestOptions] - Request-specific configuration. + limit : CommonLimit + Limit the number of items returned - Returns - ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + offset : CommonOffset + Offset the items returned - Examples - -------- - from julep.client import JulepApi + sort_by : AgentsDocsSearchRouteSearchRequestSortBy + Sort by a field - client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - client.individual_docs_route_delete( - id="id", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) + direction : AgentsDocsSearchRouteSearchRequestDirection + Sort direction - def executions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ExecutionsExecution: - """ - Get an Execution by id + metadata_filter : str + JSON string of object that should be used to filter objects by metadata - Parameters - ---------- - id : CommonUuid - ID of the resource + body : AgentsDocsSearchRouteSearchRequestBody request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ExecutionsExecution + AgentsDocsSearchRouteSearchResponse The request has succeeded. Examples -------- + from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.executions_route_get( + client.agents_docs_search_route_search( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), ) """ _response = self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="GET", + f"agents/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def execution_transitions_route_list( + def tasks_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: ExecutionTransitionsRouteListRequestSortBy, - direction: ExecutionTransitionsRouteListRequestDirection, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionTransitionsRouteListResponse: + ) -> TasksRouteListResponse: """ - List the Transitions of an Execution by id + List tasks (paginated) Parameters ---------- @@ -893,10 +893,10 @@ def execution_transitions_route_list( offset : CommonOffset Offset the items returned - sort_by : ExecutionTransitionsRouteListRequestSortBy + sort_by : TasksRouteListRequestSortBy Sort by a field - direction : ExecutionTransitionsRouteListRequestDirection + direction : TasksRouteListRequestDirection Sort direction metadata_filter : str @@ -907,7 +907,7 @@ def execution_transitions_route_list( Returns ------- - ExecutionTransitionsRouteListResponse + TasksRouteListResponse The request has succeeded. Examples @@ -918,7 +918,7 @@ def execution_transitions_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.execution_transitions_route_list( + client.tasks_route_list( id="id", limit=1, offset=1, @@ -928,7 +928,7 @@ def execution_transitions_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}/transitions", + f"agents/{jsonable_encoder(id)}/tasks", method="GET", params={ "limit": limit, @@ -941,166 +941,223 @@ def execution_transitions_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def chat_route_generate( + def tasks_route_create( self, id: CommonUuid, *, - request: ChatRouteGenerateRequest, + name: str, + description: str, + main: typing.Sequence[TasksCreateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ChatRouteGenerateResponse: + ) -> CommonResourceCreatedResponse: """ - Generate a response from the model + Create a new task Parameters ---------- id : CommonUuid - The session ID + ID of parent resource - request : ChatRouteGenerateRequest + name : str + + description : str + + main : typing.Sequence[TasksCreateTaskRequestMainItem] + The entrypoint of the task. + + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ChatRouteGenerateResponse - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- - from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage + from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.chat_route_generate( + client.tasks_route_create( id="id", - request=ChatRouteGenerateRequestPreset( - messages=[ - EntriesInputChatMlMessage( - role="user", - content="content", - ) - ], - recall=True, - remember=True, - save=True, - stream=True, - ), - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/chat", + name="name", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tasks", method="POST", - json=request, + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_list( + def tasks_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, + description: str, + main: typing.Sequence[TasksUpdateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - Get history of a Session (paginated) + Update an existing task (overwrite existing values) Parameters ---------- id : CommonUuid - ID of parent + ID of parent resource - limit : CommonLimit - Limit the number of items returned + child_id : CommonUuid + ID of the resource to be updated - offset : CommonOffset - Offset the items returned + description : str - sort_by : HistoryRouteListRequestSortBy - Sort by a field + main : typing.Sequence[TasksUpdateTaskRequestMainItem] + The entrypoint of the task. - direction : HistoryRouteListRequestDirection - Sort direction + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples -------- + from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.history_route_list( + client.tasks_route_update( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + child_id="child_id", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PUT", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + def tasks_route_delete( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceDeletedResponse: """ - Clear the history of a Session (resets the Session) + Delete a task by its id Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + child_id : CommonUuid + ID of the resource to be deleted request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1118,12 +1175,13 @@ def history_route_delete( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.history_route_delete( + client.tasks_route_delete( id="id", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", method="DELETE", request_options=request_options, ) @@ -1135,19 +1193,102 @@ def history_route_delete( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def task_executions_route_list( + def tasks_route_patch( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.Sequence[TasksTaskTool]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing task (merges with existing values) + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be patched + + description : typing.Optional[str] + + main : typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] + The entrypoint of the task. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + tools : typing.Optional[typing.Sequence[TasksTaskTool]] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.tasks_route_patch( + id="id", + child_id="child_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def agent_tools_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: TaskExecutionsRouteListRequestSortBy, - direction: TaskExecutionsRouteListRequestDirection, + sort_by: AgentToolsRouteListRequestSortBy, + direction: AgentToolsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteListResponse: + ) -> AgentToolsRouteListResponse: """ - List executions of the given task + List tools of the given agent Parameters ---------- @@ -1160,10 +1301,10 @@ def task_executions_route_list( offset : CommonOffset Offset the items returned - sort_by : TaskExecutionsRouteListRequestSortBy + sort_by : AgentToolsRouteListRequestSortBy Sort by a field - direction : TaskExecutionsRouteListRequestDirection + direction : AgentToolsRouteListRequestDirection Sort direction metadata_filter : str @@ -1174,7 +1315,7 @@ def task_executions_route_list( Returns ------- - TaskExecutionsRouteListResponse + AgentToolsRouteListResponse The request has succeeded. Examples @@ -1185,7 +1326,7 @@ def task_executions_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.task_executions_route_list( + client.agent_tools_route_list( id="id", limit=1, offset=1, @@ -1195,7 +1336,7 @@ def task_executions_route_list( ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", + f"agents/{jsonable_encoder(id)}/tools", method="GET", params={ "limit": limit, @@ -1208,33 +1349,51 @@ def task_executions_route_list( ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def task_executions_route_create( + def agent_tools_route_create( self, id: CommonUuid, *, - input: typing.Dict[str, typing.Any], + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceCreatedResponse: """ - Create an execution for the given task + Create a new tool for this agent Parameters ---------- id : CommonUuid ID of parent resource - input : typing.Dict[str, typing.Any] - The input to the execution + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent metadata : typing.Optional[typing.Dict[str, typing.Any]] + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1251,15 +1410,25 @@ def task_executions_route_create( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.task_executions_route_create( + client.agent_tools_route_create( id="id", - input={"key": "value"}, + name="name", + about="about", + model="model", + instructions="instructions", ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", + f"agents/{jsonable_encoder(id)}/tools", method="POST", - json={"input": input, "metadata": metadata}, + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, request_options=request_options, omit=OMIT, ) @@ -1271,27 +1440,43 @@ def task_executions_route_create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def task_executions_route_resume_with_task_token( + def agent_tools_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - task_token: str, - input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + type: ToolsToolType, + name: CommonValidPythonIdentifier, + function: typing.Optional[ToolsFunctionDef] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Resume an execution with a task token + Update an existing tool (overwrite existing values) Parameters ---------- id : CommonUuid - ID of parent Task + ID of parent resource - task_token : str - A Task Token is a unique identifier for a specific Task Execution. + child_id : CommonUuid + ID of the resource to be updated - input : typing.Optional[typing.Dict[str, typing.Any]] - The input to resume the execution with + type : ToolsToolType + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + + name : CommonValidPythonIdentifier + Name of the tool (must be unique for this agent and a valid python identifier string ) + + function : typing.Optional[ToolsFunctionDef] + + integration : typing.Optional[typing.Any] + + system : typing.Optional[typing.Any] + + api_call : typing.Optional[typing.Any] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1309,15 +1494,24 @@ def task_executions_route_resume_with_task_token( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.task_executions_route_resume_with_task_token( + client.agent_tools_route_update( id="id", - task_token="task_token", + child_id="child_id", + type="function", + name="name", ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", method="PUT", - json={"task_token": task_token, "input": input, "status": "running"}, + json={ + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, request_options=request_options, omit=OMIT, ) @@ -1329,16 +1523,15 @@ def task_executions_route_resume_with_task_token( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def task_executions_route_update( + def agent_tools_route_delete( self, id: CommonUuid, child_id: CommonUuid, *, - request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> CommonResourceDeletedResponse: """ - Update an existing Execution + Delete an existing tool by id Parameters ---------- @@ -1346,90 +1539,86 @@ def task_executions_route_update( ID of parent resource child_id : CommonUuid - ID of the resource to be updated - - request : ExecutionsUpdateExecutionRequest + ID of the resource to be deleted request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- - from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.task_executions_route_update( - id="string", - child_id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), + client.agent_tools_route_delete( + id="id", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", - method="PUT", - json=request, + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def user_docs_route_list( + def agent_tools_route_patch( self, id: CommonUuid, + child_id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: UserDocsRouteListRequestSortBy, - direction: UserDocsRouteListRequestDirection, - metadata_filter: str, + type: typing.Optional[ToolsToolType] = OMIT, + name: typing.Optional[CommonValidPythonIdentifier] = OMIT, + function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UserDocsRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - List Docs owned by a User + Update an existing tool (merges with existing values) Parameters ---------- id : CommonUuid - ID of parent + ID of parent resource - limit : CommonLimit - Limit the number of items returned + child_id : CommonUuid + ID of the resource to be patched - offset : CommonOffset - Offset the items returned + type : typing.Optional[ToolsToolType] + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) - sort_by : UserDocsRouteListRequestSortBy - Sort by a field + name : typing.Optional[CommonValidPythonIdentifier] + Name of the tool (must be unique for this agent and a valid python identifier string ) - direction : UserDocsRouteListRequestDirection - Sort direction + function : typing.Optional[ToolsFunctionDefUpdate] - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + integration : typing.Optional[typing.Any] + + system : typing.Optional[typing.Any] + + api_call : typing.Optional[typing.Any] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - UserDocsRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -1440,211 +1629,3960 @@ def user_docs_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.user_docs_route_list( + client.agent_tools_route_patch( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + child_id="child_id", ) """ _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}/docs", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def user_docs_search_route_search( + def tasks_create_or_update_route_create_or_update( self, + parent_id: CommonUuid, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: UserDocsSearchRouteSearchRequestSortBy, - direction: UserDocsSearchRouteSearchRequestDirection, - metadata_filter: str, - body: UserDocsSearchRouteSearchRequestBody, + name: str, + description: str, + main: typing.Sequence[TasksCreateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> UserDocsSearchRouteSearchResponse: + ) -> CommonResourceUpdatedResponse: """ - Search Docs owned by a User + Create or update a task Parameters ---------- + parent_id : CommonUuid + ID of parent resource + id : CommonUuid - ID of the parent - limit : CommonLimit - Limit the number of items returned + name : str - offset : CommonOffset - Offset the items returned + description : str - sort_by : UserDocsSearchRouteSearchRequestSortBy - Sort by a field + main : typing.Sequence[TasksCreateTaskRequestMainItem] + The entrypoint of the task. - direction : UserDocsSearchRouteSearchRequestDirection - Sort direction + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. - body : UserDocsSearchRouteSearchRequestBody + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - UserDocsSearchRouteSearchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples -------- - from julep import DocsVectorDocSearchRequest + from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.user_docs_search_route_search( + client.tasks_create_or_update_route_create_or_update( + parent_id="parent_id", id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - body=DocsVectorDocSearchRequest( - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), + name="name", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, ) """ _response = self._client_wrapper.httpx_client.request( - f"users/{jsonable_encoder(id)}/search", + f"agents/{jsonable_encoder(parent_id)}/tasks/{jsonable_encoder(id)}", method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, }, - json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def individual_docs_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> DocsDoc: + """ + Get Doc by id -class AsyncJulepApi: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : typing.Optional[str] - The base url to use for requests from the client. + Parameters + ---------- + id : CommonUuid + ID of the resource - environment : JulepApiEnvironment - The environment to use for requests from the client. from .environment import JulepApiEnvironment + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + Returns + ------- + DocsDoc + The request has succeeded. + Examples + -------- + from julep.client import JulepApi - Defaults to JulepApiEnvironment.DEFAULT + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.individual_docs_route_get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"docs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + def individual_docs_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete an existing Doc by id + Parameters + ---------- + id : CommonUuid + ID of the resource - auth_key : str - api_key : str - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 300 seconds, unless a custom httpx client is used, in which case this default is not enforced. + request_options : typing.Optional[RequestOptions] + Request-specific configuration. - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.individual_docs_route_delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"docs/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def embed_route_embed( + self, + *, + body: DocsEmbedQueryRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> DocsEmbedQueryResponse: + """ + Embed a query for search + + Parameters + ---------- + body : DocsEmbedQueryRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DocsEmbedQueryResponse + The request has succeeded. + + Examples + -------- + from julep import DocsEmbedQueryRequest + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "embed", + method="POST", + json={"body": body}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def executions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExecutionsExecution: + """ + Get an Execution by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionsExecution + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.executions_route_get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"executions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def execution_transitions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> ExecutionTransitionsRouteListResponse: + """ + List the Transitions of an Execution by id + + Parameters + ---------- + id : CommonUuid + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : ExecutionTransitionsRouteListRequestSortBy + Sort by a field + + direction : ExecutionTransitionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionTransitionsRouteListResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"executions/{jsonable_encoder(id)}/transitions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def job_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> JobsJobStatus: + """ + Get the status of an existing Job by its id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + JobsJobStatus + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.job_route_get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"jobs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: SessionsRouteListRequestSortBy, + direction: SessionsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> SessionsRouteListResponse: + """ + List sessions (paginated) + + Parameters + ---------- + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : SessionsRouteListRequestSortBy + Sort by a field + + direction : SessionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteListResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "sessions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_create( + self, + *, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create a new session + + Parameters + ---------- + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + user : typing.Optional[CommonUuid] + User ID of user associated with this session + + users : typing.Optional[typing.Sequence[CommonUuid]] + + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session + + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_create( + situation="situation", + render_templates=True, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "sessions", + method="POST", + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsSession: + """ + Get a session by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsSession + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_get( + id="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_create_or_update( + self, + id: CommonUuid, + *, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Create or update a session + + Parameters + ---------- + id : CommonUuid + + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + user : typing.Optional[CommonUuid] + User ID of user associated with this session + + users : typing.Optional[typing.Sequence[CommonUuid]] + + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session + + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_create_or_update( + id="id", + situation="situation", + render_templates=True, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}", + method="POST", + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_update( + self, + id: CommonUuid, + *, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing session by its id (overwrites all existing values) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_update( + id="id", + situation="situation", + render_templates=True, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}", + method="PUT", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete a session by its id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def sessions_route_patch( + self, + id: CommonUuid, + *, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing session by its id (merges with existing values) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + situation : typing.Optional[str] + A specific situation that sets the background for this session + + render_templates : typing.Optional[bool] + Render system and assistant message content as jinja templates + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.sessions_route_patch( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}", + method="PATCH", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def chat_route_generate( + self, + id: CommonUuid, + *, + request: ChatRouteGenerateRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> ChatRouteGenerateResponse: + """ + Generate a response from the model + + Parameters + ---------- + id : CommonUuid + The session ID + + request : ChatRouteGenerateRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ChatRouteGenerateResponse + The request has succeeded. + + Examples + -------- + from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.chat_route_generate( + id="id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}/chat", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def history_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> HistoryRouteListResponse: + """ + Get history of a Session (paginated) + + Parameters + ---------- + id : CommonUuid + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : HistoryRouteListRequestSortBy + Sort by a field + + direction : HistoryRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HistoryRouteListResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.history_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}/history", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def history_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Clear the history of a Session (resets the Session) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.history_route_delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}/history", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def task_executions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TaskExecutionsRouteListRequestSortBy, + direction: TaskExecutionsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> TaskExecutionsRouteListResponse: + """ + List executions of the given task + + Parameters + ---------- + id : CommonUuid + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : TaskExecutionsRouteListRequestSortBy + Sort by a field + + direction : TaskExecutionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TaskExecutionsRouteListResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.task_executions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"tasks/{jsonable_encoder(id)}/executions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def task_executions_route_create( + self, + id: CommonUuid, + *, + input: typing.Dict[str, typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create an execution for the given task + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + input : typing.Dict[str, typing.Any] + The input to the execution + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.task_executions_route_create( + id="id", + input={"key": "value"}, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"tasks/{jsonable_encoder(id)}/executions", + method="POST", + json={"input": input, "metadata": metadata}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def task_executions_route_resume_with_task_token( + self, + id: CommonUuid, + *, + task_token: str, + input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Resume an execution with a task token + + Parameters + ---------- + id : CommonUuid + ID of parent Task + + task_token : str + A Task Token is a unique identifier for a specific Task Execution. + + input : typing.Optional[typing.Dict[str, typing.Any]] + The input to resume the execution with + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.task_executions_route_resume_with_task_token( + id="id", + task_token="task_token", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"tasks/{jsonable_encoder(id)}/executions", + method="PUT", + json={"task_token": task_token, "input": input, "status": "running"}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def task_executions_route_update( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + request: ExecutionsUpdateExecutionRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing Execution + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be updated + + request : ExecutionsUpdateExecutionRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep import ExecutionsUpdateExecutionRequest_Cancelled + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", + method="PUT", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def users_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UsersRouteListRequestSortBy, + direction: UsersRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> UsersRouteListResponse: + """ + List users (paginated) + + Parameters + ---------- + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : UsersRouteListRequestSortBy + Sort by a field + + direction : UsersRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersRouteListResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.users_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "users", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def users_route_create( + self, + *, + name: CommonIdentifierSafeUnicode, + about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create a new user + + Parameters + ---------- + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.users_route_create( + name="name", + about="about", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "users", + method="POST", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def users_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersUser: + """ + Get a user by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UsersUser + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.users_route_get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def users_route_create_or_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Create or update a user + + Parameters + ---------- + id : CommonUuid + + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.users_route_create_or_update( + id="id", + name="name", + about="about", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}", + method="POST", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def users_route_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing user by id (overwrite existing values) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.users_route_update( + id="id", + name="name", + about="about", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}", + method="PUT", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def users_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete a user by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.users_route_delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def users_route_patch( + self, + id: CommonUuid, + *, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing user by id (merge with existing values) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the user + + about : typing.Optional[str] + About the user + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.users_route_patch( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}", + method="PATCH", + json={"metadata": metadata, "name": name, "about": about}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def user_docs_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UserDocsRouteListRequestSortBy, + direction: UserDocsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> UserDocsRouteListResponse: + """ + List Docs owned by a User + + Parameters + ---------- + id : CommonUuid + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : UserDocsRouteListRequestSortBy + Sort by a field + + direction : UserDocsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserDocsRouteListResponse + The request has succeeded. + + Examples + -------- + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.user_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}/docs", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserDocsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def user_docs_search_route_search( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: UserDocsSearchRouteSearchRequestSortBy, + direction: UserDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: UserDocsSearchRouteSearchRequestBody, + request_options: typing.Optional[RequestOptions] = None, + ) -> UserDocsSearchRouteSearchResponse: + """ + Search Docs owned by a User + + Parameters + ---------- + id : CommonUuid + ID of the parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : UserDocsSearchRouteSearchRequestSortBy + Sort by a field + + direction : UserDocsSearchRouteSearchRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + body : UserDocsSearchRouteSearchRequestBody + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UserDocsSearchRouteSearchResponse + The request has succeeded. + + Examples + -------- + from julep import DocsVectorDocSearchRequest + from julep.client import JulepApi + + client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + client.user_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(UserDocsSearchRouteSearchResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncJulepApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : typing.Optional[str] + The base url to use for requests from the client. + + environment : JulepApiEnvironment + The environment to use for requests from the client. from .environment import JulepApiEnvironment + + + + Defaults to JulepApiEnvironment.DEFAULT + + + + auth_key : str + api_key : str + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 300 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + """ + + def __init__( + self, + *, + base_url: typing.Optional[str] = None, + environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, + auth_key: str, + api_key: str, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.AsyncClient] = None, + ): + _defaulted_timeout = ( + timeout if timeout is not None else 300 if httpx_client is None else None + ) + self._client_wrapper = AsyncClientWrapper( + base_url=_get_base_url(base_url=base_url, environment=environment), + auth_key=auth_key, + api_key=api_key, + httpx_client=( + httpx_client + if httpx_client is not None + else ( + httpx.AsyncClient( + timeout=_defaulted_timeout, follow_redirects=follow_redirects + ) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout) + ) + ), + timeout=_defaulted_timeout, + ) + + async def agents_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsRouteListRequestSortBy, + direction: AgentsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentsRouteListResponse: + """ + List Agents (paginated) + + Parameters + ---------- + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : AgentsRouteListRequestSortBy + Sort by a field + + direction : AgentsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "agents", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_create( + self, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create a new Agent + + Parameters + ---------- + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "agents", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentsAgent: + """ + Get an Agent by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsAgent + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsAgent, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_create_or_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Create or update an Agent + + Parameters + ---------- + id : CommonUuid + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_create_or_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_update( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsUpdateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsUpdateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsUpdateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsUpdateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_update( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="PUT", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete Agent by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_route_patch( + self, + id: CommonUuid, + *, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, + model: typing.Optional[str] = OMIT, + instructions: typing.Optional[AgentsPatchAgentRequestInstructions] = OMIT, + default_settings: typing.Optional[ + AgentsPatchAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing Agent by id (merges with existing values) + + Parameters + ---------- + id : CommonUuid + ID of the resource + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the agent + + about : typing.Optional[str] + About the agent + + model : typing.Optional[str] + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : typing.Optional[AgentsPatchAgentRequestInstructions] + Instructions for the agent + + default_settings : typing.Optional[AgentsPatchAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_route_patch( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}", + method="PATCH", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agent_docs_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentDocsRouteListRequestSortBy, + direction: AgentDocsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentDocsRouteListResponse: + """ + List Docs owned by an Agent + + Parameters + ---------- + id : CommonUuid + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : AgentDocsRouteListRequestSortBy + Sort by a field + + direction : AgentDocsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentDocsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agent_docs_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/docs", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agents_docs_search_route_search( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentsDocsSearchRouteSearchRequestSortBy, + direction: AgentsDocsSearchRouteSearchRequestDirection, + metadata_filter: str, + body: AgentsDocsSearchRouteSearchRequestBody, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentsDocsSearchRouteSearchResponse: + """ + Search Docs owned by an Agent + + Parameters + ---------- + id : CommonUuid + ID of the parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : AgentsDocsSearchRouteSearchRequestSortBy + Sort by a field + + direction : AgentsDocsSearchRouteSearchRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + body : AgentsDocsSearchRouteSearchRequestBody + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentsDocsSearchRouteSearchResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import DocsVectorDocSearchRequest + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agents_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/search", + method="POST", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + json={"body": body}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def tasks_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TasksRouteListRequestSortBy, + direction: TasksRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> TasksRouteListResponse: + """ + List tasks (paginated) + + Parameters + ---------- + id : CommonUuid + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : TasksRouteListRequestSortBy + Sort by a field + + direction : TasksRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + TasksRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.tasks_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tasks", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def tasks_route_create( + self, + id: CommonUuid, + *, + name: str, + description: str, + main: typing.Sequence[TasksCreateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create a new task + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + name : str + + description : str + + main : typing.Sequence[TasksCreateTaskRequestMainItem] + The entrypoint of the task. + + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + + from julep import TasksEvaluateStep, TasksTaskTool + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.tasks_route_create( + id="id", + name="name", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tasks", + method="POST", + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def tasks_route_update( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + description: str, + main: typing.Sequence[TasksUpdateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing task (overwrite existing values) + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be updated + + description : str + + main : typing.Sequence[TasksUpdateTaskRequestMainItem] + The entrypoint of the task. + + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import TasksEvaluateStep, TasksTaskTool + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.tasks_route_update( + id="id", + child_id="child_id", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PUT", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def tasks_route_delete( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceDeletedResponse: + """ + Delete a task by its id + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be deleted + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.tasks_route_delete( + id="id", + child_id="child_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def tasks_route_patch( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + description: typing.Optional[str] = OMIT, + main: typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] = OMIT, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + tools: typing.Optional[typing.Sequence[TasksTaskTool]] = OMIT, + inherit_tools: typing.Optional[bool] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing task (merges with existing values) + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be patched + + description : typing.Optional[str] + + main : typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] + The entrypoint of the task. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + tools : typing.Optional[typing.Sequence[TasksTaskTool]] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : typing.Optional[bool] + Whether to inherit tools from the parent agent or not. Defaults to true. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.tasks_route_patch( + id="id", + child_id="child_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agent_tools_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: AgentToolsRouteListRequestSortBy, + direction: AgentToolsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentToolsRouteListResponse: + """ + List tools of the given agent + + Parameters + ---------- + id : CommonUuid + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : AgentToolsRouteListRequestSortBy + Sort by a field + + direction : AgentToolsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentToolsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agent_tools_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tools", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(AgentToolsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agent_tools_route_create( + self, + id: CommonUuid, + *, + name: CommonIdentifierSafeUnicode, + about: str, + model: str, + instructions: AgentsCreateAgentRequestInstructions, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + default_settings: typing.Optional[ + AgentsCreateAgentRequestDefaultSettings + ] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create a new tool for this agent + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + name : CommonIdentifierSafeUnicode + Name of the agent + + about : str + About the agent + + model : str + Model name to use (gpt-4-turbo, gemini-nano etc) + + instructions : AgentsCreateAgentRequestInstructions + Instructions for the agent + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + default_settings : typing.Optional[AgentsCreateAgentRequestDefaultSettings] + Default settings for all sessions created by this agent + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agent_tools_route_create( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tools", + method="POST", + json={ + "metadata": metadata, + "name": name, + "about": about, + "model": model, + "instructions": instructions, + "default_settings": default_settings, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agent_tools_route_update( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + type: ToolsToolType, + name: CommonValidPythonIdentifier, + function: typing.Optional[ToolsFunctionDef] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing tool (overwrite existing values) + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be updated + + type : ToolsToolType + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + + name : CommonValidPythonIdentifier + Name of the tool (must be unique for this agent and a valid python identifier string ) + + function : typing.Optional[ToolsFunctionDef] + + integration : typing.Optional[typing.Any] + + system : typing.Optional[typing.Any] + + api_call : typing.Optional[typing.Any] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agent_tools_route_update( + id="id", + child_id="child_id", + type="function", + name="name", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="PUT", + json={ + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agent_tools_route_delete( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceDeletedResponse: + """ + Delete an existing tool by id + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be deleted + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agent_tools_route_delete( + id="id", + child_id="child_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def agent_tools_route_patch( + self, + id: CommonUuid, + child_id: CommonUuid, + *, + type: typing.Optional[ToolsToolType] = OMIT, + name: typing.Optional[CommonValidPythonIdentifier] = OMIT, + function: typing.Optional[ToolsFunctionDefUpdate] = OMIT, + integration: typing.Optional[typing.Any] = OMIT, + system: typing.Optional[typing.Any] = OMIT, + api_call: typing.Optional[typing.Any] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Update an existing tool (merges with existing values) + + Parameters + ---------- + id : CommonUuid + ID of parent resource + + child_id : CommonUuid + ID of the resource to be patched + + type : typing.Optional[ToolsToolType] + Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + + name : typing.Optional[CommonValidPythonIdentifier] + Name of the tool (must be unique for this agent and a valid python identifier string ) + + function : typing.Optional[ToolsFunctionDefUpdate] + + integration : typing.Optional[typing.Any] + + system : typing.Optional[typing.Any] + + api_call : typing.Optional[typing.Any] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.agent_tools_route_patch( + id="id", + child_id="child_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(id)}/tools/{jsonable_encoder(child_id)}", + method="PATCH", + json={ + "type": type, + "name": name, + "function": function, + "integration": integration, + "system": system, + "api_call": api_call, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def tasks_create_or_update_route_create_or_update( + self, + parent_id: CommonUuid, + id: CommonUuid, + *, + name: str, + description: str, + main: typing.Sequence[TasksCreateTaskRequestMainItem], + tools: typing.Sequence[TasksTaskTool], + inherit_tools: bool, + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceUpdatedResponse: + """ + Create or update a task + + Parameters + ---------- + parent_id : CommonUuid + ID of parent resource + + id : CommonUuid + + name : str + + description : str + + main : typing.Sequence[TasksCreateTaskRequestMainItem] + The entrypoint of the task. + + tools : typing.Sequence[TasksTaskTool] + Tools defined specifically for this task not included in the Agent itself. + + inherit_tools : bool + Whether to inherit tools from the parent agent or not. Defaults to true. + + input_schema : typing.Optional[typing.Dict[str, typing.Any]] + The schema for the input to the task. `null` means all inputs are valid. + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceUpdatedResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import TasksEvaluateStep, TasksTaskTool + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.tasks_create_or_update_route_create_or_update( + parent_id="parent_id", + id="id", + name="name", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, + ) - httpx_client : typing.Optional[httpx.AsyncClient] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - Examples - -------- - from julep.client import AsyncJulepApi + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"agents/{jsonable_encoder(parent_id)}/tasks/{jsonable_encoder(id)}", + method="POST", + json={ + "name": name, + "description": description, + "main": main, + "input_schema": input_schema, + "tools": tools, + "inherit_tools": inherit_tools, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) - client = AsyncJulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", - ) - """ + async def individual_docs_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> DocsDoc: + """ + Get Doc by id - def __init__( + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DocsDoc + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.individual_docs_route_get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"docs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def individual_docs_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete an existing Doc by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.individual_docs_route_delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"docs/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def embed_route_embed( self, *, - base_url: typing.Optional[str] = None, - environment: JulepApiEnvironment = JulepApiEnvironment.DEFAULT, - auth_key: str, - api_key: str, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.AsyncClient] = None, - ): - _defaulted_timeout = ( - timeout if timeout is not None else 300 if httpx_client is None else None + body: DocsEmbedQueryRequest, + request_options: typing.Optional[RequestOptions] = None, + ) -> DocsEmbedQueryResponse: + """ + Embed a query for search + + Parameters + ---------- + body : DocsEmbedQueryRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DocsEmbedQueryResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep import DocsEmbedQueryRequest + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", ) - self._client_wrapper = AsyncClientWrapper( - base_url=_get_base_url(base_url=base_url, environment=environment), - auth_key=auth_key, - api_key=api_key, - httpx_client=( - httpx_client - if httpx_client is not None - else ( - httpx.AsyncClient( - timeout=_defaulted_timeout, follow_redirects=follow_redirects - ) - if follow_redirects is not None - else httpx.AsyncClient(timeout=_defaulted_timeout) - ) - ), - timeout=_defaulted_timeout, + + + async def main() -> None: + await client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "embed", + method="POST", + json={"body": body}, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(DocsEmbedQueryResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def executions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExecutionsExecution: + """ + Get an Execution by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExecutionsExecution + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.executions_route_get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"executions/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) - async def agent_docs_route_list( + async def execution_transitions_route_list( self, id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: AgentDocsRouteListRequestSortBy, - direction: AgentDocsRouteListRequestDirection, + sort_by: ExecutionTransitionsRouteListRequestSortBy, + direction: ExecutionTransitionsRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentDocsRouteListResponse: + ) -> ExecutionTransitionsRouteListResponse: """ - List Docs owned by an Agent + List the Transitions of an Execution by id Parameters ---------- @@ -1657,10 +5595,10 @@ async def agent_docs_route_list( offset : CommonOffset Offset the items returned - sort_by : AgentDocsRouteListRequestSortBy + sort_by : ExecutionTransitionsRouteListRequestSortBy Sort by a field - direction : AgentDocsRouteListRequestDirection + direction : ExecutionTransitionsRouteListRequestDirection Sort direction metadata_filter : str @@ -1671,7 +5609,7 @@ async def agent_docs_route_list( Returns ------- - AgentDocsRouteListResponse + ExecutionTransitionsRouteListResponse The request has succeeded. Examples @@ -1687,8 +5625,142 @@ async def agent_docs_route_list( async def main() -> None: - await client.agent_docs_route_list( + await client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"executions/{jsonable_encoder(id)}/transitions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def job_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> JobsJobStatus: + """ + Get the status of an existing Job by its id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + JobsJobStatus + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.job_route_get( id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"jobs/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(JobsJobStatus, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def sessions_route_list( + self, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: SessionsRouteListRequestSortBy, + direction: SessionsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> SessionsRouteListResponse: + """ + List sessions (paginated) + + Parameters + ---------- + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : SessionsRouteListRequestSortBy + Sort by a field + + direction : SessionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsRouteListResponse + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.sessions_route_list( limit=1, offset=1, sort_by="created_at", @@ -1700,75 +5772,232 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/docs", + "sessions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(SessionsRouteListResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def sessions_route_create( + self, + *, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: + """ + Create a new session + + Parameters + ---------- + situation : str + A specific situation that sets the background for this session + + render_templates : bool + Render system and assistant message content as jinja templates + + user : typing.Optional[CommonUuid] + User ID of user associated with this session + + users : typing.Optional[typing.Sequence[CommonUuid]] + + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session + + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.sessions_route_create( + situation="situation", + render_templates=True, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "sessions", + method="POST", + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def sessions_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> SessionsSession: + """ + Get a session by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SessionsSession + The request has succeeded. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.sessions_route_get( + id="string", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"sessions/{jsonable_encoder(id)}", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentDocsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(SessionsSession, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def agents_docs_search_route_search( + async def sessions_route_create_or_update( self, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: AgentsDocsSearchRouteSearchRequestSortBy, - direction: AgentsDocsSearchRouteSearchRequestDirection, - metadata_filter: str, - body: AgentsDocsSearchRouteSearchRequestBody, + situation: str, + render_templates: bool, + user: typing.Optional[CommonUuid] = OMIT, + users: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + agent: typing.Optional[CommonUuid] = OMIT, + agents: typing.Optional[typing.Sequence[CommonUuid]] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AgentsDocsSearchRouteSearchResponse: + ) -> CommonResourceUpdatedResponse: """ - Search Docs owned by an Agent + Create or update a session Parameters ---------- id : CommonUuid - ID of the parent - limit : CommonLimit - Limit the number of items returned + situation : str + A specific situation that sets the background for this session - offset : CommonOffset - Offset the items returned + render_templates : bool + Render system and assistant message content as jinja templates - sort_by : AgentsDocsSearchRouteSearchRequestSortBy - Sort by a field + user : typing.Optional[CommonUuid] + User ID of user associated with this session - direction : AgentsDocsSearchRouteSearchRequestDirection - Sort direction + users : typing.Optional[typing.Sequence[CommonUuid]] - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + agent : typing.Optional[CommonUuid] + Agent ID of agent associated with this session - body : AgentsDocsSearchRouteSearchRequestBody + agents : typing.Optional[typing.Sequence[CommonUuid]] + + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality + + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AgentsDocsSearchRouteSearchResponse + CommonResourceUpdatedResponse The request has succeeded. Examples -------- import asyncio - from julep import DocsVectorDocSearchRequest from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -1778,86 +6007,79 @@ async def agents_docs_search_route_search( async def main() -> None: - await client.agents_docs_search_route_search( + await client.sessions_route_create_or_update( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - body=DocsVectorDocSearchRequest( - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), + situation="situation", + render_templates=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/search", + f"sessions/{jsonable_encoder(id)}", method="POST", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + json={ + "user": user, + "users": users, + "agent": agent, + "agents": agents, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, }, - json={"body": body}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(AgentsDocsSearchRouteSearchResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_list( + async def sessions_route_update( self, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: TasksRouteListRequestSortBy, - direction: TasksRouteListRequestDirection, - metadata_filter: str, + situation: str, + render_templates: bool, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> TasksRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - List tasks (paginated) + Update an existing session by its id (overwrites all existing values) Parameters ---------- id : CommonUuid - ID of parent + ID of the resource - limit : CommonLimit - Limit the number of items returned + situation : str + A specific situation that sets the background for this session - offset : CommonOffset - Offset the items returned + render_templates : bool + Render system and assistant message content as jinja templates - sort_by : TasksRouteListRequestSortBy - Sort by a field + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - direction : TasksRouteListRequestDirection - Sort direction + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TasksRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -1873,90 +6095,59 @@ async def tasks_route_list( async def main() -> None: - await client.tasks_route_list( + await client.sessions_route_update( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + situation="situation", + render_templates=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, + f"sessions/{jsonable_encoder(id)}", + method="PUT", + json={ + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, + "metadata": metadata, }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TasksRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_create( - self, - id: CommonUuid, - *, - name: str, - description: str, - main: typing.Sequence[TasksCreateTaskRequestMainItem], - tools: typing.Sequence[TasksTaskTool], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + async def sessions_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: """ - Create a new task + Delete a session by its id Parameters ---------- id : CommonUuid - ID of parent resource - - name : str - - description : str - - main : typing.Sequence[TasksCreateTaskRequestMainItem] - The entrypoint of the task. - - tools : typing.Sequence[TasksTaskTool] - Tools defined specifically for this task not included in the Agent itself. - - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. - - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. - - metadata : typing.Optional[typing.Dict[str, typing.Any]] + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- import asyncio - from julep import TasksEvaluateStep, TasksTaskTool from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -1966,87 +6157,56 @@ async def tasks_route_create( async def main() -> None: - await client.tasks_route_create( + await client.sessions_route_delete( id="id", - name="name", - description="description", - main=[ - TasksEvaluateStep( - evaluate={"key": "value"}, - ) - ], - tools=[ - TasksTaskTool( - type="function", - name="name", - ) - ], - inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks", - method="POST", - json={ - "name": name, - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, - }, + f"sessions/{jsonable_encoder(id)}", + method="DELETE", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_update( + async def sessions_route_patch( self, id: CommonUuid, - child_id: CommonUuid, *, - description: str, - main: typing.Sequence[TasksUpdateTaskRequestMainItem], - tools: typing.Sequence[TasksTaskTool], - inherit_tools: bool, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + situation: typing.Optional[str] = OMIT, + render_templates: typing.Optional[bool] = OMIT, + token_budget: typing.Optional[int] = OMIT, + context_overflow: typing.Optional[SessionsContextOverflowType] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing task (overwrite existing values) + Update an existing session by its id (merges with existing values) Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be updated - - description : str + ID of the resource - main : typing.Sequence[TasksUpdateTaskRequestMainItem] - The entrypoint of the task. + situation : typing.Optional[str] + A specific situation that sets the background for this session - tools : typing.Sequence[TasksTaskTool] - Tools defined specifically for this task not included in the Agent itself. + render_templates : typing.Optional[bool] + Render system and assistant message content as jinja templates - inherit_tools : bool - Whether to inherit tools from the parent agent or not. Defaults to true. + token_budget : typing.Optional[int] + Threshold value for the adaptive context functionality - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + context_overflow : typing.Optional[SessionsContextOverflowType] + Action to start on context window overflow metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -2062,7 +6222,6 @@ async def tasks_route_update( -------- import asyncio - from julep import TasksEvaluateStep, TasksTaskTool from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -2072,36 +6231,21 @@ async def tasks_route_update( async def main() -> None: - await client.tasks_route_update( + await client.sessions_route_patch( id="id", - child_id="child_id", - description="description", - main=[ - TasksEvaluateStep( - evaluate={"key": "value"}, - ) - ], - tools=[ - TasksTaskTool( - type="function", - name="name", - ) - ], - inherit_tools=True, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="PUT", + f"sessions/{jsonable_encoder(id)}", + method="PATCH", json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, + "situation": situation, + "render_templates": render_templates, + "token_budget": token_budget, + "context_overflow": context_overflow, "metadata": metadata, }, request_options=request_options, @@ -2115,36 +6259,36 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_delete( + async def chat_route_generate( self, id: CommonUuid, - child_id: CommonUuid, *, + request: ChatRouteGenerateRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceDeletedResponse: + ) -> ChatRouteGenerateResponse: """ - Delete a task by its id + Generate a response from the model Parameters ---------- id : CommonUuid - ID of parent resource + The session ID - child_id : CommonUuid - ID of the resource to be deleted + request : ChatRouteGenerateRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + ChatRouteGenerateResponse + The request has succeeded. Examples -------- import asyncio + from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -2154,73 +6298,80 @@ async def tasks_route_delete( async def main() -> None: - await client.tasks_route_delete( + await client.chat_route_generate( id="id", - child_id="child_id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="DELETE", + f"sessions/{jsonable_encoder(id)}/chat", + method="POST", + json=request, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def tasks_route_patch( + async def history_route_list( self, id: CommonUuid, - child_id: CommonUuid, *, - description: typing.Optional[str] = OMIT, - main: typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] = OMIT, - input_schema: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - tools: typing.Optional[typing.Sequence[TasksTaskTool]] = OMIT, - inherit_tools: typing.Optional[bool] = OMIT, - metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + limit: CommonLimit, + offset: CommonOffset, + sort_by: HistoryRouteListRequestSortBy, + direction: HistoryRouteListRequestDirection, + metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceUpdatedResponse: + ) -> HistoryRouteListResponse: """ - Update an existing task (merges with existing values) + Get history of a Session (paginated) Parameters ---------- id : CommonUuid - ID of parent resource - - child_id : CommonUuid - ID of the resource to be patched - - description : typing.Optional[str] + ID of parent - main : typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]] - The entrypoint of the task. + limit : CommonLimit + Limit the number of items returned - input_schema : typing.Optional[typing.Dict[str, typing.Any]] - The schema for the input to the task. `null` means all inputs are valid. + offset : CommonOffset + Offset the items returned - tools : typing.Optional[typing.Sequence[TasksTaskTool]] - Tools defined specifically for this task not included in the Agent itself. + sort_by : HistoryRouteListRequestSortBy + Sort by a field - inherit_tools : typing.Optional[bool] - Whether to inherit tools from the parent agent or not. Defaults to true. + direction : HistoryRouteListRequestDirection + Sort direction - metadata : typing.Optional[typing.Dict[str, typing.Any]] + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceUpdatedResponse + HistoryRouteListResponse The request has succeeded. Examples @@ -2236,41 +6387,43 @@ async def tasks_route_patch( async def main() -> None: - await client.tasks_route_patch( + await client.history_route_list( id="id", - child_id="child_id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"agents/{jsonable_encoder(id)}/tasks/{jsonable_encoder(child_id)}", - method="PATCH", - json={ - "description": description, - "main": main, - "input_schema": input_schema, - "tools": tools, - "inherit_tools": inherit_tools, - "metadata": metadata, + f"sessions/{jsonable_encoder(id)}/history", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def individual_docs_route_get( + async def history_route_delete( self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> DocsDoc: + ) -> CommonResourceDeletedResponse: """ - Get Doc by id + Clear the history of a Session (resets the Session) Parameters ---------- @@ -2282,8 +6435,8 @@ async def individual_docs_route_get( Returns ------- - DocsDoc - The request has succeeded. + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. Examples -------- @@ -2298,7 +6451,7 @@ async def individual_docs_route_get( async def main() -> None: - await client.individual_docs_route_get( + await client.history_route_delete( id="id", ) @@ -2306,36 +6459,59 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="GET", + f"sessions/{jsonable_encoder(id)}/history", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(DocsDoc, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def individual_docs_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + async def task_executions_route_list( + self, + id: CommonUuid, + *, + limit: CommonLimit, + offset: CommonOffset, + sort_by: TaskExecutionsRouteListRequestSortBy, + direction: TaskExecutionsRouteListRequestDirection, + metadata_filter: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> TaskExecutionsRouteListResponse: """ - Delete an existing Doc by id + List executions of the given task Parameters ---------- id : CommonUuid - ID of the resource + ID of parent + + limit : CommonLimit + Limit the number of items returned + + offset : CommonOffset + Offset the items returned + + sort_by : TaskExecutionsRouteListRequestSortBy + Sort by a field + + direction : TaskExecutionsRouteListRequestDirection + Sort direction + + metadata_filter : str + JSON string of object that should be used to filter objects by metadata request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + TaskExecutionsRouteListResponse + The request has succeeded. Examples -------- @@ -2350,44 +6526,66 @@ async def individual_docs_route_delete( async def main() -> None: - await client.individual_docs_route_delete( + await client.task_executions_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"docs/{jsonable_encoder(id)}", - method="DELETE", + f"tasks/{jsonable_encoder(id)}/executions", + method="GET", + params={ + "limit": limit, + "offset": offset, + "sort_by": sort_by, + "direction": direction, + "metadata_filter": metadata_filter, + }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def executions_route_get( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> ExecutionsExecution: + async def task_executions_route_create( + self, + id: CommonUuid, + *, + input: typing.Dict[str, typing.Any], + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: """ - Get an Execution by id + Create an execution for the given task Parameters ---------- id : CommonUuid - ID of the resource + ID of parent resource + + input : typing.Dict[str, typing.Any] + The input to the execution + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ExecutionsExecution - The request has succeeded. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- @@ -2402,66 +6600,57 @@ async def executions_route_get( async def main() -> None: - await client.executions_route_get( + await client.task_executions_route_create( id="id", + input={"key": "value"}, ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}", - method="GET", + f"tasks/{jsonable_encoder(id)}/executions", + method="POST", + json={"input": input, "metadata": metadata}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionsExecution, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def execution_transitions_route_list( + async def task_executions_route_resume_with_task_token( self, id: CommonUuid, *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: ExecutionTransitionsRouteListRequestSortBy, - direction: ExecutionTransitionsRouteListRequestDirection, - metadata_filter: str, + task_token: str, + input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ExecutionTransitionsRouteListResponse: + ) -> CommonResourceUpdatedResponse: """ - List the Transitions of an Execution by id + Resume an execution with a task token Parameters ---------- id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : ExecutionTransitionsRouteListRequestSortBy - Sort by a field + ID of parent Task - direction : ExecutionTransitionsRouteListRequestDirection - Sort direction + task_token : str + A Task Token is a unique identifier for a specific Task Execution. - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + input : typing.Optional[typing.Dict[str, typing.Any]] + The input to resume the execution with request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ExecutionTransitionsRouteListResponse + CommonResourceUpdatedResponse The request has succeeded. Examples @@ -2477,68 +6666,63 @@ async def execution_transitions_route_list( async def main() -> None: - await client.execution_transitions_route_list( + await client.task_executions_route_resume_with_task_token( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"executions/{jsonable_encoder(id)}/transitions", - method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, + task_token="task_token", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"tasks/{jsonable_encoder(id)}/executions", + method="PUT", + json={"task_token": task_token, "input": input, "status": "running"}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ExecutionTransitionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def chat_route_generate( + async def task_executions_route_update( self, id: CommonUuid, + child_id: CommonUuid, *, - request: ChatRouteGenerateRequest, + request: ExecutionsUpdateExecutionRequest, request_options: typing.Optional[RequestOptions] = None, - ) -> ChatRouteGenerateResponse: + ) -> CommonResourceUpdatedResponse: """ - Generate a response from the model + Update an existing Execution Parameters ---------- id : CommonUuid - The session ID + ID of parent resource - request : ChatRouteGenerateRequest + child_id : CommonUuid + ID of the resource to be updated + + request : ExecutionsUpdateExecutionRequest request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ChatRouteGenerateResponse + CommonResourceUpdatedResponse The request has succeeded. Examples -------- import asyncio - from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage + from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -2548,19 +6732,11 @@ async def chat_route_generate( async def main() -> None: - await client.chat_route_generate( - id="id", - request=ChatRouteGenerateRequestPreset( - messages=[ - EntriesInputChatMlMessage( - role="user", - content="content", - ) - ], - recall=True, - remember=True, - save=True, - stream=True, + await client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", ), ) @@ -2568,49 +6744,45 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/chat", - method="POST", + f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", + method="PUT", json=request, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(ChatRouteGenerateResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_list( + async def users_route_list( self, - id: CommonUuid, *, limit: CommonLimit, offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, + sort_by: UsersRouteListRequestSortBy, + direction: UsersRouteListRequestDirection, metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + ) -> UsersRouteListResponse: """ - Get history of a Session (paginated) + List users (paginated) Parameters ---------- - id : CommonUuid - ID of parent - limit : CommonLimit Limit the number of items returned offset : CommonOffset Offset the items returned - sort_by : HistoryRouteListRequestSortBy + sort_by : UsersRouteListRequestSortBy Sort by a field - direction : HistoryRouteListRequestDirection + direction : UsersRouteListRequestDirection Sort direction metadata_filter : str @@ -2621,7 +6793,7 @@ async def history_route_list( Returns ------- - HistoryRouteListResponse + UsersRouteListResponse The request has succeeded. Examples @@ -2637,8 +6809,7 @@ async def history_route_list( async def main() -> None: - await client.history_route_list( - id="id", + await client.users_route_list( limit=1, offset=1, sort_by="created_at", @@ -2650,7 +6821,7 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", + "users", method="GET", params={ "limit": limit, @@ -2663,30 +6834,40 @@ async def main() -> None: ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(UsersRouteListResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_delete( - self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None - ) -> CommonResourceDeletedResponse: + async def users_route_create( + self, + *, + name: CommonIdentifierSafeUnicode, + about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonResourceCreatedResponse: """ - Clear the history of a Session (resets the Session) + Create a new user Parameters ---------- - id : CommonUuid - ID of the resource + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CommonResourceDeletedResponse - The request has been accepted for processing, but processing has not yet completed. + CommonResourceCreatedResponse + The request has succeeded and a new resource has been created as a result. Examples -------- @@ -2701,66 +6882,46 @@ async def history_route_delete( async def main() -> None: - await client.history_route_delete( - id="id", + await client.users_route_create( + name="name", + about="about", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"sessions/{jsonable_encoder(id)}/history", - method="DELETE", + "users", + method="POST", + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_list( - self, - id: CommonUuid, - *, - limit: CommonLimit, - offset: CommonOffset, - sort_by: TaskExecutionsRouteListRequestSortBy, - direction: TaskExecutionsRouteListRequestDirection, - metadata_filter: str, - request_options: typing.Optional[RequestOptions] = None, - ) -> TaskExecutionsRouteListResponse: + async def users_route_get( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> UsersUser: """ - List executions of the given task + Get a user by id Parameters ---------- id : CommonUuid - ID of parent - - limit : CommonLimit - Limit the number of items returned - - offset : CommonOffset - Offset the items returned - - sort_by : TaskExecutionsRouteListRequestSortBy - Sort by a field - - direction : TaskExecutionsRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata + ID of the resource request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TaskExecutionsRouteListResponse + UsersUser The request has succeeded. Examples @@ -2776,56 +6937,47 @@ async def task_executions_route_list( async def main() -> None: - await client.task_executions_route_list( + await client.users_route_get( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", + f"users/{jsonable_encoder(id)}", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(TaskExecutionsRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(UsersUser, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_create( + async def users_route_create_or_update( self, id: CommonUuid, *, - input: typing.Dict[str, typing.Any], + name: CommonIdentifierSafeUnicode, + about: str, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> CommonResourceCreatedResponse: + ) -> CommonResourceUpdatedResponse: """ - Create an execution for the given task + Create or update a user Parameters ---------- id : CommonUuid - ID of parent resource - input : typing.Dict[str, typing.Any] - The input to the execution + name : CommonIdentifierSafeUnicode + Name of the user + + about : str + About the user metadata : typing.Optional[typing.Dict[str, typing.Any]] @@ -2834,8 +6986,8 @@ async def task_executions_route_create( Returns ------- - CommonResourceCreatedResponse - The request has succeeded and a new resource has been created as a result. + CommonResourceUpdatedResponse + The request has succeeded. Examples -------- @@ -2850,50 +7002,54 @@ async def task_executions_route_create( async def main() -> None: - await client.task_executions_route_create( + await client.users_route_create_or_update( id="id", - input={"key": "value"}, + name="name", + about="about", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", + f"users/{jsonable_encoder(id)}", method="POST", - json={"input": input, "metadata": metadata}, + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, omit=OMIT, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(CommonResourceCreatedResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(CommonResourceUpdatedResponse, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_resume_with_task_token( + async def users_route_update( self, id: CommonUuid, *, - task_token: str, - input: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: CommonIdentifierSafeUnicode, + about: str, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Resume an execution with a task token + Update an existing user by id (overwrite existing values) Parameters ---------- id : CommonUuid - ID of parent Task + ID of the resource - task_token : str - A Task Token is a unique identifier for a specific Task Execution. + name : CommonIdentifierSafeUnicode + Name of the user - input : typing.Optional[typing.Dict[str, typing.Any]] - The input to resume the execution with + about : str + About the user + + metadata : typing.Optional[typing.Dict[str, typing.Any]] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2916,18 +7072,19 @@ async def task_executions_route_resume_with_task_token( async def main() -> None: - await client.task_executions_route_resume_with_task_token( + await client.users_route_update( id="id", - task_token="task_token", + name="name", + about="about", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions", + f"users/{jsonable_encoder(id)}", method="PUT", - json={"task_token": task_token, "input": input, "status": "running"}, + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, omit=OMIT, ) @@ -2939,26 +7096,82 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def task_executions_route_update( + async def users_route_delete( + self, id: CommonUuid, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonResourceDeletedResponse: + """ + Delete a user by id + + Parameters + ---------- + id : CommonUuid + ID of the resource + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonResourceDeletedResponse + The request has been accepted for processing, but processing has not yet completed. + + Examples + -------- + import asyncio + + from julep.client import AsyncJulepApi + + client = AsyncJulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.users_route_delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"users/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return pydantic_v1.parse_obj_as(CommonResourceDeletedResponse, _response.json()) # type: ignore + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def users_route_patch( self, id: CommonUuid, - child_id: CommonUuid, *, - request: ExecutionsUpdateExecutionRequest, + metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + name: typing.Optional[CommonIdentifierSafeUnicode] = OMIT, + about: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CommonResourceUpdatedResponse: """ - Update an existing Execution + Update an existing user by id (merge with existing values) Parameters ---------- id : CommonUuid - ID of parent resource + ID of the resource - child_id : CommonUuid - ID of the resource to be updated + metadata : typing.Optional[typing.Dict[str, typing.Any]] - request : ExecutionsUpdateExecutionRequest + name : typing.Optional[CommonIdentifierSafeUnicode] + Name of the user + + about : typing.Optional[str] + About the user request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2972,7 +7185,6 @@ async def task_executions_route_update( -------- import asyncio - from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import AsyncJulepApi client = AsyncJulepApi( @@ -2982,21 +7194,17 @@ async def task_executions_route_update( async def main() -> None: - await client.task_executions_route_update( - id="string", - child_id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), + await client.users_route_patch( + id="id", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"tasks/{jsonable_encoder(id)}/executions/{jsonable_encoder(child_id)}", - method="PUT", - json=request, + f"users/{jsonable_encoder(id)}", + method="PATCH", + json={"metadata": metadata, "name": name, "about": about}, request_options=request_options, omit=OMIT, ) diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index d442e909d..7e8e230be 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -1,5 +1,5 @@ # Reference -
client.agent_docs_route_list(...) +
client.agents_route_list(...)
@@ -11,7 +11,7 @@
-List Docs owned by an Agent +List Agents (paginated)
@@ -32,8 +32,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agent_docs_route_list( - id="id", +client.agents_route_list( limit=1, offset=1, sort_by="created_at", @@ -55,14 +54,6 @@ client.agent_docs_route_list(
-**id:** `CommonUuid` — ID of parent - -
-
- -
-
- **limit:** `CommonLimit` — Limit the number of items returned
@@ -79,7 +70,7 @@ client.agent_docs_route_list(
-**sort_by:** `AgentDocsRouteListRequestSortBy` — Sort by a field +**sort_by:** `AgentsRouteListRequestSortBy` — Sort by a field
@@ -87,7 +78,7 @@ client.agent_docs_route_list(
-**direction:** `AgentDocsRouteListRequestDirection` — Sort direction +**direction:** `AgentsRouteListRequestDirection` — Sort direction
@@ -115,7 +106,7 @@ client.agent_docs_route_list(
-
client.agents_docs_search_route_search(...) +
client.agents_route_create(...)
@@ -127,7 +118,7 @@ client.agent_docs_route_list(
-Search Docs owned by an Agent +Create a new Agent
@@ -142,26 +133,17 @@ Search Docs owned by an Agent
```python -from julep import DocsVectorDocSearchRequest from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.agents_docs_search_route_search( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", - body=DocsVectorDocSearchRequest( - confidence=1.1, - alpha=1.1, - mmr=True, - vector=[1.1], - ), +client.agents_route_create( + name="name", + about="about", + model="model", + instructions="instructions", ) ``` @@ -178,15 +160,7 @@ client.agents_docs_search_route_search(
-**id:** `CommonUuid` — ID of the parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned +**name:** `CommonIdentifierSafeUnicode` — Name of the agent
@@ -194,7 +168,7 @@ client.agents_docs_search_route_search(
-**offset:** `CommonOffset` — Offset the items returned +**about:** `str` — About the agent
@@ -202,7 +176,7 @@ client.agents_docs_search_route_search(
-**sort_by:** `AgentsDocsSearchRouteSearchRequestSortBy` — Sort by a field +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc)
@@ -210,7 +184,7 @@ client.agents_docs_search_route_search(
-**direction:** `AgentsDocsSearchRouteSearchRequestDirection` — Sort direction +**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent
@@ -218,7 +192,7 @@ client.agents_docs_search_route_search(
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -226,7 +200,7 @@ client.agents_docs_search_route_search(
-**body:** `AgentsDocsSearchRouteSearchRequestBody` +**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent
@@ -246,7 +220,7 @@ client.agents_docs_search_route_search(
-
client.tasks_route_list(...) +
client.agents_route_get(...)
@@ -258,7 +232,7 @@ client.agents_docs_search_route_search(
-List tasks (paginated) +Get an Agent by id
@@ -279,13 +253,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_list( +client.agents_route_get( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) ``` @@ -302,47 +271,7 @@ client.tasks_route_list(
-**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `TasksRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `TasksRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**id:** `CommonUuid` — ID of the resource
@@ -362,7 +291,7 @@ client.tasks_route_list(
-
client.tasks_route_create(...) +
client.agents_route_create_or_update(...)
@@ -374,7 +303,7 @@ client.tasks_route_list(
-Create a new task +Create or update an Agent
@@ -389,29 +318,18 @@ Create a new task
```python -from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_create( +client.agents_route_create_or_update( id="id", name="name", - description="description", - main=[ - TasksEvaluateStep( - evaluate={"key": "value"}, - ) - ], - tools=[ - TasksTaskTool( - type="function", - name="name", - ) - ], - inherit_tools=True, + about="about", + model="model", + instructions="instructions", ) ``` @@ -428,15 +346,7 @@ client.tasks_route_create(
-**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**name:** `str` +**id:** `CommonUuid`
@@ -444,7 +354,7 @@ client.tasks_route_create(
-**description:** `str` +**name:** `CommonIdentifierSafeUnicode` — Name of the agent
@@ -452,7 +362,7 @@ client.tasks_route_create(
-**main:** `typing.Sequence[TasksCreateTaskRequestMainItem]` — The entrypoint of the task. +**about:** `str` — About the agent
@@ -460,7 +370,7 @@ client.tasks_route_create(
-**tools:** `typing.Sequence[TasksTaskTool]` — Tools defined specifically for this task not included in the Agent itself. +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc)
@@ -468,7 +378,7 @@ client.tasks_route_create(
-**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. +**instructions:** `AgentsUpdateAgentRequestInstructions` — Instructions for the agent
@@ -476,7 +386,7 @@ client.tasks_route_create(
-**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -484,7 +394,7 @@ client.tasks_route_create(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**default_settings:** `typing.Optional[AgentsUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent
@@ -504,7 +414,7 @@ client.tasks_route_create(
-
client.tasks_route_update(...) +
client.agents_route_update(...)
@@ -516,7 +426,7 @@ client.tasks_route_create(
-Update an existing task (overwrite existing values) +Update an existing Agent by id (overwrites existing values; use PATCH for merging instead)
@@ -531,29 +441,18 @@ Update an existing task (overwrite existing values)
```python -from julep import TasksEvaluateStep, TasksTaskTool from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_update( +client.agents_route_update( id="id", - child_id="child_id", - description="description", - main=[ - TasksEvaluateStep( - evaluate={"key": "value"}, - ) - ], - tools=[ - TasksTaskTool( - type="function", - name="name", - ) - ], - inherit_tools=True, + name="name", + about="about", + model="model", + instructions="instructions", ) ``` @@ -570,15 +469,7 @@ client.tasks_route_update(
-**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be updated +**id:** `CommonUuid` — ID of the resource
@@ -586,7 +477,7 @@ client.tasks_route_update(
-**description:** `str` +**name:** `CommonIdentifierSafeUnicode` — Name of the agent
@@ -594,7 +485,7 @@ client.tasks_route_update(
-**main:** `typing.Sequence[TasksUpdateTaskRequestMainItem]` — The entrypoint of the task. +**about:** `str` — About the agent
@@ -602,7 +493,7 @@ client.tasks_route_update(
-**tools:** `typing.Sequence[TasksTaskTool]` — Tools defined specifically for this task not included in the Agent itself. +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc)
@@ -610,7 +501,7 @@ client.tasks_route_update(
-**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. +**instructions:** `AgentsUpdateAgentRequestInstructions` — Instructions for the agent
@@ -618,7 +509,7 @@ client.tasks_route_update(
-**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -626,7 +517,7 @@ client.tasks_route_update(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**default_settings:** `typing.Optional[AgentsUpdateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent
@@ -646,7 +537,7 @@ client.tasks_route_update(
-
client.tasks_route_delete(...) +
client.agents_route_delete(...)
@@ -658,7 +549,7 @@ client.tasks_route_update(
-Delete a task by its id +Delete Agent by id
@@ -679,9 +570,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_delete( +client.agents_route_delete( id="id", - child_id="child_id", ) ``` @@ -698,15 +588,7 @@ client.tasks_route_delete(
-**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be deleted +**id:** `CommonUuid` — ID of the resource
@@ -726,7 +608,7 @@ client.tasks_route_delete(
-
client.tasks_route_patch(...) +
client.agents_route_patch(...)
@@ -738,7 +620,7 @@ client.tasks_route_delete(
-Update an existing task (merges with existing values) +Update an existing Agent by id (merges with existing values)
@@ -759,9 +641,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.tasks_route_patch( +client.agents_route_patch( id="id", - child_id="child_id", ) ``` @@ -778,15 +659,7 @@ client.tasks_route_patch(
-**id:** `CommonUuid` — ID of parent resource - -
-
- -
-
- -**child_id:** `CommonUuid` — ID of the resource to be patched +**id:** `CommonUuid` — ID of the resource
@@ -794,7 +667,7 @@ client.tasks_route_patch(
-**description:** `typing.Optional[str]` +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -802,7 +675,7 @@ client.tasks_route_patch(
-**main:** `typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]]` — The entrypoint of the task. +**name:** `typing.Optional[CommonIdentifierSafeUnicode]` — Name of the agent
@@ -810,7 +683,7 @@ client.tasks_route_patch(
-**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. +**about:** `typing.Optional[str]` — About the agent
@@ -818,7 +691,7 @@ client.tasks_route_patch(
-**tools:** `typing.Optional[typing.Sequence[TasksTaskTool]]` — Tools defined specifically for this task not included in the Agent itself. +**model:** `typing.Optional[str]` — Model name to use (gpt-4-turbo, gemini-nano etc)
@@ -826,7 +699,7 @@ client.tasks_route_patch(
-**inherit_tools:** `typing.Optional[bool]` — Whether to inherit tools from the parent agent or not. Defaults to true. +**instructions:** `typing.Optional[AgentsPatchAgentRequestInstructions]` — Instructions for the agent
@@ -834,7 +707,7 @@ client.tasks_route_patch(
-**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` +**default_settings:** `typing.Optional[AgentsPatchAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent
@@ -854,7 +727,7 @@ client.tasks_route_patch(
-
client.individual_docs_route_get(...) +
client.agent_docs_route_list(...)
@@ -866,7 +739,7 @@ client.tasks_route_patch(
-Get Doc by id +List Docs owned by an Agent
@@ -887,8 +760,13 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.individual_docs_route_get( +client.agent_docs_route_list( id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -905,7 +783,7 @@ client.individual_docs_route_get(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent
@@ -913,51 +791,1629 @@ client.individual_docs_route_get(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**limit:** `CommonLimit` — Limit the number of items returned
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned +
+
+
+**sort_by:** `AgentDocsRouteListRequestSortBy` — Sort by a field +
-
-
client.individual_docs_route_delete(...)
-#### 📝 Description +**direction:** `AgentDocsRouteListRequestDirection` — Sort direction + +
+
+**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+
-Delete an existing Doc by id +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +
-#### 🔌 Usage + + +
+ +
client.agents_docs_search_route_search(...)
+#### 📝 Description +
-```python -from julep.client import JulepApi +
+
-client = JulepApi( - auth_key="YOUR_AUTH_KEY", - api_key="YOUR_API_KEY", -) +Search Docs owned by an Agent +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import DocsVectorDocSearchRequest +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agents_docs_search_route_search( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", + body=DocsVectorDocSearchRequest( + confidence=1.1, + alpha=1.1, + mmr=True, + vector=[1.1], + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `AgentsDocsSearchRouteSearchRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `AgentsDocsSearchRouteSearchRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**body:** `AgentsDocsSearchRouteSearchRequestBody` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List tasks (paginated) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `TasksRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `TasksRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new task +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import TasksEvaluateStep, TasksTaskTool +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_create( + id="id", + name="name", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**name:** `str` + +
+
+ +
+
+ +**description:** `str` + +
+
+ +
+
+ +**main:** `typing.Sequence[TasksCreateTaskRequestMainItem]` — The entrypoint of the task. + +
+
+ +
+
+ +**tools:** `typing.Sequence[TasksTaskTool]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing task (overwrite existing values) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import TasksEvaluateStep, TasksTaskTool +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_update( + id="id", + child_id="child_id", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be updated + +
+
+ +
+
+ +**description:** `str` + +
+
+ +
+
+ +**main:** `typing.Sequence[TasksUpdateTaskRequestMainItem]` — The entrypoint of the task. + +
+
+ +
+
+ +**tools:** `typing.Sequence[TasksTaskTool]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a task by its id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_delete( + id="id", + child_id="child_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be deleted + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing task (merges with existing values) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_route_patch( + id="id", + child_id="child_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be patched + +
+
+ +
+
+ +**description:** `typing.Optional[str]` + +
+
+ +
+
+ +**main:** `typing.Optional[typing.Sequence[TasksPatchTaskRequestMainItem]]` — The entrypoint of the task. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**tools:** `typing.Optional[typing.Sequence[TasksTaskTool]]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `typing.Optional[bool]` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_tools_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List tools of the given agent +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `AgentToolsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `AgentToolsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_tools_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new tool for this agent +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_create( + id="id", + name="name", + about="about", + model="model", + instructions="instructions", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**name:** `CommonIdentifierSafeUnicode` — Name of the agent + +
+
+ +
+
+ +**about:** `str` — About the agent + +
+
+ +
+
+ +**model:** `str` — Model name to use (gpt-4-turbo, gemini-nano etc) + +
+
+ +
+
+ +**instructions:** `AgentsCreateAgentRequestInstructions` — Instructions for the agent + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**default_settings:** `typing.Optional[AgentsCreateAgentRequestDefaultSettings]` — Default settings for all sessions created by this agent + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_tools_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing tool (overwrite existing values) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_update( + id="id", + child_id="child_id", + type="function", + name="name", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be updated + +
+
+ +
+
+ +**type:** `ToolsToolType` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + +
+
+ +
+
+ +**name:** `CommonValidPythonIdentifier` — Name of the tool (must be unique for this agent and a valid python identifier string ) + +
+
+ +
+
+ +**function:** `typing.Optional[ToolsFunctionDef]` + +
+
+ +
+
+ +**integration:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**system:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**api_call:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_tools_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete an existing tool by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_delete( + id="id", + child_id="child_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be deleted + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.agent_tools_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing tool (merges with existing values) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.agent_tools_route_patch( + id="id", + child_id="child_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**child_id:** `CommonUuid` — ID of the resource to be patched + +
+
+ +
+
+ +**type:** `typing.Optional[ToolsToolType]` — Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + +
+
+ +
+
+ +**name:** `typing.Optional[CommonValidPythonIdentifier]` — Name of the tool (must be unique for this agent and a valid python identifier string ) + +
+
+ +
+
+ +**function:** `typing.Optional[ToolsFunctionDefUpdate]` + +
+
+ +
+
+ +**integration:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**system:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**api_call:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.tasks_create_or_update_route_create_or_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update a task +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import TasksEvaluateStep, TasksTaskTool +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.tasks_create_or_update_route_create_or_update( + parent_id="parent_id", + id="id", + name="name", + description="description", + main=[ + TasksEvaluateStep( + evaluate={"key": "value"}, + ) + ], + tools=[ + TasksTaskTool( + type="function", + name="name", + ) + ], + inherit_tools=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**parent_id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**id:** `CommonUuid` + +
+
+ +
+
+ +**name:** `str` + +
+
+ +
+
+ +**description:** `str` + +
+
+ +
+
+ +**main:** `typing.Sequence[TasksCreateTaskRequestMainItem]` — The entrypoint of the task. + +
+
+ +
+
+ +**tools:** `typing.Sequence[TasksTaskTool]` — Tools defined specifically for this task not included in the Agent itself. + +
+
+ +
+
+ +**inherit_tools:** `bool` — Whether to inherit tools from the parent agent or not. Defaults to true. + +
+
+ +
+
+ +**input_schema:** `typing.Optional[typing.Dict[str, typing.Any]]` — The schema for the input to the task. `null` means all inputs are valid. + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.individual_docs_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get Doc by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.individual_docs_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.individual_docs_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete an existing Doc by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) client.individual_docs_route_delete( id="id", ) @@ -976,7 +2432,1576 @@ client.individual_docs_route_delete(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.embed_route_embed(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Embed a query for search +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import DocsEmbedQueryRequest +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.embed_route_embed( + body=DocsEmbedQueryRequest( + text="text", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**body:** `DocsEmbedQueryRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.executions_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get an Execution by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.executions_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.execution_transitions_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List the Transitions of an Execution by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.execution_transitions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `ExecutionTransitionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `ExecutionTransitionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.job_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the status of an existing Job by its id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.job_route_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List sessions (paginated) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `SessionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `SessionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a new session +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_create( + situation="situation", + render_templates=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**situation:** `str` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `bool` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session + +
+
+ +
+
+ +**users:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session + +
+
+ +
+
+ +**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a session by id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_get( + id="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_create_or_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update a session +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_create_or_update( + id="id", + situation="situation", + render_templates=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` + +
+
+ +
+
+ +**situation:** `str` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `bool` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**user:** `typing.Optional[CommonUuid]` — User ID of user associated with this session + +
+
+ +
+
+ +**users:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**agent:** `typing.Optional[CommonUuid]` — Agent ID of agent associated with this session + +
+
+ +
+
+ +**agents:** `typing.Optional[typing.Sequence[CommonUuid]]` + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing session by its id (overwrites all existing values) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_update( + id="id", + situation="situation", + render_templates=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**situation:** `str` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `bool` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a session by its id +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.sessions_route_patch(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update an existing session by its id (merges with existing values) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.sessions_route_patch( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**situation:** `typing.Optional[str]` — A specific situation that sets the background for this session + +
+
+ +
+
+ +**render_templates:** `typing.Optional[bool]` — Render system and assistant message content as jinja templates + +
+
+ +
+
+ +**token_budget:** `typing.Optional[int]` — Threshold value for the adaptive context functionality + +
+
+ +
+
+ +**context_overflow:** `typing.Optional[SessionsContextOverflowType]` — Action to start on context window overflow + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.chat_route_generate(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Generate a response from the model +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.chat_route_generate( + id="id", + request=ChatRouteGenerateRequestPreset( + messages=[ + EntriesInputChatMlMessage( + role="user", + content="content", + ) + ], + recall=True, + remember=True, + save=True, + stream=True, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — The session ID + +
+
+ +
+
+ +**request:** `ChatRouteGenerateRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.history_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get history of a Session (paginated) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.history_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `HistoryRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.history_route_delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Clear the history of a Session (resets the Session) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.history_route_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of the resource + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.task_executions_route_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List executions of the given task +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.task_executions_route_list( + id="id", + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent + +
+
+ +
+
+ +**limit:** `CommonLimit` — Limit the number of items returned + +
+
+ +
+
+ +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `TaskExecutionsRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `TaskExecutionsRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.task_executions_route_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an execution for the given task +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from julep.client import JulepApi + +client = JulepApi( + auth_key="YOUR_AUTH_KEY", + api_key="YOUR_API_KEY", +) +client.task_executions_route_create( + id="id", + input={"key": "value"}, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `CommonUuid` — ID of parent resource + +
+
+ +
+
+ +**input:** `typing.Dict[str, typing.Any]` — The input to the execution + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -996,7 +4021,7 @@ client.individual_docs_route_delete(
-
client.executions_route_get(...) +
client.task_executions_route_resume_with_task_token(...)
@@ -1008,7 +4033,7 @@ client.individual_docs_route_delete(
-Get an Execution by id +Resume an execution with a task token
@@ -1029,8 +4054,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.executions_route_get( +client.task_executions_route_resume_with_task_token( id="id", + task_token="task_token", ) ``` @@ -1047,7 +4073,23 @@ client.executions_route_get(
-**id:** `CommonUuid` — ID of the resource +**id:** `CommonUuid` — ID of parent Task + +
+
+ +
+
+ +**task_token:** `str` — A Task Token is a unique identifier for a specific Task Execution. + +
+
+ +
+
+ +**input:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input to resume the execution with
@@ -1067,7 +4109,7 @@ client.executions_route_get(
-
client.execution_transitions_route_list(...) +
client.task_executions_route_update(...)
@@ -1079,7 +4121,7 @@ client.executions_route_get(
-List the Transitions of an Execution by id +Update an existing Execution
@@ -1094,19 +4136,19 @@ List the Transitions of an Execution by id
```python +from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.execution_transitions_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", +client.task_executions_route_update( + id="string", + child_id="string", + request=ExecutionsUpdateExecutionRequest_Cancelled( + reason="string", + ), ) ``` @@ -1123,31 +4165,7 @@ client.execution_transitions_route_list(
-**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `ExecutionTransitionsRouteListRequestSortBy` — Sort by a field +**id:** `CommonUuid` — ID of parent resource
@@ -1155,7 +4173,7 @@ client.execution_transitions_route_list(
-**direction:** `ExecutionTransitionsRouteListRequestDirection` — Sort direction +**child_id:** `CommonUuid` — ID of the resource to be updated
@@ -1163,7 +4181,7 @@ client.execution_transitions_route_list(
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**request:** `ExecutionsUpdateExecutionRequest`
@@ -1183,7 +4201,7 @@ client.execution_transitions_route_list(
-
client.chat_route_generate(...) +
client.users_route_list(...)
@@ -1195,7 +4213,7 @@ client.execution_transitions_route_list(
-Generate a response from the model +List users (paginated)
@@ -1210,27 +4228,18 @@ Generate a response from the model
```python -from julep import ChatRouteGenerateRequestPreset, EntriesInputChatMlMessage from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.chat_route_generate( - id="id", - request=ChatRouteGenerateRequestPreset( - messages=[ - EntriesInputChatMlMessage( - role="user", - content="content", - ) - ], - recall=True, - remember=True, - save=True, - stream=True, - ), +client.users_route_list( + limit=1, + offset=1, + sort_by="created_at", + direction="asc", + metadata_filter="metadata_filter", ) ``` @@ -1247,7 +4256,7 @@ client.chat_route_generate(
-**id:** `CommonUuid` — The session ID +**limit:** `CommonLimit` — Limit the number of items returned
@@ -1255,7 +4264,31 @@ client.chat_route_generate(
-**request:** `ChatRouteGenerateRequest` +**offset:** `CommonOffset` — Offset the items returned + +
+
+ +
+
+ +**sort_by:** `UsersRouteListRequestSortBy` — Sort by a field + +
+
+ +
+
+ +**direction:** `UsersRouteListRequestDirection` — Sort direction + +
+
+ +
+
+ +**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata
@@ -1275,7 +4308,7 @@ client.chat_route_generate(
-
client.history_route_list(...) +
client.users_route_create(...)
@@ -1287,7 +4320,7 @@ client.chat_route_generate(
-Get history of a Session (paginated) +Create a new user
@@ -1308,13 +4341,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.history_route_list( - id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", +client.users_route_create( + name="name", + about="about", ) ``` @@ -1331,31 +4360,7 @@ client.history_route_list(
-**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field +**name:** `CommonIdentifierSafeUnicode` — Name of the user
@@ -1363,7 +4368,7 @@ client.history_route_list(
-**direction:** `HistoryRouteListRequestDirection` — Sort direction +**about:** `str` — About the user
@@ -1371,7 +4376,7 @@ client.history_route_list(
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -1391,7 +4396,7 @@ client.history_route_list(
-
client.history_route_delete(...) +
client.users_route_get(...)
@@ -1403,7 +4408,7 @@ client.history_route_list(
-Clear the history of a Session (resets the Session) +Get a user by id
@@ -1424,7 +4429,7 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.history_route_delete( +client.users_route_get( id="id", ) @@ -1462,7 +4467,7 @@ client.history_route_delete(
-
client.task_executions_route_list(...) +
client.users_route_create_or_update(...)
@@ -1474,7 +4479,7 @@ client.history_route_delete(
-List executions of the given task +Create or update a user
@@ -1495,13 +4500,10 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_list( +client.users_route_create_or_update( id="id", - limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", + name="name", + about="about", ) ``` @@ -1518,23 +4520,7 @@ client.task_executions_route_list(
-**id:** `CommonUuid` — ID of parent - -
-
- -
-
- -**limit:** `CommonLimit` — Limit the number of items returned - -
-
- -
-
- -**offset:** `CommonOffset` — Offset the items returned +**id:** `CommonUuid`
@@ -1542,7 +4528,7 @@ client.task_executions_route_list(
-**sort_by:** `TaskExecutionsRouteListRequestSortBy` — Sort by a field +**name:** `CommonIdentifierSafeUnicode` — Name of the user
@@ -1550,7 +4536,7 @@ client.task_executions_route_list(
-**direction:** `TaskExecutionsRouteListRequestDirection` — Sort direction +**about:** `str` — About the user
@@ -1558,7 +4544,7 @@ client.task_executions_route_list(
-**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -1578,7 +4564,7 @@ client.task_executions_route_list(
-
client.task_executions_route_create(...) +
client.users_route_update(...)
@@ -1590,7 +4576,7 @@ client.task_executions_route_list(
-Create an execution for the given task +Update an existing user by id (overwrite existing values)
@@ -1611,9 +4597,10 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_create( +client.users_route_update( id="id", - input={"key": "value"}, + name="name", + about="about", ) ``` @@ -1630,7 +4617,7 @@ client.task_executions_route_create(
-**id:** `CommonUuid` — ID of parent resource +**id:** `CommonUuid` — ID of the resource
@@ -1638,7 +4625,15 @@ client.task_executions_route_create(
-**input:** `typing.Dict[str, typing.Any]` — The input to the execution +**name:** `CommonIdentifierSafeUnicode` — Name of the user + +
+
+ +
+
+ +**about:** `str` — About the user
@@ -1666,7 +4661,7 @@ client.task_executions_route_create(
-
client.task_executions_route_resume_with_task_token(...) +
client.users_route_delete(...)
@@ -1678,7 +4673,7 @@ client.task_executions_route_create(
-Resume an execution with a task token +Delete a user by id
@@ -1699,9 +4694,8 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_resume_with_task_token( +client.users_route_delete( id="id", - task_token="task_token", ) ``` @@ -1718,23 +4712,7 @@ client.task_executions_route_resume_with_task_token(
-**id:** `CommonUuid` — ID of parent Task - -
-
- -
-
- -**task_token:** `str` — A Task Token is a unique identifier for a specific Task Execution. - -
-
- -
-
- -**input:** `typing.Optional[typing.Dict[str, typing.Any]]` — The input to resume the execution with +**id:** `CommonUuid` — ID of the resource
@@ -1754,7 +4732,7 @@ client.task_executions_route_resume_with_task_token(
-
client.task_executions_route_update(...) +
client.users_route_patch(...)
@@ -1766,7 +4744,7 @@ client.task_executions_route_resume_with_task_token(
-Update an existing Execution +Update an existing user by id (merge with existing values)
@@ -1781,19 +4759,14 @@ Update an existing Execution
```python -from julep import ExecutionsUpdateExecutionRequest_Cancelled from julep.client import JulepApi client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.task_executions_route_update( - id="string", - child_id="string", - request=ExecutionsUpdateExecutionRequest_Cancelled( - reason="string", - ), +client.users_route_patch( + id="id", ) ``` @@ -1810,7 +4783,7 @@ client.task_executions_route_update(
-**id:** `CommonUuid` — ID of parent resource +**id:** `CommonUuid` — ID of the resource
@@ -1818,7 +4791,7 @@ client.task_executions_route_update(
-**child_id:** `CommonUuid` — ID of the resource to be updated +**metadata:** `typing.Optional[typing.Dict[str, typing.Any]]`
@@ -1826,7 +4799,15 @@ client.task_executions_route_update(
-**request:** `ExecutionsUpdateExecutionRequest` +**name:** `typing.Optional[CommonIdentifierSafeUnicode]` — Name of the user + +
+
+ +
+
+ +**about:** `typing.Optional[str]` — About the user
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 7f926084b..4e11ae2f5 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -3,6 +3,21 @@ from .agent_docs_route_list_request_direction import AgentDocsRouteListRequestDirection from .agent_docs_route_list_request_sort_by import AgentDocsRouteListRequestSortBy from .agent_docs_route_list_response import AgentDocsRouteListResponse +from .agent_tools_route_list_request_direction import ( + AgentToolsRouteListRequestDirection, +) +from .agent_tools_route_list_request_sort_by import AgentToolsRouteListRequestSortBy +from .agent_tools_route_list_response import AgentToolsRouteListResponse +from .agents_agent import AgentsAgent +from .agents_agent_default_settings import AgentsAgentDefaultSettings +from .agents_agent_instructions import AgentsAgentInstructions +from .agents_create_agent_request import AgentsCreateAgentRequest +from .agents_create_agent_request_default_settings import ( + AgentsCreateAgentRequestDefaultSettings, +) +from .agents_create_agent_request_instructions import ( + AgentsCreateAgentRequestInstructions, +) from .agents_docs_search_route_search_request_body import ( AgentsDocsSearchRouteSearchRequestBody, ) @@ -15,6 +30,20 @@ from .agents_docs_search_route_search_response import ( AgentsDocsSearchRouteSearchResponse, ) +from .agents_patch_agent_request_default_settings import ( + AgentsPatchAgentRequestDefaultSettings, +) +from .agents_patch_agent_request_instructions import AgentsPatchAgentRequestInstructions +from .agents_route_list_request_direction import AgentsRouteListRequestDirection +from .agents_route_list_request_sort_by import AgentsRouteListRequestSortBy +from .agents_route_list_response import AgentsRouteListResponse +from .agents_update_agent_request import AgentsUpdateAgentRequest +from .agents_update_agent_request_default_settings import ( + AgentsUpdateAgentRequestDefaultSettings, +) +from .agents_update_agent_request_instructions import ( + AgentsUpdateAgentRequestInstructions, +) from .chat_base_chat_output import ChatBaseChatOutput from .chat_base_chat_response import ChatBaseChatResponse from .chat_base_token_log_prob import ChatBaseTokenLogProb @@ -25,9 +54,11 @@ from .chat_completion_response_format_type import ChatCompletionResponseFormatType from .chat_finish_reason import ChatFinishReason from .chat_generation_preset import ChatGenerationPreset +from .chat_generation_preset_settings import ChatGenerationPresetSettings from .chat_log_prob_response import ChatLogProbResponse from .chat_message_chat_response import ChatMessageChatResponse from .chat_multiple_chat_output import ChatMultipleChatOutput +from .chat_open_ai_settings import ChatOpenAiSettings from .chat_route_generate_request import ChatRouteGenerateRequest from .chat_route_generate_request_agent import ChatRouteGenerateRequestAgent from .chat_route_generate_request_agent_tool_choice import ( @@ -46,6 +77,7 @@ from .chat_route_generate_response import ChatRouteGenerateResponse from .chat_single_chat_output import ChatSingleChatOutput from .chat_token_log_prob import ChatTokenLogProb +from .chat_v_llm_settings import ChatVLlmSettings from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode from .common_limit import CommonLimit from .common_logit_bias import CommonLogitBias @@ -63,6 +95,9 @@ from .docs_doc_owner import DocsDocOwner from .docs_doc_owner_role import DocsDocOwnerRole from .docs_doc_reference import DocsDocReference +from .docs_embed_query_request import DocsEmbedQueryRequest +from .docs_embed_query_request_text import DocsEmbedQueryRequestText +from .docs_embed_query_response import DocsEmbedQueryResponse from .docs_hybrid_doc_search_request import DocsHybridDocSearchRequest from .docs_hybrid_doc_search_request_text import DocsHybridDocSearchRequestText from .docs_hybrid_doc_search_request_vector import DocsHybridDocSearchRequestVector @@ -126,6 +161,34 @@ from .history_route_list_request_direction import HistoryRouteListRequestDirection from .history_route_list_request_sort_by import HistoryRouteListRequestSortBy from .history_route_list_response import HistoryRouteListResponse +from .jobs_job_state import JobsJobState +from .jobs_job_status import JobsJobStatus +from .sessions_context_overflow_type import SessionsContextOverflowType +from .sessions_create_session_request import SessionsCreateSessionRequest +from .sessions_multi_agent_multi_user_session import SessionsMultiAgentMultiUserSession +from .sessions_multi_agent_no_user_session import SessionsMultiAgentNoUserSession +from .sessions_multi_agent_single_user_session import ( + SessionsMultiAgentSingleUserSession, +) +from .sessions_route_list_request_direction import SessionsRouteListRequestDirection +from .sessions_route_list_request_sort_by import SessionsRouteListRequestSortBy +from .sessions_route_list_response import SessionsRouteListResponse +from .sessions_session import ( + SessionsSession, + SessionsSession_MultiAgentMultiUser, + SessionsSession_MultiAgentNoUser, + SessionsSession_MultiAgentSingleUser, + SessionsSession_SingleAgentMultiUser, + SessionsSession_SingleAgentNoUser, + SessionsSession_SingleAgentSingleUser, +) +from .sessions_single_agent_multi_user_session import ( + SessionsSingleAgentMultiUserSession, +) +from .sessions_single_agent_no_user_session import SessionsSingleAgentNoUserSession +from .sessions_single_agent_single_user_session import ( + SessionsSingleAgentSingleUserSession, +) from .task_executions_route_list_request_direction import ( TaskExecutionsRouteListRequestDirection, ) @@ -133,6 +196,7 @@ TaskExecutionsRouteListRequestSortBy, ) from .task_executions_route_list_response import TaskExecutionsRouteListResponse +from .tasks_create_task_request import TasksCreateTaskRequest from .tasks_create_task_request_main_item import TasksCreateTaskRequestMainItem from .tasks_error_workflow_step import TasksErrorWorkflowStep from .tasks_evaluate_step import TasksEvaluateStep @@ -161,6 +225,7 @@ from .tools_chosen_tool_call import ToolsChosenToolCall, ToolsChosenToolCall_Function from .tools_function_call_option import ToolsFunctionCallOption from .tools_function_def import ToolsFunctionDef +from .tools_function_def_update import ToolsFunctionDefUpdate from .tools_function_tool import ToolsFunctionTool from .tools_named_function_choice import ToolsNamedFunctionChoice from .tools_named_tool_choice import ToolsNamedToolChoice, ToolsNamedToolChoice_Function @@ -180,15 +245,37 @@ UserDocsSearchRouteSearchRequestSortBy, ) from .user_docs_search_route_search_response import UserDocsSearchRouteSearchResponse +from .users_route_list_request_direction import UsersRouteListRequestDirection +from .users_route_list_request_sort_by import UsersRouteListRequestSortBy +from .users_route_list_response import UsersRouteListResponse +from .users_update_user_request import UsersUpdateUserRequest +from .users_user import UsersUser __all__ = [ "AgentDocsRouteListRequestDirection", "AgentDocsRouteListRequestSortBy", "AgentDocsRouteListResponse", + "AgentToolsRouteListRequestDirection", + "AgentToolsRouteListRequestSortBy", + "AgentToolsRouteListResponse", + "AgentsAgent", + "AgentsAgentDefaultSettings", + "AgentsAgentInstructions", + "AgentsCreateAgentRequest", + "AgentsCreateAgentRequestDefaultSettings", + "AgentsCreateAgentRequestInstructions", "AgentsDocsSearchRouteSearchRequestBody", "AgentsDocsSearchRouteSearchRequestDirection", "AgentsDocsSearchRouteSearchRequestSortBy", "AgentsDocsSearchRouteSearchResponse", + "AgentsPatchAgentRequestDefaultSettings", + "AgentsPatchAgentRequestInstructions", + "AgentsRouteListRequestDirection", + "AgentsRouteListRequestSortBy", + "AgentsRouteListResponse", + "AgentsUpdateAgentRequest", + "AgentsUpdateAgentRequestDefaultSettings", + "AgentsUpdateAgentRequestInstructions", "ChatBaseChatOutput", "ChatBaseChatResponse", "ChatBaseTokenLogProb", @@ -199,9 +286,11 @@ "ChatCompletionResponseFormatType", "ChatFinishReason", "ChatGenerationPreset", + "ChatGenerationPresetSettings", "ChatLogProbResponse", "ChatMessageChatResponse", "ChatMultipleChatOutput", + "ChatOpenAiSettings", "ChatRouteGenerateRequest", "ChatRouteGenerateRequestAgent", "ChatRouteGenerateRequestAgentToolChoice", @@ -212,6 +301,7 @@ "ChatRouteGenerateResponse", "ChatSingleChatOutput", "ChatTokenLogProb", + "ChatVLlmSettings", "CommonIdentifierSafeUnicode", "CommonLimit", "CommonLogitBias", @@ -229,6 +319,9 @@ "DocsDocOwner", "DocsDocOwnerRole", "DocsDocReference", + "DocsEmbedQueryRequest", + "DocsEmbedQueryRequestText", + "DocsEmbedQueryResponse", "DocsHybridDocSearchRequest", "DocsHybridDocSearchRequestText", "DocsHybridDocSearchRequestVector", @@ -276,9 +369,30 @@ "HistoryRouteListRequestDirection", "HistoryRouteListRequestSortBy", "HistoryRouteListResponse", + "JobsJobState", + "JobsJobStatus", + "SessionsContextOverflowType", + "SessionsCreateSessionRequest", + "SessionsMultiAgentMultiUserSession", + "SessionsMultiAgentNoUserSession", + "SessionsMultiAgentSingleUserSession", + "SessionsRouteListRequestDirection", + "SessionsRouteListRequestSortBy", + "SessionsRouteListResponse", + "SessionsSession", + "SessionsSession_MultiAgentMultiUser", + "SessionsSession_MultiAgentNoUser", + "SessionsSession_MultiAgentSingleUser", + "SessionsSession_SingleAgentMultiUser", + "SessionsSession_SingleAgentNoUser", + "SessionsSession_SingleAgentSingleUser", + "SessionsSingleAgentMultiUserSession", + "SessionsSingleAgentNoUserSession", + "SessionsSingleAgentSingleUserSession", "TaskExecutionsRouteListRequestDirection", "TaskExecutionsRouteListRequestSortBy", "TaskExecutionsRouteListResponse", + "TasksCreateTaskRequest", "TasksCreateTaskRequestMainItem", "TasksErrorWorkflowStep", "TasksEvaluateStep", @@ -306,6 +420,7 @@ "ToolsChosenToolCall_Function", "ToolsFunctionCallOption", "ToolsFunctionDef", + "ToolsFunctionDefUpdate", "ToolsFunctionTool", "ToolsNamedFunctionChoice", "ToolsNamedToolChoice", @@ -321,4 +436,9 @@ "UserDocsSearchRouteSearchRequestDirection", "UserDocsSearchRouteSearchRequestSortBy", "UserDocsSearchRouteSearchResponse", + "UsersRouteListRequestDirection", + "UsersRouteListRequestSortBy", + "UsersRouteListResponse", + "UsersUpdateUserRequest", + "UsersUser", ] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py b/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py new file mode 100644 index 000000000..b968f7b7c --- /dev/null +++ b/sdks/python/julep/api/types/agent_tools_route_list_request_direction.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentToolsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py b/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py new file mode 100644 index 000000000..5584ba780 --- /dev/null +++ b/sdks/python/julep/api/types/agent_tools_route_list_request_sort_by.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentToolsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/agent_tools_route_list_response.py b/sdks/python/julep/api/types/agent_tools_route_list_response.py new file mode 100644 index 000000000..9e56ed1a1 --- /dev/null +++ b/sdks/python/julep/api/types/agent_tools_route_list_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tools_tool import ToolsTool + + +class AgentToolsRouteListResponse(pydantic_v1.BaseModel): + results: typing.List[ToolsTool] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_agent.py b/sdks/python/julep/api/types/agents_agent.py new file mode 100644 index 000000000..04827f31f --- /dev/null +++ b/sdks/python/julep/api/types/agents_agent.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .agents_agent_default_settings import AgentsAgentDefaultSettings +from .agents_agent_instructions import AgentsAgentInstructions +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid + + +class AgentsAgent(pydantic_v1.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the agent + """ + + about: str = pydantic_v1.Field() + """ + About the agent + """ + + model: str = pydantic_v1.Field() + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + + instructions: AgentsAgentInstructions = pydantic_v1.Field() + """ + Instructions for the agent + """ + + default_settings: typing.Optional[AgentsAgentDefaultSettings] = pydantic_v1.Field( + default=None + ) + """ + Default settings for all sessions created by this agent + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_agent_default_settings.py b/sdks/python/julep/api/types/agents_agent_default_settings.py new file mode 100644 index 000000000..71b82cfc2 --- /dev/null +++ b/sdks/python/julep/api/types/agents_agent_default_settings.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsAgentDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agents_agent_instructions.py b/sdks/python/julep/api/types/agents_agent_instructions.py new file mode 100644 index 000000000..b69d41f6f --- /dev/null +++ b/sdks/python/julep/api/types/agents_agent_instructions.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsAgentInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_create_agent_request.py b/sdks/python/julep/api/types/agents_create_agent_request.py new file mode 100644 index 000000000..2a545c6dc --- /dev/null +++ b/sdks/python/julep/api/types/agents_create_agent_request.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .agents_create_agent_request_default_settings import ( + AgentsCreateAgentRequestDefaultSettings, +) +from .agents_create_agent_request_instructions import ( + AgentsCreateAgentRequestInstructions, +) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode + + +class AgentsCreateAgentRequest(pydantic_v1.BaseModel): + """ + Payload for creating a agent (and associated documents) + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the agent + """ + + about: str = pydantic_v1.Field() + """ + About the agent + """ + + model: str = pydantic_v1.Field() + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + + instructions: AgentsCreateAgentRequestInstructions = pydantic_v1.Field() + """ + Instructions for the agent + """ + + default_settings: typing.Optional[AgentsCreateAgentRequestDefaultSettings] = ( + pydantic_v1.Field(default=None) + ) + """ + Default settings for all sessions created by this agent + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py new file mode 100644 index 000000000..da2d239bf --- /dev/null +++ b/sdks/python/julep/api/types/agents_create_agent_request_default_settings.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsCreateAgentRequestDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agents_create_agent_request_instructions.py b/sdks/python/julep/api/types/agents_create_agent_request_instructions.py new file mode 100644 index 000000000..70ec8cac1 --- /dev/null +++ b/sdks/python/julep/api/types/agents_create_agent_request_instructions.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsCreateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py new file mode 100644 index 000000000..2ce2b4fc3 --- /dev/null +++ b/sdks/python/julep/api/types/agents_patch_agent_request_default_settings.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsPatchAgentRequestDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py b/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py new file mode 100644 index 000000000..9df431bc5 --- /dev/null +++ b/sdks/python/julep/api/types/agents_patch_agent_request_instructions.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsPatchAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/agents_route_list_request_direction.py b/sdks/python/julep/api/types/agents_route_list_request_direction.py new file mode 100644 index 000000000..c2c39fb15 --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_list_request_direction.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/agents_route_list_request_sort_by.py b/sdks/python/julep/api/types/agents_route_list_request_sort_by.py new file mode 100644 index 000000000..88dcc2fcf --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_list_request_sort_by.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/agents_route_list_response.py b/sdks/python/julep/api/types/agents_route_list_response.py new file mode 100644 index 000000000..98362162e --- /dev/null +++ b/sdks/python/julep/api/types/agents_route_list_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .agents_agent import AgentsAgent + + +class AgentsRouteListResponse(pydantic_v1.BaseModel): + results: typing.List[AgentsAgent] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_update_agent_request.py b/sdks/python/julep/api/types/agents_update_agent_request.py new file mode 100644 index 000000000..1b7a648a7 --- /dev/null +++ b/sdks/python/julep/api/types/agents_update_agent_request.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .agents_update_agent_request_default_settings import ( + AgentsUpdateAgentRequestDefaultSettings, +) +from .agents_update_agent_request_instructions import ( + AgentsUpdateAgentRequestInstructions, +) +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode + + +class AgentsUpdateAgentRequest(pydantic_v1.BaseModel): + """ + Payload for updating a agent + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the agent + """ + + about: str = pydantic_v1.Field() + """ + About the agent + """ + + model: str = pydantic_v1.Field() + """ + Model name to use (gpt-4-turbo, gemini-nano etc) + """ + + instructions: AgentsUpdateAgentRequestInstructions = pydantic_v1.Field() + """ + Instructions for the agent + """ + + default_settings: typing.Optional[AgentsUpdateAgentRequestDefaultSettings] = ( + pydantic_v1.Field(default=None) + ) + """ + Default settings for all sessions created by this agent + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py b/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py new file mode 100644 index 000000000..dc6ff15ab --- /dev/null +++ b/sdks/python/julep/api/types/agents_update_agent_request_default_settings.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .chat_generation_preset_settings import ChatGenerationPresetSettings +from .chat_open_ai_settings import ChatOpenAiSettings +from .chat_v_llm_settings import ChatVLlmSettings + +AgentsUpdateAgentRequestDefaultSettings = typing.Union[ + ChatGenerationPresetSettings, ChatOpenAiSettings, ChatVLlmSettings +] diff --git a/sdks/python/julep/api/types/agents_update_agent_request_instructions.py b/sdks/python/julep/api/types/agents_update_agent_request_instructions.py new file mode 100644 index 000000000..aecd60481 --- /dev/null +++ b/sdks/python/julep/api/types/agents_update_agent_request_instructions.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AgentsUpdateAgentRequestInstructions = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/chat_generation_preset_settings.py b/sdks/python/julep/api/types/chat_generation_preset_settings.py new file mode 100644 index 000000000..7ce09ceff --- /dev/null +++ b/sdks/python/julep/api/types/chat_generation_preset_settings.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .chat_generation_preset import ChatGenerationPreset + + +class ChatGenerationPresetSettings(pydantic_v1.BaseModel): + preset: typing.Optional[ChatGenerationPreset] = pydantic_v1.Field(default=None) + """ + Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_open_ai_settings.py b/sdks/python/julep/api/types/chat_open_ai_settings.py new file mode 100644 index 000000000..0bb5a0799 --- /dev/null +++ b/sdks/python/julep/api/types/chat_open_ai_settings.py @@ -0,0 +1,60 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 + + +class ChatOpenAiSettings(pydantic_v1.BaseModel): + frequency_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + presence_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/chat_v_llm_settings.py b/sdks/python/julep/api/types/chat_v_llm_settings.py new file mode 100644 index 000000000..897c25b2f --- /dev/null +++ b/sdks/python/julep/api/types/chat_v_llm_settings.py @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 + + +class ChatVLlmSettings(pydantic_v1.BaseModel): + repetition_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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. + """ + + length_penalty: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + """ + + temperature: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + 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] = pydantic_v1.Field(default=None) + """ + 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. + """ + + min_p: typing.Optional[float] = pydantic_v1.Field(default=None) + """ + Minimum probability compared to leading token to be considered + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_embed_query_request.py b/sdks/python/julep/api/types/docs_embed_query_request.py new file mode 100644 index 000000000..21d49b706 --- /dev/null +++ b/sdks/python/julep/api/types/docs_embed_query_request.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .docs_embed_query_request_text import DocsEmbedQueryRequestText + + +class DocsEmbedQueryRequest(pydantic_v1.BaseModel): + text: DocsEmbedQueryRequestText = pydantic_v1.Field() + """ + Text or texts to embed + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/docs_embed_query_request_text.py b/sdks/python/julep/api/types/docs_embed_query_request_text.py new file mode 100644 index 000000000..6462dd057 --- /dev/null +++ b/sdks/python/julep/api/types/docs_embed_query_request_text.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +DocsEmbedQueryRequestText = typing.Union[str, typing.List[str]] diff --git a/sdks/python/julep/api/types/docs_embed_query_response.py b/sdks/python/julep/api/types/docs_embed_query_response.py new file mode 100644 index 000000000..acf7907ae --- /dev/null +++ b/sdks/python/julep/api/types/docs_embed_query_response.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 + + +class DocsEmbedQueryResponse(pydantic_v1.BaseModel): + vectors: typing.List[typing.List[float]] = pydantic_v1.Field() + """ + The embedded vectors + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/jobs_job_state.py b/sdks/python/julep/api/types/jobs_job_state.py new file mode 100644 index 000000000..5dbc9903b --- /dev/null +++ b/sdks/python/julep/api/types/jobs_job_state.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +JobsJobState = typing.Union[ + typing.Literal[ + "pending", + "in_progress", + "retrying", + "succeeded", + "aborted", + "failed", + "unknown", + ], + typing.Any, +] diff --git a/sdks/python/julep/api/types/jobs_job_status.py b/sdks/python/julep/api/types/jobs_job_status.py new file mode 100644 index 000000000..cc29891d8 --- /dev/null +++ b/sdks/python/julep/api/types/jobs_job_status.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid +from .jobs_job_state import JobsJobState + + +class JobsJobStatus(pydantic_v1.BaseModel): + id: CommonUuid + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the job + """ + + reason: str = pydantic_v1.Field() + """ + Reason for the current state of the job + """ + + has_progress: bool = pydantic_v1.Field() + """ + Whether this Job supports progress updates + """ + + progress: float = pydantic_v1.Field() + """ + Progress percentage + """ + + state: JobsJobState = pydantic_v1.Field() + """ + Current state of the job + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_context_overflow_type.py b/sdks/python/julep/api/types/sessions_context_overflow_type.py new file mode 100644 index 000000000..85006c98b --- /dev/null +++ b/sdks/python/julep/api/types/sessions_context_overflow_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SessionsContextOverflowType = typing.Union[ + typing.Literal["truncate", "adaptive"], typing.Any +] diff --git a/sdks/python/julep/api/types/sessions_create_session_request.py b/sdks/python/julep/api/types/sessions_create_session_request.py new file mode 100644 index 000000000..e6570309d --- /dev/null +++ b/sdks/python/julep/api/types/sessions_create_session_request.py @@ -0,0 +1,82 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .sessions_context_overflow_type import SessionsContextOverflowType + + +class SessionsCreateSessionRequest(pydantic_v1.BaseModel): + """ + Payload for creating a session + """ + + user: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + User ID of user associated with this session + """ + + users: typing.Optional[typing.List[CommonUuid]] = None + agent: typing.Optional[CommonUuid] = pydantic_v1.Field(default=None) + """ + Agent ID of agent associated with this session + """ + + agents: typing.Optional[typing.List[CommonUuid]] = None + situation: str = pydantic_v1.Field() + """ + A specific situation that sets the background for this session + """ + + render_templates: bool = pydantic_v1.Field() + """ + Render system and assistant message content as jinja templates + """ + + token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + Threshold value for the adaptive context functionality + """ + + context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( + default=None + ) + """ + Action to start on context window overflow + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py new file mode 100644 index 000000000..057c70ebf --- /dev/null +++ b/sdks/python/julep/api/types/sessions_multi_agent_multi_user_session.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid + + +class SessionsMultiAgentMultiUserSession(pydantic_v1.BaseModel): + agents: typing.List[CommonUuid] + users: typing.List[CommonUuid] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py new file mode 100644 index 000000000..8814b09f3 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_multi_agent_no_user_session.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid + + +class SessionsMultiAgentNoUserSession(pydantic_v1.BaseModel): + agents: typing.List[CommonUuid] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py new file mode 100644 index 000000000..cda61b7a1 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_multi_agent_single_user_session.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid + + +class SessionsMultiAgentSingleUserSession(pydantic_v1.BaseModel): + agents: typing.List[CommonUuid] + user: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_route_list_request_direction.py b/sdks/python/julep/api/types/sessions_route_list_request_direction.py new file mode 100644 index 000000000..c419b7e2b --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_list_request_direction.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SessionsRouteListRequestDirection = typing.Union[ + typing.Literal["asc", "desc"], typing.Any +] diff --git a/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py b/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py new file mode 100644 index 000000000..add82a7be --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_list_request_sort_by.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SessionsRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/sessions_route_list_response.py b/sdks/python/julep/api/types/sessions_route_list_response.py new file mode 100644 index 000000000..874d1bd1e --- /dev/null +++ b/sdks/python/julep/api/types/sessions_route_list_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .sessions_session import SessionsSession + + +class SessionsRouteListResponse(pydantic_v1.BaseModel): + results: typing.List[SessionsSession] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_session.py b/sdks/python/julep/api/types/sessions_session.py new file mode 100644 index 000000000..d610040c0 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_session.py @@ -0,0 +1,325 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid +from .sessions_context_overflow_type import SessionsContextOverflowType + + +class Base(pydantic_v1.BaseModel): + situation: str = pydantic_v1.Field() + """ + A specific situation that sets the background for this session + """ + + summary: typing.Optional[str] = pydantic_v1.Field(default=None) + """ + Summary (null at the beginning) - generated automatically after every interaction + """ + + render_templates: bool = pydantic_v1.Field() + """ + Render system and assistant message content as jinja templates + """ + + token_budget: typing.Optional[int] = pydantic_v1.Field(default=None) + """ + Threshold value for the adaptive context functionality + """ + + context_overflow: typing.Optional[SessionsContextOverflowType] = pydantic_v1.Field( + default=None + ) + """ + Action to start on context window overflow + """ + + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_SingleAgentNoUser(Base): + agent: CommonUuid + kind: typing.Literal["single_agent_no_user"] = "single_agent_no_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_SingleAgentSingleUser(Base): + agent: CommonUuid + user: CommonUuid + kind: typing.Literal["single_agent_single_user"] = "single_agent_single_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_SingleAgentMultiUser(Base): + agent: CommonUuid + users: typing.List[CommonUuid] + kind: typing.Literal["single_agent_multi_user"] = "single_agent_multi_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_MultiAgentNoUser(Base): + agents: typing.List[CommonUuid] + kind: typing.Literal["multi_agent_no_user"] = "multi_agent_no_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_MultiAgentSingleUser(Base): + agents: typing.List[CommonUuid] + user: CommonUuid + kind: typing.Literal["multi_agent_single_user"] = "multi_agent_single_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +class SessionsSession_MultiAgentMultiUser(Base): + agents: typing.List[CommonUuid] + users: typing.List[CommonUuid] + kind: typing.Literal["multi_agent_multi_user"] = "multi_agent_multi_user" + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + populate_by_name = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} + + +SessionsSession = typing.Union[ + SessionsSession_SingleAgentNoUser, + SessionsSession_SingleAgentSingleUser, + SessionsSession_SingleAgentMultiUser, + SessionsSession_MultiAgentNoUser, + SessionsSession_MultiAgentSingleUser, + SessionsSession_MultiAgentMultiUser, +] diff --git a/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py new file mode 100644 index 000000000..66d652b02 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_single_agent_multi_user_session.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid + + +class SessionsSingleAgentMultiUserSession(pydantic_v1.BaseModel): + agent: CommonUuid + users: typing.List[CommonUuid] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py new file mode 100644 index 000000000..8b7866b62 --- /dev/null +++ b/sdks/python/julep/api/types/sessions_single_agent_no_user_session.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid + + +class SessionsSingleAgentNoUserSession(pydantic_v1.BaseModel): + agent: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py b/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py new file mode 100644 index 000000000..9ba35bb4b --- /dev/null +++ b/sdks/python/julep/api/types/sessions_single_agent_single_user_session.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_uuid import CommonUuid + + +class SessionsSingleAgentSingleUserSession(pydantic_v1.BaseModel): + agent: CommonUuid + user: CommonUuid + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tasks_create_task_request.py b/sdks/python/julep/api/types/tasks_create_task_request.py new file mode 100644 index 000000000..b407e7453 --- /dev/null +++ b/sdks/python/julep/api/types/tasks_create_task_request.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .tasks_create_task_request_main_item import TasksCreateTaskRequestMainItem +from .tasks_task_tool import TasksTaskTool + + +class TasksCreateTaskRequest(pydantic_v1.BaseModel): + """ + Payload for creating a task + """ + + name: str + description: str + main: typing.List[TasksCreateTaskRequestMainItem] = pydantic_v1.Field() + """ + The entrypoint of the task. + """ + + input_schema: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + default=None + ) + """ + The schema for the input to the task. `null` means all inputs are valid. + """ + + tools: typing.List[TasksTaskTool] = pydantic_v1.Field() + """ + Tools defined specifically for this task not included in the Agent itself. + """ + + inherit_tools: bool = pydantic_v1.Field() + """ + Whether to inherit tools from the parent agent or not. Defaults to true. + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/tools_function_def_update.py b/sdks/python/julep/api/types/tools_function_def_update.py new file mode 100644 index 000000000..9cfc3bd81 --- /dev/null +++ b/sdks/python/julep/api/types/tools_function_def_update.py @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_valid_python_identifier import CommonValidPythonIdentifier + + +class ToolsFunctionDefUpdate(pydantic_v1.BaseModel): + """ + Function definition + """ + + name: typing.Optional[CommonValidPythonIdentifier] = pydantic_v1.Field(default=None) + """ + DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + """ + + description: typing.Optional[CommonIdentifierSafeUnicode] = pydantic_v1.Field( + default=None + ) + """ + Description of the function + """ + + parameters: typing.Optional[typing.Dict[str, typing.Any]] = pydantic_v1.Field( + default=None + ) + """ + The parameters the function accepts + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_route_list_request_direction.py b/sdks/python/julep/api/types/users_route_list_request_direction.py new file mode 100644 index 000000000..0bd478d82 --- /dev/null +++ b/sdks/python/julep/api/types/users_route_list_request_direction.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UsersRouteListRequestDirection = typing.Union[typing.Literal["asc", "desc"], typing.Any] diff --git a/sdks/python/julep/api/types/users_route_list_request_sort_by.py b/sdks/python/julep/api/types/users_route_list_request_sort_by.py new file mode 100644 index 000000000..2e45a9857 --- /dev/null +++ b/sdks/python/julep/api/types/users_route_list_request_sort_by.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UsersRouteListRequestSortBy = typing.Union[ + typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any +] diff --git a/sdks/python/julep/api/types/users_route_list_response.py b/sdks/python/julep/api/types/users_route_list_response.py new file mode 100644 index 000000000..7cb75ac18 --- /dev/null +++ b/sdks/python/julep/api/types/users_route_list_response.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .users_user import UsersUser + + +class UsersRouteListResponse(pydantic_v1.BaseModel): + results: typing.List[UsersUser] + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_update_user_request.py b/sdks/python/julep/api/types/users_update_user_request.py new file mode 100644 index 000000000..f747a2093 --- /dev/null +++ b/sdks/python/julep/api/types/users_update_user_request.py @@ -0,0 +1,56 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode + + +class UsersUpdateUserRequest(pydantic_v1.BaseModel): + """ + Payload for updating a user + """ + + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the user + """ + + about: str = pydantic_v1.Field() + """ + About the user + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/python/julep/api/types/users_user.py b/sdks/python/julep/api/types/users_user.py new file mode 100644 index 000000000..9b6c519de --- /dev/null +++ b/sdks/python/julep/api/types/users_user.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.datetime_utils import serialize_datetime +from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 +from .common_identifier_safe_unicode import CommonIdentifierSafeUnicode +from .common_uuid import CommonUuid + + +class UsersUser(pydantic_v1.BaseModel): + id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + created_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was created as UTC date-time + """ + + updated_at: dt.datetime = pydantic_v1.Field() + """ + When this resource was updated as UTC date-time + """ + + name: CommonIdentifierSafeUnicode = pydantic_v1.Field() + """ + Name of the user + """ + + about: str = pydantic_v1.Field() + """ + About the user + """ + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults_exclude_unset: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + kwargs_with_defaults_exclude_none: typing.Any = { + "by_alias": True, + "exclude_none": True, + **kwargs, + } + + return deep_union_pydantic_dicts( + super().dict(**kwargs_with_defaults_exclude_unset), + super().dict(**kwargs_with_defaults_exclude_none), + ) + + class Config: + frozen = True + smart_union = True + extra = pydantic_v1.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/ts/src/api/index.ts b/sdks/ts/src/api/index.ts index ccaf9a0ab..cdd3a21f6 100644 --- a/sdks/ts/src/api/index.ts +++ b/sdks/ts/src/api/index.ts @@ -10,6 +10,11 @@ export { CancelablePromise, CancelError } from "./core/CancelablePromise"; export { OpenAPI } from "./core/OpenAPI"; export type { OpenAPIConfig } from "./core/OpenAPI"; +export type { Agents_Agent } from "./models/Agents_Agent"; +export type { Agents_CreateAgentRequest } from "./models/Agents_CreateAgentRequest"; +export type { Agents_CreateOrUpdateAgentRequest_id } from "./models/Agents_CreateOrUpdateAgentRequest_id"; +export type { Agents_PatchAgentRequest } from "./models/Agents_PatchAgentRequest"; +export type { Agents_UpdateAgentRequest } from "./models/Agents_UpdateAgentRequest"; export type { Chat_BaseChatOutput } from "./models/Chat_BaseChatOutput"; export type { Chat_BaseChatResponse } from "./models/Chat_BaseChatResponse"; export type { Chat_BaseTokenLogProb } from "./models/Chat_BaseTokenLogProb"; @@ -19,11 +24,14 @@ export type { Chat_CompetionUsage } from "./models/Chat_CompetionUsage"; export type { Chat_CompletionResponseFormat } from "./models/Chat_CompletionResponseFormat"; export type { Chat_FinishReason } from "./models/Chat_FinishReason"; export type { Chat_GenerationPreset } from "./models/Chat_GenerationPreset"; +export type { Chat_GenerationPresetSettings } from "./models/Chat_GenerationPresetSettings"; export type { Chat_LogProbResponse } from "./models/Chat_LogProbResponse"; export type { Chat_MessageChatResponse } from "./models/Chat_MessageChatResponse"; export type { Chat_MultipleChatOutput } from "./models/Chat_MultipleChatOutput"; +export type { Chat_OpenAISettings } from "./models/Chat_OpenAISettings"; export type { Chat_SingleChatOutput } from "./models/Chat_SingleChatOutput"; export type { Chat_TokenLogProb } from "./models/Chat_TokenLogProb"; +export type { Chat_vLLMSettings } from "./models/Chat_vLLMSettings"; export type { Common_identifierSafeUnicode } from "./models/Common_identifierSafeUnicode"; export type { Common_limit } from "./models/Common_limit"; export type { Common_logit_bias } from "./models/Common_logit_bias"; @@ -44,6 +52,8 @@ export type { Docs_BaseDocSearchRequest } from "./models/Docs_BaseDocSearchReque export type { Docs_Doc } from "./models/Docs_Doc"; export type { Docs_DocOwner } from "./models/Docs_DocOwner"; export type { Docs_DocReference } from "./models/Docs_DocReference"; +export type { Docs_EmbedQueryRequest } from "./models/Docs_EmbedQueryRequest"; +export type { Docs_EmbedQueryResponse } from "./models/Docs_EmbedQueryResponse"; export type { Docs_HybridDocSearchRequest } from "./models/Docs_HybridDocSearchRequest"; export type { Docs_TextOnlyDocSearchRequest } from "./models/Docs_TextOnlyDocSearchRequest"; export type { Docs_VectorDocSearchRequest } from "./models/Docs_VectorDocSearchRequest"; @@ -64,6 +74,21 @@ export type { Executions_StopExecutionRequest } from "./models/Executions_StopEx export type { Executions_TaskTokenResumeExecutionRequest } from "./models/Executions_TaskTokenResumeExecutionRequest"; export type { Executions_Transition } from "./models/Executions_Transition"; export type { Executions_UpdateExecutionRequest } from "./models/Executions_UpdateExecutionRequest"; +export type { Jobs_JobState } from "./models/Jobs_JobState"; +export type { Jobs_JobStatus } from "./models/Jobs_JobStatus"; +export type { Sessions_ContextOverflowType } from "./models/Sessions_ContextOverflowType"; +export type { Sessions_CreateOrUpdateSessionRequest_id } from "./models/Sessions_CreateOrUpdateSessionRequest_id"; +export type { Sessions_CreateSessionRequest } from "./models/Sessions_CreateSessionRequest"; +export type { Sessions_MultiAgentMultiUserSession } from "./models/Sessions_MultiAgentMultiUserSession"; +export type { Sessions_MultiAgentNoUserSession } from "./models/Sessions_MultiAgentNoUserSession"; +export type { Sessions_MultiAgentSingleUserSession } from "./models/Sessions_MultiAgentSingleUserSession"; +export type { Sessions_PatchSessionRequest } from "./models/Sessions_PatchSessionRequest"; +export type { Sessions_Session } from "./models/Sessions_Session"; +export type { Sessions_SingleAgentMultiUserSession } from "./models/Sessions_SingleAgentMultiUserSession"; +export type { Sessions_SingleAgentNoUserSession } from "./models/Sessions_SingleAgentNoUserSession"; +export type { Sessions_SingleAgentSingleUserSession } from "./models/Sessions_SingleAgentSingleUserSession"; +export type { Sessions_UpdateSessionRequest } from "./models/Sessions_UpdateSessionRequest"; +export type { Tasks_CreateOrUpdateTaskRequest_id } from "./models/Tasks_CreateOrUpdateTaskRequest_id"; export type { Tasks_CreateTaskRequest } from "./models/Tasks_CreateTaskRequest"; export type { Tasks_ErrorWorkflowStep } from "./models/Tasks_ErrorWorkflowStep"; export type { Tasks_EvaluateStep } from "./models/Tasks_EvaluateStep"; @@ -79,13 +104,26 @@ export type { Tools_ChosenFunctionCall } from "./models/Tools_ChosenFunctionCall export type { Tools_ChosenToolCall } from "./models/Tools_ChosenToolCall"; export type { Tools_FunctionCallOption } from "./models/Tools_FunctionCallOption"; export type { Tools_FunctionDef } from "./models/Tools_FunctionDef"; +export type { Tools_FunctionDefUpdate } from "./models/Tools_FunctionDefUpdate"; export type { Tools_FunctionTool } from "./models/Tools_FunctionTool"; export type { Tools_NamedFunctionChoice } from "./models/Tools_NamedFunctionChoice"; export type { Tools_NamedToolChoice } from "./models/Tools_NamedToolChoice"; +export type { Tools_PatchToolRequest } from "./models/Tools_PatchToolRequest"; export type { Tools_Tool } from "./models/Tools_Tool"; export type { Tools_ToolResponse } from "./models/Tools_ToolResponse"; export type { Tools_ToolType } from "./models/Tools_ToolType"; +export type { Tools_UpdateToolRequest } from "./models/Tools_UpdateToolRequest"; +export type { Users_CreateOrUpdateUserRequest_id } from "./models/Users_CreateOrUpdateUserRequest_id"; +export type { Users_CreateUserRequest } from "./models/Users_CreateUserRequest"; +export type { Users_PatchUserRequest } from "./models/Users_PatchUserRequest"; +export type { Users_UpdateUserRequest } from "./models/Users_UpdateUserRequest"; +export type { Users_User } from "./models/Users_User"; +export { $Agents_Agent } from "./schemas/$Agents_Agent"; +export { $Agents_CreateAgentRequest } from "./schemas/$Agents_CreateAgentRequest"; +export { $Agents_CreateOrUpdateAgentRequest_id } from "./schemas/$Agents_CreateOrUpdateAgentRequest_id"; +export { $Agents_PatchAgentRequest } from "./schemas/$Agents_PatchAgentRequest"; +export { $Agents_UpdateAgentRequest } from "./schemas/$Agents_UpdateAgentRequest"; export { $Chat_BaseChatOutput } from "./schemas/$Chat_BaseChatOutput"; export { $Chat_BaseChatResponse } from "./schemas/$Chat_BaseChatResponse"; export { $Chat_BaseTokenLogProb } from "./schemas/$Chat_BaseTokenLogProb"; @@ -95,11 +133,14 @@ export { $Chat_CompetionUsage } from "./schemas/$Chat_CompetionUsage"; export { $Chat_CompletionResponseFormat } from "./schemas/$Chat_CompletionResponseFormat"; export { $Chat_FinishReason } from "./schemas/$Chat_FinishReason"; export { $Chat_GenerationPreset } from "./schemas/$Chat_GenerationPreset"; +export { $Chat_GenerationPresetSettings } from "./schemas/$Chat_GenerationPresetSettings"; export { $Chat_LogProbResponse } from "./schemas/$Chat_LogProbResponse"; export { $Chat_MessageChatResponse } from "./schemas/$Chat_MessageChatResponse"; export { $Chat_MultipleChatOutput } from "./schemas/$Chat_MultipleChatOutput"; +export { $Chat_OpenAISettings } from "./schemas/$Chat_OpenAISettings"; export { $Chat_SingleChatOutput } from "./schemas/$Chat_SingleChatOutput"; export { $Chat_TokenLogProb } from "./schemas/$Chat_TokenLogProb"; +export { $Chat_vLLMSettings } from "./schemas/$Chat_vLLMSettings"; export { $Common_identifierSafeUnicode } from "./schemas/$Common_identifierSafeUnicode"; export { $Common_limit } from "./schemas/$Common_limit"; export { $Common_logit_bias } from "./schemas/$Common_logit_bias"; @@ -120,6 +161,8 @@ export { $Docs_BaseDocSearchRequest } from "./schemas/$Docs_BaseDocSearchRequest export { $Docs_Doc } from "./schemas/$Docs_Doc"; export { $Docs_DocOwner } from "./schemas/$Docs_DocOwner"; export { $Docs_DocReference } from "./schemas/$Docs_DocReference"; +export { $Docs_EmbedQueryRequest } from "./schemas/$Docs_EmbedQueryRequest"; +export { $Docs_EmbedQueryResponse } from "./schemas/$Docs_EmbedQueryResponse"; export { $Docs_HybridDocSearchRequest } from "./schemas/$Docs_HybridDocSearchRequest"; export { $Docs_TextOnlyDocSearchRequest } from "./schemas/$Docs_TextOnlyDocSearchRequest"; export { $Docs_VectorDocSearchRequest } from "./schemas/$Docs_VectorDocSearchRequest"; @@ -140,6 +183,21 @@ export { $Executions_StopExecutionRequest } from "./schemas/$Executions_StopExec export { $Executions_TaskTokenResumeExecutionRequest } from "./schemas/$Executions_TaskTokenResumeExecutionRequest"; export { $Executions_Transition } from "./schemas/$Executions_Transition"; export { $Executions_UpdateExecutionRequest } from "./schemas/$Executions_UpdateExecutionRequest"; +export { $Jobs_JobState } from "./schemas/$Jobs_JobState"; +export { $Jobs_JobStatus } from "./schemas/$Jobs_JobStatus"; +export { $Sessions_ContextOverflowType } from "./schemas/$Sessions_ContextOverflowType"; +export { $Sessions_CreateOrUpdateSessionRequest_id } from "./schemas/$Sessions_CreateOrUpdateSessionRequest_id"; +export { $Sessions_CreateSessionRequest } from "./schemas/$Sessions_CreateSessionRequest"; +export { $Sessions_MultiAgentMultiUserSession } from "./schemas/$Sessions_MultiAgentMultiUserSession"; +export { $Sessions_MultiAgentNoUserSession } from "./schemas/$Sessions_MultiAgentNoUserSession"; +export { $Sessions_MultiAgentSingleUserSession } from "./schemas/$Sessions_MultiAgentSingleUserSession"; +export { $Sessions_PatchSessionRequest } from "./schemas/$Sessions_PatchSessionRequest"; +export { $Sessions_Session } from "./schemas/$Sessions_Session"; +export { $Sessions_SingleAgentMultiUserSession } from "./schemas/$Sessions_SingleAgentMultiUserSession"; +export { $Sessions_SingleAgentNoUserSession } from "./schemas/$Sessions_SingleAgentNoUserSession"; +export { $Sessions_SingleAgentSingleUserSession } from "./schemas/$Sessions_SingleAgentSingleUserSession"; +export { $Sessions_UpdateSessionRequest } from "./schemas/$Sessions_UpdateSessionRequest"; +export { $Tasks_CreateOrUpdateTaskRequest_id } from "./schemas/$Tasks_CreateOrUpdateTaskRequest_id"; export { $Tasks_CreateTaskRequest } from "./schemas/$Tasks_CreateTaskRequest"; export { $Tasks_ErrorWorkflowStep } from "./schemas/$Tasks_ErrorWorkflowStep"; export { $Tasks_EvaluateStep } from "./schemas/$Tasks_EvaluateStep"; @@ -155,11 +213,19 @@ export { $Tools_ChosenFunctionCall } from "./schemas/$Tools_ChosenFunctionCall"; export { $Tools_ChosenToolCall } from "./schemas/$Tools_ChosenToolCall"; export { $Tools_FunctionCallOption } from "./schemas/$Tools_FunctionCallOption"; export { $Tools_FunctionDef } from "./schemas/$Tools_FunctionDef"; +export { $Tools_FunctionDefUpdate } from "./schemas/$Tools_FunctionDefUpdate"; export { $Tools_FunctionTool } from "./schemas/$Tools_FunctionTool"; export { $Tools_NamedFunctionChoice } from "./schemas/$Tools_NamedFunctionChoice"; export { $Tools_NamedToolChoice } from "./schemas/$Tools_NamedToolChoice"; +export { $Tools_PatchToolRequest } from "./schemas/$Tools_PatchToolRequest"; export { $Tools_Tool } from "./schemas/$Tools_Tool"; export { $Tools_ToolResponse } from "./schemas/$Tools_ToolResponse"; export { $Tools_ToolType } from "./schemas/$Tools_ToolType"; +export { $Tools_UpdateToolRequest } from "./schemas/$Tools_UpdateToolRequest"; +export { $Users_CreateOrUpdateUserRequest_id } from "./schemas/$Users_CreateOrUpdateUserRequest_id"; +export { $Users_CreateUserRequest } from "./schemas/$Users_CreateUserRequest"; +export { $Users_PatchUserRequest } from "./schemas/$Users_PatchUserRequest"; +export { $Users_UpdateUserRequest } from "./schemas/$Users_UpdateUserRequest"; +export { $Users_User } from "./schemas/$Users_User"; export { DefaultService } from "./services/DefaultService"; diff --git a/sdks/ts/src/api/models/Agents_Agent.ts b/sdks/ts/src/api/models/Agents_Agent.ts new file mode 100644 index 000000000..c92c84c33 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_Agent.ts @@ -0,0 +1,44 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Agents_Agent = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts b/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts new file mode 100644 index 000000000..c9c95127b --- /dev/null +++ b/sdks/ts/src/api/models/Agents_CreateAgentRequest.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for creating a agent (and associated documents) + */ +export type Agents_CreateAgentRequest = { + metadata?: Record; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts new file mode 100644 index 000000000..a0b127a69 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_CreateOrUpdateAgentRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Agents_CreateOrUpdateAgentRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts b/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts new file mode 100644 index 000000000..52f60bb04 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_PatchAgentRequest.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for patching a agent + */ +export type Agents_PatchAgentRequest = { + metadata?: Record; + /** + * Name of the agent + */ + name?: Common_identifierSafeUnicode; + /** + * About the agent + */ + about?: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model?: string; + /** + * Instructions for the agent + */ + instructions?: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts b/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts new file mode 100644 index 000000000..1b5aa4c23 --- /dev/null +++ b/sdks/ts/src/api/models/Agents_UpdateAgentRequest.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPresetSettings } from "./Chat_GenerationPresetSettings"; +import type { Chat_OpenAISettings } from "./Chat_OpenAISettings"; +import type { Chat_vLLMSettings } from "./Chat_vLLMSettings"; +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for updating a agent + */ +export type Agents_UpdateAgentRequest = { + metadata?: Record; + /** + * Name of the agent + */ + name: Common_identifierSafeUnicode; + /** + * About the agent + */ + about: string; + /** + * Model name to use (gpt-4-turbo, gemini-nano etc) + */ + model: string; + /** + * Instructions for the agent + */ + instructions: string | Array; + /** + * Default settings for all sessions created by this agent + */ + default_settings?: + | Chat_GenerationPresetSettings + | Chat_OpenAISettings + | Chat_vLLMSettings; +}; diff --git a/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts b/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts new file mode 100644 index 000000000..230124c0a --- /dev/null +++ b/sdks/ts/src/api/models/Chat_GenerationPresetSettings.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Chat_GenerationPreset } from "./Chat_GenerationPreset"; +export type Chat_GenerationPresetSettings = { + /** + * Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual) + */ + preset?: Chat_GenerationPreset; +}; diff --git a/sdks/ts/src/api/models/Chat_OpenAISettings.ts b/sdks/ts/src/api/models/Chat_OpenAISettings.ts new file mode 100644 index 000000000..2ab230a6f --- /dev/null +++ b/sdks/ts/src/api/models/Chat_OpenAISettings.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Chat_OpenAISettings = { + /** + * 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. + */ + frequency_penalty?: number; + /** + * 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. + */ + presence_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; +}; diff --git a/sdks/ts/src/api/models/Chat_vLLMSettings.ts b/sdks/ts/src/api/models/Chat_vLLMSettings.ts new file mode 100644 index 000000000..8973da946 --- /dev/null +++ b/sdks/ts/src/api/models/Chat_vLLMSettings.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Chat_vLLMSettings = { + /** + * 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. + */ + repetition_penalty?: number; + /** + * Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + */ + length_penalty?: number; + /** + * 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. + */ + temperature?: number; + /** + * 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. + */ + top_p?: number; + /** + * Minimum probability compared to leading token to be considered + */ + min_p?: number; +}; diff --git a/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts b/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts new file mode 100644 index 000000000..37b3cfe85 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_EmbedQueryRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Docs_EmbedQueryRequest = { + /** + * Text or texts to embed + */ + text: string | Array; +}; diff --git a/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts b/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts new file mode 100644 index 000000000..042d22084 --- /dev/null +++ b/sdks/ts/src/api/models/Docs_EmbedQueryResponse.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Docs_EmbedQueryResponse = { + /** + * The embedded vectors + */ + vectors: Array>; +}; diff --git a/sdks/ts/src/api/models/Jobs_JobState.ts b/sdks/ts/src/api/models/Jobs_JobState.ts new file mode 100644 index 000000000..886df5653 --- /dev/null +++ b/sdks/ts/src/api/models/Jobs_JobState.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed) + */ +export type Jobs_JobState = + | "pending" + | "in_progress" + | "retrying" + | "succeeded" + | "aborted" + | "failed" + | "unknown"; diff --git a/sdks/ts/src/api/models/Jobs_JobStatus.ts b/sdks/ts/src/api/models/Jobs_JobStatus.ts new file mode 100644 index 000000000..9ec75c8c7 --- /dev/null +++ b/sdks/ts/src/api/models/Jobs_JobStatus.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +import type { Jobs_JobState } from "./Jobs_JobState"; +export type Jobs_JobStatus = { + readonly id: Common_uuid; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the job + */ + name: Common_identifierSafeUnicode; + /** + * Reason for the current state of the job + */ + reason: string; + /** + * Whether this Job supports progress updates + */ + has_progress: boolean; + /** + * Progress percentage + */ + progress: number; + /** + * Current state of the job + */ + state: Jobs_JobState; +}; diff --git a/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts b/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts new file mode 100644 index 000000000..87de87a34 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_ContextOverflowType.ts @@ -0,0 +1,5 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Sessions_ContextOverflowType = "truncate" | "adaptive"; diff --git a/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts new file mode 100644 index 000000000..e668e6ee3 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_CreateOrUpdateSessionRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Sessions_CreateOrUpdateSessionRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts new file mode 100644 index 000000000..b2b09c9d3 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_CreateSessionRequest.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; +/** + * Payload for creating a session + */ +export type Sessions_CreateSessionRequest = { + /** + * User ID of user associated with this session + */ + user?: Common_uuid; + users?: Array; + /** + * Agent ID of agent associated with this session + */ + agent?: Common_uuid; + agents?: Array; + /** + * A specific situation that sets the background for this session + */ + situation: string; + /** + * Render system and assistant message content as jinja templates + */ + render_templates: boolean; + /** + * Threshold value for the adaptive context functionality + */ + token_budget: number | null; + /** + * Action to start on context window overflow + */ + context_overflow: Sessions_ContextOverflowType | null; + metadata?: Record; +}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts new file mode 100644 index 000000000..8437427fc --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_MultiAgentMultiUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_MultiAgentMultiUserSession = Sessions_Session & { + agents: Array; + users: Array; +}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts new file mode 100644 index 000000000..a684f2dc2 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_MultiAgentNoUserSession.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_MultiAgentNoUserSession = Sessions_Session & { + agents: Array; +}; diff --git a/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts b/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts new file mode 100644 index 000000000..7a39383c8 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_MultiAgentSingleUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_MultiAgentSingleUserSession = Sessions_Session & { + agents: Array; + user: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts b/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts new file mode 100644 index 000000000..589c01379 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_PatchSessionRequest.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; +/** + * Payload for patching a session + */ +export type Sessions_PatchSessionRequest = { + /** + * A specific situation that sets the background for this session + */ + situation?: string; + /** + * Render system and assistant message content as jinja templates + */ + render_templates?: boolean; + /** + * Threshold value for the adaptive context functionality + */ + token_budget?: number | null; + /** + * Action to start on context window overflow + */ + context_overflow?: Sessions_ContextOverflowType | null; + metadata?: Record; +}; diff --git a/sdks/ts/src/api/models/Sessions_Session.ts b/sdks/ts/src/api/models/Sessions_Session.ts new file mode 100644 index 000000000..d8e89604b --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_Session.ts @@ -0,0 +1,42 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; +export type Sessions_Session = { + /** + * A specific situation that sets the background for this session + */ + situation: string; + /** + * Summary (null at the beginning) - generated automatically after every interaction + */ + readonly summary: string | null; + /** + * Render system and assistant message content as jinja templates + */ + render_templates: boolean; + /** + * Threshold value for the adaptive context functionality + */ + token_budget: number | null; + /** + * Action to start on context window overflow + */ + context_overflow: Sessions_ContextOverflowType | null; + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Discriminator property for Session. + */ + kind?: string; +}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts new file mode 100644 index 000000000..2fb9ce705 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_SingleAgentMultiUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_SingleAgentMultiUserSession = Sessions_Session & { + agent: Common_uuid; + users: Array; +}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts new file mode 100644 index 000000000..5454c6265 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_SingleAgentNoUserSession.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_SingleAgentNoUserSession = Sessions_Session & { + agent: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts b/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts new file mode 100644 index 000000000..b4636829b --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_SingleAgentSingleUserSession.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +import type { Sessions_Session } from "./Sessions_Session"; +export type Sessions_SingleAgentSingleUserSession = Sessions_Session & { + agent: Common_uuid; + user: Common_uuid; +}; diff --git a/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts b/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts new file mode 100644 index 000000000..cd28f9783 --- /dev/null +++ b/sdks/ts/src/api/models/Sessions_UpdateSessionRequest.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Sessions_ContextOverflowType } from "./Sessions_ContextOverflowType"; +/** + * Payload for updating a session + */ +export type Sessions_UpdateSessionRequest = { + /** + * A specific situation that sets the background for this session + */ + situation: string; + /** + * Render system and assistant message content as jinja templates + */ + render_templates: boolean; + /** + * Threshold value for the adaptive context functionality + */ + token_budget: number | null; + /** + * Action to start on context window overflow + */ + context_overflow: Sessions_ContextOverflowType | null; + metadata?: Record; +}; diff --git a/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts new file mode 100644 index 000000000..aa19b3598 --- /dev/null +++ b/sdks/ts/src/api/models/Tasks_CreateOrUpdateTaskRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Tasks_CreateOrUpdateTaskRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts new file mode 100644 index 000000000..7f4417abd --- /dev/null +++ b/sdks/ts/src/api/models/Tools_FunctionDefUpdate.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; +/** + * Function definition + */ +export type Tools_FunctionDefUpdate = { + /** + * DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. + */ + name?: Common_validPythonIdentifier; + /** + * Description of the function + */ + description?: Common_identifierSafeUnicode; + /** + * The parameters the function accepts + */ + parameters?: Record; +}; diff --git a/sdks/ts/src/api/models/Tools_PatchToolRequest.ts b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts new file mode 100644 index 000000000..0957c8db2 --- /dev/null +++ b/sdks/ts/src/api/models/Tools_PatchToolRequest.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; +import type { Tools_FunctionDefUpdate } from "./Tools_FunctionDefUpdate"; +import type { Tools_ToolType } from "./Tools_ToolType"; +/** + * Payload for patching a tool + */ +export type Tools_PatchToolRequest = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type?: Tools_ToolType; + /** + * Name of the tool (must be unique for this agent and a valid python identifier string ) + */ + name?: Common_validPythonIdentifier; + function?: Tools_FunctionDefUpdate; + integration?: any; + system?: any; + api_call?: any; +}; diff --git a/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts new file mode 100644 index 000000000..6a964fc8c --- /dev/null +++ b/sdks/ts/src/api/models/Tools_UpdateToolRequest.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_validPythonIdentifier } from "./Common_validPythonIdentifier"; +import type { Tools_FunctionDef } from "./Tools_FunctionDef"; +import type { Tools_ToolType } from "./Tools_ToolType"; +/** + * Payload for updating a tool + */ +export type Tools_UpdateToolRequest = { + /** + * Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + */ + type: Tools_ToolType; + /** + * Name of the tool (must be unique for this agent and a valid python identifier string ) + */ + name: Common_validPythonIdentifier; + function?: Tools_FunctionDef; + integration?: any; + system?: any; + api_call?: any; +}; diff --git a/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts new file mode 100644 index 000000000..7338d9bed --- /dev/null +++ b/sdks/ts/src/api/models/Users_CreateOrUpdateUserRequest_id.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_uuid } from "./Common_uuid"; +export type Users_CreateOrUpdateUserRequest_id = Common_uuid; diff --git a/sdks/ts/src/api/models/Users_CreateUserRequest.ts b/sdks/ts/src/api/models/Users_CreateUserRequest.ts new file mode 100644 index 000000000..8811f8252 --- /dev/null +++ b/sdks/ts/src/api/models/Users_CreateUserRequest.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for creating a user (and associated documents) + */ +export type Users_CreateUserRequest = { + metadata?: Record; + /** + * Name of the user + */ + name: Common_identifierSafeUnicode; + /** + * About the user + */ + about: string; +}; diff --git a/sdks/ts/src/api/models/Users_PatchUserRequest.ts b/sdks/ts/src/api/models/Users_PatchUserRequest.ts new file mode 100644 index 000000000..1fe03611b --- /dev/null +++ b/sdks/ts/src/api/models/Users_PatchUserRequest.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for patching a user + */ +export type Users_PatchUserRequest = { + metadata?: Record; + /** + * Name of the user + */ + name?: Common_identifierSafeUnicode; + /** + * About the user + */ + about?: string; +}; diff --git a/sdks/ts/src/api/models/Users_UpdateUserRequest.ts b/sdks/ts/src/api/models/Users_UpdateUserRequest.ts new file mode 100644 index 000000000..d9094acf4 --- /dev/null +++ b/sdks/ts/src/api/models/Users_UpdateUserRequest.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +/** + * Payload for updating a user + */ +export type Users_UpdateUserRequest = { + metadata?: Record; + /** + * Name of the user + */ + name: Common_identifierSafeUnicode; + /** + * About the user + */ + about: string; +}; diff --git a/sdks/ts/src/api/models/Users_User.ts b/sdks/ts/src/api/models/Users_User.ts new file mode 100644 index 000000000..eb42b433e --- /dev/null +++ b/sdks/ts/src/api/models/Users_User.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Common_identifierSafeUnicode } from "./Common_identifierSafeUnicode"; +import type { Common_uuid } from "./Common_uuid"; +export type Users_User = { + readonly id: Common_uuid; + metadata?: Record; + /** + * When this resource was created as UTC date-time + */ + readonly created_at: string; + /** + * When this resource was updated as UTC date-time + */ + readonly updated_at: string; + /** + * Name of the user + */ + name: Common_identifierSafeUnicode; + /** + * About the user + */ + about: string; +}; diff --git a/sdks/ts/src/api/schemas/$Agents_Agent.ts b/sdks/ts/src/api/schemas/$Agents_Agent.ts new file mode 100644 index 000000000..72bb0e2b3 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agents_Agent.ts @@ -0,0 +1,89 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agents_Agent = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the agent`, + isRequired: true, + }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + isRequired: true, + }, + instructions: { + type: "any-of", + description: `Instructions for the agent`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts new file mode 100644 index 000000000..035b10261 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agents_CreateAgentRequest.ts @@ -0,0 +1,66 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agents_CreateAgentRequest = { + description: `Payload for creating a agent (and associated documents)`, + properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + name: { + type: "all-of", + description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the agent`, + isRequired: true, + }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + isRequired: true, + }, + instructions: { + type: "any-of", + description: `Instructions for the agent`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts new file mode 100644 index 000000000..e5db88f15 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agents_CreateOrUpdateAgentRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agents_CreateOrUpdateAgentRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts new file mode 100644 index 000000000..903376a1a --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agents_PatchAgentRequest.ts @@ -0,0 +1,62 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agents_PatchAgentRequest = { + description: `Payload for patching a agent`, + properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + name: { + type: "all-of", + description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + about: { + type: "string", + description: `About the agent`, + }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + }, + instructions: { + type: "any-of", + description: `Instructions for the agent`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts b/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts new file mode 100644 index 000000000..6591bc329 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Agents_UpdateAgentRequest.ts @@ -0,0 +1,66 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Agents_UpdateAgentRequest = { + description: `Payload for updating a agent`, + properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + name: { + type: "all-of", + description: `Name of the agent`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the agent`, + isRequired: true, + }, + model: { + type: "string", + description: `Model name to use (gpt-4-turbo, gemini-nano etc)`, + isRequired: true, + }, + instructions: { + type: "any-of", + description: `Instructions for the agent`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + default_settings: { + type: "any-of", + description: `Default settings for all sessions created by this agent`, + contains: [ + { + type: "Chat_GenerationPresetSettings", + }, + { + type: "Chat_OpenAISettings", + }, + { + type: "Chat_vLLMSettings", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts b/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts new file mode 100644 index 000000000..fd8b68db1 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_GenerationPresetSettings.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_GenerationPresetSettings = { + properties: { + preset: { + type: "all-of", + description: `Generation preset (one of: problem_solving, conversational, fun, prose, creative, business, deterministic, code, multilingual)`, + contains: [ + { + type: "Chat_GenerationPreset", + }, + ], + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts b/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts new file mode 100644 index 000000000..61a12ed7e --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_OpenAISettings.ts @@ -0,0 +1,34 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_OpenAISettings = { + properties: { + frequency_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + presence_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + minimum: -2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts b/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts new file mode 100644 index 000000000..5006b6775 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Chat_vLLMSettings.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Chat_vLLMSettings = { + properties: { + repetition_penalty: { + type: "number", + description: `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.`, + format: "float", + maximum: 2, + }, + length_penalty: { + type: "number", + description: `Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated.`, + format: "float", + maximum: 2, + }, + temperature: { + type: "number", + description: `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.`, + format: "float", + maximum: 5, + }, + top_p: { + type: "number", + description: `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.`, + format: "float", + maximum: 1, + }, + min_p: { + type: "number", + description: `Minimum probability compared to leading token to be considered`, + format: "float", + maximum: 1, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts b/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts new file mode 100644 index 000000000..1cf18ee0e --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_EmbedQueryRequest.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_EmbedQueryRequest = { + properties: { + text: { + type: "any-of", + description: `Text or texts to embed`, + contains: [ + { + type: "string", + }, + { + type: "array", + contains: { + type: "string", + }, + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts b/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts new file mode 100644 index 000000000..381f37709 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Docs_EmbedQueryResponse.ts @@ -0,0 +1,18 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Docs_EmbedQueryResponse = { + properties: { + vectors: { + type: "array", + contains: { + type: "array", + contains: { + type: "number", + }, + }, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Jobs_JobState.ts b/sdks/ts/src/api/schemas/$Jobs_JobState.ts new file mode 100644 index 000000000..651b0849f --- /dev/null +++ b/sdks/ts/src/api/schemas/$Jobs_JobState.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Jobs_JobState = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts b/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts new file mode 100644 index 000000000..3fe2f032b --- /dev/null +++ b/sdks/ts/src/api/schemas/$Jobs_JobStatus.ts @@ -0,0 +1,69 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Jobs_JobStatus = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the job`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + reason: { + type: "string", + description: `Reason for the current state of the job`, + isRequired: true, + }, + has_progress: { + type: "boolean", + description: `Whether this Job supports progress updates`, + isRequired: true, + }, + progress: { + type: "number", + description: `Progress percentage`, + isRequired: true, + format: "float", + maximum: 100, + }, + state: { + type: "all-of", + description: `Current state of the job`, + contains: [ + { + type: "Jobs_JobState", + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts b/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts new file mode 100644 index 000000000..1a4cd0f7d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_ContextOverflowType.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_ContextOverflowType = { + type: "Enum", +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts new file mode 100644 index 000000000..56cc353a0 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_CreateOrUpdateSessionRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_CreateOrUpdateSessionRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts new file mode 100644 index 000000000..3f21c4996 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_CreateSessionRequest.ts @@ -0,0 +1,73 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_CreateSessionRequest = { + description: `Payload for creating a session`, + properties: { + user: { + type: "all-of", + description: `User ID of user associated with this session`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + }, + agent: { + type: "all-of", + description: `Agent ID of agent associated with this session`, + contains: [ + { + type: "Common_uuid", + }, + ], + }, + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + }, + situation: { + type: "string", + description: `A specific situation that sets the background for this session`, + isRequired: true, + }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, + isRequired: true, + }, + token_budget: { + type: "number", + description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", + }, + context_overflow: { + type: "one-of", + description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], + isRequired: true, + isNullable: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts new file mode 100644 index 000000000..846bf8b92 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_MultiAgentMultiUserSession.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_MultiAgentMultiUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts new file mode 100644 index 000000000..36f2ada1d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_MultiAgentNoUserSession.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_MultiAgentNoUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts new file mode 100644 index 000000000..17146caa9 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_MultiAgentSingleUserSession.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_MultiAgentSingleUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agents: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + user: { + type: "Common_uuid", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts new file mode 100644 index 000000000..ec0f8ebed --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_PatchSessionRequest.ts @@ -0,0 +1,39 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_PatchSessionRequest = { + description: `Payload for patching a session`, + properties: { + situation: { + type: "string", + description: `A specific situation that sets the background for this session`, + }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, + }, + token_budget: { + type: "number", + description: `Threshold value for the adaptive context functionality`, + isNullable: true, + format: "uint16", + }, + context_overflow: { + type: "one-of", + description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], + isNullable: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_Session.ts b/sdks/ts/src/api/schemas/$Sessions_Session.ts new file mode 100644 index 000000000..27b368494 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_Session.ts @@ -0,0 +1,77 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_Session = { + properties: { + situation: { + type: "string", + description: `A specific situation that sets the background for this session`, + isRequired: true, + }, + summary: { + type: "string", + description: `Summary (null at the beginning) - generated automatically after every interaction`, + isReadOnly: true, + isRequired: true, + isNullable: true, + }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, + isRequired: true, + }, + token_budget: { + type: "number", + description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", + }, + context_overflow: { + type: "one-of", + description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], + isRequired: true, + isNullable: true, + }, + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + kind: { + type: "string", + description: `Discriminator property for Session.`, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts new file mode 100644 index 000000000..25e5a0f92 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_SingleAgentMultiUserSession.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_SingleAgentMultiUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agent: { + type: "Common_uuid", + isRequired: true, + }, + users: { + type: "array", + contains: { + type: "Common_uuid", + }, + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts new file mode 100644 index 000000000..e234326b9 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_SingleAgentNoUserSession.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_SingleAgentNoUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agent: { + type: "Common_uuid", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts b/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts new file mode 100644 index 000000000..943fd645d --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_SingleAgentSingleUserSession.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_SingleAgentSingleUserSession = { + type: "all-of", + contains: [ + { + type: "Sessions_Session", + }, + { + properties: { + agent: { + type: "Common_uuid", + isRequired: true, + }, + user: { + type: "Common_uuid", + isRequired: true, + }, + }, + }, + ], +} as const; diff --git a/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts b/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts new file mode 100644 index 000000000..ceada4666 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Sessions_UpdateSessionRequest.ts @@ -0,0 +1,43 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Sessions_UpdateSessionRequest = { + description: `Payload for updating a session`, + properties: { + situation: { + type: "string", + description: `A specific situation that sets the background for this session`, + isRequired: true, + }, + render_templates: { + type: "boolean", + description: `Render system and assistant message content as jinja templates`, + isRequired: true, + }, + token_budget: { + type: "number", + description: `Threshold value for the adaptive context functionality`, + isRequired: true, + isNullable: true, + format: "uint16", + }, + context_overflow: { + type: "one-of", + description: `Action to start on context window overflow`, + contains: [ + { + type: "Sessions_ContextOverflowType", + }, + ], + isRequired: true, + isNullable: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts new file mode 100644 index 000000000..54aca71b6 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tasks_CreateOrUpdateTaskRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tasks_CreateOrUpdateTaskRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts b/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts new file mode 100644 index 000000000..c79a3478e --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_FunctionDefUpdate.ts @@ -0,0 +1,33 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_FunctionDefUpdate = { + description: `Function definition`, + properties: { + name: { + type: "all-of", + description: `DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons.`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], + }, + description: { + type: "all-of", + description: `Description of the function`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + parameters: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts new file mode 100644 index 000000000..4170be793 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_PatchToolRequest.ts @@ -0,0 +1,39 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_PatchToolRequest = { + description: `Payload for patching a tool`, + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + }, + name: { + type: "all-of", + description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], + }, + function: { + type: "Tools_FunctionDefUpdate", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts new file mode 100644 index 000000000..4e8373fbf --- /dev/null +++ b/sdks/ts/src/api/schemas/$Tools_UpdateToolRequest.ts @@ -0,0 +1,41 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Tools_UpdateToolRequest = { + description: `Payload for updating a tool`, + properties: { + type: { + type: "all-of", + description: `Whether this tool is a \`function\`, \`api_call\`, \`system\` etc. (Only \`function\` tool supported right now)`, + contains: [ + { + type: "Tools_ToolType", + }, + ], + isRequired: true, + }, + name: { + type: "all-of", + description: `Name of the tool (must be unique for this agent and a valid python identifier string )`, + contains: [ + { + type: "Common_validPythonIdentifier", + }, + ], + isRequired: true, + }, + function: { + type: "Tools_FunctionDef", + }, + integration: { + properties: {}, + }, + system: { + properties: {}, + }, + api_call: { + properties: {}, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts new file mode 100644 index 000000000..47f504e4c --- /dev/null +++ b/sdks/ts/src/api/schemas/$Users_CreateOrUpdateUserRequest_id.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Users_CreateOrUpdateUserRequest_id = { + type: "Common_uuid", +} as const; diff --git a/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts new file mode 100644 index 000000000..e9131ec14 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Users_CreateUserRequest.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Users_CreateUserRequest = { + description: `Payload for creating a user (and associated documents)`, + properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the user`, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts b/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts new file mode 100644 index 000000000..060855d65 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Users_PatchUserRequest.ts @@ -0,0 +1,28 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Users_PatchUserRequest = { + description: `Payload for patching a user`, + properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + }, + about: { + type: "string", + description: `About the user`, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts b/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts new file mode 100644 index 000000000..cef57aa63 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Users_UpdateUserRequest.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Users_UpdateUserRequest = { + description: `Payload for updating a user`, + properties: { + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the user`, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/schemas/$Users_User.ts b/sdks/ts/src/api/schemas/$Users_User.ts new file mode 100644 index 000000000..232c618c3 --- /dev/null +++ b/sdks/ts/src/api/schemas/$Users_User.ts @@ -0,0 +1,53 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $Users_User = { + properties: { + id: { + type: "all-of", + contains: [ + { + type: "Common_uuid", + }, + ], + isReadOnly: true, + isRequired: true, + }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, + created_at: { + type: "string", + description: `When this resource was created as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + updated_at: { + type: "string", + description: `When this resource was updated as UTC date-time`, + isReadOnly: true, + isRequired: true, + format: "date-time", + }, + name: { + type: "all-of", + description: `Name of the user`, + contains: [ + { + type: "Common_identifierSafeUnicode", + }, + ], + isRequired: true, + }, + about: { + type: "string", + description: `About the user`, + isRequired: true, + }, + }, +} as const; diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index babe0e845..622a77ffa 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -2,6 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Agents_Agent } from "../models/Agents_Agent"; +import type { Agents_CreateAgentRequest } from "../models/Agents_CreateAgentRequest"; +import type { Agents_PatchAgentRequest } from "../models/Agents_PatchAgentRequest"; +import type { Agents_UpdateAgentRequest } from "../models/Agents_UpdateAgentRequest"; import type { Chat_ChunkChatResponse } from "../models/Chat_ChunkChatResponse"; import type { Chat_CompletionResponseFormat } from "../models/Chat_CompletionResponseFormat"; import type { Chat_GenerationPreset } from "../models/Chat_GenerationPreset"; @@ -16,6 +20,8 @@ import type { Common_ResourceUpdatedResponse } from "../models/Common_ResourceUp import type { Common_uuid } from "../models/Common_uuid"; import type { Docs_Doc } from "../models/Docs_Doc"; import type { Docs_DocReference } from "../models/Docs_DocReference"; +import type { Docs_EmbedQueryRequest } from "../models/Docs_EmbedQueryRequest"; +import type { Docs_EmbedQueryResponse } from "../models/Docs_EmbedQueryResponse"; import type { Docs_HybridDocSearchRequest } from "../models/Docs_HybridDocSearchRequest"; import type { Docs_TextOnlyDocSearchRequest } from "../models/Docs_TextOnlyDocSearchRequest"; import type { Docs_VectorDocSearchRequest } from "../models/Docs_VectorDocSearchRequest"; @@ -26,16 +32,206 @@ import type { Executions_Execution } from "../models/Executions_Execution"; import type { Executions_TaskTokenResumeExecutionRequest } from "../models/Executions_TaskTokenResumeExecutionRequest"; import type { Executions_Transition } from "../models/Executions_Transition"; import type { Executions_UpdateExecutionRequest } from "../models/Executions_UpdateExecutionRequest"; +import type { Jobs_JobStatus } from "../models/Jobs_JobStatus"; +import type { Sessions_CreateSessionRequest } from "../models/Sessions_CreateSessionRequest"; +import type { Sessions_PatchSessionRequest } from "../models/Sessions_PatchSessionRequest"; +import type { Sessions_Session } from "../models/Sessions_Session"; +import type { Sessions_UpdateSessionRequest } from "../models/Sessions_UpdateSessionRequest"; import type { Tasks_CreateTaskRequest } from "../models/Tasks_CreateTaskRequest"; import type { Tasks_PatchTaskRequest } from "../models/Tasks_PatchTaskRequest"; import type { Tasks_Task } from "../models/Tasks_Task"; import type { Tasks_UpdateTaskRequest } from "../models/Tasks_UpdateTaskRequest"; import type { Tools_FunctionTool } from "../models/Tools_FunctionTool"; import type { Tools_NamedToolChoice } from "../models/Tools_NamedToolChoice"; +import type { Tools_PatchToolRequest } from "../models/Tools_PatchToolRequest"; +import type { Tools_Tool } from "../models/Tools_Tool"; +import type { Tools_UpdateToolRequest } from "../models/Tools_UpdateToolRequest"; +import type { Users_CreateUserRequest } from "../models/Users_CreateUserRequest"; +import type { Users_PatchUserRequest } from "../models/Users_PatchUserRequest"; +import type { Users_UpdateUserRequest } from "../models/Users_UpdateUserRequest"; +import type { Users_User } from "../models/Users_User"; import type { CancelablePromise } from "../core/CancelablePromise"; import type { BaseHttpRequest } from "../core/BaseHttpRequest"; export class DefaultService { constructor(public readonly httpRequest: BaseHttpRequest) {} + /** + * List Agents (paginated) + * @returns any The request has succeeded. + * @throws ApiError + */ + public agentsRouteList({ + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * Limit the number of items returned + */ + limit?: Common_limit; + /** + * Offset the items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { + return this.httpRequest.request({ + method: "GET", + url: "/agents", + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Create a new Agent + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. + * @throws ApiError + */ + public agentsRouteCreate({ + requestBody, + }: { + requestBody: Agents_CreateAgentRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/agents", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Create or update an Agent + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public agentsRouteCreateOrUpdate({ + id, + requestBody, + }: { + id: Common_uuid; + requestBody: Agents_UpdateAgentRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/agents/{id}", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public agentsRouteUpdate({ + id, + requestBody, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + requestBody: Agents_UpdateAgentRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PUT", + url: "/agents/{id}", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing Agent by id (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public agentsRoutePatch({ + id, + requestBody, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + requestBody: Agents_PatchAgentRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/agents/{id}", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Delete Agent by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public agentsRouteDelete({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/agents/{id}", + path: { + id: id, + }, + }); + } + /** + * Get an Agent by id + * @returns Agents_Agent The request has succeeded. + * @throws ApiError + */ + public agentsRouteGet({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/agents/{id}", + path: { + id: id, + }, + }); + } /** * List Docs owned by an Agent * @returns any The request has succeeded. @@ -287,161 +483,576 @@ export class DefaultService { requestBody: Tasks_PatchTaskRequest; }): CancelablePromise { return this.httpRequest.request({ - method: "PATCH", - url: "/agents/{id}/tasks/{child_id}", - path: { - id: id, - child_id: childId, - }, + method: "PATCH", + url: "/agents/{id}/tasks/{child_id}", + path: { + id: id, + child_id: childId, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Delete a task by its id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public tasksRouteDelete({ + id, + childId, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be deleted + */ + childId: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/agents/{id}/tasks/{child_id}", + path: { + id: id, + child_id: childId, + }, + }); + } + /** + * List tools of the given agent + * @returns any The request has succeeded. + * @throws ApiError + */ + public agentToolsRouteList({ + id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * ID of parent + */ + id: Common_uuid; + /** + * Limit the number of items returned + */ + limit?: Common_limit; + /** + * Offset the items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { + return this.httpRequest.request({ + method: "GET", + url: "/agents/{id}/tools", + path: { + id: id, + }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Create a new tool for this agent + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. + * @throws ApiError + */ + public agentToolsRouteCreate({ + id, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + requestBody: Agents_CreateAgentRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/agents/{id}/tools", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing tool (overwrite existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public agentToolsRouteUpdate({ + id, + childId, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be updated + */ + childId: Common_uuid; + requestBody: Tools_UpdateToolRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PUT", + url: "/agents/{id}/tools/{child_id}", + path: { + id: id, + child_id: childId, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing tool (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public agentToolsRoutePatch({ + id, + childId, + requestBody, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be patched + */ + childId: Common_uuid; + requestBody: Tools_PatchToolRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/agents/{id}/tools/{child_id}", + path: { + id: id, + child_id: childId, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Delete an existing tool by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public agentToolsRouteDelete({ + id, + childId, + }: { + /** + * ID of parent resource + */ + id: Common_uuid; + /** + * ID of the resource to be deleted + */ + childId: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/agents/{id}/tools/{child_id}", + path: { + id: id, + child_id: childId, + }, + }); + } + /** + * Create or update a task + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public tasksCreateOrUpdateRouteCreateOrUpdate({ + parentId, + id, + requestBody, + }: { + /** + * ID of parent resource + */ + parentId: Common_uuid; + id: Common_uuid; + requestBody: Tasks_CreateTaskRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/agents/{parent_id}/tasks/{id}", + path: { + parent_id: parentId, + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Get Doc by id + * @returns Docs_Doc The request has succeeded. + * @throws ApiError + */ + public individualDocsRouteGet({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/docs/{id}", + path: { + id: id, + }, + }); + } + /** + * Delete an existing Doc by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public individualDocsRouteDelete({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/docs/{id}", + path: { + id: id, + }, + }); + } + /** + * Embed a query for search + * @returns Docs_EmbedQueryResponse The request has succeeded. + * @throws ApiError + */ + public embedRouteEmbed({ + requestBody, + }: { + requestBody: { + body: Docs_EmbedQueryRequest; + }; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/embed", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Get an Execution by id + * @returns Executions_Execution The request has succeeded. + * @throws ApiError + */ + public executionsRouteGet({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/executions/{id}", + path: { + id: id, + }, + }); + } + /** + * List the Transitions of an Execution by id + * @returns any The request has succeeded. + * @throws ApiError + */ + public executionTransitionsRouteList({ + id, + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * ID of parent + */ + id: Common_uuid; + /** + * Limit the number of items returned + */ + limit?: Common_limit; + /** + * Offset the items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array<{ + transitions: Array; + }>; + }> { + return this.httpRequest.request({ + method: "GET", + url: "/executions/{id}/transitions", + path: { + id: id, + }, + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Get the status of an existing Job by its id + * @returns Jobs_JobStatus The request has succeeded. + * @throws ApiError + */ + public jobRouteGet({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/jobs/{id}", + path: { + id: id, + }, + }); + } + /** + * List sessions (paginated) + * @returns any The request has succeeded. + * @throws ApiError + */ + public sessionsRouteList({ + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * Limit the number of items returned + */ + limit?: Common_limit; + /** + * Offset the items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { + return this.httpRequest.request({ + method: "GET", + url: "/sessions", + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Create a new session + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. + * @throws ApiError + */ + public sessionsRouteCreate({ + requestBody, + }: { + requestBody: Sessions_CreateSessionRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/sessions", body: requestBody, mediaType: "application/json", }); } /** - * Delete a task by its id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * Create or update a session + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ - public tasksRouteDelete({ + public sessionsRouteCreateOrUpdate({ id, - childId, + requestBody, }: { - /** - * ID of parent resource - */ id: Common_uuid; - /** - * ID of the resource to be deleted - */ - childId: Common_uuid; - }): CancelablePromise { + requestBody: Sessions_CreateSessionRequest; + }): CancelablePromise { return this.httpRequest.request({ - method: "DELETE", - url: "/agents/{id}/tasks/{child_id}", + method: "POST", + url: "/sessions/{id}", path: { id: id, - child_id: childId, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Get Doc by id - * @returns Docs_Doc The request has succeeded. + * Update an existing session by its id (overwrites all existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ - public individualDocsRouteGet({ + public sessionsRouteUpdate({ id, + requestBody, }: { /** * ID of the resource */ id: Common_uuid; - }): CancelablePromise { + requestBody: Sessions_UpdateSessionRequest; + }): CancelablePromise { return this.httpRequest.request({ - method: "GET", - url: "/docs/{id}", + method: "PUT", + url: "/sessions/{id}", path: { id: id, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Delete an existing Doc by id - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * Update an existing session by its id (merges with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. * @throws ApiError */ - public individualDocsRouteDelete({ + public sessionsRoutePatch({ id, + requestBody, }: { /** * ID of the resource */ id: Common_uuid; - }): CancelablePromise { + requestBody: Sessions_PatchSessionRequest; + }): CancelablePromise { return this.httpRequest.request({ - method: "DELETE", - url: "/docs/{id}", + method: "PATCH", + url: "/sessions/{id}", path: { id: id, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Get an Execution by id - * @returns Executions_Execution The request has succeeded. + * Delete a session by its id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public executionsRouteGet({ + public sessionsRouteDelete({ id, }: { /** * ID of the resource */ id: Common_uuid; - }): CancelablePromise { + }): CancelablePromise { return this.httpRequest.request({ - method: "GET", - url: "/executions/{id}", + method: "DELETE", + url: "/sessions/{id}", path: { id: id, }, }); } /** - * List the Transitions of an Execution by id - * @returns any The request has succeeded. + * Get a session by id + * @returns Sessions_Session The request has succeeded. * @throws ApiError */ - public executionTransitionsRouteList({ + public sessionsRouteGet({ id, - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", }: { /** - * ID of parent + * ID of the resource */ id: Common_uuid; - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array<{ - transitions: Array; - }>; - }> { + }): CancelablePromise { return this.httpRequest.request({ method: "GET", - url: "/executions/{id}/transitions", + url: "/sessions/{id}", path: { id: id, }, - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, }); } /** @@ -901,6 +1512,184 @@ export class DefaultService { mediaType: "application/json", }); } + /** + * List users (paginated) + * @returns any The request has succeeded. + * @throws ApiError + */ + public usersRouteList({ + limit = 100, + offset, + sortBy = "created_at", + direction = "asc", + metadataFilter = "{}", + }: { + /** + * Limit the number of items returned + */ + limit?: Common_limit; + /** + * Offset the items returned + */ + offset: Common_offset; + /** + * Sort by a field + */ + sortBy?: "created_at" | "updated_at" | "deleted_at"; + /** + * Sort direction + */ + direction?: "asc" | "desc"; + /** + * JSON string of object that should be used to filter objects by metadata + */ + metadataFilter?: string; + }): CancelablePromise<{ + results: Array; + }> { + return this.httpRequest.request({ + method: "GET", + url: "/users", + query: { + limit: limit, + offset: offset, + sort_by: sortBy, + direction: direction, + metadata_filter: metadataFilter, + }, + }); + } + /** + * Create a new user + * @returns Common_ResourceCreatedResponse The request has succeeded and a new resource has been created as a result. + * @throws ApiError + */ + public usersRouteCreate({ + requestBody, + }: { + requestBody: Users_CreateUserRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/users", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Create or update a user + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public usersRouteCreateOrUpdate({ + id, + requestBody, + }: { + id: Common_uuid; + requestBody: Users_UpdateUserRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/users/{id}", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing user by id (overwrite existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public usersRouteUpdate({ + id, + requestBody, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + requestBody: Users_UpdateUserRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PUT", + url: "/users/{id}", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Update an existing user by id (merge with existing values) + * @returns Common_ResourceUpdatedResponse The request has succeeded. + * @throws ApiError + */ + public usersRoutePatch({ + id, + requestBody, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + requestBody: Users_PatchUserRequest; + }): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/users/{id}", + path: { + id: id, + }, + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Delete a user by id + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * @throws ApiError + */ + public usersRouteDelete({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/users/{id}", + path: { + id: id, + }, + }); + } + /** + * Get a user by id + * @returns Users_User The request has succeeded. + * @throws ApiError + */ + public usersRouteGet({ + id, + }: { + /** + * ID of the resource + */ + id: Common_uuid; + }): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/users/{id}", + path: { + id: id, + }, + }); + } /** * List Docs owned by a User * @returns any The request has succeeded. From b8f89922901b9c84a38fe09763b229d23646a60a Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sat, 27 Jul 2024 20:30:53 -0400 Subject: [PATCH 32/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/autogen/Chat.py | 2 +- agents-api/agents_api/autogen/Entries.py | 2 +- agents-api/agents_api/autogen/Executions.py | 1 + .../agents_api/autogen/openapi_model.py | 12 ++ agents-api/agents_api/env.py | 6 - .../models/execution/create_execution.py | 104 ++++++++++-------- .../execution/create_execution_transition.py | 96 ++++++++-------- .../models/execution/get_execution.py | 32 ++++-- .../models/execution/get_execution_status.py | 21 ---- .../execution/get_execution_transition.py | 36 ------ .../execution/list_execution_transitions.py | 35 ++++-- .../models/execution/list_executions.py | 58 +++++++--- ...ion_input.py => prepare_execution_data.py} | 0 .../models/execution/update_execution.py | 101 +++++++++++++++++ .../execution/update_execution_status.py | 47 -------- .../execution/update_execution_transition.py | 54 --------- .../models/task/create_or_update_task.py | 1 - .../agents_api/models/task/delete_task.py | 1 - agents-api/agents_api/models/task/get_task.py | 2 - .../agents_api/models/task/list_tasks.py | 2 - .../agents_api/models/task/patch_task.py | 1 - .../agents_api/models/task/update_task.py | 1 - agents-api/agents_api/models/utils.py | 32 ++++-- ...2107354_rename_executions_arguments_col.py | 83 ++++++++++++++ ...rate_1722115427_rename_transitions_from.py | 103 +++++++++++++++++ agents-api/poetry.lock | 16 ++- agents-api/pyproject.toml | 1 + .../julep/api/types/executions_transition.py | 1 + .../src/api/models/Executions_Transition.ts | 1 + .../src/api/schemas/$Executions_Transition.ts | 6 + typespec/executions/models.tsp | 1 + 31 files changed, 547 insertions(+), 312 deletions(-) delete mode 100644 agents-api/agents_api/models/execution/get_execution_status.py delete mode 100644 agents-api/agents_api/models/execution/get_execution_transition.py rename agents-api/agents_api/models/execution/{get_execution_input.py => prepare_execution_data.py} (100%) create mode 100644 agents-api/agents_api/models/execution/update_execution.py delete mode 100644 agents-api/agents_api/models/execution/update_execution_status.py delete mode 100644 agents-api/agents_api/models/execution/update_execution_transition.py create mode 100644 agents-api/migrations/migrate_1722107354_rename_executions_arguments_col.py create mode 100644 agents-api/migrations/migrate_1722115427_rename_transitions_from.py diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index 6669fbcec..c7c25c7ad 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field from .Docs import DocReference from .Entries import ChatMLMessage diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index b953d31c2..60c11a628 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field from .Tools import ChosenToolCall, Tool, ToolResponse diff --git a/agents-api/agents_api/autogen/Executions.py b/agents-api/agents_api/autogen/Executions.py index 151cd7cde..c28ae7b57 100644 --- a/agents-api/agents_api/autogen/Executions.py +++ b/agents-api/agents_api/autogen/Executions.py @@ -91,6 +91,7 @@ class Transition(BaseModel): current: Annotated[list, Field(json_schema_extra={"readOnly": True})] next: Annotated[list | None, Field(json_schema_extra={"readOnly": True})] id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})] + metadata: dict[str, Any] | None = None created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})] """ When this resource was created as UTC date-time diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index d04bbdedc..3bf1b4ff0 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -1,6 +1,8 @@ # ruff: noqa: F401, F403, F405 from uuid import UUID +from pydantic_partial import create_partial_model + from .Agents import * from .Chat import * from .Common import * @@ -19,6 +21,16 @@ CreateOrUpdateSessionRequest = CreateSessionRequest CreateOrUpdateTaskRequest = CreateTaskRequest +CreateTransitionRequest = create_partial_model( + Transition, + # The following fields are optional + "id", + "execution_id", + "created_at", + "updated_at", + "metadata", +) + ChatMLRole = Entry.model_fields["role"].annotation diff --git a/agents-api/agents_api/env.py b/agents-api/agents_api/env.py index 15b83d408..eba083500 100644 --- a/agents-api/agents_api/env.py +++ b/agents-api/agents_api/env.py @@ -17,12 +17,6 @@ # Base URL for the COZO service. Defaults to the local development URL if not specified. cozo_host: str = env.str("COZO_HOST", default="http://127.0.0.1:9070") cozo_auth: str = env.str("COZO_AUTH_TOKEN", default=None) -prediction_project: str = env.str("PREDICTION_PROJECT", default=None) -prediction_endpoint_id: str = env.str("PREDICTION_ENDPOINT_ID", default=None) -prediction_location: str = env.str("PREDICTION_LOCATION", default="us-central1") -prediction_api_endpoint: str = env.str( - "PREDICTION_API_ENDPOINT", default="us-central1-aiplatform.googleapis.com" -) model_api_key: str = env.str("MODEL_API_KEY", default=None) model_inference_url: str = env.str("MODEL_INFERENCE_URL", default=None) openai_api_key: str = env.str("OPENAI_API_KEY", default="") diff --git a/agents-api/agents_api/models/execution/create_execution.py b/agents-api/agents_api/models/execution/create_execution.py index ce84ea2b2..38084707d 100644 --- a/agents-api/agents_api/models/execution/create_execution.py +++ b/agents-api/agents_api/models/execution/create_execution.py @@ -1,59 +1,71 @@ -from typing import Literal, Dict, Any -from uuid import UUID +from uuid import UUID, uuid4 from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Execution, CreateExecutionRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + +@wrap_in_class( + Execution, + one=True, + transform=lambda d: {"id": d["execution_id"], **d}, +) @cozo_query @beartype -def create_execution_query( +def create_execution( + *, developer_id: UUID, - agent_id: UUID, task_id: UUID, - execution_id: UUID, - session_id: UUID | None = None, - status: Literal[ - "pending", - "queued", - "starting", - "running", - "awaiting_input", - "succeeded", - "failed", - ] = "pending", - arguments: Dict[str, Any] = {}, + execution_id: UUID | None = None, + data: CreateExecutionRequest, ) -> tuple[str, dict]: - # TODO: Check for agent in developer ID; Assert whether dev can access agent and by relation the task - - query = """ -{ - ?[task_id, execution_id, session_id, status, arguments] := - task_id = to_uuid($task_id), - execution_id = to_uuid($execution_id), - session_id = if(is_null($session_id), null, to_uuid($session_id)), - status = $status, - arguments = $arguments - - :insert executions { - task_id, - execution_id, - session_id, - status, - arguments - } + execution_id = execution_id or uuid4() - :returning -} -""" - return ( - query, + developer_id = str(developer_id) + task_id = str(task_id) + execution_id = str(execution_id) + + data.metadata = data.metadata or {} + execution_data = data.model_dump() + + columns, values = cozo_process_mutate_data( { - "task_id": str(task_id), - "execution_id": str(execution_id), - "session_id": str(session_id) if session_id is not None else None, - "status": status, - "arguments": arguments, - }, + **execution_data, + "task_id": task_id, + "execution_id": execution_id, + } ) + + insert_query = f""" + ?[{columns}] <- $values + + :insert executions {{ + {columns} + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, + "tasks", + task_id=task_id, + parents=[("agents", "agent_id")], + ), + insert_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"values": values}) diff --git a/agents-api/agents_api/models/execution/create_execution_transition.py b/agents-api/agents_api/models/execution/create_execution_transition.py index 34e1e315e..6f11e462b 100644 --- a/agents-api/agents_api/models/execution/create_execution_transition.py +++ b/agents-api/agents_api/models/execution/create_execution_transition.py @@ -1,58 +1,66 @@ -from typing import Literal, Dict, Any -from uuid import UUID +from uuid import UUID, uuid4 from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Transition, CreateTransitionRequest +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) +@wrap_in_class(Transition, transform=lambda d: {"id": d["transition_id"], **d}) @cozo_query @beartype -def create_execution_transition_query( +def create_execution_transition( + *, developer_id: UUID, execution_id: UUID, - transition_id: UUID, - type: Literal["finish", "wait", "error", "step"], - from_: tuple[str, int], - to: tuple[str, int] | None, - outputs: Dict[str, Any] | None, + transition_id: UUID | None = None, + data: CreateTransitionRequest, task_token: str | None = None, - metadata: Dict[str, Any] = {}, ) -> tuple[str, dict]: - # TODO: Check for agent in developer ID; Assert whether dev can access agent and by relation the task - # TODO: Check for task and execution - - if outputs is None: - outputs = {} - - query = """ -{ - ?[execution_id, transition_id, type, from, to, output, task_token, metadata] <- [[ - to_uuid($execution_id), - to_uuid($transition_id), - $type, - $from, - $to, - $output, - $task_token, - $metadata, - ]] - - :insert transitions { - execution_id, transition_id, type, from, to, output, task_token, metadata, - } -} -""" - return ( - query, + + transition_id = transition_id or uuid4() + + data.metadata = data.metadata or {} + data.execution_id = execution_id + + transition_data = data.model_dump(exclude_unset=True) + columns, values = cozo_process_mutate_data( { - "execution_id": str(execution_id), - "transition_id": str(transition_id), - "type": type, - "from": from_, - "to": to, - "output": outputs, + **transition_data, "task_token": task_token, - "metadata": metadata, - }, + "transition_id": str(transition_id), + "execution_id": str(execution_id), + } ) + + insert_query = f""" + ?[{columns}] <- $values + + :insert transitions {{ + {columns} + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, + "executions", + execution_id=execution_id, + parents=[("agents", "agent_id"), ("tasks", "task_id")], + ), + insert_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"values": values}) diff --git a/agents-api/agents_api/models/execution/get_execution.py b/agents-api/agents_api/models/execution/get_execution.py index 3171e4025..fbe7b6483 100644 --- a/agents-api/agents_api/models/execution/get_execution.py +++ b/agents-api/agents_api/models/execution/get_execution.py @@ -1,38 +1,46 @@ from uuid import UUID -from ..utils import cozo_query - from beartype import beartype +from ...autogen.openapi_model import Execution +from ..utils import ( + cozo_query, + wrap_in_class, +) + +@wrap_in_class(Execution, one=True) @cozo_query @beartype -def get_execution_query( - task_id: UUID, +def get_execution( + *, execution_id: UUID, ) -> tuple[str, dict]: + # Executions are allowed direct GET access if they have execution_id + query = """ -{ - input[task_id, execution_id] <- [[to_uuid($task_id), to_uuid($execution_id)]] + input[execution_id] <- [[to_uuid($execution_id)]] - ?[id, task_id, status, arguments, session_id, created_at, updated_at] := - input[task_id, execution_id], + ?[id, task_id, status, input, session_id, metadata, created_at, updated_at] := + input[execution_id], *executions { task_id, execution_id, status, - arguments, + input, session_id, + metadata, created_at, updated_at, }, id = execution_id -} -""" + + :limit 1 + """ + return ( query, { - "task_id": str(task_id), "execution_id": str(execution_id), }, ) diff --git a/agents-api/agents_api/models/execution/get_execution_status.py b/agents-api/agents_api/models/execution/get_execution_status.py deleted file mode 100644 index d4d355377..000000000 --- a/agents-api/agents_api/models/execution/get_execution_status.py +++ /dev/null @@ -1,21 +0,0 @@ -from uuid import UUID -from beartype import beartype - -from ..utils import cozo_query - - -@cozo_query -@beartype -def get_execution_status_query(task_id: UUID, execution_id: UUID) -> tuple[str, dict]: - task_id = str(task_id) - execution_id = str(execution_id) - query = """ -{ - ?[status] := *executions { - task_id: to_uuid($task_id), - execution_id: to_uuid($execution_id), - status, - } -} -""" - return (query, {"task_id": task_id, "execution_id": execution_id}) diff --git a/agents-api/agents_api/models/execution/get_execution_transition.py b/agents-api/agents_api/models/execution/get_execution_transition.py deleted file mode 100644 index 787913c79..000000000 --- a/agents-api/agents_api/models/execution/get_execution_transition.py +++ /dev/null @@ -1,36 +0,0 @@ -from uuid import UUID - -from beartype import beartype - -from ..utils import cozo_query - - -@cozo_query -@beartype -def get_execution_transition_query( - execution_id: UUID, transition_id: UUID -) -> tuple[str, dict]: - - query = """ -{ - ?[type, from, to, output] := *transitions { - execution_id: to_uuid($execution_id), - transition_id: to_uuid($transition_id), - type, - from, - to, - output, - metadata, - task_token, - created_at, - updated_at, - } -} -""" - return ( - query, - { - "execution_id": str(execution_id), - "transition_id": str(transition_id), - }, - ) diff --git a/agents-api/agents_api/models/execution/list_execution_transitions.py b/agents-api/agents_api/models/execution/list_execution_transitions.py index 8ce522e4c..b2c9b85fa 100644 --- a/agents-api/agents_api/models/execution/list_execution_transitions.py +++ b/agents-api/agents_api/models/execution/list_execution_transitions.py @@ -1,30 +1,41 @@ +from typing import Literal from uuid import UUID from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Transition +from ..utils import cozo_query, wrap_in_class +@wrap_in_class(Transition) @cozo_query @beartype -def list_execution_transitions_query( - execution_id: UUID, limit: int = 100, offset: int = 0 +def list_execution_transitions( + *, + execution_id: UUID, + limit: int = 100, + offset: int = 0, + sort_by: Literal["created_at", "updated_at", "deleted_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", ) -> tuple[str, dict]: - query = """ - { - ?[transition_id, type, from, to, output, updated_at, created_at] := *transitions { - execution_id: to_uuid($execution_id), - transition_id, + sort = f"{'-' if direction == 'desc' else ''}{sort_by}" + + query = f""" + ?[id, execution_id, type, current, next, output, metadata, updated_at, created_at] := *transitions {{ + execution_id, + transition_id: id, type, - from, - to, + current, + next, output, + metadata, updated_at, created_at, - } + }}, execution_id = to_uuid($execution_id) + :limit $limit :offset $offset - } + :sort {sort} """ return ( diff --git a/agents-api/agents_api/models/execution/list_executions.py b/agents-api/agents_api/models/execution/list_executions.py index 985267976..15a790282 100644 --- a/agents-api/agents_api/models/execution/list_executions.py +++ b/agents-api/agents_api/models/execution/list_executions.py @@ -1,26 +1,42 @@ +from typing import Literal from uuid import UUID from beartype import beartype -from ..utils import cozo_query +from ...autogen.openapi_model import Execution +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + +@wrap_in_class(Execution) @cozo_query @beartype -def list_task_executions_query( - agent_id: UUID, task_id: UUID, developer_id: UUID, limit: int = 100, offset: int = 0 +def list_executions( + *, + developer_id: UUID, + task_id: UUID, + limit: int = 100, + offset: int = 0, + sort_by: Literal["created_at", "updated_at", "deleted_at"] = "created_at", + direction: Literal["asc", "desc"] = "desc", ) -> tuple[str, dict]: - # TODO: Check for agent in developer ID; Assert whether dev can access agent and by relation the task - query = f""" -{{ + sort = f"{'-' if direction == 'desc' else ''}{sort_by}" + + list_query = f""" input[task_id] <- [[to_uuid($task_id)]] ?[ id, task_id, status, - arguments, + input, session_id, + metadata, created_at, updated_at, ] := input[task_id], @@ -28,14 +44,30 @@ def list_task_executions_query( task_id, execution_id: id, status, - arguments, + input, session_id, + metadata, created_at, updated_at, }} - :limit {limit} - :offset {offset} -}} -""" - return (query, {"task_id": str(task_id)}) + :limit {limit} + :offset {offset} + :sort {sort} + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, + "tasks", + task_id=task_id, + parents=[("agents", "agent_id")], + ), + list_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"task_id": str(task_id), "limit": limit, "offset": offset}) diff --git a/agents-api/agents_api/models/execution/get_execution_input.py b/agents-api/agents_api/models/execution/prepare_execution_data.py similarity index 100% rename from agents-api/agents_api/models/execution/get_execution_input.py rename to agents-api/agents_api/models/execution/prepare_execution_data.py diff --git a/agents-api/agents_api/models/execution/update_execution.py b/agents-api/agents_api/models/execution/update_execution.py new file mode 100644 index 000000000..f341bc30a --- /dev/null +++ b/agents-api/agents_api/models/execution/update_execution.py @@ -0,0 +1,101 @@ +from uuid import UUID + +from beartype import beartype + + +from ...autogen.openapi_model import ( + ResourceUpdatedResponse, + UpdateExecutionRequest, +) +from ...common.utils.cozo import cozo_process_mutate_data +from ..utils import ( + cozo_query, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@wrap_in_class( + ResourceUpdatedResponse, + one=True, + transform=lambda d: {"id": d["execution_id"], "jobs": [], **d}, +) +@cozo_query +@beartype +def update_execution( + *, + developer_id: UUID, + task_id: UUID, + execution_id: UUID, + data: UpdateExecutionRequest, +) -> tuple[str, dict]: + developer_id = str(developer_id) + task_id = str(task_id) + execution_id = str(execution_id) + + valid_previous_statuses = [] + match data.status: + case "running": + valid_previous_statuses = ["queued", "starting", "awaiting_input"] + case "cancelled": + valid_previous_statuses = [ + "queued", + "starting", + "awaiting_input", + "running", + ] + + execution_data = data.model_dump(exclude_none=True) + + columns, values = cozo_process_mutate_data( + { + **execution_data, + "task_id": task_id, + "execution_id": execution_id, + } + ) + + validate_status_query = """ + ?[status, execution_id] := + *executions { + status, + execution_id, + }, status in $valid_previous_statuses + + :assert some + """ + + update_query = f""" + input[{columns}] <- $values + ?[{columns}, updated_at] := + input[{columns}], + updated_at = now() + + :update executions {{ + updated_at, + {columns} + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, + "tasks", + task_id=task_id, + parents=[("agents", "agent_id")], + ), + validate_status_query, + update_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return ( + query, + {"values": values, "valid_previous_statuses": valid_previous_statuses}, + ) diff --git a/agents-api/agents_api/models/execution/update_execution_status.py b/agents-api/agents_api/models/execution/update_execution_status.py deleted file mode 100644 index 0c967c343..000000000 --- a/agents-api/agents_api/models/execution/update_execution_status.py +++ /dev/null @@ -1,47 +0,0 @@ -from typing import Literal, Dict, Any -from uuid import UUID - -from beartype import beartype - -from ..utils import cozo_query - - -@cozo_query -@beartype -def update_execution_status_query( - task_id: UUID, - execution_id: UUID, - status: Literal[ - "queued", "starting", "running", "awaiting_input", "succeeded", "failed" - ], - arguments: Dict[str, Any] = {}, -) -> tuple[str, dict]: - query = """ -{ - ?[execution_id, task_id, status, updated_at] <- [[ - to_uuid($execution_id), - to_uuid($task_id), - $status, - now() - ]] - - :update executions { - execution_id, - task_id, - status, - updated_at - } - - :returning -} - -""" - return ( - query, - { - "task_id": str(task_id), - "execution_id": str(execution_id), - "status": status, - "arguments": arguments, - }, - ) diff --git a/agents-api/agents_api/models/execution/update_execution_transition.py b/agents-api/agents_api/models/execution/update_execution_transition.py deleted file mode 100644 index a3f41f278..000000000 --- a/agents-api/agents_api/models/execution/update_execution_transition.py +++ /dev/null @@ -1,54 +0,0 @@ -from uuid import UUID - -from beartype import beartype - -from agents_api.common.utils.datetime import utcnow - -from ..utils import cozo_query -from ...common.utils.cozo import cozo_process_mutate_data - - -@cozo_query -@beartype -def update_execution_transition_query( - execution_id: UUID, transition_id: UUID, **update_data -) -> tuple[str, dict]: - # Only output and type can be updated - assert update_data.keys() <= { - "output", - "type", - }, "Only output and type can be updated for a transition" - - transition_update_cols, transition_update_vals = cozo_process_mutate_data( - { - **{k: v for k, v, in update_data.items() if v is not None}, - "execution_id": str(execution_id), - "transition_id": str(transition_id), - "updated_at": utcnow().timestamp(), - } - ) - query = f""" - {{ - input[{transition_update_cols}] <- $transition_update_vals - - ?[{transition_update_cols}] := input[{transition_update_cols}], - *transitions {{ - execution_id: to_uuid($execution_id), - transition_id: to_uuid($transition_id), - }} - - :update transitions {{ - {transition_update_cols} - }} - :returning - }} - """ - - return ( - query, - { - "transition_update_vals": transition_update_vals, - "execution_id": str(execution_id), - "transition_id": str(transition_id), - }, - ) diff --git a/agents-api/agents_api/models/task/create_or_update_task.py b/agents-api/agents_api/models/task/create_or_update_task.py index fb889299d..172df57e2 100644 --- a/agents-api/agents_api/models/task/create_or_update_task.py +++ b/agents-api/agents_api/models/task/create_or_update_task.py @@ -4,7 +4,6 @@ """ from uuid import UUID -from typing import Any from beartype import beartype diff --git a/agents-api/agents_api/models/task/delete_task.py b/agents-api/agents_api/models/task/delete_task.py index 7ca62d53e..f70718103 100644 --- a/agents-api/agents_api/models/task/delete_task.py +++ b/agents-api/agents_api/models/task/delete_task.py @@ -4,7 +4,6 @@ from ...autogen.openapi_model import ResourceDeletedResponse -from ...common.utils.cozo import cozo_process_mutate_data from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/task/get_task.py b/agents-api/agents_api/models/task/get_task.py index 05984a413..11ebafa7b 100644 --- a/agents-api/agents_api/models/task/get_task.py +++ b/agents-api/agents_api/models/task/get_task.py @@ -3,8 +3,6 @@ from uuid import UUID -from ...autogen.openapi_model import Task, CreateTaskRequest -from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, verify_developer_id_query, diff --git a/agents-api/agents_api/models/task/list_tasks.py b/agents-api/agents_api/models/task/list_tasks.py index 2e44fb5c0..c1e3541e6 100644 --- a/agents-api/agents_api/models/task/list_tasks.py +++ b/agents-api/agents_api/models/task/list_tasks.py @@ -3,8 +3,6 @@ from beartype import beartype -from ...autogen.openapi_model import Task, CreateTaskRequest -from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, verify_developer_id_query, diff --git a/agents-api/agents_api/models/task/patch_task.py b/agents-api/agents_api/models/task/patch_task.py index 580d63da6..d43fb5e04 100644 --- a/agents-api/agents_api/models/task/patch_task.py +++ b/agents-api/agents_api/models/task/patch_task.py @@ -4,7 +4,6 @@ """ from uuid import UUID -from typing import Any from beartype import beartype diff --git a/agents-api/agents_api/models/task/update_task.py b/agents-api/agents_api/models/task/update_task.py index 5c6ee6afe..ce851d799 100644 --- a/agents-api/agents_api/models/task/update_task.py +++ b/agents-api/agents_api/models/task/update_task.py @@ -4,7 +4,6 @@ """ from uuid import UUID -from typing import Any from beartype import beartype diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index e4e79c9b3..1ee8a4074 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -23,22 +23,34 @@ def verify_developer_id_query(developer_id: UUID | str) -> str: def verify_developer_owns_resource_query( - developer_id: UUID | str, resource: str, **resource_id + developer_id: UUID | str, + resource: str, + parents: list[tuple[str, str]] = [], + **resource_id, ) -> str: - resource_id_key, resource_id_value = next(iter(resource_id.items())) - return f""" + parents.append((resource, resource_id_key)) + parent_keys = ["developer_id", *map(lambda x: x[1], parents)] + + rule_head = f""" ?[{resource_id_key}] := - *{resource}{{ - developer_id, - {resource_id_key}, - }}, developer_id = to_uuid("{str(developer_id)}"), - {resource_id_key} = to_uuid("{str(resource_id_value)}") - - :assert some + developer_id = to_uuid("{str(developer_id)}"), + {resource_id_key} = to_uuid("{str(resource_id_value)}"), """ + rule_body = "" + for parent_key, (relation, key) in zip(parent_keys, parents): + rule_body += f""" + *{relation}{{ + {parent_key}, + {key}, + }}, + """ + + rule = rule_head + rule_body + "\n:assert some" + return rule + def cozo_query( func: Callable[P, tuple[str, dict]] | None = None, debug: bool | None = None diff --git a/agents-api/migrations/migrate_1722107354_rename_executions_arguments_col.py b/agents-api/migrations/migrate_1722107354_rename_executions_arguments_col.py new file mode 100644 index 000000000..9fcb3dac9 --- /dev/null +++ b/agents-api/migrations/migrate_1722107354_rename_executions_arguments_col.py @@ -0,0 +1,83 @@ +# /usr/bin/env python3 + +MIGRATION_ID = "rename_executions_arguments_col" +CREATED_AT = 1722107354.988836 + +rename_arguments_add_metadata_query = dict( + up=""" + ?[ + task_id, + execution_id, + status, + input, + session_id, + created_at, + updated_at, + metadata, + ] := + *executions{ + task_id, + execution_id, + arguments: input, + status, + session_id, + created_at, + updated_at, + }, metadata = {} + + :replace executions { + task_id: Uuid, + execution_id: Uuid, + => + status: String default 'queued', + # one of: "queued", "starting", "running", "awaiting_input", "succeeded", "failed" + + input: Json, + session_id: Uuid? default null, + metadata: Json default {}, + created_at: Float default now(), + updated_at: Float default now(), + } + """, + down=""" + ?[ + task_id, + execution_id, + status, + arguments, + session_id, + created_at, + updated_at, + ] := + *executions{ + task_id, + execution_id, + input: arguments, + status, + session_id, + created_at, + updated_at, + } + + :replace executions { + task_id: Uuid, + execution_id: Uuid, + => + status: String default 'queued', + # one of: "queued", "starting", "running", "awaiting_input", "succeeded", "failed" + + arguments: Json, + session_id: Uuid? default null, + created_at: Float default now(), + updated_at: Float default now(), + } + """, +) + + +def up(client): + client.run(rename_arguments_add_metadata_query["up"]) + + +def down(client): + client.run(rename_arguments_add_metadata_query["down"]) diff --git a/agents-api/migrations/migrate_1722115427_rename_transitions_from.py b/agents-api/migrations/migrate_1722115427_rename_transitions_from.py new file mode 100644 index 000000000..63f2660e8 --- /dev/null +++ b/agents-api/migrations/migrate_1722115427_rename_transitions_from.py @@ -0,0 +1,103 @@ +# /usr/bin/env python3 + +MIGRATION_ID = "rename_transitions_from" +CREATED_AT = 1722115427.685346 + +rename_transitions_from_to_query = dict( + up=""" + ?[ + execution_id, + transition_id, + type, + current, + next, + output, + task_token, + metadata, + created_at, + updated_at, + ] := *transitions { + execution_id, + transition_id, + type, + from: current, + to: next, + output, + task_token, + metadata, + created_at, + updated_at, + } + + :replace transitions { + execution_id: Uuid, + transition_id: Uuid, + => + type: String, + # one of: "finish", "wait", "error", "step" + + current: (String, Int), + next: (String, Int)?, + output: Json, + + task_token: String? default null, + + # should store: an Activity Id, a Workflow Id, and optionally a Run Id. + metadata: Json default {}, + created_at: Float default now(), + updated_at: Float default now(), + } + """, + down=""" + ?[ + execution_id, + transition_id, + type, + from, + to, + output, + task_token, + metadata, + created_at, + updated_at, + ] := *transitions { + execution_id, + transition_id, + type, + current: from, + next: to, + output, + task_token, + metadata, + created_at, + updated_at, + } + + :replace transitions { + execution_id: Uuid, + transition_id: Uuid, + => + type: String, + # one of: "finish", "wait", "error", "step" + + from: (String, Int), + to: (String, Int)?, + output: Json, + + task_token: String? default null, + + # should store: an Activity Id, a Workflow Id, and optionally a Run Id. + metadata: Json default {}, + created_at: Float default now(), + updated_at: Float default now(), + } + """, +) + + +def up(client): + client.run(rename_transitions_from_to_query["up"]) + + +def down(client): + client.run(rename_transitions_from_to_query["down"]) diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 58f1dd6f8..8ceb982ef 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -3929,6 +3929,20 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" +[[package]] +name = "pydantic-partial" +version = "0.5.5" +description = "Create partial models from your pydantic models. Partial models may allow None for certain or all fields." +optional = false +python-versions = "<4.0,>=3.9" +files = [ + {file = "pydantic_partial-0.5.5-py3-none-any.whl", hash = "sha256:1e2f1b2c99ee1e8cd0af82c48873d51b1551bbea10c308b65367c9fa1030e4ba"}, + {file = "pydantic_partial-0.5.5.tar.gz", hash = "sha256:a903bdf6b2b30c850865843645432537eae81713fba59ee03bae567eb4c4ff3b"}, +] + +[package.dependencies] +pydantic = ">=1.9.0,<3.0.0" + [[package]] name = "pydot" version = "3.0.1" @@ -5942,4 +5956,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.11" -content-hash = "728d58e8603503f630eea610a0d7bcbab62298b7a81c0780b8e90d00c3de05b7" +content-hash = "45cdf80d64f1773a6913588982e6e2f9727cd4a872d1d9fb0d27e620e59b0614" diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index f54a9a922..f6b5a97b0 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -35,6 +35,7 @@ beartype = "^0.18.5" cel-python = "^0.1.5" mergedeep = "^1.3.4" +pydantic-partial = "^0.5.5" [tool.poetry.group.dev.dependencies] ipython = "^8.18.1" black = "^24.4.0" diff --git a/sdks/python/julep/api/types/executions_transition.py b/sdks/python/julep/api/types/executions_transition.py index abdd873f1..c0982cfcc 100644 --- a/sdks/python/julep/api/types/executions_transition.py +++ b/sdks/python/julep/api/types/executions_transition.py @@ -16,6 +16,7 @@ class ExecutionsTransition(pydantic_v1.BaseModel): current: typing.List[typing.Any] next: typing.Optional[typing.List[typing.Any]] = None id: CommonUuid + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None created_at: dt.datetime = pydantic_v1.Field() """ When this resource was created as UTC date-time diff --git a/sdks/ts/src/api/models/Executions_Transition.ts b/sdks/ts/src/api/models/Executions_Transition.ts index 36a3d6dbe..a934ab78f 100644 --- a/sdks/ts/src/api/models/Executions_Transition.ts +++ b/sdks/ts/src/api/models/Executions_Transition.ts @@ -10,6 +10,7 @@ export type Executions_Transition = { readonly current: Array; readonly next: Array | null; readonly id: Common_uuid; + metadata?: Record; /** * When this resource was created as UTC date-time */ diff --git a/sdks/ts/src/api/schemas/$Executions_Transition.ts b/sdks/ts/src/api/schemas/$Executions_Transition.ts index 47c1bce66..223abfb13 100644 --- a/sdks/ts/src/api/schemas/$Executions_Transition.ts +++ b/sdks/ts/src/api/schemas/$Executions_Transition.ts @@ -54,6 +54,12 @@ export const $Executions_Transition = { isReadOnly: true, isRequired: true, }, + metadata: { + type: "dictionary", + contains: { + properties: {}, + }, + }, created_at: { type: "string", description: `When this resource was created as UTC date-time`, diff --git a/typespec/executions/models.tsp b/typespec/executions/models.tsp index 5dba37513..30ffb2259 100644 --- a/typespec/executions/models.tsp +++ b/typespec/executions/models.tsp @@ -121,5 +121,6 @@ model Transition { next: TransitionTarget | null; ...HasId; + ...HasMetadata; ...HasTimestamps; } From 4428ed967bdf4a791e176e72cc552787342b35a6 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 28 Jul 2024 19:30:10 -0400 Subject: [PATCH 33/36] wip Signed-off-by: Diwank Tomer --- .../agents_api/models/agent/create_agent.py | 18 +- .../models/agent/create_or_update_agent.py | 18 +- .../agents_api/models/agent/delete_agent.py | 12 + .../agents_api/models/agent/get_agent.py | 12 + .../agents_api/models/agent/list_agents.py | 12 + .../agents_api/models/agent/patch_agent.py | 12 + .../models/agent/test_agent_queries.py | 334 ++++---- .../agents_api/models/agent/update_agent.py | 17 +- .../models/docs/test_docs_queries.py | 218 ++--- .../models/entry/test_entry_queries.py | 384 ++++----- .../models/execution/create_execution.py | 12 + .../execution/create_execution_transition.py | 12 + .../models/execution/get_execution.py | 12 + .../execution/list_execution_transitions.py | 12 +- .../models/execution/list_executions.py | 12 + .../execution/test_execution_queries.py | 754 +++++++++--------- .../models/execution/update_execution.py | 12 + .../session/create_or_update_session.py | 12 + .../models/session/create_session.py | 12 + .../models/session/delete_session.py | 12 + .../agents_api/models/session/get_session.py | 12 + .../models/session/list_sessions.py | 12 + .../models/session/patch_session.py | 12 + .../models/session/test_session_queries.py | 568 ++++++------- .../models/session/update_session.py | 12 + .../models/task/create_or_update_task.py | 12 + .../agents_api/models/task/create_task.py | 12 + .../agents_api/models/task/delete_task.py | 12 + agents-api/agents_api/models/task/get_task.py | 12 + .../agents_api/models/task/list_tasks.py | 12 + .../agents_api/models/task/patch_task.py | 12 + .../models/task/test_task_queries.py | 154 ++-- .../agents_api/models/task/update_task.py | 12 + .../agents_api/models/tools/create_tools.py | 12 + .../agents_api/models/tools/delete_tools.py | 12 + .../agents_api/models/tools/get_tool.py | 12 + .../agents_api/models/tools/list_tools.py | 12 + .../agents_api/models/tools/patch_tool.py | 12 + .../models/tools/test_tool_queries.py | 182 ++--- .../models/user/create_or_update_user.py | 22 +- .../agents_api/models/user/create_user.py | 18 +- agents-api/agents_api/models/user/get_user.py | 12 + .../agents_api/models/user/list_users.py | 12 + .../agents_api/models/user/patch_user.py | 12 + .../models/user/test_user_queries.py | 340 ++++---- .../agents_api/models/user/update_user.py | 12 + agents-api/agents_api/models/utils.py | 59 +- 47 files changed, 2001 insertions(+), 1481 deletions(-) diff --git a/agents-api/agents_api/models/agent/create_agent.py b/agents-api/agents_api/models/agent/create_agent.py index b77033a7b..5199ca1eb 100644 --- a/agents-api/agents_api/models/agent/create_agent.py +++ b/agents-api/agents_api/models/agent/create_agent.py @@ -4,14 +4,30 @@ """ from uuid import UUID, uuid4 +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype from ...autogen.openapi_model import Agent, CreateAgentRequest from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query, verify_developer_id_query, wrap_in_class +from ..utils import ( + cozo_query, + partialclass, + rewrap_exceptions, + verify_developer_id_query, + wrap_in_class, +) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( Agent, one=True, transform=lambda d: {"id": UUID(d.pop("agent_id")), **d} ) diff --git a/agents-api/agents_api/models/agent/create_or_update_agent.py b/agents-api/agents_api/models/agent/create_or_update_agent.py index f41a76f44..99be1e108 100644 --- a/agents-api/agents_api/models/agent/create_or_update_agent.py +++ b/agents-api/agents_api/models/agent/create_or_update_agent.py @@ -4,14 +4,30 @@ """ from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype from ...autogen.openapi_model import Agent, CreateOrUpdateAgentRequest from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query, verify_developer_id_query, wrap_in_class +from ..utils import ( + cozo_query, + partialclass, + rewrap_exceptions, + verify_developer_id_query, + wrap_in_class, +) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( Agent, one=True, transform=lambda d: {"id": UUID(d.pop("agent_id")), **d} ) diff --git a/agents-api/agents_api/models/agent/delete_agent.py b/agents-api/agents_api/models/agent/delete_agent.py index 3db55628a..545f28976 100644 --- a/agents-api/agents_api/models/agent/delete_agent.py +++ b/agents-api/agents_api/models/agent/delete_agent.py @@ -5,17 +5,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import ResourceDeletedResponse from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceDeletedResponse, one=True, diff --git a/agents-api/agents_api/models/agent/get_agent.py b/agents-api/agents_api/models/agent/get_agent.py index 9475b0eb9..214779a9e 100644 --- a/agents-api/agents_api/models/agent/get_agent.py +++ b/agents-api/agents_api/models/agent/get_agent.py @@ -1,17 +1,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Agent from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(Agent, one=True) @cozo_query @beartype diff --git a/agents-api/agents_api/models/agent/list_agents.py b/agents-api/agents_api/models/agent/list_agents.py index 0912c864c..e44876565 100644 --- a/agents-api/agents_api/models/agent/list_agents.py +++ b/agents-api/agents_api/models/agent/list_agents.py @@ -2,17 +2,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Agent from ...common.utils import json from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(Agent) @cozo_query @beartype diff --git a/agents-api/agents_api/models/agent/patch_agent.py b/agents-api/agents_api/models/agent/patch_agent.py index 5d84f599f..4db7507d1 100644 --- a/agents-api/agents_api/models/agent/patch_agent.py +++ b/agents-api/agents_api/models/agent/patch_agent.py @@ -1,18 +1,30 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import PatchAgentRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/agent/test_agent_queries.py b/agents-api/agents_api/models/agent/test_agent_queries.py index aed1e0b35..b416b3628 100644 --- a/agents-api/agents_api/models/agent/test_agent_queries.py +++ b/agents-api/agents_api/models/agent/test_agent_queries.py @@ -1,167 +1,167 @@ -# Tests for agent queries -from uuid import uuid4 - -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import test - -from .create_agent import create_agent_query -from .delete_agent import delete_agent_query -from .get_agent import get_agent_query -from .list_agents import list_agents_query -from .update_agent import update_agent_query - -MODEL = "julep-ai/samantha-1-turbo" - - -def cozo_client(migrations_dir: str = "./migrations"): - # Create a new client for each test - # and initialize the schema. - client = Client() - - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) - - return client - - -@test("model: create agent") -def _(): - client = cozo_client() - agent_id = uuid4() - developer_id = uuid4() - - create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - name="test agent", - about="test agent about", - client=client, - ) - - -@test("model: create agent with instructions") -def _(): - client = cozo_client() - agent_id = uuid4() - developer_id = uuid4() - - create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - name="test agent", - about="test agent about", - instructions=[ - "test instruction", - ], - client=client, - ) - - -@test("model: get agent not exists") -def _(): - client = cozo_client() - agent_id = uuid4() - developer_id = uuid4() - - result = get_agent_query( - agent_id=agent_id, developer_id=developer_id, client=client - ) - - assert len(result["id"]) == 0 - - -@test("model: get agent exists") -def _(): - client = cozo_client() - agent_id = uuid4() - developer_id = uuid4() - - result = create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - name="test agent", - about="test agent about", - default_settings={"temperature": 1.5}, - client=client, - ) - - result = get_agent_query( - agent_id=agent_id, developer_id=developer_id, client=client - ) - - assert len(result["id"]) == 1 - assert "temperature" in result["default_settings"][0] - assert result["default_settings"][0]["temperature"] == 1.5 - - -@test("model: delete agent") -def _(): - client = cozo_client() - agent_id = uuid4() - developer_id = uuid4() - - # Create the agent - result = create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - name="test agent", - about="test agent about", - client=client, - ) - - # Delete the agent - result = delete_agent_query( - agent_id=agent_id, developer_id=developer_id, client=client - ) - - # Check that the agent is deleted - result = get_agent_query( - agent_id=agent_id, developer_id=developer_id, client=client - ) - - assert len(result["id"]) == 0 - - -@test("model: update agent") -def _(): - client = cozo_client() - agent_id = uuid4() - developer_id = uuid4() - - create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - name="test agent", - about="test agent about", - client=client, - ) - - result = update_agent_query( - agent_id=agent_id, - developer_id=developer_id, - name="updated agent", - about="updated agent about", - default_settings={"temperature": 1.5}, - client=client, - ) - - data = result.iloc[0].to_dict() - - assert data["updated_at"] > data["created_at"] - - -@test("model: list agents") -def _(): - """Tests listing all agents associated with a developer in the database. Verifies that the correct list of agents is retrieved.""" - client = cozo_client() - developer_id = uuid4() - - result = list_agents_query(developer_id=developer_id, client=client) - - assert len(result["id"]) == 0 +# # Tests for agent queries +# from uuid import uuid4 + +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import test + +# from .create_agent import create_agent_query +# from .delete_agent import delete_agent_query +# from .get_agent import get_agent_query +# from .list_agents import list_agents_query +# from .update_agent import update_agent_query + +# MODEL = "julep-ai/samantha-1-turbo" + + +# def cozo_client(migrations_dir: str = "./migrations"): +# # Create a new client for each test +# # and initialize the schema. +# client = Client() + +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) + +# return client + + +# @test("model: create agent") +# def _(): +# client = cozo_client() +# agent_id = uuid4() +# developer_id = uuid4() + +# create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# name="test agent", +# about="test agent about", +# client=client, +# ) + + +# @test("model: create agent with instructions") +# def _(): +# client = cozo_client() +# agent_id = uuid4() +# developer_id = uuid4() + +# create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# name="test agent", +# about="test agent about", +# instructions=[ +# "test instruction", +# ], +# client=client, +# ) + + +# @test("model: get agent not exists") +# def _(): +# client = cozo_client() +# agent_id = uuid4() +# developer_id = uuid4() + +# result = get_agent_query( +# agent_id=agent_id, developer_id=developer_id, client=client +# ) + +# assert len(result["id"]) == 0 + + +# @test("model: get agent exists") +# def _(): +# client = cozo_client() +# agent_id = uuid4() +# developer_id = uuid4() + +# result = create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# name="test agent", +# about="test agent about", +# default_settings={"temperature": 1.5}, +# client=client, +# ) + +# result = get_agent_query( +# agent_id=agent_id, developer_id=developer_id, client=client +# ) + +# assert len(result["id"]) == 1 +# assert "temperature" in result["default_settings"][0] +# assert result["default_settings"][0]["temperature"] == 1.5 + + +# @test("model: delete agent") +# def _(): +# client = cozo_client() +# agent_id = uuid4() +# developer_id = uuid4() + +# # Create the agent +# result = create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# name="test agent", +# about="test agent about", +# client=client, +# ) + +# # Delete the agent +# result = delete_agent_query( +# agent_id=agent_id, developer_id=developer_id, client=client +# ) + +# # Check that the agent is deleted +# result = get_agent_query( +# agent_id=agent_id, developer_id=developer_id, client=client +# ) + +# assert len(result["id"]) == 0 + + +# @test("model: update agent") +# def _(): +# client = cozo_client() +# agent_id = uuid4() +# developer_id = uuid4() + +# create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# name="test agent", +# about="test agent about", +# client=client, +# ) + +# result = update_agent_query( +# agent_id=agent_id, +# developer_id=developer_id, +# name="updated agent", +# about="updated agent about", +# default_settings={"temperature": 1.5}, +# client=client, +# ) + +# data = result.iloc[0].to_dict() + +# assert data["updated_at"] > data["created_at"] + + +# @test("model: list agents") +# def _(): +# """Tests listing all agents associated with a developer in the database. Verifies that the correct list of agents is retrieved.""" +# client = cozo_client() +# developer_id = uuid4() + +# result = list_agents_query(developer_id=developer_id, client=client) + +# assert len(result["id"]) == 0 diff --git a/agents-api/agents_api/models/agent/update_agent.py b/agents-api/agents_api/models/agent/update_agent.py index 96c0d3d97..42b1bd80b 100644 --- a/agents-api/agents_api/models/agent/update_agent.py +++ b/agents-api/agents_api/models/agent/update_agent.py @@ -1,22 +1,29 @@ -""" -This module provides functionality for updating agent data in the 'cozodb' database. -It includes the `update_agent_query` function which constructs and executes datalog queries for updating agent and their settings. -""" - from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import UpdateAgentRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/docs/test_docs_queries.py b/agents-api/agents_api/models/docs/test_docs_queries.py index 553a30e40..6b5528b40 100644 --- a/agents-api/agents_api/models/docs/test_docs_queries.py +++ b/agents-api/agents_api/models/docs/test_docs_queries.py @@ -1,158 +1,158 @@ -# Tests for entry queries -from uuid import uuid4 +# # Tests for entry queries +# from uuid import uuid4 -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import test +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import test -from .create_docs import create_docs_query -from .delete_docs import delete_docs_by_id_query -from .get_docs import get_docs_snippets_by_id_query -from .list_docs import list_docs_snippets_by_owner_query -from .embed_docs import embed_docs_snippets_query -from .search_docs import search_docs_snippets_by_embedding_query +# from .create_docs import create_docs_query +# from .delete_docs import delete_docs_by_id_query +# from .get_docs import get_docs_snippets_by_id_query +# from .list_docs import list_docs_snippets_by_owner_query +# from .embed_docs import embed_docs_snippets_query +# from .search_docs import search_docs_snippets_by_embedding_query -EMBEDDING_SIZE: int = 1024 +# EMBEDDING_SIZE: int = 1024 -def cozo_client(migrations_dir: str = "./migrations"): - # Create a new client for each test - # and initialize the schema. - client = Client() +# def cozo_client(migrations_dir: str = "./migrations"): +# # Create a new client for each test +# # and initialize the schema. +# client = Client() - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) - return client +# return client -@test("model: create docs") -def _(): - client = cozo_client() +# @test("model: create docs") +# def _(): +# client = cozo_client() - for owner_type in ("user", "agent"): - owner_id = uuid4() - id = uuid4() +# for owner_type in ("user", "agent"): +# owner_id = uuid4() +# id = uuid4() - result = create_docs_query( - owner_type, owner_id, id, title="Hello", content="World", client=client - ) +# result = create_docs_query( +# owner_type, owner_id, id, title="Hello", content="World", client=client +# ) - assert result["created_at"][0] +# assert result["created_at"][0] -@test("model: get docs") -def _(): - client = cozo_client() +# @test("model: get docs") +# def _(): +# client = cozo_client() - for owner_type in ("user", "agent"): - owner_id = uuid4() - id = uuid4() +# for owner_type in ("user", "agent"): +# owner_id = uuid4() +# id = uuid4() - create_docs_query( - owner_type, owner_id, id, title="Hello", content="World", client=client - ) +# create_docs_query( +# owner_type, owner_id, id, title="Hello", content="World", client=client +# ) - result = get_docs_snippets_by_id_query(owner_type, id, client=client) +# result = get_docs_snippets_by_id_query(owner_type, id, client=client) - assert len(result) == 1, "Only 1 should have been found" +# assert len(result) == 1, "Only 1 should have been found" -@test("model: delete docs") -def _(): - client = cozo_client() +# @test("model: delete docs") +# def _(): +# client = cozo_client() - for owner_type in ("user", "agent"): - owner_id = uuid4() - id = uuid4() +# for owner_type in ("user", "agent"): +# owner_id = uuid4() +# id = uuid4() - create_docs_query( - owner_type, owner_id, id, title="Hello", content="World", client=client - ) +# create_docs_query( +# owner_type, owner_id, id, title="Hello", content="World", client=client +# ) - result = delete_docs_by_id_query(owner_type, owner_id, id, client=client) +# result = delete_docs_by_id_query(owner_type, owner_id, id, client=client) - delete_info = next( - (row for row in result.to_dict("records") if row["_kind"] == "deleted"), - None, - ) +# delete_info = next( +# (row for row in result.to_dict("records") if row["_kind"] == "deleted"), +# None, +# ) - assert delete_info is not None, "Delete operation found the row" +# assert delete_info is not None, "Delete operation found the row" -@test("model: list docs") -def _(): - client = cozo_client() +# @test("model: list docs") +# def _(): +# client = cozo_client() - for owner_type in ("user", "agent"): - owner_id = uuid4() - id = uuid4() +# for owner_type in ("user", "agent"): +# owner_id = uuid4() +# id = uuid4() - create_docs_query( - owner_type, owner_id, id, title="Hello", content="World", client=client - ) +# create_docs_query( +# owner_type, owner_id, id, title="Hello", content="World", client=client +# ) - result = list_docs_snippets_by_owner_query(owner_type, owner_id, client=client) +# result = list_docs_snippets_by_owner_query(owner_type, owner_id, client=client) - assert len(result) == 1, "Only 1 should have been found" +# assert len(result) == 1, "Only 1 should have been found" -@test("model: search docs") -def _(): - client = cozo_client() +# @test("model: search docs") +# def _(): +# client = cozo_client() - for owner_type in ("user", "agent"): - owner_id = uuid4() - id = uuid4() +# for owner_type in ("user", "agent"): +# owner_id = uuid4() +# id = uuid4() - create_docs_query( - owner_type, owner_id, id, title="Hello", content="World", client=client - ) +# create_docs_query( +# owner_type, owner_id, id, title="Hello", content="World", client=client +# ) - ### Add embedding to the snippet - client.update( - "information_snippets", - dict(doc_id=str(id), snippet_idx=0, embedding=[1.0] * EMBEDDING_SIZE), - ) +# ### Add embedding to the snippet +# client.update( +# "information_snippets", +# dict(doc_id=str(id), snippet_idx=0, embedding=[1.0] * EMBEDDING_SIZE), +# ) - ### Search - query_embedding = [0.99] * EMBEDDING_SIZE +# ### Search +# query_embedding = [0.99] * EMBEDDING_SIZE - result = search_docs_snippets_by_embedding_query( - owner_type, owner_id, query_embedding, client=client - ) +# result = search_docs_snippets_by_embedding_query( +# owner_type, owner_id, query_embedding, client=client +# ) - assert len(result) == 1, "Only 1 should have been found" +# assert len(result) == 1, "Only 1 should have been found" -@test("model: embed docs") -def _(): - client = cozo_client() +# @test("model: embed docs") +# def _(): +# client = cozo_client() - for owner_type in ("user", "agent"): - owner_id = uuid4() - id = uuid4() +# for owner_type in ("user", "agent"): +# owner_id = uuid4() +# id = uuid4() - snippets = [ - "Hello World", - "Hello Banana", - "Hello Apple", - ] +# snippets = [ +# "Hello World", +# "Hello Banana", +# "Hello Apple", +# ] - create_docs_query( - owner_type, - owner_id, - id, - title="Hi", - content=snippets, - client=client, - ) +# create_docs_query( +# owner_type, +# owner_id, +# id, +# title="Hi", +# content=snippets, +# client=client, +# ) - ### Add embedding to the snippet - snippet_indices = [*range(len(snippets))] +# ### Add embedding to the snippet +# snippet_indices = [*range(len(snippets))] - embeddings = [[1.0] * EMBEDDING_SIZE for _ in snippets] +# embeddings = [[1.0] * EMBEDDING_SIZE for _ in snippets] - embed_docs_snippets_query(id, snippet_indices, embeddings, client=client) +# embed_docs_snippets_query(id, snippet_indices, embeddings, client=client) diff --git a/agents-api/agents_api/models/entry/test_entry_queries.py b/agents-api/agents_api/models/entry/test_entry_queries.py index 04a49ea0e..d4549898d 100644 --- a/agents-api/agents_api/models/entry/test_entry_queries.py +++ b/agents-api/agents_api/models/entry/test_entry_queries.py @@ -1,192 +1,192 @@ -""" -This module contains tests for entry queries against the CozoDB database. -It verifies the functionality of adding, retrieving, and processing entries as defined in the schema. -""" - -# Tests for entry queries -from uuid import uuid4 - -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import test - -from ...autogen.openapi_model import FunctionDef -from ...common.protocol.entries import Entry -from ..docs.create_docs import create_docs_query -from ..docs.embed_docs import embed_docs_snippets_query -from ..agent.create_agent import create_agent_query -from ..session.create_session import create_session_query -from ..tools.create_tools import create_function_query -from ..tools.embed_tools import embed_functions_query -from ..user.create_user import create_user_query -from .add_entries import add_entries_query -from .get_entries import get_entries_query -from .proc_mem_context import proc_mem_context_query - -MODEL = "julep-ai/samantha-1-turbo" - - -# Initializes a new CozoDB client for testing, applying all migrations. -def cozo_client(migrations_dir: str = "./migrations"): - # Create a new client for each test - # and initialize the schema. - client = Client() - - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) - - return client - - -@test("model: create entry") -def _(): - """ - Tests the addition of a new entry to the database. - Verifies that the entry can be successfully added using the add_entries_query function. - """ - client = cozo_client() - session_id = uuid4() - - test_entry = Entry( - session_id=session_id, - role="user", - content="test entry content", - ) - - add_entries_query(entries=[test_entry], client=client) - - -@test("model: get entries") -def _(): - """ - Tests the retrieval of entries from the database. - Verifies that entries matching specific criteria can be successfully retrieved. - """ - client = cozo_client() - session_id = uuid4() - - test_entry = Entry( - session_id=session_id, - role="user", - content="test entry content", - ) - - internal_entry = Entry( - session_id=session_id, - role="user", - content="test entry content", - source="internal", - ) - - add_entries_query(entries=[test_entry, internal_entry], client=client) - - result = get_entries_query(session_id=session_id, client=client) - - # Asserts that only one entry is retrieved, matching the session_id. - assert len(result["entry_id"]) == 1 - - -@test("model: procedural memory context") -def _(): - """ - Tests the procedural memory context in the database. - Verifies the functionality of retrieving relevant memory context based on embeddings. - """ - client = cozo_client() - developer_id = uuid4() - user_id = uuid4() - agent_id = uuid4() - session_id = uuid4() - tool_id = uuid4() - user_doc_id = uuid4() - agent_doc_id = uuid4() - - # Setup: Creates a user, agent, session, function, and documents, then embeds tools and document snippets. - # Create stuff - test_entry = Entry( - session_id=session_id, - role="user", - content="test entry content", - source="api_request", - ) - - test_instruction1 = "test instruction" - test_instruction2 = "test instruction" - test_function = FunctionDef( - name="test function", - description="test function description", - parameters={"type": "object", "properties": {}}, - ) - - test_user_doc = "test user doc" - test_agent_doc = "test agent doc" - - [ - add_entries_query(entries=[test_entry], client=client), - create_user_query( - user_id=user_id, - developer_id=developer_id, - name="test user", - about="test user about", - client=client, - ), - create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - name="test agent", - about="test agent about", - instructions=[test_instruction1, test_instruction2], - client=client, - ), - create_session_query( - developer_id=developer_id, - session_id=session_id, - user_id=user_id, - agent_id=agent_id, - situation="test situation", - client=client, - ), - create_function_query( - agent_id=agent_id, id=tool_id, function=test_function, client=client - ), - create_docs_query( - owner_type="agent", - owner_id=agent_id, - id=agent_doc_id, - title=test_agent_doc, - content=test_agent_doc, - client=client, - ), - create_docs_query( - owner_type="user", - owner_id=user_id, - id=user_doc_id, - title=test_user_doc, - content=test_user_doc, - client=client, - ), - embed_functions_query( - agent_id=agent_id, - tool_ids=[tool_id], - embeddings=[[1.0] * 768], - client=client, - ), - embed_docs_snippets_query( - agent_doc_id, snippet_indices=[0], embeddings=[[1.0] * 1024], client=client - ), - embed_docs_snippets_query( - user_doc_id, snippet_indices=[0], embeddings=[[1.0] * 1024], client=client - ), - ] - - # Executes the procedural memory context query to retrieve relevant memory context based on embeddings. - # Run the query - result = proc_mem_context_query( - session_id=session_id, - tool_query_embedding=[0.9] * 768, - doc_query_embedding=[0.9] * 1024, - client=client, - ) - - assert len(result) == 8 +# """ +# This module contains tests for entry queries against the CozoDB database. +# It verifies the functionality of adding, retrieving, and processing entries as defined in the schema. +# """ + +# # Tests for entry queries +# from uuid import uuid4 + +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import test + +# from ...autogen.openapi_model import FunctionDef +# from ...common.protocol.entries import Entry +# from ..docs.create_docs import create_docs_query +# from ..docs.embed_docs import embed_docs_snippets_query +# from ..agent.create_agent import create_agent_query +# from ..session.create_session import create_session_query +# from ..tools.create_tools import create_function_query +# from ..tools.embed_tools import embed_functions_query +# from ..user.create_user import create_user_query +# from .add_entries import add_entries_query +# from .get_entries import get_entries_query +# from .proc_mem_context import proc_mem_context_query + +# MODEL = "julep-ai/samantha-1-turbo" + + +# # Initializes a new CozoDB client for testing, applying all migrations. +# def cozo_client(migrations_dir: str = "./migrations"): +# # Create a new client for each test +# # and initialize the schema. +# client = Client() + +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) + +# return client + + +# @test("model: create entry") +# def _(): +# """ +# Tests the addition of a new entry to the database. +# Verifies that the entry can be successfully added using the add_entries_query function. +# """ +# client = cozo_client() +# session_id = uuid4() + +# test_entry = Entry( +# session_id=session_id, +# role="user", +# content="test entry content", +# ) + +# add_entries_query(entries=[test_entry], client=client) + + +# @test("model: get entries") +# def _(): +# """ +# Tests the retrieval of entries from the database. +# Verifies that entries matching specific criteria can be successfully retrieved. +# """ +# client = cozo_client() +# session_id = uuid4() + +# test_entry = Entry( +# session_id=session_id, +# role="user", +# content="test entry content", +# ) + +# internal_entry = Entry( +# session_id=session_id, +# role="user", +# content="test entry content", +# source="internal", +# ) + +# add_entries_query(entries=[test_entry, internal_entry], client=client) + +# result = get_entries_query(session_id=session_id, client=client) + +# # Asserts that only one entry is retrieved, matching the session_id. +# assert len(result["entry_id"]) == 1 + + +# @test("model: procedural memory context") +# def _(): +# """ +# Tests the procedural memory context in the database. +# Verifies the functionality of retrieving relevant memory context based on embeddings. +# """ +# client = cozo_client() +# developer_id = uuid4() +# user_id = uuid4() +# agent_id = uuid4() +# session_id = uuid4() +# tool_id = uuid4() +# user_doc_id = uuid4() +# agent_doc_id = uuid4() + +# # Setup: Creates a user, agent, session, function, and documents, then embeds tools and document snippets. +# # Create stuff +# test_entry = Entry( +# session_id=session_id, +# role="user", +# content="test entry content", +# source="api_request", +# ) + +# test_instruction1 = "test instruction" +# test_instruction2 = "test instruction" +# test_function = FunctionDef( +# name="test function", +# description="test function description", +# parameters={"type": "object", "properties": {}}, +# ) + +# test_user_doc = "test user doc" +# test_agent_doc = "test agent doc" + +# [ +# add_entries_query(entries=[test_entry], client=client), +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="test user", +# about="test user about", +# client=client, +# ), +# create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# name="test agent", +# about="test agent about", +# instructions=[test_instruction1, test_instruction2], +# client=client, +# ), +# create_session_query( +# developer_id=developer_id, +# session_id=session_id, +# user_id=user_id, +# agent_id=agent_id, +# situation="test situation", +# client=client, +# ), +# create_function_query( +# agent_id=agent_id, id=tool_id, function=test_function, client=client +# ), +# create_docs_query( +# owner_type="agent", +# owner_id=agent_id, +# id=agent_doc_id, +# title=test_agent_doc, +# content=test_agent_doc, +# client=client, +# ), +# create_docs_query( +# owner_type="user", +# owner_id=user_id, +# id=user_doc_id, +# title=test_user_doc, +# content=test_user_doc, +# client=client, +# ), +# embed_functions_query( +# agent_id=agent_id, +# tool_ids=[tool_id], +# embeddings=[[1.0] * 768], +# client=client, +# ), +# embed_docs_snippets_query( +# agent_doc_id, snippet_indices=[0], embeddings=[[1.0] * 1024], client=client +# ), +# embed_docs_snippets_query( +# user_doc_id, snippet_indices=[0], embeddings=[[1.0] * 1024], client=client +# ), +# ] + +# # Executes the procedural memory context query to retrieve relevant memory context based on embeddings. +# # Run the query +# result = proc_mem_context_query( +# session_id=session_id, +# tool_query_embedding=[0.9] * 768, +# doc_query_embedding=[0.9] * 1024, +# client=client, +# ) + +# assert len(result) == 8 diff --git a/agents-api/agents_api/models/execution/create_execution.py b/agents-api/agents_api/models/execution/create_execution.py index 38084707d..db4198091 100644 --- a/agents-api/agents_api/models/execution/create_execution.py +++ b/agents-api/agents_api/models/execution/create_execution.py @@ -1,18 +1,30 @@ from uuid import UUID, uuid4 from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Execution, CreateExecutionRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( Execution, one=True, diff --git a/agents-api/agents_api/models/execution/create_execution_transition.py b/agents-api/agents_api/models/execution/create_execution_transition.py index 6f11e462b..280b84376 100644 --- a/agents-api/agents_api/models/execution/create_execution_transition.py +++ b/agents-api/agents_api/models/execution/create_execution_transition.py @@ -1,17 +1,29 @@ from uuid import UUID, uuid4 from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Transition, CreateTransitionRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(Transition, transform=lambda d: {"id": d["transition_id"], **d}) @cozo_query @beartype diff --git a/agents-api/agents_api/models/execution/get_execution.py b/agents-api/agents_api/models/execution/get_execution.py index fbe7b6483..2738edace 100644 --- a/agents-api/agents_api/models/execution/get_execution.py +++ b/agents-api/agents_api/models/execution/get_execution.py @@ -1,14 +1,26 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Execution from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(Execution, one=True) @cozo_query @beartype diff --git a/agents-api/agents_api/models/execution/list_execution_transitions.py b/agents-api/agents_api/models/execution/list_execution_transitions.py index b2c9b85fa..fdee95af5 100644 --- a/agents-api/agents_api/models/execution/list_execution_transitions.py +++ b/agents-api/agents_api/models/execution/list_execution_transitions.py @@ -2,11 +2,21 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Transition -from ..utils import cozo_query, wrap_in_class +from ..utils import cozo_query, partialclass, rewrap_exceptions, wrap_in_class +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(Transition) @cozo_query @beartype diff --git a/agents-api/agents_api/models/execution/list_executions.py b/agents-api/agents_api/models/execution/list_executions.py index 15a790282..4b4f01636 100644 --- a/agents-api/agents_api/models/execution/list_executions.py +++ b/agents-api/agents_api/models/execution/list_executions.py @@ -2,17 +2,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Execution from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(Execution) @cozo_query @beartype diff --git a/agents-api/agents_api/models/execution/test_execution_queries.py b/agents-api/agents_api/models/execution/test_execution_queries.py index f2a56033b..eade4329c 100644 --- a/agents-api/agents_api/models/execution/test_execution_queries.py +++ b/agents-api/agents_api/models/execution/test_execution_queries.py @@ -1,377 +1,377 @@ -# Tests for execution queries -from uuid import uuid4 - -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import test - -from ..agent.create_agent import create_agent_query -from ..task.create_task import create_task_query -from .create_execution import create_execution_query -from .get_execution import get_execution_query -from .get_execution_status import get_execution_status_query -from .get_execution_input import get_execution_input_query -from .list_executions import list_task_executions_query -from .update_execution_status import update_execution_status_query -from .create_execution_transition import create_execution_transition_query -from .get_execution_transition import get_execution_transition_query -from .list_execution_transitions import list_execution_transitions_query -from .update_execution_transition import update_execution_transition_query - -from ...common.protocol.tasks import ExecutionInput - - -def cozo_client(migrations_dir: str = "./migrations"): - # Create a new client for each test - # and initialize the schema. - client = Client() - - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) - - return client - - -@test("model: create execution") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - arguments={"input": "test"}, - client=client, - ) - - -@test("model: create execution with session") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - session_id = uuid4() - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - session_id=session_id, - arguments={"input": "test"}, - client=client, - ) - - -@test("model: get execution") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - arguments={"input": "test"}, - client=client, - ) - - result = get_execution_query( - task_id=task_id, execution_id=execution_id, client=client - ) - - assert len(result["status"]) == 1 - assert result["status"][0] == "queued" - - -@test("model: get execution status") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - arguments={"input": "test"}, - client=client, - ) - - result = get_execution_status_query( - task_id=task_id, execution_id=execution_id, client=client - ) - - assert len(result["status"]) == 1 - assert result["status"][0] == "queued" - - -@test("model: get execution input") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - - create_agent_query( - agent_id=agent_id, - developer_id=developer_id, - name="test", - about="test", - model="gpt-4", - metadata={"test": "test"}, - client=client, - ) - - create_task_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - name="test", - description="test", - input_schema={"test": "test"}, - tools_available=[], - workflows=[], - client=client, - ) - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - arguments={"input": "test"}, - client=client, - ) - - result = get_execution_input_query( - task_id=task_id, execution_id=execution_id, client=client - ) - - assert len(result["execution"]) == 1 - - -@test("model: fetch execution input") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - - create_agent_query( - agent_id=agent_id, - developer_id=developer_id, - name="test", - about="test", - model="gpt-4", - metadata={"test": "test"}, - client=client, - ) - - create_task_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - name="test", - description="test", - input_schema={"test": "test"}, - tools_available=[], - workflows=[{"name": "main", "steps": []}], - client=client, - ) - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - arguments={"input": "test"}, - client=client, - ) - - result = ExecutionInput.fetch( - developer_id=developer_id, - task_id=task_id, - execution_id=execution_id, - client=client, - ) - - assert result.execution.id == execution_id - - -@test("model: list executions empty") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - - result = list_task_executions_query( - task_id=task_id, agent_id=agent_id, developer_id=developer_id, client=client - ) - - assert len(result) == 0 - - -@test("model: list executions") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - arguments={"input": "test"}, - client=client, - ) - - result = list_task_executions_query( - task_id=task_id, agent_id=agent_id, developer_id=developer_id, client=client - ) - - assert len(result["status"]) == 1 - assert result["status"][0] == "queued" - - -@test("model: update execution status") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - execution_id = uuid4() - - create_execution_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - execution_id=execution_id, - arguments={"input": "test"}, - client=client, - ) - - result = update_execution_status_query( - task_id=task_id, execution_id=execution_id, status="running", client=client - ) - - updated_rows = result[result["_kind"] == "inserted"].reset_index() - assert len(updated_rows) == 1 - assert updated_rows["status"][0] == "running" - - -@test("model: create execution transition") -def _(): - client = cozo_client() - developer_id = uuid4() - execution_id = uuid4() - transition_id = uuid4() - - create_execution_transition_query( - developer_id=developer_id, - execution_id=execution_id, - transition_id=transition_id, - type="step", - from_=("test", 1), - to=("test", 2), - outputs={"input": "test"}, - client=client, - ) - - -@test("model: get execution transition") -def _(): - client = cozo_client() - developer_id = uuid4() - execution_id = uuid4() - transition_id = uuid4() - - create_execution_transition_query( - developer_id=developer_id, - execution_id=execution_id, - transition_id=transition_id, - type="step", - from_=("test", 1), - to=("test", 2), - outputs={"input": "test"}, - client=client, - ) - - result = get_execution_transition_query( - execution_id=execution_id, transition_id=transition_id, client=client - ) - - assert len(result["type"]) == 1 - - -@test("model: list execution transitions") -def _(): - client = cozo_client() - developer_id = uuid4() - execution_id = uuid4() - transition_id = uuid4() - - create_execution_transition_query( - developer_id=developer_id, - execution_id=execution_id, - transition_id=transition_id, - type="step", - from_=("test", 1), - to=("test", 2), - outputs={"input": "test"}, - client=client, - ) - - result = list_execution_transitions_query(execution_id=execution_id, client=client) - - assert len(result["type"]) == 1 - - -@test("model: update execution transitions") -def _(): - client = cozo_client() - developer_id = uuid4() - execution_id = uuid4() - transition_id = uuid4() - - create_execution_transition_query( - developer_id=developer_id, - execution_id=execution_id, - transition_id=transition_id, - type="step", - from_=("test", 1), - to=("test", 2), - outputs={"input": "test"}, - client=client, - ) - - result = update_execution_transition_query( - execution_id=execution_id, - transition_id=transition_id, - type="finished", - client=client, - ) - - updated_rows = result[result["_kind"] == "inserted"].reset_index() - assert len(updated_rows) == 1 - assert updated_rows["type"][0] == "finished" +# # Tests for execution queries +# from uuid import uuid4 +# +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import test + +# from ..agent.create_agent import create_agent_query +# from ..task.create_task import create_task_query +# from .create_execution import create_execution_query +# from .get_execution import get_execution_query +# from .get_execution_status import get_execution_status_query +# from .get_execution_input import get_execution_input_query +# from .list_executions import list_task_executions_query +# from .update_execution_status import update_execution_status_query +# from .create_execution_transition import create_execution_transition_query +# from .get_execution_transition import get_execution_transition_query +# from .list_execution_transitions import list_execution_transitions_query +# from .update_execution_transition import update_execution_transition_query + +# from ...common.protocol.tasks import ExecutionInput + + +# def cozo_client(migrations_dir: str = "./migrations"): +# # Create a new client for each test +# # and initialize the schema. +# client = Client() + +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) + +# return client + + +# @test("model: create execution") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# arguments={"input": "test"}, +# client=client, +# ) + + +# @test("model: create execution with session") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() +# session_id = uuid4() + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# session_id=session_id, +# arguments={"input": "test"}, +# client=client, +# ) + + +# @test("model: get execution") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# arguments={"input": "test"}, +# client=client, +# ) + +# result = get_execution_query( +# task_id=task_id, execution_id=execution_id, client=client +# ) + +# assert len(result["status"]) == 1 +# assert result["status"][0] == "queued" + + +# @test("model: get execution status") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# arguments={"input": "test"}, +# client=client, +# ) + +# result = get_execution_status_query( +# task_id=task_id, execution_id=execution_id, client=client +# ) + +# assert len(result["status"]) == 1 +# assert result["status"][0] == "queued" + + +# @test("model: get execution input") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() + +# create_agent_query( +# agent_id=agent_id, +# developer_id=developer_id, +# name="test", +# about="test", +# model="gpt-4", +# metadata={"test": "test"}, +# client=client, +# ) + +# create_task_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# name="test", +# description="test", +# input_schema={"test": "test"}, +# tools_available=[], +# workflows=[], +# client=client, +# ) + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# arguments={"input": "test"}, +# client=client, +# ) + +# result = get_execution_input_query( +# task_id=task_id, execution_id=execution_id, client=client +# ) + +# assert len(result["execution"]) == 1 + + +# @test("model: fetch execution input") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() + +# create_agent_query( +# agent_id=agent_id, +# developer_id=developer_id, +# name="test", +# about="test", +# model="gpt-4", +# metadata={"test": "test"}, +# client=client, +# ) + +# create_task_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# name="test", +# description="test", +# input_schema={"test": "test"}, +# tools_available=[], +# workflows=[{"name": "main", "steps": []}], +# client=client, +# ) + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# arguments={"input": "test"}, +# client=client, +# ) + +# result = ExecutionInput.fetch( +# developer_id=developer_id, +# task_id=task_id, +# execution_id=execution_id, +# client=client, +# ) + +# assert result.execution.id == execution_id + + +# @test("model: list executions empty") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() + +# result = list_task_executions_query( +# task_id=task_id, agent_id=agent_id, developer_id=developer_id, client=client +# ) + +# assert len(result) == 0 + + +# @test("model: list executions") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# arguments={"input": "test"}, +# client=client, +# ) + +# result = list_task_executions_query( +# task_id=task_id, agent_id=agent_id, developer_id=developer_id, client=client +# ) + +# assert len(result["status"]) == 1 +# assert result["status"][0] == "queued" + + +# @test("model: update execution status") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() +# execution_id = uuid4() + +# create_execution_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# execution_id=execution_id, +# arguments={"input": "test"}, +# client=client, +# ) + +# result = update_execution_status_query( +# task_id=task_id, execution_id=execution_id, status="running", client=client +# ) + +# updated_rows = result[result["_kind"] == "inserted"].reset_index() +# assert len(updated_rows) == 1 +# assert updated_rows["status"][0] == "running" + + +# @test("model: create execution transition") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# execution_id = uuid4() +# transition_id = uuid4() + +# create_execution_transition_query( +# developer_id=developer_id, +# execution_id=execution_id, +# transition_id=transition_id, +# type="step", +# from_=("test", 1), +# to=("test", 2), +# outputs={"input": "test"}, +# client=client, +# ) + + +# @test("model: get execution transition") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# execution_id = uuid4() +# transition_id = uuid4() + +# create_execution_transition_query( +# developer_id=developer_id, +# execution_id=execution_id, +# transition_id=transition_id, +# type="step", +# from_=("test", 1), +# to=("test", 2), +# outputs={"input": "test"}, +# client=client, +# ) + +# result = get_execution_transition_query( +# execution_id=execution_id, transition_id=transition_id, client=client +# ) + +# assert len(result["type"]) == 1 + + +# @test("model: list execution transitions") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# execution_id = uuid4() +# transition_id = uuid4() + +# create_execution_transition_query( +# developer_id=developer_id, +# execution_id=execution_id, +# transition_id=transition_id, +# type="step", +# from_=("test", 1), +# to=("test", 2), +# outputs={"input": "test"}, +# client=client, +# ) + +# result = list_execution_transitions_query(execution_id=execution_id, client=client) + +# assert len(result["type"]) == 1 + + +# @test("model: update execution transitions") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# execution_id = uuid4() +# transition_id = uuid4() + +# create_execution_transition_query( +# developer_id=developer_id, +# execution_id=execution_id, +# transition_id=transition_id, +# type="step", +# from_=("test", 1), +# to=("test", 2), +# outputs={"input": "test"}, +# client=client, +# ) + +# result = update_execution_transition_query( +# execution_id=execution_id, +# transition_id=transition_id, +# type="finished", +# client=client, +# ) + +# updated_rows = result[result["_kind"] == "inserted"].reset_index() +# assert len(updated_rows) == 1 +# assert updated_rows["type"][0] == "finished" diff --git a/agents-api/agents_api/models/execution/update_execution.py b/agents-api/agents_api/models/execution/update_execution.py index f341bc30a..afce49cc6 100644 --- a/agents-api/agents_api/models/execution/update_execution.py +++ b/agents-api/agents_api/models/execution/update_execution.py @@ -1,6 +1,9 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import ( @@ -10,12 +13,21 @@ from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/session/create_or_update_session.py b/agents-api/agents_api/models/session/create_or_update_session.py index a09d0a37b..e27e8bc3d 100644 --- a/agents-api/agents_api/models/session/create_or_update_session.py +++ b/agents-api/agents_api/models/session/create_or_update_session.py @@ -1,6 +1,9 @@ from beartype import beartype from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import ( @@ -10,12 +13,21 @@ from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/session/create_session.py b/agents-api/agents_api/models/session/create_session.py index 13d00f484..410d66880 100644 --- a/agents-api/agents_api/models/session/create_session.py +++ b/agents-api/agents_api/models/session/create_session.py @@ -4,6 +4,9 @@ """ from uuid import UUID, uuid4 +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype @@ -11,12 +14,21 @@ from ...autogen.openapi_model import Session, CreateSessionRequest from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( Session, one=True, diff --git a/agents-api/agents_api/models/session/delete_session.py b/agents-api/agents_api/models/session/delete_session.py index a32a90a36..d40b0fa06 100644 --- a/agents-api/agents_api/models/session/delete_session.py +++ b/agents-api/agents_api/models/session/delete_session.py @@ -1,6 +1,9 @@ """This module contains the implementation for deleting sessions from the 'cozodb' database using datalog queries.""" from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype @@ -9,12 +12,21 @@ from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceDeletedResponse, one=True, diff --git a/agents-api/agents_api/models/session/get_session.py b/agents-api/agents_api/models/session/get_session.py index 3a37fb532..a74729463 100644 --- a/agents-api/agents_api/models/session/get_session.py +++ b/agents-api/agents_api/models/session/get_session.py @@ -1,17 +1,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import make_session from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(make_session, one=True) @cozo_query @beartype diff --git a/agents-api/agents_api/models/session/list_sessions.py b/agents-api/agents_api/models/session/list_sessions.py index 2f3da454a..d8dbdfc7c 100644 --- a/agents-api/agents_api/models/session/list_sessions.py +++ b/agents-api/agents_api/models/session/list_sessions.py @@ -1,6 +1,9 @@ """This module contains functions for querying session data from the 'cozodb' database.""" from typing import Any, Literal +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from uuid import UUID from beartype import beartype @@ -10,11 +13,20 @@ from ...common.utils import json from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(make_session) @cozo_query @beartype diff --git a/agents-api/agents_api/models/session/patch_session.py b/agents-api/agents_api/models/session/patch_session.py index 090a6b240..a0d44f7db 100644 --- a/agents-api/agents_api/models/session/patch_session.py +++ b/agents-api/agents_api/models/session/patch_session.py @@ -1,6 +1,9 @@ """This module contains functions for patching session data in the 'cozodb' database using datalog queries.""" from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from uuid import UUID @@ -9,6 +12,8 @@ from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -27,6 +32,13 @@ # TODO: Add support for updating `render_templates` field +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/session/test_session_queries.py b/agents-api/agents_api/models/session/test_session_queries.py index 018c08949..8bc750359 100644 --- a/agents-api/agents_api/models/session/test_session_queries.py +++ b/agents-api/agents_api/models/session/test_session_queries.py @@ -1,284 +1,284 @@ -""" -This module contains tests for session-related queries against the 'cozodb' database. It verifies the creation, retrieval, and deletion of session records as defined in the schema provided in agents-api/README.md. -""" - -# Tests for session queries -from uuid import uuid4 - -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import test, skip - -from ..agent.create_agent import create_agent_query -from ..user.create_user import create_user_query - -from .create_session import create_session_query -from .delete_session import delete_session_query -from .get_session import get_session_query -from .list_sessions import list_sessions_query -from .session_data import get_session_data, session_data_query - - -MODEL = "julep-ai/samantha-1-turbo" - - -def cozo_client(migrations_dir: str = "./migrations"): - # Create a new client for each test - # and initialize the schema. - client = Client() - - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) - - return client - - -@test("model: create session") -def _(): - """Test session creation with a valid session, user, agent, and developer IDs.""" - client = cozo_client() - session_id = uuid4() - agent_id = uuid4() - user_id = uuid4() - developer_id = uuid4() - - create_session_query( - session_id=session_id, - user_id=user_id, - developer_id=developer_id, - agent_id=agent_id, - situation="test session about", - client=client, - ) - - -@test("model: create session no user") -def _(): - """Test session creation without a user ID.""" - client = cozo_client() - session_id = uuid4() - agent_id = uuid4() - developer_id = uuid4() - - create_session_query( - session_id=session_id, - user_id=None, - developer_id=developer_id, - agent_id=agent_id, - situation="test session about", - client=client, - ) - - -@test("model: get session not exists") -def _(): - """Verify that querying a non-existent session returns an empty result.""" - client = cozo_client() - session_id = uuid4() - developer_id = uuid4() - - result = get_session_query( - session_id=session_id, - developer_id=developer_id, - client=client, - ) - - assert len(result["id"]) == 0 - - -@test("model: get session exists") -def _(): - """Verify that a created session can be successfully retrieved.""" - client = cozo_client() - session_id = uuid4() - agent_id = uuid4() - user_id = uuid4() - developer_id = uuid4() - - result = create_session_query( - session_id=session_id, - user_id=user_id, - agent_id=agent_id, - developer_id=developer_id, - situation="test session about", - client=client, - ) - - result = get_session_query( - session_id=session_id, - developer_id=developer_id, - client=client, - ) - - assert len(result["id"]) == 1 - - -@test("model: get session data") -def _(): - """Test retrieval of session data for an existing session.""" - # Setup client for user and agent - client = cozo_client() - - session_id = uuid4() - agent_id = uuid4() - user_id = uuid4() - developer_id = uuid4() - - # Create a user - create_user_query( - user_id=user_id, - developer_id=developer_id, - about="test user about", - name="test user name", - client=client, - ) - - # Create an agent - create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - about="test agent about", - name="test agent name", - client=client, - ) - - # Create a session - - result = create_session_query( - session_id=session_id, - user_id=user_id, - agent_id=agent_id, - developer_id=developer_id, - situation="test session about", - client=client, - ) - - result = session_data_query( - session_id=session_id, - developer_id=developer_id, - client=client, - ) - - assert len(result["user_about"]) == 1 - - -@test("model: delete session") -def _(): - """Test the deletion of a session and verify it cannot be retrieved afterwards.""" - # Setup client for user and agent - client = cozo_client() - - session_id = uuid4() - agent_id = uuid4() - user_id = uuid4() - developer_id = uuid4() - - # Create a user - create_user_query( - user_id=user_id, - developer_id=developer_id, - about="test user about", - name="test user name", - client=client, - ) - - # Create an agent - create_agent_query( - agent_id=agent_id, - model=MODEL, - developer_id=developer_id, - about="test agent about", - name="test agent name", - client=client, - ) - - # Create a session - result = create_session_query( - session_id=session_id, - user_id=user_id, - agent_id=agent_id, - developer_id=developer_id, - situation="test session about", - client=client, - ) - - # Delete the session - result = delete_session_query( - session_id=session_id, - developer_id=developer_id, - client=client, - ) - - # Check that the session is deleted - result = get_session_query( - session_id=session_id, - developer_id=developer_id, - client=client, - ) - - assert len(result["id"]) == 0 - - -@skip("get session data using get_session_data") -def _(): - # Setup client for user and agent - client = cozo_client() - - developer_id = uuid4() - session_id = uuid4() - agent_id = uuid4() - user_id = uuid4() - - # Setup: Create a user, agent, and session for testing session data retrieval using get_session_data. - # Create a user - create_user_query( - user_id=user_id, - developer_id=developer_id, - about="test user about", - name="test user name", - client=client, - ) - - # Create an agent - create_agent_query( - developer_id=developer_id, - model=MODEL, - agent_id=agent_id, - about="test agent about", - name="test agent name", - client=client, - ) - - # Create a session - - create_session_query( - developer_id=developer_id, - session_id=session_id, - user_id=user_id, - agent_id=agent_id, - situation="test session about", - client=client, - ) - - session_data = get_session_data( - developer_id=developer_id, - session_id=session_id, - client=client, - ) - - assert session_data is not None - assert session_data.user_about == "test user about" - - -@skip("list sessions") -def _(): - client = cozo_client() - developer_id = uuid4() - - result = list_sessions_query( - developer_id=developer_id, - client=client, - ) - - assert len(result["id"]) == 0 +# """ +# This module contains tests for session-related queries against the 'cozodb' database. It verifies the creation, retrieval, and deletion of session records as defined in the schema provided in agents-api/README.md. +# """ + +# # Tests for session queries +# from uuid import uuid4 + +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import test, skip + +# from ..agent.create_agent import create_agent_query +# from ..user.create_user import create_user_query + +# from .create_session import create_session_query +# from .delete_session import delete_session_query +# from .get_session import get_session_query +# from .list_sessions import list_sessions_query +# from .session_data import get_session_data, session_data_query + + +# MODEL = "julep-ai/samantha-1-turbo" + + +# def cozo_client(migrations_dir: str = "./migrations"): +# # Create a new client for each test +# # and initialize the schema. +# client = Client() + +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) + +# return client + + +# @test("model: create session") +# def _(): +# """Test session creation with a valid session, user, agent, and developer IDs.""" +# client = cozo_client() +# session_id = uuid4() +# agent_id = uuid4() +# user_id = uuid4() +# developer_id = uuid4() + +# create_session_query( +# session_id=session_id, +# user_id=user_id, +# developer_id=developer_id, +# agent_id=agent_id, +# situation="test session about", +# client=client, +# ) + + +# @test("model: create session no user") +# def _(): +# """Test session creation without a user ID.""" +# client = cozo_client() +# session_id = uuid4() +# agent_id = uuid4() +# developer_id = uuid4() + +# create_session_query( +# session_id=session_id, +# user_id=None, +# developer_id=developer_id, +# agent_id=agent_id, +# situation="test session about", +# client=client, +# ) + + +# @test("model: get session not exists") +# def _(): +# """Verify that querying a non-existent session returns an empty result.""" +# client = cozo_client() +# session_id = uuid4() +# developer_id = uuid4() + +# result = get_session_query( +# session_id=session_id, +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["id"]) == 0 + + +# @test("model: get session exists") +# def _(): +# """Verify that a created session can be successfully retrieved.""" +# client = cozo_client() +# session_id = uuid4() +# agent_id = uuid4() +# user_id = uuid4() +# developer_id = uuid4() + +# result = create_session_query( +# session_id=session_id, +# user_id=user_id, +# agent_id=agent_id, +# developer_id=developer_id, +# situation="test session about", +# client=client, +# ) + +# result = get_session_query( +# session_id=session_id, +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["id"]) == 1 + + +# @test("model: get session data") +# def _(): +# """Test retrieval of session data for an existing session.""" +# # Setup client for user and agent +# client = cozo_client() + +# session_id = uuid4() +# agent_id = uuid4() +# user_id = uuid4() +# developer_id = uuid4() + +# # Create a user +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# about="test user about", +# name="test user name", +# client=client, +# ) + +# # Create an agent +# create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# about="test agent about", +# name="test agent name", +# client=client, +# ) + +# # Create a session + +# result = create_session_query( +# session_id=session_id, +# user_id=user_id, +# agent_id=agent_id, +# developer_id=developer_id, +# situation="test session about", +# client=client, +# ) + +# result = session_data_query( +# session_id=session_id, +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["user_about"]) == 1 + + +# @test("model: delete session") +# def _(): +# """Test the deletion of a session and verify it cannot be retrieved afterwards.""" +# # Setup client for user and agent +# client = cozo_client() + +# session_id = uuid4() +# agent_id = uuid4() +# user_id = uuid4() +# developer_id = uuid4() + +# # Create a user +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# about="test user about", +# name="test user name", +# client=client, +# ) + +# # Create an agent +# create_agent_query( +# agent_id=agent_id, +# model=MODEL, +# developer_id=developer_id, +# about="test agent about", +# name="test agent name", +# client=client, +# ) + +# # Create a session +# result = create_session_query( +# session_id=session_id, +# user_id=user_id, +# agent_id=agent_id, +# developer_id=developer_id, +# situation="test session about", +# client=client, +# ) + +# # Delete the session +# result = delete_session_query( +# session_id=session_id, +# developer_id=developer_id, +# client=client, +# ) + +# # Check that the session is deleted +# result = get_session_query( +# session_id=session_id, +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["id"]) == 0 + + +# @skip("get session data using get_session_data") +# def _(): +# # Setup client for user and agent +# client = cozo_client() + +# developer_id = uuid4() +# session_id = uuid4() +# agent_id = uuid4() +# user_id = uuid4() + +# # Setup: Create a user, agent, and session for testing session data retrieval using get_session_data. +# # Create a user +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# about="test user about", +# name="test user name", +# client=client, +# ) + +# # Create an agent +# create_agent_query( +# developer_id=developer_id, +# model=MODEL, +# agent_id=agent_id, +# about="test agent about", +# name="test agent name", +# client=client, +# ) + +# # Create a session + +# create_session_query( +# developer_id=developer_id, +# session_id=session_id, +# user_id=user_id, +# agent_id=agent_id, +# situation="test session about", +# client=client, +# ) + +# session_data = get_session_data( +# developer_id=developer_id, +# session_id=session_id, +# client=client, +# ) + +# assert session_data is not None +# assert session_data.user_about == "test user about" + + +# @skip("list sessions") +# def _(): +# client = cozo_client() +# developer_id = uuid4() + +# result = list_sessions_query( +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["id"]) == 0 diff --git a/agents-api/agents_api/models/session/update_session.py b/agents-api/agents_api/models/session/update_session.py index beb863155..d4fd584e3 100644 --- a/agents-api/agents_api/models/session/update_session.py +++ b/agents-api/agents_api/models/session/update_session.py @@ -1,12 +1,17 @@ from beartype import beartype from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import UpdateSessionRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -24,6 +29,13 @@ # TODO: Add support for updating `render_templates` field +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/task/create_or_update_task.py b/agents-api/agents_api/models/task/create_or_update_task.py index 172df57e2..7e61bb847 100644 --- a/agents-api/agents_api/models/task/create_or_update_task.py +++ b/agents-api/agents_api/models/task/create_or_update_task.py @@ -4,6 +4,9 @@ """ from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype @@ -16,6 +19,8 @@ from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -23,6 +28,13 @@ from .create_task import task_to_spec +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/task/create_task.py b/agents-api/agents_api/models/task/create_task.py index 3be925311..7a9938ac4 100644 --- a/agents-api/agents_api/models/task/create_task.py +++ b/agents-api/agents_api/models/task/create_task.py @@ -4,6 +4,9 @@ """ from uuid import UUID, uuid4 +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError import sys if sys.version_info < (3, 11): @@ -18,6 +21,8 @@ from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -101,6 +106,13 @@ def spec_to_task(**spec) -> Task | CreateTaskRequest: return cls(**spec_to_task_data(spec)) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(spec_to_task, one=True) @cozo_query @beartype diff --git a/agents-api/agents_api/models/task/delete_task.py b/agents-api/agents_api/models/task/delete_task.py index f70718103..88062f17a 100644 --- a/agents-api/agents_api/models/task/delete_task.py +++ b/agents-api/agents_api/models/task/delete_task.py @@ -1,18 +1,30 @@ from beartype import beartype from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import ResourceDeletedResponse from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceDeletedResponse, one=True, diff --git a/agents-api/agents_api/models/task/get_task.py b/agents-api/agents_api/models/task/get_task.py index 11ebafa7b..a738ad4ff 100644 --- a/agents-api/agents_api/models/task/get_task.py +++ b/agents-api/agents_api/models/task/get_task.py @@ -1,10 +1,15 @@ from beartype import beartype from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -13,6 +18,13 @@ from .create_task import spec_to_task +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(spec_to_task, one=True) @cozo_query @beartype diff --git a/agents-api/agents_api/models/task/list_tasks.py b/agents-api/agents_api/models/task/list_tasks.py index c1e3541e6..14cced53e 100644 --- a/agents-api/agents_api/models/task/list_tasks.py +++ b/agents-api/agents_api/models/task/list_tasks.py @@ -2,9 +2,14 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -13,6 +18,13 @@ from .create_task import spec_to_task +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(spec_to_task) @cozo_query @beartype diff --git a/agents-api/agents_api/models/task/patch_task.py b/agents-api/agents_api/models/task/patch_task.py index d43fb5e04..d0a65a38f 100644 --- a/agents-api/agents_api/models/task/patch_task.py +++ b/agents-api/agents_api/models/task/patch_task.py @@ -4,6 +4,9 @@ """ from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype @@ -12,6 +15,8 @@ from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -19,6 +24,13 @@ from .create_task import task_to_spec, TaskSpec +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/task/test_task_queries.py b/agents-api/agents_api/models/task/test_task_queries.py index 9e2a48ab5..ff9150f99 100644 --- a/agents-api/agents_api/models/task/test_task_queries.py +++ b/agents-api/agents_api/models/task/test_task_queries.py @@ -1,90 +1,90 @@ -# Tests for task queries -from uuid import uuid4 +# # Tests for task queries +# from uuid import uuid4 -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import test +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import test -from .create_task import create_task_query -from .get_task import get_task_query -from .list_tasks import list_tasks_query +# from .create_task import create_task_query +# from .get_task import get_task_query +# from .list_tasks import list_tasks_query -def cozo_client(migrations_dir: str = "./migrations"): - # Create a new client for each test - # and initialize the schema. - client = Client() +# def cozo_client(migrations_dir: str = "./migrations"): +# # Create a new client for each test +# # and initialize the schema. +# client = Client() - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) - return client +# return client -@test("model: create task") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - - create_task_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - name="test task", - description="test task about", - input_schema={"type": "object", "additionalProperties": True}, - client=client, - ) - - -@test("model: list tasks") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - - result = list_tasks_query( - developer_id=developer_id, - agent_id=agent_id, - client=client, - ) - - assert len(result["id"]) == 0 - - -@test("model: get task exists") -def _(): - client = cozo_client() - developer_id = uuid4() - agent_id = uuid4() - task_id = uuid4() - - create_task_query( - developer_id=developer_id, - agent_id=agent_id, - task_id=task_id, - name="test task", - description="test task about", - input_schema={"type": "object", "additionalProperties": True}, - client=client, - ) - - result = get_task_query( - agent_id=agent_id, task_id=task_id, developer_id=developer_id, client=client - ) - - assert len(result["id"]) == 1 +# @test("model: create task") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() + +# create_task_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# name="test task", +# description="test task about", +# input_schema={"type": "object", "additionalProperties": True}, +# client=client, +# ) + + +# @test("model: list tasks") +# def _(): +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# result = list_tasks_query( +# developer_id=developer_id, +# agent_id=agent_id, +# client=client, +# ) -# @test("model: delete task") -# def _(): -# TODO: Implement this test -# raise NotImplementedError +# assert len(result["id"]) == 0 -# @test("model: update task") +# @test("model: get task exists") # def _(): -# TODO: Implement this test -# raise NotImplementedError +# client = cozo_client() +# developer_id = uuid4() +# agent_id = uuid4() +# task_id = uuid4() + +# create_task_query( +# developer_id=developer_id, +# agent_id=agent_id, +# task_id=task_id, +# name="test task", +# description="test task about", +# input_schema={"type": "object", "additionalProperties": True}, +# client=client, +# ) + +# result = get_task_query( +# agent_id=agent_id, task_id=task_id, developer_id=developer_id, client=client +# ) + +# assert len(result["id"]) == 1 + + +# # @test("model: delete task") +# # def _(): +# # TODO: Implement this test +# # raise NotImplementedError + + +# # @test("model: update task") +# # def _(): +# # TODO: Implement this test +# # raise NotImplementedError diff --git a/agents-api/agents_api/models/task/update_task.py b/agents-api/agents_api/models/task/update_task.py index ce851d799..1ba5743ab 100644 --- a/agents-api/agents_api/models/task/update_task.py +++ b/agents-api/agents_api/models/task/update_task.py @@ -4,6 +4,9 @@ """ from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype @@ -12,6 +15,8 @@ from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, @@ -19,6 +24,13 @@ from .create_task import task_to_spec +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/tools/create_tools.py b/agents-api/agents_api/models/tools/create_tools.py index 09a7a7c7e..7f3c6d98e 100644 --- a/agents-api/agents_api/models/tools/create_tools.py +++ b/agents-api/agents_api/models/tools/create_tools.py @@ -1,6 +1,9 @@ """This module contains functions for creating tools in the CozoDB database.""" from uuid import UUID, uuid4 +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype @@ -8,12 +11,21 @@ from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( Tool, transform=lambda d: { diff --git a/agents-api/agents_api/models/tools/delete_tools.py b/agents-api/agents_api/models/tools/delete_tools.py index 81ffefeef..7da38d41c 100644 --- a/agents-api/agents_api/models/tools/delete_tools.py +++ b/agents-api/agents_api/models/tools/delete_tools.py @@ -1,18 +1,30 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import ResourceDeletedResponse from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceDeletedResponse, one=True, diff --git a/agents-api/agents_api/models/tools/get_tool.py b/agents-api/agents_api/models/tools/get_tool.py index da961229c..313876416 100644 --- a/agents-api/agents_api/models/tools/get_tool.py +++ b/agents-api/agents_api/models/tools/get_tool.py @@ -1,17 +1,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Tool from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( Tool, transform=lambda d: { diff --git a/agents-api/agents_api/models/tools/list_tools.py b/agents-api/agents_api/models/tools/list_tools.py index 794dd1873..05637213b 100644 --- a/agents-api/agents_api/models/tools/list_tools.py +++ b/agents-api/agents_api/models/tools/list_tools.py @@ -2,17 +2,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import Tool from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(Tool) @cozo_query @beartype diff --git a/agents-api/agents_api/models/tools/patch_tool.py b/agents-api/agents_api/models/tools/patch_tool.py index a3aab308a..89dd7137e 100644 --- a/agents-api/agents_api/models/tools/patch_tool.py +++ b/agents-api/agents_api/models/tools/patch_tool.py @@ -1,18 +1,30 @@ from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype from ...autogen.openapi_model import PatchToolRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/tools/test_tool_queries.py b/agents-api/agents_api/models/tools/test_tool_queries.py index be68d10bb..058b36eba 100644 --- a/agents-api/agents_api/models/tools/test_tool_queries.py +++ b/agents-api/agents_api/models/tools/test_tool_queries.py @@ -1,127 +1,127 @@ # # Tests for entry queries -from uuid import uuid4 +# from uuid import uuid4 -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import test +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import test -from ...autogen.openapi_model import FunctionDef -from .create_tools import create_function_query, create_multiple_functions_query -from .delete_tools import delete_function_by_id_query -from .get_tool import get_function_by_id_query -from .list_tools import list_functions_by_agent_query +# from ...autogen.openapi_model import FunctionDef +# from .create_tools import create_function_query, create_multiple_functions_query +# from .delete_tools import delete_function_by_id_query +# from .get_tool import get_function_by_id_query +# from .list_tools import list_functions_by_agent_query -def cozo_client(migrations_dir: str = "./migrations"): - # Create a new client for each test - # and initialize the schema. - client = Client() +# def cozo_client(migrations_dir: str = "./migrations"): +# # Create a new client for each test +# # and initialize the schema. +# client = Client() - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) - return client +# return client -@test("model: create function") -def _(): - client = cozo_client() +# @test("model: create function") +# def _(): +# client = cozo_client() - agent_id = uuid4() - tool_id = uuid4() - function = FunctionDef( - name="hello_world", - description="A function that prints hello world", - parameters={"type": "object", "properties": {}}, - ) +# agent_id = uuid4() +# tool_id = uuid4() +# function = FunctionDef( +# name="hello_world", +# description="A function that prints hello world", +# parameters={"type": "object", "properties": {}}, +# ) - result = create_function_query(agent_id, tool_id, function, client=client) +# result = create_function_query(agent_id, tool_id, function, client=client) - assert result["created_at"][0] +# assert result["created_at"][0] -@test("model: create multiple functions") -def _(): - client = cozo_client() +# @test("model: create multiple functions") +# def _(): +# client = cozo_client() - agent_id = uuid4() - function = FunctionDef( - name="hello_world", - description="A function that prints hello world", - parameters={"type": "object", "properties": {}}, - ) - num_functions = 10 +# agent_id = uuid4() +# function = FunctionDef( +# name="hello_world", +# description="A function that prints hello world", +# parameters={"type": "object", "properties": {}}, +# ) +# num_functions = 10 - result = create_multiple_functions_query( - agent_id, [function] * num_functions, client=client - ) +# result = create_multiple_functions_query( +# agent_id, [function] * num_functions, client=client +# ) - assert result["created_at"][0] - assert len(result["tool_id"]) == num_functions +# assert result["created_at"][0] +# assert len(result["tool_id"]) == num_functions -@test("model: delete function") -def _(): - client = cozo_client() +# @test("model: delete function") +# def _(): +# client = cozo_client() - # Create function - agent_id = uuid4() - tool_id = uuid4() - function = FunctionDef( - name="hello_world", - description="A function that prints hello world", - parameters={"type": "object", "properties": {}}, - ) +# # Create function +# agent_id = uuid4() +# tool_id = uuid4() +# function = FunctionDef( +# name="hello_world", +# description="A function that prints hello world", +# parameters={"type": "object", "properties": {}}, +# ) - create_function_query(agent_id, tool_id, function, client=client) +# create_function_query(agent_id, tool_id, function, client=client) - # Delete function - result = delete_function_by_id_query(agent_id, tool_id, client=client) +# # Delete function +# result = delete_function_by_id_query(agent_id, tool_id, client=client) - delete_info = next( - (row for row in result.to_dict("records") if row["_kind"] == "deleted"), None - ) +# delete_info = next( +# (row for row in result.to_dict("records") if row["_kind"] == "deleted"), None +# ) - assert delete_info is not None, "Delete operation did not find the row" +# assert delete_info is not None, "Delete operation did not find the row" -@test("model: get function") -def _(): - client = cozo_client() +# @test("model: get function") +# def _(): +# client = cozo_client() - # Create function - agent_id = uuid4() - tool_id = uuid4() - function = FunctionDef( - name="hello_world", - description="A function that prints hello world", - parameters={"type": "object", "properties": {}}, - ) +# # Create function +# agent_id = uuid4() +# tool_id = uuid4() +# function = FunctionDef( +# name="hello_world", +# description="A function that prints hello world", +# parameters={"type": "object", "properties": {}}, +# ) - create_function_query(agent_id, tool_id, function, client=client) +# create_function_query(agent_id, tool_id, function, client=client) - # Get function - result = get_function_by_id_query(agent_id, tool_id, client=client) +# # Get function +# result = get_function_by_id_query(agent_id, tool_id, client=client) - assert len(result["tool_id"]) == 1, "Get operation did not find the row" +# assert len(result["tool_id"]) == 1, "Get operation did not find the row" -@test("model: list functions") -def _(): - client = cozo_client() +# @test("model: list functions") +# def _(): +# client = cozo_client() - agent_id = uuid4() - function = FunctionDef( - name="hello_world", - description="A function that prints hello world", - parameters={"type": "object", "properties": {}}, - ) - num_functions = 10 +# agent_id = uuid4() +# function = FunctionDef( +# name="hello_world", +# description="A function that prints hello world", +# parameters={"type": "object", "properties": {}}, +# ) +# num_functions = 10 - # Create functions - create_multiple_functions_query(agent_id, [function] * num_functions, client=client) +# # Create functions +# create_multiple_functions_query(agent_id, [function] * num_functions, client=client) - # List functions - result = list_functions_by_agent_query(agent_id, client=client) +# # List functions +# result = list_functions_by_agent_query(agent_id, client=client) - assert len(result["tool_id"]) == num_functions +# assert len(result["tool_id"]) == num_functions diff --git a/agents-api/agents_api/models/user/create_or_update_user.py b/agents-api/agents_api/models/user/create_or_update_user.py index f6760aa36..16c948bb7 100644 --- a/agents-api/agents_api/models/user/create_or_update_user.py +++ b/agents-api/agents_api/models/user/create_or_update_user.py @@ -4,13 +4,29 @@ """ from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype from ...autogen.openapi_model import User, CreateOrUpdateUserRequest -from ..utils import cozo_query, verify_developer_id_query, wrap_in_class - - +from ..utils import ( + cozo_query, + partialclass, + rewrap_exceptions, + verify_developer_id_query, + wrap_in_class, +) + + +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(User, one=True, transform=lambda d: {"id": UUID(d.pop("user_id")), **d}) @cozo_query @beartype diff --git a/agents-api/agents_api/models/user/create_user.py b/agents-api/agents_api/models/user/create_user.py index b972a7bc7..6b1a677bd 100644 --- a/agents-api/agents_api/models/user/create_user.py +++ b/agents-api/agents_api/models/user/create_user.py @@ -4,14 +4,30 @@ """ from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from uuid import uuid4, UUID from ...autogen.openapi_model import User, CreateUserRequest -from ..utils import cozo_query, verify_developer_id_query, wrap_in_class +from ..utils import ( + cozo_query, + partialclass, + rewrap_exceptions, + verify_developer_id_query, + wrap_in_class, +) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(User, one=True, transform=lambda d: {"id": UUID(d.pop("user_id")), **d}) @cozo_query @beartype diff --git a/agents-api/agents_api/models/user/get_user.py b/agents-api/agents_api/models/user/get_user.py index 84259d2b2..5af3eda5e 100644 --- a/agents-api/agents_api/models/user/get_user.py +++ b/agents-api/agents_api/models/user/get_user.py @@ -1,17 +1,29 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import User from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(User, one=True) @cozo_query @beartype diff --git a/agents-api/agents_api/models/user/list_users.py b/agents-api/agents_api/models/user/list_users.py index bb98b4cf5..648496189 100644 --- a/agents-api/agents_api/models/user/list_users.py +++ b/agents-api/agents_api/models/user/list_users.py @@ -2,16 +2,28 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import User from ...common.utils import json from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class(User) @cozo_query @beartype diff --git a/agents-api/agents_api/models/user/patch_user.py b/agents-api/agents_api/models/user/patch_user.py index ff508731e..aa6156a27 100644 --- a/agents-api/agents_api/models/user/patch_user.py +++ b/agents-api/agents_api/models/user/patch_user.py @@ -1,6 +1,9 @@ """Module for generating datalog queries to update user information in the 'cozodb' database.""" from uuid import UUID +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from beartype import beartype @@ -10,12 +13,21 @@ from ...common.utils.datetime import utcnow from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/user/test_user_queries.py b/agents-api/agents_api/models/user/test_user_queries.py index e4464b529..e33d044e1 100644 --- a/agents-api/agents_api/models/user/test_user_queries.py +++ b/agents-api/agents_api/models/user/test_user_queries.py @@ -1,170 +1,170 @@ -"""This module contains tests for user-related queries against the 'cozodb' database. It includes tests for creating, updating, and retrieving user information.""" - -# Tests for user queries -from uuid import uuid4 - -from cozo_migrate.api import init, apply -from pycozo import Client -from ward import raises, test - -from .create_user import create_user_query -from .get_user import get_user_query -from .list_users import list_users_query -from .update_user import update_user_query - - -def cozo_client(migrations_dir: str = "./migrations"): - """Initializes a new Cozo client for testing, applying all migrations to ensure the database schema is up to date.""" - # Create a new client for each test - # and initialize the schema. - client = Client() - - init(client) - apply(client, migrations_dir=migrations_dir, all_=True) - - return client - - -@test("model: create user") -def _(): - """Test that a user can be successfully created.""" - client = cozo_client() - user_id = uuid4() - developer_id = uuid4() - - create_user_query( - user_id=user_id, - developer_id=developer_id, - name="test user", - about="test user about", - client=client, - ) - - -@test("model: create user twice should fail") -def _(): - """Test that attempting to create the same user twice results in a failure.""" - client = cozo_client() - user_id = uuid4() - developer_id = uuid4() - - # Expect an exception to be raised as creating the same user twice should not be allowed. - # Should fail because the user already exists. - with raises(Exception): - create_user_query( - user_id=user_id, - developer_id=developer_id, - name="test user", - about="test user about", - client=client, - ) - - create_user_query( - user_id=user_id, - developer_id=developer_id, - name="test user", - about="test user about", - client=client, - ) - - -@test("model: update non-existent user should fail") -def _(): - """Test that attempting to update a non-existent user results in a failure.""" - client = cozo_client() - user_id = uuid4() - developer_id = uuid4() - - # Should fail because the user doecn't exists. - with raises(Exception): - update_user_query( - user_id=user_id, - developer_id=developer_id, - name="test user", - about="test user about", - client=client, - ) - - -@test("model: update user") -def _(): - """Test that an existing user's information can be successfully updated.""" - client = cozo_client() - user_id = uuid4() - developer_id = uuid4() - - create_user_query( - user_id=user_id, - developer_id=developer_id, - name="test user", - about="test user about", - client=client, - ) - - # Verify that the 'updated_at' timestamp is greater than the 'created_at' timestamp, indicating a successful update. - update_result = update_user_query( - user_id=user_id, - developer_id=developer_id, - name="updated user", - about="updated user about", - client=client, - ) - - data = update_result.iloc[0].to_dict() - - assert data["updated_at"] > data["created_at"] - - -@test("model: get user not exists") -def _(): - """Test that retrieving a non-existent user returns an empty result.""" - client = cozo_client() - user_id = uuid4() - developer_id = uuid4() - - # Ensure that the query for an existing user returns exactly one result. - result = get_user_query( - user_id=user_id, - developer_id=developer_id, - client=client, - ) - - assert len(result["id"]) == 0 - - -@test("model: get user exists") -def _(): - """Test that retrieving an existing user returns the correct user information.""" - client = cozo_client() - user_id = uuid4() - developer_id = uuid4() - - result = create_user_query( - user_id=user_id, - developer_id=developer_id, - name="test user", - about="test user about", - client=client, - ) - - result = get_user_query( - user_id=user_id, - developer_id=developer_id, - client=client, - ) - - assert len(result["id"]) == 1 - - -@test("model: list users") -def _(): - """Test that listing users returns a collection of user information.""" - client = cozo_client() - developer_id = uuid4() - - result = list_users_query( - developer_id=developer_id, - client=client, - ) - - assert len(result["id"]) == 0 +# """This module contains tests for user-related queries against the 'cozodb' database. It includes tests for creating, updating, and retrieving user information.""" + +# # Tests for user queries +# from uuid import uuid4 + +# from cozo_migrate.api import init, apply +# from pycozo import Client +# from ward import raises, test + +# from .create_user import create_user_query +# from .get_user import get_user_query +# from .list_users import list_users_query +# from .update_user import update_user_query + + +# def cozo_client(migrations_dir: str = "./migrations"): +# """Initializes a new Cozo client for testing, applying all migrations to ensure the database schema is up to date.""" +# # Create a new client for each test +# # and initialize the schema. +# client = Client() + +# init(client) +# apply(client, migrations_dir=migrations_dir, all_=True) + +# return client + + +# @test("model: create user") +# def _(): +# """Test that a user can be successfully created.""" +# client = cozo_client() +# user_id = uuid4() +# developer_id = uuid4() + +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="test user", +# about="test user about", +# client=client, +# ) + + +# @test("model: create user twice should fail") +# def _(): +# """Test that attempting to create the same user twice results in a failure.""" +# client = cozo_client() +# user_id = uuid4() +# developer_id = uuid4() + +# # Expect an exception to be raised as creating the same user twice should not be allowed. +# # Should fail because the user already exists. +# with raises(Exception): +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="test user", +# about="test user about", +# client=client, +# ) + +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="test user", +# about="test user about", +# client=client, +# ) + + +# @test("model: update non-existent user should fail") +# def _(): +# """Test that attempting to update a non-existent user results in a failure.""" +# client = cozo_client() +# user_id = uuid4() +# developer_id = uuid4() + +# # Should fail because the user doecn't exists. +# with raises(Exception): +# update_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="test user", +# about="test user about", +# client=client, +# ) + + +# @test("model: update user") +# def _(): +# """Test that an existing user's information can be successfully updated.""" +# client = cozo_client() +# user_id = uuid4() +# developer_id = uuid4() + +# create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="test user", +# about="test user about", +# client=client, +# ) + +# # Verify that the 'updated_at' timestamp is greater than the 'created_at' timestamp, indicating a successful update. +# update_result = update_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="updated user", +# about="updated user about", +# client=client, +# ) + +# data = update_result.iloc[0].to_dict() + +# assert data["updated_at"] > data["created_at"] + + +# @test("model: get user not exists") +# def _(): +# """Test that retrieving a non-existent user returns an empty result.""" +# client = cozo_client() +# user_id = uuid4() +# developer_id = uuid4() + +# # Ensure that the query for an existing user returns exactly one result. +# result = get_user_query( +# user_id=user_id, +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["id"]) == 0 + + +# @test("model: get user exists") +# def _(): +# """Test that retrieving an existing user returns the correct user information.""" +# client = cozo_client() +# user_id = uuid4() +# developer_id = uuid4() + +# result = create_user_query( +# user_id=user_id, +# developer_id=developer_id, +# name="test user", +# about="test user about", +# client=client, +# ) + +# result = get_user_query( +# user_id=user_id, +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["id"]) == 1 + + +# @test("model: list users") +# def _(): +# """Test that listing users returns a collection of user information.""" +# client = cozo_client() +# developer_id = uuid4() + +# result = list_users_query( +# developer_id=developer_id, +# client=client, +# ) + +# assert len(result["id"]) == 0 diff --git a/agents-api/agents_api/models/user/update_user.py b/agents-api/agents_api/models/user/update_user.py index 756de53f1..15095b898 100644 --- a/agents-api/agents_api/models/user/update_user.py +++ b/agents-api/agents_api/models/user/update_user.py @@ -1,18 +1,30 @@ from uuid import UUID from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import UpdateUserRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, + partialclass, + rewrap_exceptions, verify_developer_id_query, verify_developer_owns_resource_query, wrap_in_class, ) +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) @wrap_in_class( ResourceUpdatedResponse, one=True, diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index 1ee8a4074..d2c474c5b 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -1,5 +1,6 @@ -from functools import wraps -from typing import Callable, ParamSpec, Type +from functools import partialmethod, wraps +import inspect +from typing import Any, Callable, ParamSpec, Type from uuid import UUID from pydantic import BaseModel @@ -11,6 +12,18 @@ P = ParamSpec("P") +def partialclass(cls, *args, **kwargs): + cls_signature = inspect.signature(cls) + bound = cls_signature.bind_partial(*args, **kwargs) + + # The `updated=()` argument is necessary to avoid a TypeError when using @wraps for a class + @wraps(cls, updated=()) + class NewCls(cls): + __init__ = partialmethod(cls.__init__, *bound.args, **bound.kwargs) + + return NewCls + + def verify_developer_id_query(developer_id: UUID | str) -> str: return f""" ?[developer_id] := @@ -127,3 +140,45 @@ def wrapper(*args, **kwargs): return wrapper return decorator + + +def rewrap_exceptions( + mapping: dict[ + Type[BaseException] | Callable[[BaseException], bool], + Type[BaseException] | Callable[[BaseException], BaseException], + ], + /, +): + mappers = [*mapping.items()] + + for i, (check, transform) in enumerate(mappers): + if inspect.isclass(check): + mappers[i] = (lambda e: isinstance(e, check), mappers[i][1]) + + if inspect.isclass(transform): + mappers[i] = (mappers[i][0], lambda e: transform(str(e))) + + def decorator(func: Callable[..., Any]): + @wraps(func) + def wrapper(*args, **kwargs): + nonlocal mappers + + try: + result = func(*args, **kwargs) + + except BaseException as e: + for check, transform in mappers: + if check(e): + raise transform(e) from e + + raise + + return result + + # Set the wrapped function as an attribute of the wrapper, + # forwards the __wrapped__ attribute if it exists. + setattr(wrapper, "__wrapped__", getattr(func, "__wrapped__", func)) + + return wrapper + + return decorator From e5aac60e1ac5cd1b588bedb73f0944da65cb299e Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 28 Jul 2024 19:40:43 -0400 Subject: [PATCH 34/36] reformat evthing Signed-off-by: Diwank Tomer --- .../agents_api/activities/embed_docs.py | 4 +- agents-api/agents_api/activities/logger.py | 1 - agents-api/agents_api/activities/mem_mgmt.py | 1 - .../agents_api/activities/summarization.py | 16 +++--- .../activities/task_steps/__init__.py | 11 ++-- .../agents_api/activities/truncation.py | 6 ++- agents-api/agents_api/activities/types.py | 6 ++- agents-api/agents_api/autogen/Sessions.py | 16 ++---- agents-api/agents_api/clients/cozo.py | 2 +- agents-api/agents_api/clients/embed.py | 3 +- agents-api/agents_api/clients/model.py | 2 +- agents-api/agents_api/clients/temporal.py | 9 ++-- agents-api/agents_api/clients/worker/types.py | 10 ++-- .../agents_api/clients/worker/worker.py | 4 +- .../agents_api/common/exceptions/agents.py | 1 + .../agents_api/common/exceptions/sessions.py | 2 +- .../agents_api/common/exceptions/users.py | 1 + .../agents_api/common/protocol/entries.py | 3 +- .../agents_api/common/protocol/sessions.py | 3 +- .../agents_api/common/protocol/tasks.py | 22 ++++---- agents-api/agents_api/common/utils/json.py | 2 +- .../agents_api/common/utils/messages.py | 3 +- agents-api/agents_api/dependencies/auth.py | 3 +- .../agents_api/dependencies/developer_id.py | 5 +- .../agents_api/embed_models_registry.py | 12 +++-- agents-api/agents_api/env.py | 2 +- agents-api/agents_api/model_registry.py | 13 ++--- .../agents_api/models/agent/create_agent.py | 4 +- .../models/agent/create_or_update_agent.py | 4 +- .../agents_api/models/agent/get_agent.py | 1 - .../agents_api/models/agent/list_agents.py | 1 - .../agents_api/models/agent/update_agent.py | 2 +- .../agents_api/models/docs/create_docs.py | 2 +- agents-api/agents_api/models/docs/get_docs.py | 1 - .../agents_api/models/docs/list_docs.py | 5 +- .../agents_api/models/docs/search_docs.py | 3 +- .../agents_api/models/entry/add_entries.py | 3 +- .../agents_api/models/entry/delete_entries.py | 1 - .../models/entry/entries_summarization.py | 3 +- .../agents_api/models/entry/get_entries.py | 1 - .../models/execution/create_execution.py | 3 +- .../execution/create_execution_transition.py | 3 +- .../models/execution/list_executions.py | 1 - .../models/execution/update_execution.py | 1 - .../session/create_or_update_session.py | 6 +-- .../models/session/create_session.py | 7 ++- .../models/session/delete_session.py | 5 +- .../models/session/get_cached_response.py | 4 +- .../agents_api/models/session/get_session.py | 1 - .../models/session/list_sessions.py | 7 ++- .../models/session/patch_session.py | 6 +-- .../agents_api/models/session/session_data.py | 1 - .../models/session/set_cached_response.py | 4 +- .../models/session/update_session.py | 8 ++- .../models/task/create_or_update_task.py | 7 ++- .../agents_api/models/task/create_task.py | 9 ++-- .../agents_api/models/task/delete_task.py | 5 +- agents-api/agents_api/models/task/get_task.py | 6 +-- .../agents_api/models/task/list_tasks.py | 1 - .../agents_api/models/task/patch_task.py | 9 ++-- .../agents_api/models/task/update_task.py | 5 +- .../agents_api/models/tools/create_tools.py | 5 +- .../agents_api/models/tools/delete_tools.py | 1 - .../agents_api/models/tools/get_tool.py | 1 - .../agents_api/models/tools/list_tools.py | 1 - .../agents_api/models/tools/patch_tool.py | 3 +- .../agents_api/models/tools/update_tool.py | 2 +- .../models/user/create_or_update_user.py | 6 +-- .../agents_api/models/user/create_user.py | 7 ++- agents-api/agents_api/models/user/get_user.py | 1 - .../agents_api/models/user/patch_user.py | 5 +- .../agents_api/models/user/update_user.py | 3 +- agents-api/agents_api/models/utils.py | 5 +- agents-api/agents_api/rec_sum/data.py | 1 - agents-api/agents_api/rec_sum/entities.py | 5 +- agents-api/agents_api/rec_sum/generate.py | 5 +- agents-api/agents_api/rec_sum/summarize.py | 3 +- agents-api/agents_api/rec_sum/trim.py | 3 +- .../agents_api/routers/agents/__init__.py | 5 +- .../agents_api/routers/agents/create_agent.py | 5 +- .../agents_api/routers/agents/delete_agent.py | 7 ++- .../routers/agents/get_agent_details.py | 5 +- .../agents_api/routers/agents/list_agents.py | 5 +- .../agents_api/routers/agents/patch_agent.py | 7 ++- .../agents_api/routers/agents/update_agent.py | 7 ++- agents-api/agents_api/routers/jobs/routers.py | 1 - .../agents_api/routers/sessions/__init__.py | 5 +- .../routers/sessions/create_session.py | 7 ++- .../routers/sessions/delete_session.py | 1 - .../routers/sessions/get_session.py | 3 +- .../routers/sessions/list_sessions.py | 3 +- .../routers/sessions/patch_session.py | 7 ++- .../agents_api/routers/sessions/protocol.py | 5 +- .../agents_api/routers/sessions/session.py | 35 ++++++------- .../routers/sessions/update_session.py | 9 ++-- .../agents_api/routers/tasks/routers.py | 50 +++++++++---------- .../agents_api/routers/users/__init__.py | 5 +- .../agents_api/routers/users/create_user.py | 3 +- .../routers/users/get_user_details.py | 7 ++- .../agents_api/routers/users/list_users.py | 5 +- .../agents_api/routers/users/patch_user.py | 7 ++- .../agents_api/routers/users/update_user.py | 7 ++- agents-api/agents_api/web.py | 23 ++++----- agents-api/agents_api/worker/__main__.py | 14 +++--- agents-api/agents_api/worker/codec.py | 9 ++-- agents-api/agents_api/workflows/co_density.py | 1 + .../agents_api/workflows/dialog_insights.py | 3 +- agents-api/agents_api/workflows/embed_docs.py | 1 + agents-api/agents_api/workflows/mem_mgmt.py | 3 +- agents-api/agents_api/workflows/mem_rating.py | 1 + .../workflows/relationship_summary.py | 1 + .../agents_api/workflows/salient_questions.py | 1 + .../agents_api/workflows/summarization.py | 1 + .../agents_api/workflows/task_execution.py | 1 - agents-api/agents_api/workflows/truncation.py | 1 + agents-api/pyproject.toml | 9 ++-- agents-api/tests/fixtures.py | 5 +- agents-api/tests/test_activities.py | 6 ++- agents-api/tests/test_agents.py | 6 ++- agents-api/tests/test_messages_truncation.py | 6 ++- agents-api/tests/test_sessions.py | 20 ++++---- agents-api/tests/test_tasks.py | 6 ++- agents-api/tests/test_users.py | 4 +- 123 files changed, 314 insertions(+), 359 deletions(-) diff --git a/agents-api/agents_api/activities/embed_docs.py b/agents-api/agents_api/activities/embed_docs.py index 633e4d4de..e2316d59e 100644 --- a/agents-api/agents_api/activities/embed_docs.py +++ b/agents-api/agents_api/activities/embed_docs.py @@ -1,11 +1,11 @@ from pydantic import UUID4 from temporalio import activity + +from agents_api.embed_models_registry import EmbeddingModel from agents_api.env import embedding_model_id from agents_api.models.docs.embed_docs import ( embed_docs_snippets_query, ) -from agents_api.embed_models_registry import EmbeddingModel - snippet_embed_instruction = "Encode this passage for retrieval: " diff --git a/agents-api/agents_api/activities/logger.py b/agents-api/agents_api/activities/logger.py index 4880d0652..f3c31fece 100644 --- a/agents-api/agents_api/activities/logger.py +++ b/agents-api/agents_api/activities/logger.py @@ -1,6 +1,5 @@ import logging - logger = logging.getLogger(__name__) h = logging.StreamHandler() fmt = logging.Formatter("[%(asctime)s/%(levelname)s] - %(message)s") diff --git a/agents-api/agents_api/activities/mem_mgmt.py b/agents-api/agents_api/activities/mem_mgmt.py index 56716e724..4f661ca46 100644 --- a/agents-api/agents_api/activities/mem_mgmt.py +++ b/agents-api/agents_api/activities/mem_mgmt.py @@ -7,7 +7,6 @@ from ..clients.model import julep_client from .types import ChatML, MemoryManagementTaskArgs - example_previous_memory = """ Speaker 1: Composes and listens to music. Likes to buy basketball shoes but doesn't wear them often. """.strip() diff --git a/agents-api/agents_api/activities/summarization.py b/agents-api/agents_api/activities/summarization.py index 03a5f0d79..81e694bd5 100644 --- a/agents-api/agents_api/activities/summarization.py +++ b/agents-api/agents_api/activities/summarization.py @@ -1,22 +1,24 @@ #!/usr/bin/env python3 import asyncio -from uuid import UUID -from typing import Callable from textwrap import dedent -from temporalio import activity +from typing import Callable +from uuid import UUID + from litellm import acompletion +from temporalio import activity + +from agents_api.common.protocol.entries import Entry from agents_api.models.entry.entries_summarization import ( - get_toplevel_entries_query, entries_summarization_query, + get_toplevel_entries_query, ) -from agents_api.common.protocol.entries import Entry -from ..model_registry import LOCAL_MODELS -from ..env import model_inference_url, model_api_key, summarization_model_name from agents_api.rec_sum.entities import get_entities from agents_api.rec_sum.summarize import summarize_messages from agents_api.rec_sum.trim import trim_messages +from ..env import model_api_key, model_inference_url, summarization_model_name +from ..model_registry import LOCAL_MODELS example_previous_memory = """ Speaker 1: Composes and listens to music. Likes to buy basketball shoes but doesn't wear them often. diff --git a/agents-api/agents_api/activities/task_steps/__init__.py b/agents-api/agents_api/activities/task_steps/__init__.py index e376c4782..465697ff8 100644 --- a/agents-api/agents_api/activities/task_steps/__init__.py +++ b/agents-api/agents_api/activities/task_steps/__init__.py @@ -1,33 +1,30 @@ import asyncio +from uuid import uuid4 # import celpy from openai.types.chat.chat_completion import ChatCompletion from temporalio import activity -from uuid import uuid4 from ...autogen.openapi_model import ( - PromptWorkflowStep, # EvaluateWorkflowStep, # YieldWorkflowStep, # ToolCallWorkflowStep, # ErrorWorkflowStep, # IfElseWorkflowStep, InputChatMLMessage, + PromptWorkflowStep, ) - +from ...clients.worker.types import ChatML from ...common.protocol.tasks import ( StepContext, TransitionInfo, ) - from ...common.utils.template import render_template - from ...models.execution.create_execution_transition import ( create_execution_transition_query, ) -from ...routers.sessions.session import llm_generate from ...routers.sessions.protocol import Settings -from ...clients.worker.types import ChatML +from ...routers.sessions.session import llm_generate @activity.defn diff --git a/agents-api/agents_api/activities/truncation.py b/agents-api/agents_api/activities/truncation.py index cbe0ee730..190190a79 100644 --- a/agents-api/agents_api/activities/truncation.py +++ b/agents-api/agents_api/activities/truncation.py @@ -1,9 +1,11 @@ from uuid import UUID + from temporalio import activity -from agents_api.models.entry.entries_summarization import get_toplevel_entries_query -from agents_api.models.entry.delete_entries import delete_entries + from agents_api.autogen.openapi_model import Role from agents_api.common.protocol.entries import Entry +from agents_api.models.entry.delete_entries import delete_entries +from agents_api.models.entry.entries_summarization import get_toplevel_entries_query def get_extra_entries(messages: list[Entry], token_count_threshold: int) -> list[UUID]: diff --git a/agents-api/agents_api/activities/types.py b/agents-api/agents_api/activities/types.py index 37fd8015d..4fa1d4d46 100644 --- a/agents-api/agents_api/activities/types.py +++ b/agents-api/agents_api/activities/types.py @@ -25,10 +25,12 @@ class ChatML(BaseModel): token_count: Optional[int] = None -class BaseTask(BaseModel): ... +class BaseTask(BaseModel): + ... -class BaseTaskArgs(BaseModel): ... +class BaseTaskArgs(BaseModel): + ... class AddPrinciplesTaskArgs(BaseTaskArgs): diff --git a/agents-api/agents_api/autogen/Sessions.py b/agents-api/agents_api/autogen/Sessions.py index f20480d96..89f5f590d 100644 --- a/agents-api/agents_api/autogen/Sessions.py +++ b/agents-api/agents_api/autogen/Sessions.py @@ -27,9 +27,7 @@ class CreateSessionRequest(BaseModel): Agent ID of agent associated with this session """ agents: list[UUID] | None = None - situation: str = ( - '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' - ) + situation: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' """ A specific situation that sets the background for this session """ @@ -56,9 +54,7 @@ class PatchSessionRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - situation: str = ( - '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' - ) + situation: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' """ A specific situation that sets the background for this session """ @@ -81,9 +77,7 @@ class Session(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - situation: str = ( - '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' - ) + situation: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' """ A specific situation that sets the background for this session """ @@ -150,9 +144,7 @@ class UpdateSessionRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - situation: str = ( - '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' - ) + situation: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{"\n\n"}}\n\n{%- if agent.instructions -%}\nInstructions:{{"\n"}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{"\n"}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"\n"}}\n{%- endif -%}\n\n{%- if tools -%}\nTools:{{"\n"}}\n {%- for tool in tools -%}\n {%- if tool.type == "function" -%}\n - {{tool.function.name}}\n {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{"\n"}}\n {%- else -%}\n - {{ 0/0 }} {# Error: Other tool types aren\'t supported yet. #}\n {%- endif -%}\n {%- endfor -%}\n{{"\n\n"}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{"\n"}}\n {%- for doc in docs -%}\n {{doc.title}}{{"\n"}}\n {%- if doc.content is string -%}\n {{doc.content}}{{"\n"}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{"\n"}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}' """ A specific situation that sets the background for this session """ diff --git a/agents-api/agents_api/clients/cozo.py b/agents-api/agents_api/clients/cozo.py index 66a155d02..c9fafe710 100644 --- a/agents-api/agents_api/clients/cozo.py +++ b/agents-api/agents_api/clients/cozo.py @@ -1,6 +1,6 @@ from pycozo.client import Client -from ..env import cozo_host, cozo_auth +from ..env import cozo_auth, cozo_host options = {"host": cozo_host} if cozo_auth: diff --git a/agents-api/agents_api/clients/embed.py b/agents-api/agents_api/clients/embed.py index 81f0bf07a..1176585a8 100644 --- a/agents-api/agents_api/clients/embed.py +++ b/agents-api/agents_api/clients/embed.py @@ -1,5 +1,6 @@ import httpx -from ..env import embedding_service_url, truncate_embed_text, embedding_model_id + +from ..env import embedding_model_id, embedding_service_url, truncate_embed_text async def embed( diff --git a/agents-api/agents_api/clients/model.py b/agents-api/agents_api/clients/model.py index d4b504267..648cc8d57 100644 --- a/agents-api/agents_api/clients/model.py +++ b/agents-api/agents_api/clients/model.py @@ -1,6 +1,6 @@ from openai import AsyncOpenAI -from ..env import model_inference_url, model_api_key, openai_api_key +from ..env import model_api_key, model_inference_url, openai_api_key openai_client = AsyncOpenAI(api_key=openai_api_key) diff --git a/agents-api/agents_api/clients/temporal.py b/agents-api/agents_api/clients/temporal.py index 9ccac2938..57560b880 100644 --- a/agents-api/agents_api/clients/temporal.py +++ b/agents-api/agents_api/clients/temporal.py @@ -1,11 +1,14 @@ -from temporalio.client import Client, TLSConfig from uuid import UUID + +from temporalio.client import Client, TLSConfig + from agents_api.env import ( - temporal_worker_url, - temporal_namespace, temporal_client_cert, + temporal_namespace, temporal_private_key, + temporal_worker_url, ) + from ..common.protocol.tasks import ExecutionInput diff --git a/agents-api/agents_api/clients/worker/types.py b/agents-api/agents_api/clients/worker/types.py index 694559739..10ebe7e2a 100644 --- a/agents-api/agents_api/clients/worker/types.py +++ b/agents-api/agents_api/clients/worker/types.py @@ -1,9 +1,11 @@ from typing import Callable, Literal, Optional, Protocol from uuid import UUID + from pydantic import BaseModel + from agents_api.autogen.openapi_model import ( - ChatMLTextContentPart, ChatMLImageContentPart, + ChatMLTextContentPart, ) @@ -28,10 +30,12 @@ class ChatML(BaseModel): token_count: Optional[int] = None -class BaseTask(BaseModel): ... +class BaseTask(BaseModel): + ... -class BaseTaskArgs(BaseModel): ... +class BaseTaskArgs(BaseModel): + ... class MemoryManagementTaskArgs(BaseTaskArgs): diff --git a/agents-api/agents_api/clients/worker/worker.py b/agents-api/agents_api/clients/worker/worker.py index 44019b17b..d7bcacc2b 100644 --- a/agents-api/agents_api/clients/worker/worker.py +++ b/agents-api/agents_api/clients/worker/worker.py @@ -1,8 +1,10 @@ import httpx + from agents_api.env import worker_url + from .types import ( - MemoryManagementTaskArgs, MemoryManagementTask, + MemoryManagementTaskArgs, ) diff --git a/agents-api/agents_api/common/exceptions/agents.py b/agents-api/agents_api/common/exceptions/agents.py index f1cf04cdc..c412eba35 100644 --- a/agents-api/agents_api/common/exceptions/agents.py +++ b/agents-api/agents_api/common/exceptions/agents.py @@ -1,6 +1,7 @@ """Defines custom exceptions for agent-related operations in the agents API.""" from uuid import UUID + from . import BaseCommonException diff --git a/agents-api/agents_api/common/exceptions/sessions.py b/agents-api/agents_api/common/exceptions/sessions.py index b4101989b..d6c04aff5 100644 --- a/agents-api/agents_api/common/exceptions/sessions.py +++ b/agents-api/agents_api/common/exceptions/sessions.py @@ -5,8 +5,8 @@ """ from uuid import UUID -from . import BaseCommonException +from . import BaseCommonException """ Base exception class for session-related errors. diff --git a/agents-api/agents_api/common/exceptions/users.py b/agents-api/agents_api/common/exceptions/users.py index 2f5674145..2f7f58ed6 100644 --- a/agents-api/agents_api/common/exceptions/users.py +++ b/agents-api/agents_api/common/exceptions/users.py @@ -1,6 +1,7 @@ """This module defines custom exceptions related to user operations in the agents-api.""" from uuid import UUID + from . import BaseCommonException diff --git a/agents-api/agents_api/common/protocol/entries.py b/agents-api/agents_api/common/protocol/entries.py index 1a06e089f..699404d73 100644 --- a/agents-api/agents_api/common/protocol/entries.py +++ b/agents-api/agents_api/common/protocol/entries.py @@ -3,9 +3,10 @@ from uuid import UUID, uuid4 from pydantic import BaseModel, Field, computed_field + from agents_api.autogen.openapi_model import ( - ChatMLRole, ChatMLImageContentPart, + ChatMLRole, ChatMLTextContentPart, ) from agents_api.common.utils.datetime import utcnow diff --git a/agents-api/agents_api/common/protocol/sessions.py b/agents-api/agents_api/common/protocol/sessions.py index 683b36aaf..a8741dad3 100644 --- a/agents-api/agents_api/common/protocol/sessions.py +++ b/agents-api/agents_api/common/protocol/sessions.py @@ -3,14 +3,13 @@ It includes definitions for session settings and session data models. """ +from typing import Dict, Optional from uuid import UUID from pydantic import BaseModel from .agents import AgentDefaultSettings -from typing import Optional, Dict - class SessionSettings(AgentDefaultSettings): """ diff --git a/agents-api/agents_api/common/protocol/tasks.py b/agents-api/agents_api/common/protocol/tasks.py index 5fc0f34b1..3024e8bb9 100644 --- a/agents-api/agents_api/common/protocol/tasks.py +++ b/agents-api/agents_api/common/protocol/tasks.py @@ -1,24 +1,23 @@ from datetime import datetime from typing import Annotated, Any, List, Literal, Tuple -from pydantic import BaseModel, Field, UUID4, computed_field +from pydantic import UUID4, BaseModel, Field, computed_field from ...autogen.openapi_model import ( - User, Agent, - Session, - Tool, - FunctionDef, - PromptStep, - EvaluateStep, - YieldStep, - ToolCallStep, ErrorWorkflowStep, + EvaluateStep, + Execution, + FunctionDef, IfElseWorkflowStep, + PromptStep, + Session, Task, - Execution, + Tool, + ToolCallStep, + User, + YieldStep, ) - from ...models.execution.get_execution_input import get_execution_input_query from ..utils.cozo import uuid_int_list_to_uuid4 @@ -63,7 +62,6 @@ class TaskSpec(BaseModel): class TaskProtocol(SerializableTask): @classmethod def from_cozo_data(cls, task_data: dict[str, Any]) -> "SerializableTask": - workflows = task_data.pop("workflows") assert len(workflows) > 0 diff --git a/agents-api/agents_api/common/utils/json.py b/agents-api/agents_api/common/utils/json.py index b5d4857ae..227ad48bc 100644 --- a/agents-api/agents_api/common/utils/json.py +++ b/agents-api/agents_api/common/utils/json.py @@ -1,8 +1,8 @@ """This module provides JSON utilities, including a custom JSON encoder for handling specific object types and a utility function for JSON serialization.""" import json -from uuid import UUID from typing import Any +from uuid import UUID class CustomJSONEncoder(json.JSONEncoder): diff --git a/agents-api/agents_api/common/utils/messages.py b/agents-api/agents_api/common/utils/messages.py index 14fe817cc..fd971296c 100644 --- a/agents-api/agents_api/common/utils/messages.py +++ b/agents-api/agents_api/common/utils/messages.py @@ -1,8 +1,9 @@ import json from typing import cast + from agents_api.autogen.openapi_model import ( - ChatMLTextContentPart, ChatMLImageContentPart, + ChatMLTextContentPart, ) diff --git a/agents-api/agents_api/dependencies/auth.py b/agents-api/agents_api/dependencies/auth.py index 5df7787ad..0054cb1cc 100644 --- a/agents-api/agents_api/dependencies/auth.py +++ b/agents-api/agents_api/dependencies/auth.py @@ -1,10 +1,9 @@ +from fastapi import HTTPException, Security from fastapi.security.api_key import APIKeyHeader -from fastapi import Security, HTTPException from starlette.status import HTTP_403_FORBIDDEN from ..env import api_key, api_key_header_name - api_key_header = APIKeyHeader(name=api_key_header_name, auto_error=False) diff --git a/agents-api/agents_api/dependencies/developer_id.py b/agents-api/agents_api/dependencies/developer_id.py index 4b173b2f4..a088389b5 100644 --- a/agents-api/agents_api/dependencies/developer_id.py +++ b/agents-api/agents_api/dependencies/developer_id.py @@ -1,5 +1,6 @@ import uuid from typing import Annotated + from fastapi import Header from pydantic import validate_email from pydantic_core import PydanticCustomError @@ -9,7 +10,7 @@ async def get_developer_id( - x_developer_id: Annotated[uuid.UUID | None, Header()] = None + x_developer_id: Annotated[uuid.UUID | None, Header()] = None, ): if skip_check_developer_headers: return x_developer_id or uuid.UUID("00000000-0000-0000-0000-000000000000") @@ -27,7 +28,7 @@ async def get_developer_id( async def get_developer_email( - x_developer_email: Annotated[str | None, Header()] = None + x_developer_email: Annotated[str | None, Header()] = None, ): if skip_check_developer_headers: return x_developer_email or "unknown_user@mail.com" diff --git a/agents-api/agents_api/embed_models_registry.py b/agents-api/agents_api/embed_models_registry.py index aa5f5ee5a..fe125fefb 100644 --- a/agents-api/agents_api/embed_models_registry.py +++ b/agents-api/agents_api/embed_models_registry.py @@ -1,16 +1,18 @@ -import tiktoken -import numpy as np -from typing import TypedDict, Any from dataclasses import dataclass +from typing import Any, TypedDict + +import numpy as np +import tiktoken from tokenizers import Tokenizer -from agents_api.clients.model import openai_client + from agents_api.clients.embed import embed +from agents_api.clients.model import openai_client +from agents_api.env import embedding_service_url from agents_api.exceptions import ( ModelNotSupportedError, PromptTooBigError, UnknownTokenizerError, ) -from agents_api.env import embedding_service_url def normalize_l2(x): diff --git a/agents-api/agents_api/env.py b/agents-api/agents_api/env.py index eba083500..7fa4fe94c 100644 --- a/agents-api/agents_api/env.py +++ b/agents-api/agents_api/env.py @@ -4,8 +4,8 @@ """ from pprint import pprint -from environs import Env +from environs import Env # Initialize the Env object for environment variable parsing. env = Env() diff --git a/agents-api/agents_api/model_registry.py b/agents-api/agents_api/model_registry.py index 69670c521..a7bf13e39 100644 --- a/agents-api/agents_api/model_registry.py +++ b/agents-api/agents_api/model_registry.py @@ -4,17 +4,18 @@ import ast import json +import xml.etree.ElementTree as ET +from typing import Dict, Literal, Optional + +import litellm +from litellm.utils import get_valid_models +from pydantic import BaseModel + from agents_api.clients.worker.types import ChatML from agents_api.common.exceptions.agents import ( AgentModelNotValid, MissingAgentModelAPIKeyError, ) -import litellm -from litellm.utils import get_valid_models -from pydantic import BaseModel -from typing import Dict, Literal, Optional -import xml.etree.ElementTree as ET - GPT4_MODELS: Dict[str, int] = { # stable model names: diff --git a/agents-api/agents_api/models/agent/create_agent.py b/agents-api/agents_api/models/agent/create_agent.py index 5199ca1eb..dd67a8e04 100644 --- a/agents-api/agents_api/models/agent/create_agent.py +++ b/agents-api/agents_api/models/agent/create_agent.py @@ -4,12 +4,12 @@ """ from uuid import UUID, uuid4 + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - from ...autogen.openapi_model import Agent, CreateAgentRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( diff --git a/agents-api/agents_api/models/agent/create_or_update_agent.py b/agents-api/agents_api/models/agent/create_or_update_agent.py index 99be1e108..1b0e5a1bc 100644 --- a/agents-api/agents_api/models/agent/create_or_update_agent.py +++ b/agents-api/agents_api/models/agent/create_or_update_agent.py @@ -4,12 +4,12 @@ """ from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - from ...autogen.openapi_model import Agent, CreateOrUpdateAgentRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( diff --git a/agents-api/agents_api/models/agent/get_agent.py b/agents-api/agents_api/models/agent/get_agent.py index 214779a9e..f57a4addc 100644 --- a/agents-api/agents_api/models/agent/get_agent.py +++ b/agents-api/agents_api/models/agent/get_agent.py @@ -5,7 +5,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import Agent from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/agent/list_agents.py b/agents-api/agents_api/models/agent/list_agents.py index e44876565..1b38e7454 100644 --- a/agents-api/agents_api/models/agent/list_agents.py +++ b/agents-api/agents_api/models/agent/list_agents.py @@ -6,7 +6,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import Agent from ...common.utils import json from ..utils import ( diff --git a/agents-api/agents_api/models/agent/update_agent.py b/agents-api/agents_api/models/agent/update_agent.py index 42b1bd80b..44acc4794 100644 --- a/agents-api/agents_api/models/agent/update_agent.py +++ b/agents-api/agents_api/models/agent/update_agent.py @@ -5,7 +5,7 @@ from pycozo.client import QueryException from pydantic import ValidationError -from ...autogen.openapi_model import UpdateAgentRequest, ResourceUpdatedResponse +from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateAgentRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/docs/create_docs.py b/agents-api/agents_api/models/docs/create_docs.py index ca8f8c1dd..fd2edc645 100644 --- a/agents-api/agents_api/models/docs/create_docs.py +++ b/agents-api/agents_api/models/docs/create_docs.py @@ -4,8 +4,8 @@ from beartype import beartype from ...common.utils.cozo import cozo_process_mutate_data -from ..utils import cozo_query from ...common.utils.datetime import utcnow +from ..utils import cozo_query @cozo_query diff --git a/agents-api/agents_api/models/docs/get_docs.py b/agents-api/agents_api/models/docs/get_docs.py index 4bb06c0f5..862b17a0c 100644 --- a/agents-api/agents_api/models/docs/get_docs.py +++ b/agents-api/agents_api/models/docs/get_docs.py @@ -5,7 +5,6 @@ from beartype import beartype - from ..utils import cozo_query diff --git a/agents-api/agents_api/models/docs/list_docs.py b/agents-api/agents_api/models/docs/list_docs.py index a6c3ac4c6..576c4a7f6 100644 --- a/agents-api/agents_api/models/docs/list_docs.py +++ b/agents-api/agents_api/models/docs/list_docs.py @@ -1,11 +1,10 @@ """This module contains functions for querying document-related data from the 'cozodb' database using datalog queries.""" -from beartype import beartype - import json -from typing import Literal, Any +from typing import Any, Literal from uuid import UUID +from beartype import beartype from ..utils import cozo_query diff --git a/agents-api/agents_api/models/docs/search_docs.py b/agents-api/agents_api/models/docs/search_docs.py index 80cb030af..7c2ad90fa 100644 --- a/agents-api/agents_api/models/docs/search_docs.py +++ b/agents-api/agents_api/models/docs/search_docs.py @@ -1,10 +1,9 @@ """This module contains functions for searching documents in the CozoDB based on embedding queries.""" -from beartype import beartype - from typing import Literal from uuid import UUID +from beartype import beartype from ..utils import cozo_query diff --git a/agents-api/agents_api/models/entry/add_entries.py b/agents-api/agents_api/models/entry/add_entries.py index 704d0bf26..123858d24 100644 --- a/agents-api/agents_api/models/entry/add_entries.py +++ b/agents-api/agents_api/models/entry/add_entries.py @@ -1,11 +1,10 @@ import pandas as pd - from beartype import beartype from ...common.protocol.entries import Entry -from ..utils import cozo_query from ...common.utils.datetime import utcnow from ...common.utils.messages import content_to_json +from ..utils import cozo_query @cozo_query diff --git a/agents-api/agents_api/models/entry/delete_entries.py b/agents-api/agents_api/models/entry/delete_entries.py index 7bdb2dce7..6e1f1f84a 100644 --- a/agents-api/agents_api/models/entry/delete_entries.py +++ b/agents-api/agents_api/models/entry/delete_entries.py @@ -2,7 +2,6 @@ from beartype import beartype - from ..utils import cozo_query diff --git a/agents-api/agents_api/models/entry/entries_summarization.py b/agents-api/agents_api/models/entry/entries_summarization.py index 30b8ea9bc..4a94bdc19 100644 --- a/agents-api/agents_api/models/entry/entries_summarization.py +++ b/agents-api/agents_api/models/entry/entries_summarization.py @@ -1,9 +1,8 @@ """This module contains functions for querying and summarizing entry data in the 'cozodb' database.""" -from beartype import beartype - from uuid import UUID +from beartype import beartype from ...common.protocol.entries import Entry from ...common.utils.messages import content_to_json diff --git a/agents-api/agents_api/models/entry/get_entries.py b/agents-api/agents_api/models/entry/get_entries.py index e1d48e8cd..be9cbe347 100644 --- a/agents-api/agents_api/models/entry/get_entries.py +++ b/agents-api/agents_api/models/entry/get_entries.py @@ -2,7 +2,6 @@ from beartype import beartype - from ..utils import cozo_query diff --git a/agents-api/agents_api/models/execution/create_execution.py b/agents-api/agents_api/models/execution/create_execution.py index db4198091..649d72c39 100644 --- a/agents-api/agents_api/models/execution/create_execution.py +++ b/agents-api/agents_api/models/execution/create_execution.py @@ -5,8 +5,7 @@ from pycozo.client import QueryException from pydantic import ValidationError - -from ...autogen.openapi_model import Execution, CreateExecutionRequest +from ...autogen.openapi_model import CreateExecutionRequest, Execution from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/execution/create_execution_transition.py b/agents-api/agents_api/models/execution/create_execution_transition.py index 280b84376..48c17ea5a 100644 --- a/agents-api/agents_api/models/execution/create_execution_transition.py +++ b/agents-api/agents_api/models/execution/create_execution_transition.py @@ -5,7 +5,7 @@ from pycozo.client import QueryException from pydantic import ValidationError -from ...autogen.openapi_model import Transition, CreateTransitionRequest +from ...autogen.openapi_model import CreateTransitionRequest, Transition from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, @@ -35,7 +35,6 @@ def create_execution_transition( data: CreateTransitionRequest, task_token: str | None = None, ) -> tuple[str, dict]: - transition_id = transition_id or uuid4() data.metadata = data.metadata or {} diff --git a/agents-api/agents_api/models/execution/list_executions.py b/agents-api/agents_api/models/execution/list_executions.py index 4b4f01636..ea2d7c923 100644 --- a/agents-api/agents_api/models/execution/list_executions.py +++ b/agents-api/agents_api/models/execution/list_executions.py @@ -6,7 +6,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import Execution from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/execution/update_execution.py b/agents-api/agents_api/models/execution/update_execution.py index afce49cc6..542fcd241 100644 --- a/agents-api/agents_api/models/execution/update_execution.py +++ b/agents-api/agents_api/models/execution/update_execution.py @@ -5,7 +5,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import ( ResourceUpdatedResponse, UpdateExecutionRequest, diff --git a/agents-api/agents_api/models/session/create_or_update_session.py b/agents-api/agents_api/models/session/create_or_update_session.py index e27e8bc3d..d818aa7ac 100644 --- a/agents-api/agents_api/models/session/create_or_update_session.py +++ b/agents-api/agents_api/models/session/create_or_update_session.py @@ -1,11 +1,10 @@ -from beartype import beartype - from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import ( CreateOrUpdateSessionRequest, ResourceUpdatedResponse, @@ -46,7 +45,6 @@ def create_or_update_session( developer_id: UUID, data: CreateOrUpdateSessionRequest, ) -> tuple[str, dict]: - data.metadata = data.metadata or {} session_data = data.model_dump() diff --git a/agents-api/agents_api/models/session/create_session.py b/agents-api/agents_api/models/session/create_session.py index 410d66880..38ce3a158 100644 --- a/agents-api/agents_api/models/session/create_session.py +++ b/agents-api/agents_api/models/session/create_session.py @@ -4,14 +4,13 @@ """ from uuid import UUID, uuid4 + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - - -from ...autogen.openapi_model import Session, CreateSessionRequest +from ...autogen.openapi_model import CreateSessionRequest, Session from ..utils import ( cozo_query, partialclass, diff --git a/agents-api/agents_api/models/session/delete_session.py b/agents-api/agents_api/models/session/delete_session.py index d40b0fa06..99a11d8b6 100644 --- a/agents-api/agents_api/models/session/delete_session.py +++ b/agents-api/agents_api/models/session/delete_session.py @@ -1,13 +1,12 @@ """This module contains the implementation for deleting sessions from the 'cozodb' database using datalog queries.""" from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - - from ...autogen.openapi_model import ResourceDeletedResponse from ...common.utils.datetime import utcnow from ..utils import ( diff --git a/agents-api/agents_api/models/session/get_cached_response.py b/agents-api/agents_api/models/session/get_cached_response.py index 226148bd6..5440a6703 100644 --- a/agents-api/agents_api/models/session/get_cached_response.py +++ b/agents-api/agents_api/models/session/get_cached_response.py @@ -1,7 +1,7 @@ -from ..utils import cozo_query - from beartype import beartype +from ..utils import cozo_query + @cozo_query @beartype diff --git a/agents-api/agents_api/models/session/get_session.py b/agents-api/agents_api/models/session/get_session.py index a74729463..43eb1e5a4 100644 --- a/agents-api/agents_api/models/session/get_session.py +++ b/agents-api/agents_api/models/session/get_session.py @@ -5,7 +5,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import make_session from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/session/list_sessions.py b/agents-api/agents_api/models/session/list_sessions.py index d8dbdfc7c..21f41ec11 100644 --- a/agents-api/agents_api/models/session/list_sessions.py +++ b/agents-api/agents_api/models/session/list_sessions.py @@ -1,13 +1,12 @@ """This module contains functions for querying session data from the 'cozodb' database.""" from typing import Any, Literal -from fastapi import HTTPException -from pycozo.client import QueryException -from pydantic import ValidationError from uuid import UUID from beartype import beartype - +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError from ...autogen.openapi_model import make_session from ...common.utils import json diff --git a/agents-api/agents_api/models/session/patch_session.py b/agents-api/agents_api/models/session/patch_session.py index a0d44f7db..870f26a9d 100644 --- a/agents-api/agents_api/models/session/patch_session.py +++ b/agents-api/agents_api/models/session/patch_session.py @@ -1,13 +1,12 @@ """This module contains functions for patching session data in the 'cozodb' database using datalog queries.""" +from uuid import UUID + from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from uuid import UUID - - from ...autogen.openapi_model import PatchSessionRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( @@ -19,7 +18,6 @@ wrap_in_class, ) - _fields = [ "situation", "summary", diff --git a/agents-api/agents_api/models/session/session_data.py b/agents-api/agents_api/models/session/session_data.py index 5d2c13996..404a13c44 100644 --- a/agents-api/agents_api/models/session/session_data.py +++ b/agents-api/agents_api/models/session/session_data.py @@ -1,7 +1,6 @@ from uuid import UUID from beartype import beartype - from pycozo.client import Client as CozoClient from ...clients.cozo import client as cozo_client diff --git a/agents-api/agents_api/models/session/set_cached_response.py b/agents-api/agents_api/models/session/set_cached_response.py index a322beaf3..8625f3f1b 100644 --- a/agents-api/agents_api/models/session/set_cached_response.py +++ b/agents-api/agents_api/models/session/set_cached_response.py @@ -1,7 +1,7 @@ -from ..utils import cozo_query - from beartype import beartype +from ..utils import cozo_query + @cozo_query @beartype diff --git a/agents-api/agents_api/models/session/update_session.py b/agents-api/agents_api/models/session/update_session.py index d4fd584e3..750c41e93 100644 --- a/agents-api/agents_api/models/session/update_session.py +++ b/agents-api/agents_api/models/session/update_session.py @@ -1,12 +1,11 @@ -from beartype import beartype - from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError - -from ...autogen.openapi_model import UpdateSessionRequest, ResourceUpdatedResponse +from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateSessionRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, @@ -54,7 +53,6 @@ def update_session( developer_id: UUID, data: UpdateSessionRequest, ) -> tuple[str, dict]: - update_data = data.model_dump(exclude_unset=True) session_update_cols, session_update_vals = cozo_process_mutate_data( diff --git a/agents-api/agents_api/models/task/create_or_update_task.py b/agents-api/agents_api/models/task/create_or_update_task.py index 7e61bb847..3341f86a7 100644 --- a/agents-api/agents_api/models/task/create_or_update_task.py +++ b/agents-api/agents_api/models/task/create_or_update_task.py @@ -4,16 +4,15 @@ """ from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - - from ...autogen.openapi_model import ( - ResourceUpdatedResponse, CreateOrUpdateTaskRequest, + ResourceUpdatedResponse, ) from ...common.utils.cozo import cozo_process_mutate_data from ...common.utils.datetime import utcnow diff --git a/agents-api/agents_api/models/task/create_task.py b/agents-api/agents_api/models/task/create_task.py index 7a9938ac4..b3765572a 100644 --- a/agents-api/agents_api/models/task/create_task.py +++ b/agents-api/agents_api/models/task/create_task.py @@ -3,21 +3,22 @@ It constructs and executes a datalog query to insert Task data. """ +import sys from uuid import UUID, uuid4 + from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -import sys if sys.version_info < (3, 11): - from typing_extensions import TypedDict, NotRequired + from typing_extensions import NotRequired, TypedDict else: - from typing import TypedDict, NotRequired + from typing import NotRequired, TypedDict from beartype import beartype -from ...autogen.openapi_model import Task, CreateTaskRequest, UpdateTaskRequest +from ...autogen.openapi_model import CreateTaskRequest, Task, UpdateTaskRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/task/delete_task.py b/agents-api/agents_api/models/task/delete_task.py index 88062f17a..9bc618e20 100644 --- a/agents-api/agents_api/models/task/delete_task.py +++ b/agents-api/agents_api/models/task/delete_task.py @@ -1,11 +1,10 @@ -from beartype import beartype - from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import ResourceDeletedResponse from ...common.utils.datetime import utcnow from ..utils import ( diff --git a/agents-api/agents_api/models/task/get_task.py b/agents-api/agents_api/models/task/get_task.py index a738ad4ff..f3608079b 100644 --- a/agents-api/agents_api/models/task/get_task.py +++ b/agents-api/agents_api/models/task/get_task.py @@ -1,11 +1,10 @@ -from beartype import beartype - from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError - from ..utils import ( cozo_query, partialclass, @@ -14,7 +13,6 @@ verify_developer_owns_resource_query, wrap_in_class, ) - from .create_task import spec_to_task diff --git a/agents-api/agents_api/models/task/list_tasks.py b/agents-api/agents_api/models/task/list_tasks.py index 14cced53e..699f879d3 100644 --- a/agents-api/agents_api/models/task/list_tasks.py +++ b/agents-api/agents_api/models/task/list_tasks.py @@ -14,7 +14,6 @@ verify_developer_owns_resource_query, wrap_in_class, ) - from .create_task import spec_to_task diff --git a/agents-api/agents_api/models/task/patch_task.py b/agents-api/agents_api/models/task/patch_task.py index d0a65a38f..dafeea940 100644 --- a/agents-api/agents_api/models/task/patch_task.py +++ b/agents-api/agents_api/models/task/patch_task.py @@ -4,14 +4,13 @@ """ from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - - -from ...autogen.openapi_model import ResourceUpdatedResponse, PatchTaskRequest +from ...autogen.openapi_model import PatchTaskRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, @@ -21,7 +20,7 @@ verify_developer_owns_resource_query, wrap_in_class, ) -from .create_task import task_to_spec, TaskSpec +from .create_task import TaskSpec, task_to_spec @rewrap_exceptions( diff --git a/agents-api/agents_api/models/task/update_task.py b/agents-api/agents_api/models/task/update_task.py index 1ba5743ab..631fb569b 100644 --- a/agents-api/agents_api/models/task/update_task.py +++ b/agents-api/agents_api/models/task/update_task.py @@ -4,13 +4,12 @@ """ from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - - from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateTaskRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( diff --git a/agents-api/agents_api/models/tools/create_tools.py b/agents-api/agents_api/models/tools/create_tools.py index 7f3c6d98e..81894642e 100644 --- a/agents-api/agents_api/models/tools/create_tools.py +++ b/agents-api/agents_api/models/tools/create_tools.py @@ -1,14 +1,13 @@ """This module contains functions for creating tools in the CozoDB database.""" from uuid import UUID, uuid4 + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - from ...autogen.openapi_model import CreateToolRequest, Tool - from ..utils import ( cozo_query, partialclass, diff --git a/agents-api/agents_api/models/tools/delete_tools.py b/agents-api/agents_api/models/tools/delete_tools.py index 7da38d41c..b97d57387 100644 --- a/agents-api/agents_api/models/tools/delete_tools.py +++ b/agents-api/agents_api/models/tools/delete_tools.py @@ -5,7 +5,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import ResourceDeletedResponse from ...common.utils.datetime import utcnow from ..utils import ( diff --git a/agents-api/agents_api/models/tools/get_tool.py b/agents-api/agents_api/models/tools/get_tool.py index 313876416..86576f9a3 100644 --- a/agents-api/agents_api/models/tools/get_tool.py +++ b/agents-api/agents_api/models/tools/get_tool.py @@ -5,7 +5,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import Tool from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/tools/list_tools.py b/agents-api/agents_api/models/tools/list_tools.py index 05637213b..d997c0aa6 100644 --- a/agents-api/agents_api/models/tools/list_tools.py +++ b/agents-api/agents_api/models/tools/list_tools.py @@ -6,7 +6,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import Tool from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/tools/patch_tool.py b/agents-api/agents_api/models/tools/patch_tool.py index 89dd7137e..b4874ffd3 100644 --- a/agents-api/agents_api/models/tools/patch_tool.py +++ b/agents-api/agents_api/models/tools/patch_tool.py @@ -1,10 +1,9 @@ from uuid import UUID - +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype from ...autogen.openapi_model import PatchToolRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data diff --git a/agents-api/agents_api/models/tools/update_tool.py b/agents-api/agents_api/models/tools/update_tool.py index ac81f14b3..aa1238643 100644 --- a/agents-api/agents_api/models/tools/update_tool.py +++ b/agents-api/agents_api/models/tools/update_tool.py @@ -17,7 +17,7 @@ def update_tool( agent_id: UUID, tool_id: UUID, data: UpdateToolRequest, - **kwargs + **kwargs, ) -> ResourceUpdatedResponse: # Same as patch_tool_query, but with a different request payload return patch_tool( diff --git a/agents-api/agents_api/models/user/create_or_update_user.py b/agents-api/agents_api/models/user/create_or_update_user.py index 16c948bb7..0f1796ff8 100644 --- a/agents-api/agents_api/models/user/create_or_update_user.py +++ b/agents-api/agents_api/models/user/create_or_update_user.py @@ -4,13 +4,13 @@ """ from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - -from ...autogen.openapi_model import User, CreateOrUpdateUserRequest +from ...autogen.openapi_model import CreateOrUpdateUserRequest, User from ..utils import ( cozo_query, partialclass, diff --git a/agents-api/agents_api/models/user/create_user.py b/agents-api/agents_api/models/user/create_user.py index 6b1a677bd..c5211b7ad 100644 --- a/agents-api/agents_api/models/user/create_user.py +++ b/agents-api/agents_api/models/user/create_user.py @@ -3,15 +3,14 @@ It defines a query for inserting user data into the 'users' relation. """ +from uuid import UUID, uuid4 + from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from uuid import uuid4, UUID - - -from ...autogen.openapi_model import User, CreateUserRequest +from ...autogen.openapi_model import CreateUserRequest, User from ..utils import ( cozo_query, partialclass, diff --git a/agents-api/agents_api/models/user/get_user.py b/agents-api/agents_api/models/user/get_user.py index 5af3eda5e..897930ae3 100644 --- a/agents-api/agents_api/models/user/get_user.py +++ b/agents-api/agents_api/models/user/get_user.py @@ -5,7 +5,6 @@ from pycozo.client import QueryException from pydantic import ValidationError - from ...autogen.openapi_model import User from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/user/patch_user.py b/agents-api/agents_api/models/user/patch_user.py index aa6156a27..91118c78c 100644 --- a/agents-api/agents_api/models/user/patch_user.py +++ b/agents-api/agents_api/models/user/patch_user.py @@ -1,13 +1,12 @@ """Module for generating datalog queries to update user information in the 'cozodb' database.""" from uuid import UUID + +from beartype import beartype from fastapi import HTTPException from pycozo.client import QueryException from pydantic import ValidationError -from beartype import beartype - - from ...autogen.openapi_model import PatchUserRequest, ResourceUpdatedResponse from ...common.utils.cozo import cozo_process_mutate_data from ...common.utils.datetime import utcnow diff --git a/agents-api/agents_api/models/user/update_user.py b/agents-api/agents_api/models/user/update_user.py index 15095b898..070c46619 100644 --- a/agents-api/agents_api/models/user/update_user.py +++ b/agents-api/agents_api/models/user/update_user.py @@ -5,8 +5,7 @@ from pycozo.client import QueryException from pydantic import ValidationError - -from ...autogen.openapi_model import UpdateUserRequest, ResourceUpdatedResponse +from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateUserRequest from ...common.utils.cozo import cozo_process_mutate_data from ..utils import ( cozo_query, diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index d2c474c5b..61e71870a 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -1,14 +1,13 @@ -from functools import partialmethod, wraps import inspect +from functools import partialmethod, wraps from typing import Any, Callable, ParamSpec, Type from uuid import UUID -from pydantic import BaseModel import pandas as pd +from pydantic import BaseModel from ..clients.cozo import client as cozo_client - P = ParamSpec("P") diff --git a/agents-api/agents_api/rec_sum/data.py b/agents-api/agents_api/rec_sum/data.py index 93e78851c..e7857a037 100644 --- a/agents-api/agents_api/rec_sum/data.py +++ b/agents-api/agents_api/rec_sum/data.py @@ -1,7 +1,6 @@ import json from pathlib import Path - module_directory = Path(__file__).parent diff --git a/agents-api/agents_api/rec_sum/entities.py b/agents-api/agents_api/rec_sum/entities.py index db6cba826..11346447c 100644 --- a/agents-api/agents_api/rec_sum/entities.py +++ b/agents-api/agents_api/rec_sum/entities.py @@ -1,14 +1,13 @@ import json -import pandas as pd - from typing import Any + +import pandas as pd from tenacity import retry, stop_after_attempt from .data import entities_example_chat from .generate import generate from .utils import chatml, get_names_from_session - ############## ## Entities ## ############## diff --git a/agents-api/agents_api/rec_sum/generate.py b/agents-api/agents_api/rec_sum/generate.py index e1a2eb607..5a8daa675 100644 --- a/agents-api/agents_api/rec_sum/generate.py +++ b/agents-api/agents_api/rec_sum/generate.py @@ -1,7 +1,8 @@ +from litellm import acompletion from tenacity import retry, stop_after_attempt, wait_fixed -from agents_api.env import model_inference_url, model_api_key + +from agents_api.env import model_api_key, model_inference_url from agents_api.model_registry import LOCAL_MODELS -from litellm import acompletion @retry(wait=wait_fixed(2), stop=stop_after_attempt(5)) diff --git a/agents-api/agents_api/rec_sum/summarize.py b/agents-api/agents_api/rec_sum/summarize.py index 4ae546e8b..97f39905b 100644 --- a/agents-api/agents_api/rec_sum/summarize.py +++ b/agents-api/agents_api/rec_sum/summarize.py @@ -4,8 +4,7 @@ from .data import summarize_example_chat, summarize_example_result from .generate import generate -from .utils import chatml, add_indices, get_names_from_session - +from .utils import add_indices, chatml, get_names_from_session ########## ## summarize ## diff --git a/agents-api/agents_api/rec_sum/trim.py b/agents-api/agents_api/rec_sum/trim.py index ef8ae4b73..eb6d15415 100644 --- a/agents-api/agents_api/rec_sum/trim.py +++ b/agents-api/agents_api/rec_sum/trim.py @@ -4,8 +4,7 @@ from .data import trim_example_chat, trim_example_result from .generate import generate -from .utils import chatml, add_indices, get_names_from_session - +from .utils import add_indices, chatml, get_names_from_session ########## ## Trim ## diff --git a/agents-api/agents_api/routers/agents/__init__.py b/agents-api/agents_api/routers/agents/__init__.py index ee2961f1b..54624e374 100644 --- a/agents-api/agents_api/routers/agents/__init__.py +++ b/agents-api/agents_api/routers/agents/__init__.py @@ -1,8 +1,7 @@ -from .router import router # noqa: F401 - from .create_agent import create_agent # noqa: F401 from .delete_agent import delete_agent # noqa: F401 from .get_agent_details import get_agent_details # noqa: F401 from .list_agents import list_agents # noqa: F401 -from .update_agent import update_agent # noqa: F401 from .patch_agent import patch_agent # noqa: F401 +from .router import router # noqa: F401 +from .update_agent import update_agent # noqa: F401 diff --git a/agents-api/agents_api/routers/agents/create_agent.py b/agents-api/agents_api/routers/agents/create_agent.py index 991a6a437..8b9e19205 100644 --- a/agents-api/agents_api/routers/agents/create_agent.py +++ b/agents-api/agents_api/routers/agents/create_agent.py @@ -4,11 +4,10 @@ from pydantic import UUID4 from starlette.status import HTTP_201_CREATED -from ...dependencies.developer_id import get_developer_id -from ...models.agent.create_agent import create_agent_query from ...autogen.openapi_model import CreateAgentRequest, ResourceCreatedResponse from ...common.utils.datetime import utcnow - +from ...dependencies.developer_id import get_developer_id +from ...models.agent.create_agent import create_agent_query from .router import router diff --git a/agents-api/agents_api/routers/agents/delete_agent.py b/agents-api/agents_api/routers/agents/delete_agent.py index 2183d6bf3..a8d24a3e2 100644 --- a/agents-api/agents_api/routers/agents/delete_agent.py +++ b/agents-api/agents_api/routers/agents/delete_agent.py @@ -4,12 +4,11 @@ from pydantic import UUID4 from starlette.status import HTTP_202_ACCEPTED, HTTP_404_NOT_FOUND -from ...dependencies.developer_id import get_developer_id -from ...models.agent.delete_agent import delete_agent_query +from ...autogen.openapi_model import ResourceDeletedResponse from ...common.exceptions.agents import AgentNotFoundError from ...common.utils.datetime import utcnow -from ...autogen.openapi_model import ResourceDeletedResponse - +from ...dependencies.developer_id import get_developer_id +from ...models.agent.delete_agent import delete_agent_query from .router import router diff --git a/agents-api/agents_api/routers/agents/get_agent_details.py b/agents-api/agents_api/routers/agents/get_agent_details.py index 174bb63b4..be90a53b7 100644 --- a/agents-api/agents_api/routers/agents/get_agent_details.py +++ b/agents-api/agents_api/routers/agents/get_agent_details.py @@ -4,11 +4,10 @@ from pydantic import UUID4 from starlette.status import HTTP_404_NOT_FOUND +from ...autogen.openapi_model import Agent +from ...common.exceptions.agents import AgentNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.agent.get_agent import get_agent_query -from ...common.exceptions.agents import AgentNotFoundError -from ...autogen.openapi_model import Agent - from .router import router diff --git a/agents-api/agents_api/routers/agents/list_agents.py b/agents-api/agents_api/routers/agents/list_agents.py index 0001aad89..de29d2555 100644 --- a/agents-api/agents_api/routers/agents/list_agents.py +++ b/agents-api/agents_api/routers/agents/list_agents.py @@ -1,12 +1,11 @@ -from typing import List, Annotated +from typing import Annotated, List from fastapi import Depends from pydantic import UUID4 +from ...autogen.openapi_model import Agent from ...dependencies.developer_id import get_developer_id from ...models.agent.list_agents import list_agents_query -from ...autogen.openapi_model import Agent - from .router import router diff --git a/agents-api/agents_api/routers/agents/patch_agent.py b/agents-api/agents_api/routers/agents/patch_agent.py index 5571fb67f..e44fe619e 100644 --- a/agents-api/agents_api/routers/agents/patch_agent.py +++ b/agents-api/agents_api/routers/agents/patch_agent.py @@ -2,13 +2,12 @@ from fastapi import Depends, HTTPException from pydantic import UUID4 -from starlette.status import HTTP_404_NOT_FOUND, HTTP_200_OK +from starlette.status import HTTP_200_OK, HTTP_404_NOT_FOUND +from ...autogen.openapi_model import PatchAgentRequest, ResourceUpdatedResponse +from ...common.exceptions.agents import AgentNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.agent.patch_agent import patch_agent_query -from ...common.exceptions.agents import AgentNotFoundError -from ...autogen.openapi_model import PatchAgentRequest, ResourceUpdatedResponse - from .router import router diff --git a/agents-api/agents_api/routers/agents/update_agent.py b/agents-api/agents_api/routers/agents/update_agent.py index 0e254131c..d6398ccc6 100644 --- a/agents-api/agents_api/routers/agents/update_agent.py +++ b/agents-api/agents_api/routers/agents/update_agent.py @@ -2,13 +2,12 @@ from fastapi import Depends, HTTPException from pydantic import UUID4 -from starlette.status import HTTP_404_NOT_FOUND, HTTP_200_OK +from starlette.status import HTTP_200_OK, HTTP_404_NOT_FOUND +from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateAgentRequest +from ...common.exceptions.agents import AgentNotFoundError from ...dependencies.developer_id import get_developer_id from ...models.agent.update_agent import update_agent_query -from ...common.exceptions.agents import AgentNotFoundError -from ...autogen.openapi_model import UpdateAgentRequest, ResourceUpdatedResponse - from .router import router diff --git a/agents-api/agents_api/routers/jobs/routers.py b/agents-api/agents_api/routers/jobs/routers.py index 49855a2e1..2d936cb28 100644 --- a/agents-api/agents_api/routers/jobs/routers.py +++ b/agents-api/agents_api/routers/jobs/routers.py @@ -5,7 +5,6 @@ from agents_api.autogen.openapi_model import JobStatus, State from agents_api.clients.temporal import get_client - router = APIRouter() diff --git a/agents-api/agents_api/routers/sessions/__init__.py b/agents-api/agents_api/routers/sessions/__init__.py index a379a97f7..3cea3eb2d 100644 --- a/agents-api/agents_api/routers/sessions/__init__.py +++ b/agents-api/agents_api/routers/sessions/__init__.py @@ -1,8 +1,7 @@ -from .router import router # noqa: F401 - from .create_session import create_session # noqa: F401 from .delete_session import delete_session # noqa: F401 from .get_session import get_session # noqa: F401 from .list_sessions import list_sessions # noqa: F401 -from .update_session import update_session # noqa: F401 from .patch_session import patch_session # noqa: F401 +from .router import router # noqa: F401 +from .update_session import update_session # noqa: F401 diff --git a/agents-api/agents_api/routers/sessions/create_session.py b/agents-api/agents_api/routers/sessions/create_session.py index f3fe3102a..1b99b4087 100644 --- a/agents-api/agents_api/routers/sessions/create_session.py +++ b/agents-api/agents_api/routers/sessions/create_session.py @@ -1,18 +1,17 @@ from typing import Annotated from uuid import uuid4 +import pandas as pd from fastapi import Depends from pydantic import UUID4 -import pandas as pd from starlette.status import HTTP_201_CREATED -from ...dependencies.developer_id import get_developer_id -from ...models.session.create_session import create_session_query from ...autogen.openapi_model import ( CreateSessionRequest, ResourceCreatedResponse, ) - +from ...dependencies.developer_id import get_developer_id +from ...models.session.create_session import create_session_query from .router import router diff --git a/agents-api/agents_api/routers/sessions/delete_session.py b/agents-api/agents_api/routers/sessions/delete_session.py index a910bc991..25e59a32d 100644 --- a/agents-api/agents_api/routers/sessions/delete_session.py +++ b/agents-api/agents_api/routers/sessions/delete_session.py @@ -9,7 +9,6 @@ from ...common.utils.datetime import utcnow from ...dependencies.developer_id import get_developer_id from ...models.session.delete_session import delete_session_query - from .router import router diff --git a/agents-api/agents_api/routers/sessions/get_session.py b/agents-api/agents_api/routers/sessions/get_session.py index 4f9ef4d2a..cabf7af54 100644 --- a/agents-api/agents_api/routers/sessions/get_session.py +++ b/agents-api/agents_api/routers/sessions/get_session.py @@ -3,10 +3,9 @@ from fastapi import Depends, HTTPException from pydantic import UUID4 +from ...autogen.openapi_model import Session from ...dependencies.developer_id import get_developer_id from ...models.session.get_session import get_session_query -from ...autogen.openapi_model import Session - from .router import router diff --git a/agents-api/agents_api/routers/sessions/list_sessions.py b/agents-api/agents_api/routers/sessions/list_sessions.py index bfc9d4548..2b76503d6 100644 --- a/agents-api/agents_api/routers/sessions/list_sessions.py +++ b/agents-api/agents_api/routers/sessions/list_sessions.py @@ -5,10 +5,9 @@ from fastapi import Depends, HTTPException, status from pydantic import UUID4, BaseModel +from ...autogen.openapi_model import Session from ...dependencies.developer_id import get_developer_id from ...models.session.list_sessions import list_sessions_query -from ...autogen.openapi_model import Session - from .router import router diff --git a/agents-api/agents_api/routers/sessions/patch_session.py b/agents-api/agents_api/routers/sessions/patch_session.py index 53bae98f3..0ae381c07 100644 --- a/agents-api/agents_api/routers/sessions/patch_session.py +++ b/agents-api/agents_api/routers/sessions/patch_session.py @@ -4,14 +4,13 @@ from pydantic import UUID4 from starlette.status import HTTP_404_NOT_FOUND -from ...common.exceptions.sessions import SessionNotFoundError -from ...dependencies.developer_id import get_developer_id -from ...models.session.patch_session import patch_session_query from ...autogen.openapi_model import ( PatchSessionRequest, ResourceUpdatedResponse, ) - +from ...common.exceptions.sessions import SessionNotFoundError +from ...dependencies.developer_id import get_developer_id +from ...models.session.patch_session import patch_session_query from .router import router diff --git a/agents-api/agents_api/routers/sessions/protocol.py b/agents-api/agents_api/routers/sessions/protocol.py index 2350afeb3..6502e98a2 100644 --- a/agents-api/agents_api/routers/sessions/protocol.py +++ b/agents-api/agents_api/routers/sessions/protocol.py @@ -1,5 +1,6 @@ -from pydantic import BaseModel, Field, field_validator, ConfigDict -from agents_api.autogen.openapi_model import ResponseFormat, Preset, Tool +from pydantic import BaseModel, ConfigDict, Field, field_validator + +from agents_api.autogen.openapi_model import Preset, ResponseFormat, Tool class Settings(BaseModel): diff --git a/agents-api/agents_api/routers/sessions/session.py b/agents-api/agents_api/routers/sessions/session.py index 9852b5124..fc999561a 100644 --- a/agents-api/agents_api/routers/sessions/session.py +++ b/agents-api/agents_api/routers/sessions/session.py @@ -1,52 +1,48 @@ import json -import xxhash -from functools import reduce +from dataclasses import dataclass +from functools import partial, reduce from json import JSONDecodeError from typing import Callable from uuid import uuid4 -from functools import partial - -from dataclasses import dataclass -from openai.types.chat.chat_completion import ChatCompletion -from pydantic import UUID4 import litellm +import xxhash from litellm import acompletion +from openai.types.chat.chat_completion import ChatCompletion +from pydantic import UUID4 -from ...autogen.openapi_model import InputChatMLMessage, Tool, DocIds +from ...autogen.openapi_model import DocIds, InputChatMLMessage, Tool from ...clients.embed import embed -from ...clients.temporal import run_summarization_task -from ...clients.temporal import run_truncation_task +from ...clients.temporal import run_summarization_task, run_truncation_task from ...clients.worker.types import ChatML from ...common.exceptions.sessions import SessionNotFoundError from ...common.protocol.entries import Entry from ...common.protocol.sessions import SessionData -from ...common.utils.template import render_template from ...common.utils.json import CustomJSONEncoder from ...common.utils.messages import stringify_content +from ...common.utils.template import render_template from ...env import ( - embedding_service_url, embedding_model_id, + embedding_service_url, + model_api_key, + model_inference_url, ) +from ...exceptions import PromptTooBigError from ...model_registry import ( - OLLAMA_MODELS, - get_extra_settings, LOCAL_MODELS, LOCAL_MODELS_WITH_TOOL_CALLS, + OLLAMA_MODELS, + get_extra_settings, load_context, validate_and_extract_tool_calls, ) - from ...models.entry.add_entries import add_entries_query from ...models.entry.proc_mem_context import proc_mem_context_query -from ...models.session.session_data import get_session_data from ...models.session.get_cached_response import get_cached_response +from ...models.session.session_data import get_session_data from ...models.session.set_cached_response import set_cached_response -from ...exceptions import PromptTooBigError - from .exceptions import InputTooBigError from .protocol import Settings -from ...env import model_inference_url, model_api_key THOUGHTS_STRIP_LEN = 2 MESSAGES_STRIP_LEN = 4 @@ -411,7 +407,6 @@ async def forward( settings.tools.extend(tools) # If render_templates=True, render the templates if session_data is not None and session_data.render_templates: - template_data = { "session": { "id": session_data.session_id, diff --git a/agents-api/agents_api/routers/sessions/update_session.py b/agents-api/agents_api/routers/sessions/update_session.py index eab921c8b..cfc31dab6 100644 --- a/agents-api/agents_api/routers/sessions/update_session.py +++ b/agents-api/agents_api/routers/sessions/update_session.py @@ -4,14 +4,13 @@ from pydantic import UUID4 from starlette.status import HTTP_404_NOT_FOUND -from ...common.exceptions.sessions import SessionNotFoundError -from ...dependencies.developer_id import get_developer_id -from ...models.session.update_session import update_session_query from ...autogen.openapi_model import ( - UpdateSessionRequest, ResourceUpdatedResponse, + UpdateSessionRequest, ) - +from ...common.exceptions.sessions import SessionNotFoundError +from ...dependencies.developer_id import get_developer_id +from ...models.session.update_session import update_session_query from .router import router diff --git a/agents-api/agents_api/routers/tasks/routers.py b/agents-api/agents_api/routers/tasks/routers.py index 1efb68cd0..fef509e99 100644 --- a/agents-api/agents_api/routers/tasks/routers.py +++ b/agents-api/agents_api/routers/tasks/routers.py @@ -1,46 +1,46 @@ from typing import Annotated from uuid import uuid4 + +import pandas as pd +from fastapi import APIRouter, Depends, HTTPException, status from jsonschema import validate from jsonschema.exceptions import ValidationError -from agents_api.models.execution.create_execution import create_execution_query -from agents_api.models.execution.update_execution_status import ( - update_execution_status_query, +from pycozo.client import QueryException +from pydantic import UUID4, BaseModel +from starlette.status import HTTP_201_CREATED + +from agents_api.autogen.openapi_model import ( + CreateExecution, + CreateTask, + Execution, + ExecutionTransition, + ResourceCreatedResponse, + ResourceUpdatedResponse, + Task, + UpdateExecutionTransitionRequest, ) +from agents_api.clients.cozo import client as cozo_client +from agents_api.clients.temporal import run_task_execution_workflow +from agents_api.common.protocol.tasks import ExecutionInput +from agents_api.dependencies.developer_id import get_developer_id +from agents_api.models.execution.create_execution import create_execution_query from agents_api.models.execution.get_execution import get_execution_query from agents_api.models.execution.get_execution_transition import ( get_execution_transition_query, ) -from agents_api.models.execution.list_executions import list_task_executions_query from agents_api.models.execution.list_execution_transitions import ( list_execution_transitions_query, ) +from agents_api.models.execution.list_executions import list_task_executions_query +from agents_api.models.execution.update_execution_status import ( + update_execution_status_query, +) from agents_api.models.execution.update_execution_transition import ( update_execution_transition_query, ) from agents_api.models.task.create_task import create_task_query from agents_api.models.task.get_task import get_task_query from agents_api.models.task.list_tasks import list_tasks_query -from fastapi import APIRouter, HTTPException, status, Depends -import pandas as pd -from pydantic import BaseModel -from pydantic import UUID4 -from starlette.status import HTTP_201_CREATED - -from pycozo.client import QueryException -from agents_api.autogen.openapi_model import ( - CreateTask, - Task, - Execution, - ExecutionTransition, - ResourceCreatedResponse, - ResourceUpdatedResponse, - UpdateExecutionTransitionRequest, - CreateExecution, -) -from agents_api.dependencies.developer_id import get_developer_id -from agents_api.clients.temporal import run_task_execution_workflow -from agents_api.common.protocol.tasks import ExecutionInput -from agents_api.clients.cozo import client as cozo_client class TaskList(BaseModel): diff --git a/agents-api/agents_api/routers/users/__init__.py b/agents-api/agents_api/routers/users/__init__.py index 9c8bfa7dc..91888636d 100644 --- a/agents-api/agents_api/routers/users/__init__.py +++ b/agents-api/agents_api/routers/users/__init__.py @@ -1,7 +1,6 @@ -from .router import router # noqa: F401 - from .create_user import create_user # noqa: F401 from .get_user_details import get_user_details # noqa: F401 from .list_users import list_users # noqa: F401 -from .update_user import update_user # noqa: F401 from .patch_user import patch_user # noqa: F401 +from .router import router # noqa: F401 +from .update_user import update_user # noqa: F401 diff --git a/agents-api/agents_api/routers/users/create_user.py b/agents-api/agents_api/routers/users/create_user.py index 024c26822..fa06db2f5 100644 --- a/agents-api/agents_api/routers/users/create_user.py +++ b/agents-api/agents_api/routers/users/create_user.py @@ -5,10 +5,9 @@ from pydantic import UUID4 from starlette.status import HTTP_201_CREATED +from ...autogen.openapi_model import CreateUserRequest, ResourceCreatedResponse from ...dependencies.developer_id import get_developer_id from ...models.user.create_user import create_user_query -from ...autogen.openapi_model import CreateUserRequest, ResourceCreatedResponse - from .router import router diff --git a/agents-api/agents_api/routers/users/get_user_details.py b/agents-api/agents_api/routers/users/get_user_details.py index 4fea6551b..3513e3891 100644 --- a/agents-api/agents_api/routers/users/get_user_details.py +++ b/agents-api/agents_api/routers/users/get_user_details.py @@ -1,14 +1,13 @@ from typing import Annotated -from fastapi import HTTPException, Depends, status +from fastapi import Depends, HTTPException, status from pycozo.client import QueryException from pydantic import UUID4 -from ...dependencies.developer_id import get_developer_id -from ...models.user.get_user import get_user_query from ...autogen.openapi_model import User from ...common.exceptions.users import UserNotFoundError - +from ...dependencies.developer_id import get_developer_id +from ...models.user.get_user import get_user_query from .router import router diff --git a/agents-api/agents_api/routers/users/list_users.py b/agents-api/agents_api/routers/users/list_users.py index 933749abf..08af1159a 100644 --- a/agents-api/agents_api/routers/users/list_users.py +++ b/agents-api/agents_api/routers/users/list_users.py @@ -2,13 +2,12 @@ from json import JSONDecodeError from typing import Annotated, List -from fastapi import HTTPException, Depends, status +from fastapi import Depends, HTTPException, status from pydantic import UUID4 +from ...autogen.openapi_model import User from ...dependencies.developer_id import get_developer_id from ...models.user.list_users import list_users_query -from ...autogen.openapi_model import User - from .router import router diff --git a/agents-api/agents_api/routers/users/patch_user.py b/agents-api/agents_api/routers/users/patch_user.py index cbcd7940a..909a81625 100644 --- a/agents-api/agents_api/routers/users/patch_user.py +++ b/agents-api/agents_api/routers/users/patch_user.py @@ -1,14 +1,13 @@ from typing import Annotated -from fastapi import HTTPException, Depends +from fastapi import Depends, HTTPException from pydantic import UUID4 from starlette.status import HTTP_404_NOT_FOUND -from ...dependencies.developer_id import get_developer_id +from ...autogen.openapi_model import PatchUserRequest, ResourceUpdatedResponse from ...common.exceptions.users import UserNotFoundError +from ...dependencies.developer_id import get_developer_id from ...models.user.patch_user import patch_user_query -from ...autogen.openapi_model import PatchUserRequest, ResourceUpdatedResponse - from .router import router diff --git a/agents-api/agents_api/routers/users/update_user.py b/agents-api/agents_api/routers/users/update_user.py index 725939eeb..afdeee985 100644 --- a/agents-api/agents_api/routers/users/update_user.py +++ b/agents-api/agents_api/routers/users/update_user.py @@ -1,14 +1,13 @@ from typing import Annotated -from fastapi import HTTPException, Depends +from fastapi import Depends, HTTPException from pydantic import UUID4 from starlette.status import HTTP_404_NOT_FOUND -from ...dependencies.developer_id import get_developer_id +from ...autogen.openapi_model import ResourceUpdatedResponse, UpdateUserRequest from ...common.exceptions.users import UserNotFoundError +from ...dependencies.developer_id import get_developer_id from ...models.user.update_user import update_user_query -from ...autogen.openapi_model import UpdateUserRequest, ResourceUpdatedResponse - from .router import router diff --git a/agents-api/agents_api/web.py b/agents-api/agents_api/web.py index e384e6817..155ced099 100644 --- a/agents-api/agents_api/web.py +++ b/agents-api/agents_api/web.py @@ -2,32 +2,31 @@ This module initializes the FastAPI application, registers routes, sets up middleware, and configures exception handlers. """ -import fire -import uvicorn import logging + +import fire import sentry_sdk -from fastapi import FastAPI, Request, status, Depends -from fastapi.responses import JSONResponse -from fastapi.middleware.cors import CORSMiddleware +import uvicorn +from fastapi import Depends, FastAPI, Request, status from fastapi.exceptions import RequestValidationError -from agents_api.common.exceptions import BaseCommonException -from agents_api.exceptions import PromptTooBigError +from fastapi.middleware.cors import CORSMiddleware +from fastapi.responses import JSONResponse +from litellm.exceptions import APIError from pycozo.client import QueryException from temporalio.service import RPCError -from litellm.exceptions import APIError +from agents_api.common.exceptions import BaseCommonException from agents_api.dependencies.auth import get_api_key from agents_api.env import sentry_dsn - +from agents_api.exceptions import PromptTooBigError from agents_api.routers import ( agents, - sessions, - users, jobs, + sessions, tasks, + users, ) - if not sentry_dsn: print("Sentry DSN not found. Sentry will not be enabled.") else: diff --git a/agents-api/agents_api/worker/__main__.py b/agents-api/agents_api/worker/__main__.py index cb57490bb..f008907a4 100644 --- a/agents-api/agents_api/worker/__main__.py +++ b/agents-api/agents_api/worker/__main__.py @@ -10,14 +10,14 @@ from temporalio.client import Client, TLSConfig from temporalio.worker import Worker -from ..activities.summarization import summarization from ..activities.co_density import co_density from ..activities.dialog_insights import dialog_insights +from ..activities.embed_docs import embed_docs from ..activities.mem_mgmt import mem_mgmt from ..activities.mem_rating import mem_rating from ..activities.relationship_summary import relationship_summary from ..activities.salient_questions import salient_questions -from ..activities.embed_docs import embed_docs +from ..activities.summarization import summarization from ..activities.task_steps import ( prompt_step, # evaluate_step, @@ -27,26 +27,24 @@ # if_else_step, transition_step, ) - from ..activities.truncation import truncation from ..env import ( + temporal_client_cert, temporal_endpoint, - temporal_task_queue, temporal_namespace, temporal_private_key, - temporal_client_cert, + temporal_task_queue, ) -from ..workflows.summarization import SummarizationWorkflow -from ..workflows.embed_docs import EmbedDocsWorkflow from ..workflows.co_density import CoDensityWorkflow from ..workflows.dialog_insights import DialogInsightsWorkflow +from ..workflows.embed_docs import EmbedDocsWorkflow from ..workflows.mem_mgmt import MemMgmtWorkflow from ..workflows.mem_rating import MemRatingWorkflow from ..workflows.relationship_summary import RelationshipSummaryWorkflow from ..workflows.salient_questions import SalientQuestionsWorkflow +from ..workflows.summarization import SummarizationWorkflow from ..workflows.task_execution import TaskExecutionWorkflow from ..workflows.truncation import TruncationWorkflow - from .codec import pydantic_data_converter diff --git a/agents-api/agents_api/worker/codec.py b/agents-api/agents_api/worker/codec.py index 429740126..abf3ddfe5 100644 --- a/agents-api/agents_api/worker/codec.py +++ b/agents-api/agents_api/worker/codec.py @@ -4,20 +4,19 @@ import openai.types as openai_types import openai.types.chat as openai_chat_types -from pydantic import BaseModel import temporalio.converter from litellm.utils import ModelResponse +from pydantic import BaseModel from temporalio.api.common.v1 import Payload from temporalio.converter import ( CompositePayloadConverter, DefaultPayloadConverter, EncodingPayloadConverter, ) -from agents_api.common.utils.json import dumps as json_dumps -import agents_api.common.protocol.tasks as tasks import agents_api.autogen.openapi_model as openapi_model - +import agents_api.common.protocol.tasks as tasks +from agents_api.common.utils.json import dumps as json_dumps # Map of model name to class so that we can look up the class when deserializing model_class_map = { @@ -79,7 +78,7 @@ def __init__(self) -> None: # Just add ours as first before the defaults super().__init__( PydanticEncodingPayloadConverter(), - *DefaultPayloadConverter.default_encoding_payload_converters + *DefaultPayloadConverter.default_encoding_payload_converters, ) diff --git a/agents-api/agents_api/workflows/co_density.py b/agents-api/agents_api/workflows/co_density.py index 1ed9fa414..ffa317926 100644 --- a/agents-api/agents_api/workflows/co_density.py +++ b/agents-api/agents_api/workflows/co_density.py @@ -2,6 +2,7 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): diff --git a/agents-api/agents_api/workflows/dialog_insights.py b/agents-api/agents_api/workflows/dialog_insights.py index d028b696c..d7e40395e 100644 --- a/agents-api/agents_api/workflows/dialog_insights.py +++ b/agents-api/agents_api/workflows/dialog_insights.py @@ -2,11 +2,12 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): - from ..activities.types import ChatML from ..activities.dialog_insights import dialog_insights + from ..activities.types import ChatML @workflow.defn diff --git a/agents-api/agents_api/workflows/embed_docs.py b/agents-api/agents_api/workflows/embed_docs.py index 20cb388ea..e52921ed8 100644 --- a/agents-api/agents_api/workflows/embed_docs.py +++ b/agents-api/agents_api/workflows/embed_docs.py @@ -2,6 +2,7 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): diff --git a/agents-api/agents_api/workflows/mem_mgmt.py b/agents-api/agents_api/workflows/mem_mgmt.py index 60927f84f..2db9f95da 100644 --- a/agents-api/agents_api/workflows/mem_mgmt.py +++ b/agents-api/agents_api/workflows/mem_mgmt.py @@ -2,11 +2,12 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): - from ..activities.types import ChatML from ..activities.mem_mgmt import mem_mgmt + from ..activities.types import ChatML @workflow.defn diff --git a/agents-api/agents_api/workflows/mem_rating.py b/agents-api/agents_api/workflows/mem_rating.py index 7cd7e2b76..4b68a7198 100644 --- a/agents-api/agents_api/workflows/mem_rating.py +++ b/agents-api/agents_api/workflows/mem_rating.py @@ -2,6 +2,7 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): diff --git a/agents-api/agents_api/workflows/relationship_summary.py b/agents-api/agents_api/workflows/relationship_summary.py index dc058b153..0f2e5fb07 100644 --- a/agents-api/agents_api/workflows/relationship_summary.py +++ b/agents-api/agents_api/workflows/relationship_summary.py @@ -2,6 +2,7 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): diff --git a/agents-api/agents_api/workflows/salient_questions.py b/agents-api/agents_api/workflows/salient_questions.py index 860988131..59f30dc37 100644 --- a/agents-api/agents_api/workflows/salient_questions.py +++ b/agents-api/agents_api/workflows/salient_questions.py @@ -2,6 +2,7 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): diff --git a/agents-api/agents_api/workflows/summarization.py b/agents-api/agents_api/workflows/summarization.py index 70d1b2549..7946e9109 100644 --- a/agents-api/agents_api/workflows/summarization.py +++ b/agents-api/agents_api/workflows/summarization.py @@ -2,6 +2,7 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): diff --git a/agents-api/agents_api/workflows/task_execution.py b/agents-api/agents_api/workflows/task_execution.py index 5daa53d95..8a1bdb6ae 100644 --- a/agents-api/agents_api/workflows/task_execution.py +++ b/agents-api/agents_api/workflows/task_execution.py @@ -10,7 +10,6 @@ prompt_step, transition_step, ) - from ..common.protocol.tasks import ( ExecutionInput, PromptWorkflowStep, diff --git a/agents-api/agents_api/workflows/truncation.py b/agents-api/agents_api/workflows/truncation.py index 6057eec38..d3646ccbe 100644 --- a/agents-api/agents_api/workflows/truncation.py +++ b/agents-api/agents_api/workflows/truncation.py @@ -2,6 +2,7 @@ from datetime import timedelta + from temporalio import workflow with workflow.unsafe.imports_passed_through(): diff --git a/agents-api/pyproject.toml b/agents-api/pyproject.toml index f6b5a97b0..f4e5b0fd5 100644 --- a/agents-api/pyproject.toml +++ b/agents-api/pyproject.toml @@ -38,8 +38,7 @@ mergedeep = "^1.3.4" pydantic-partial = "^0.5.5" [tool.poetry.group.dev.dependencies] ipython = "^8.18.1" -black = "^24.4.0" -ruff = "^0.1.9" +ruff = "^0.5.5" datamodel-code-generator = "^0.25.8" cozo-migrate = "^0.2.0" poethepoet = "^0.25.1" @@ -61,12 +60,12 @@ build-backend = "poetry.core.masonry.api" agents-api = "scripts.agents_api:run" [tool.poe.tasks] -format = "black ." -lint = "ruff agents_api/**/*.py migrations/**/*.py tests/**/*.py --fix --unsafe-fixes" +format = "ruff format" +lint = "ruff check --select I --fix --unsafe-fixes agents_api/**/*.py migrations/**/*.py tests/**/*.py" typecheck = "pytype --config pytype.toml" check = [ - "format", "lint", + "format", "typecheck", ] test = "ward" diff --git a/agents-api/tests/fixtures.py b/agents-api/tests/fixtures.py index 5b4a50c4f..2f7cfbffe 100644 --- a/agents-api/tests/fixtures.py +++ b/agents-api/tests/fixtures.py @@ -1,8 +1,9 @@ from uuid import uuid4 -from ward import fixture + from julep import AsyncClient, Client -from agents_api.routers.sessions.session import BaseSession +from ward import fixture +from agents_api.routers.sessions.session import BaseSession # TODO: make clients connect to real service diff --git a/agents-api/tests/test_activities.py b/agents-api/tests/test_activities.py index 70581c378..5ebf49d5b 100644 --- a/agents-api/tests/test_activities.py +++ b/agents-api/tests/test_activities.py @@ -1,9 +1,11 @@ import time import uuid + from ward import test -from agents_api.common.protocol.entries import Entry -from agents_api.autogen.openapi_model import Role + from agents_api.activities.truncation import get_extra_entries +from agents_api.autogen.openapi_model import Role +from agents_api.common.protocol.entries import Entry @test("get extra entries, do not strip system message") diff --git a/agents-api/tests/test_agents.py b/agents-api/tests/test_agents.py index 5f85482cc..e5076e37d 100644 --- a/agents-api/tests/test_agents.py +++ b/agents-api/tests/test_agents.py @@ -1,8 +1,10 @@ import uuid -from julep.api import ResourceCreatedResponse, ResourceUpdatedResponse, Agent + +from julep.api import Agent, ResourceCreatedResponse, ResourceUpdatedResponse from julep.api.core import ApiError from ward import test -from tests.fixtures import client, async_client, agent + +from tests.fixtures import agent, async_client, client @test("create new agent with tools") diff --git a/agents-api/tests/test_messages_truncation.py b/agents-api/tests/test_messages_truncation.py index 14a905d90..2edd5610e 100644 --- a/agents-api/tests/test_messages_truncation.py +++ b/agents-api/tests/test_messages_truncation.py @@ -1,7 +1,9 @@ from uuid import uuid4 -from ward import test, raises -from agents_api.common.protocol.entries import Entry + +from ward import raises, test + from agents_api.autogen.openapi_model import Role +from agents_api.common.protocol.entries import Entry from agents_api.routers.sessions.exceptions import InputTooBigError from tests.fixtures import base_session diff --git a/agents-api/tests/test_sessions.py b/agents-api/tests/test_sessions.py index 3bd3d7a8c..74ad0151c 100644 --- a/agents-api/tests/test_sessions.py +++ b/agents-api/tests/test_sessions.py @@ -1,21 +1,23 @@ import uuid + from julep.api import ( - ResourceCreatedResponse, - ResourceUpdatedResponse, - Session, - ChatResponse, - InputChatMlMessage, - InputChatMlMessageRole, ChatMlMessage, - ToolChoiceOption, + ChatResponse, ChatSettingsResponseFormat, ChatSettingsResponseFormatType, - Tool, + InputChatMlMessage, + InputChatMlMessageRole, + ResourceCreatedResponse, + ResourceUpdatedResponse, + Session, Suggestion, + Tool, + ToolChoiceOption, ) from julep.api.core import ApiError from ward import test -from tests.fixtures import client, async_client, user, session, agent + +from tests.fixtures import agent, async_client, client, session, user @test("get existing session") diff --git a/agents-api/tests/test_tasks.py b/agents-api/tests/test_tasks.py index 4d42fac55..24562282b 100644 --- a/agents-api/tests/test_tasks.py +++ b/agents-api/tests/test_tasks.py @@ -1,8 +1,10 @@ import uuid from typing import List + +from julep.api.types import Execution, Task from ward import test -from tests.fixtures import client, async_client, task, agent -from julep.api.types import Task, Execution + +from tests.fixtures import agent, async_client, client, task @test("create task") diff --git a/agents-api/tests/test_users.py b/agents-api/tests/test_users.py index cfd86be80..6dc2b0789 100644 --- a/agents-api/tests/test_users.py +++ b/agents-api/tests/test_users.py @@ -1,8 +1,10 @@ import uuid + from julep.api import ResourceCreatedResponse, ResourceUpdatedResponse, User from julep.api.core import ApiError from ward import test -from tests.fixtures import client, async_client, user + +from tests.fixtures import async_client, client, user @test("create user") From 1bd6bf210a7088e9bfd0574672989c37a9be71e1 Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 28 Jul 2024 21:21:06 -0400 Subject: [PATCH 35/36] wip Signed-off-by: Diwank Tomer --- agents-api/agents_api/activities/types.py | 6 +- agents-api/agents_api/autogen/Chat.py | 2 +- agents-api/agents_api/autogen/Entries.py | 4 +- .../agents_api/autogen/openapi_model.py | 13 +++ agents-api/agents_api/clients/worker/types.py | 6 +- .../agents_api/common/protocol/entries.py | 28 ++----- .../agents_api/models/entry/add_entries.py | 73 ----------------- .../agents_api/models/entry/create_entries.py | 80 +++++++++++++++++++ .../session/create_or_update_session.py | 2 +- agents-api/agents_api/models/utils.py | 34 ++++---- agents-api/poetry.lock | 39 ++++----- agents-api/pytype.toml | 2 +- sdks/python/julep/api/types/entries_entry.py | 2 +- sdks/python/poetry.lock | 6 +- sdks/ts/src/api/schemas/$Entries_Entry.ts | 1 - typespec/entries/models.tsp | 3 +- 16 files changed, 154 insertions(+), 147 deletions(-) delete mode 100644 agents-api/agents_api/models/entry/add_entries.py create mode 100644 agents-api/agents_api/models/entry/create_entries.py diff --git a/agents-api/agents_api/activities/types.py b/agents-api/agents_api/activities/types.py index 4fa1d4d46..37fd8015d 100644 --- a/agents-api/agents_api/activities/types.py +++ b/agents-api/agents_api/activities/types.py @@ -25,12 +25,10 @@ class ChatML(BaseModel): token_count: Optional[int] = None -class BaseTask(BaseModel): - ... +class BaseTask(BaseModel): ... -class BaseTaskArgs(BaseModel): - ... +class BaseTaskArgs(BaseModel): ... class AddPrinciplesTaskArgs(BaseTaskArgs): diff --git a/agents-api/agents_api/autogen/Chat.py b/agents-api/agents_api/autogen/Chat.py index c7c25c7ad..6669fbcec 100644 --- a/agents-api/agents_api/autogen/Chat.py +++ b/agents-api/agents_api/autogen/Chat.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AwareDatetime, BaseModel, ConfigDict, Field +from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel from .Docs import DocReference from .Entries import ChatMLMessage diff --git a/agents-api/agents_api/autogen/Entries.py b/agents-api/agents_api/autogen/Entries.py index 60c11a628..2252be69c 100644 --- a/agents-api/agents_api/autogen/Entries.py +++ b/agents-api/agents_api/autogen/Entries.py @@ -6,7 +6,7 @@ from typing import Annotated, Literal from uuid import UUID -from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field +from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel from .Tools import ChosenToolCall, Tool, ToolResponse @@ -107,7 +107,7 @@ class Entry(BaseModel): source: Literal[ "api_request", "api_response", "tool_response", "internal", "summarizer", "meta" ] - timestamp: int + timestamp: Annotated[float, Field(ge=0.0)] """ This is the time that this event refers to. """ diff --git a/agents-api/agents_api/autogen/openapi_model.py b/agents-api/agents_api/autogen/openapi_model.py index 3bf1b4ff0..427304cd8 100644 --- a/agents-api/agents_api/autogen/openapi_model.py +++ b/agents-api/agents_api/autogen/openapi_model.py @@ -1,8 +1,11 @@ # ruff: noqa: F401, F403, F405 +from typing import Annotated from uuid import UUID +from pydantic import AwareDatetime, Field from pydantic_partial import create_partial_model +from ..common.utils.datetime import utcnow from .Agents import * from .Chat import * from .Common import * @@ -34,6 +37,16 @@ ChatMLRole = Entry.model_fields["role"].annotation +class CreateEntryRequest(Entry): + id: Annotated[UUID | None, Field(default=None)] + created_at: Annotated[AwareDatetime | None, Field(default=None)] + timestamp: Annotated[ + float, Field(ge=0.0, default_factory=lambda: utcnow().timestamp()) + ] + tokenizer: str + token_count: int + + def make_session( *, agents: list[UUID], diff --git a/agents-api/agents_api/clients/worker/types.py b/agents-api/agents_api/clients/worker/types.py index 10ebe7e2a..02b6add6c 100644 --- a/agents-api/agents_api/clients/worker/types.py +++ b/agents-api/agents_api/clients/worker/types.py @@ -30,12 +30,10 @@ class ChatML(BaseModel): token_count: Optional[int] = None -class BaseTask(BaseModel): - ... +class BaseTask(BaseModel): ... -class BaseTaskArgs(BaseModel): - ... +class BaseTaskArgs(BaseModel): ... class MemoryManagementTaskArgs(BaseTaskArgs): diff --git a/agents-api/agents_api/common/protocol/entries.py b/agents-api/agents_api/common/protocol/entries.py index 699404d73..f4543aa54 100644 --- a/agents-api/agents_api/common/protocol/entries.py +++ b/agents-api/agents_api/common/protocol/entries.py @@ -4,12 +4,15 @@ from pydantic import BaseModel, Field, computed_field -from agents_api.autogen.openapi_model import ( +from ...autogen.openapi_model import ( ChatMLImageContentPart, ChatMLRole, ChatMLTextContentPart, ) -from agents_api.common.utils.datetime import utcnow +from ...autogen.openapi_model import ( + Entry as BaseEntry, +) +from ...common.utils.datetime import utcnow EntrySource = Literal["api_request", "api_response", "internal", "summarizer"] Tokenizer = Literal["character_count"] @@ -19,24 +22,12 @@ HIGH_IMAGE_TOKEN_COUNT = 85 + 4 * 170 -class Entry(BaseModel): +class Entry(BaseEntry): """Represents an entry in the system, encapsulating all necessary details such as ID, session ID, source, role, and content among others.""" - id: UUID = Field( - alias="entry_id", default_factory=uuid4 - ) # Uses a default factory to generate a unique UUID session_id: UUID - source: EntrySource = Field(default="api_request") - role: ChatMLRole - name: str | None = None - content: str | list[ChatMLTextContentPart] | list[ChatMLImageContentPart] | dict + token_count: int tokenizer: str = Field(default="character_count") - created_at: float = Field( - default_factory=lambda: utcnow().timestamp() - ) # Uses a default factory to set the creation timestamp - timestamp: float = Field( - default_factory=lambda: utcnow().timestamp() - ) # Uses a default factory to set the current timestamp @computed_field @property @@ -63,8 +54,3 @@ def token_count(self) -> int: return int(content_length // 3.5) raise NotImplementedError(f"Unknown tokenizer: {self.tokenizer}") - - class Config: - """Configuration settings for the Entry model, ensuring enum values are used.""" - - use_enum_values = True # Ensures that enum values are used in serialization diff --git a/agents-api/agents_api/models/entry/add_entries.py b/agents-api/agents_api/models/entry/add_entries.py deleted file mode 100644 index 123858d24..000000000 --- a/agents-api/agents_api/models/entry/add_entries.py +++ /dev/null @@ -1,73 +0,0 @@ -import pandas as pd -from beartype import beartype - -from ...common.protocol.entries import Entry -from ...common.utils.datetime import utcnow -from ...common.utils.messages import content_to_json -from ..utils import cozo_query - - -@cozo_query -@beartype -def add_entries_query(entries: list[Entry]) -> tuple[str, dict]: - """ - Parameters: - entries (list[Entry]): A list of Entry objects to be processed. - - Returns: - pd.DataFrame: A DataFrame containing the entries data ready for insertion into the 'cozodb' database. - """ - # Iterate over each entry in the provided list, processing them for database insertion. - entries_lst = [] - - for e in entries: - ts = utcnow().timestamp() - source = e.source - role = e.role - - # Convert the content of each entry to list of text parts if it is a string or a dictionary. - # Append entries with non-empty content to the list for database insertion. - content = content_to_json(e.content) - if content: - entries_lst.append( - [ - str(e.id), - str(e.session_id), - source, - role, - e.name or "", - content, - e.token_count, - e.tokenizer, - ts, - ts, - ] - ) - - # If no entries are provided or all entries have empty content, return an empty DataFrame. - if not len(entries_lst): - return pd.DataFrame(data={}) - - # Construct a datalog query to insert the processed entries into the 'cozodb' database. - # Refer to the schema for the 'entries' relation in the README.md for column names and types. - query = """ - { - ?[entry_id, session_id, source, role, name, content, token_count, tokenizer, created_at, timestamp] <- $entries_lst - - :insert entries { - entry_id, - session_id, - source, - role, - name, => - content, - token_count, - tokenizer, - created_at, - timestamp, - } - :returning - } - """ - - return (query, {"entries_lst": entries_lst}) diff --git a/agents-api/agents_api/models/entry/create_entries.py b/agents-api/agents_api/models/entry/create_entries.py new file mode 100644 index 000000000..cc725d479 --- /dev/null +++ b/agents-api/agents_api/models/entry/create_entries.py @@ -0,0 +1,80 @@ +from uuid import UUID, uuid4 + +from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError + +from ...autogen.openapi_model import CreateEntryRequest, Entry +from ...common.utils.cozo import cozo_process_mutate_data +from ...common.utils.datetime import utcnow +from ...common.utils.messages import content_to_json +from ..utils import ( + cozo_query, + partialclass, + rewrap_exceptions, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) +@wrap_in_class( + Entry, + transform=lambda d: { + "id": UUID(d.pop("entry_id")), + **d, + }, +) +@cozo_query +@beartype +def create_entries( + *, + developer_id: UUID, + session_id: UUID, + data: list[Entry], +) -> tuple[str, dict]: + developer_id = str(developer_id) + session_id = str(session_id) + + data_dicts = [item.model_dump() for item in data] + + for item in data_dicts: + item["content"] = content_to_json(item["content"]) + item["session_id"] = session_id + item["entry_id"] = item.pop("id", None) or str(uuid4()) + item["created_at"] = (item.get("created_at") or utcnow()).timestamp() + + cols, rows = cozo_process_mutate_data(data_dicts) + + # Construct a datalog query to insert the processed entries into the 'cozodb' database. + # Refer to the schema for the 'entries' relation in the README.md for column names and types. + create_query = f""" + ?[{cols}] <- $rows + + :insert entries {{ + {cols} + }} + + :returning + """ + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, "sessions", session_id=session_id + ), + create_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"rows": rows}) diff --git a/agents-api/agents_api/models/session/create_or_update_session.py b/agents-api/agents_api/models/session/create_or_update_session.py index d818aa7ac..2618e3b2b 100644 --- a/agents-api/agents_api/models/session/create_or_update_session.py +++ b/agents-api/agents_api/models/session/create_or_update_session.py @@ -37,7 +37,7 @@ **d, }, ) -@cozo_query(debug=True) +@cozo_query @beartype def create_or_update_session( *, diff --git a/agents-api/agents_api/models/utils.py b/agents-api/agents_api/models/utils.py index 61e71870a..49a5bbb55 100644 --- a/agents-api/agents_api/models/utils.py +++ b/agents-api/agents_api/models/utils.py @@ -37,9 +37,10 @@ def verify_developer_id_query(developer_id: UUID | str) -> str: def verify_developer_owns_resource_query( developer_id: UUID | str, resource: str, - parents: list[tuple[str, str]] = [], + parents: list[tuple[str, str]] | None = None, **resource_id, ) -> str: + parents = parents or [] resource_id_key, resource_id_value = next(iter(resource_id.items())) parents.append((resource, resource_id_key)) @@ -148,27 +149,30 @@ def rewrap_exceptions( ], /, ): - mappers = [*mapping.items()] - - for i, (check, transform) in enumerate(mappers): - if inspect.isclass(check): - mappers[i] = (lambda e: isinstance(e, check), mappers[i][1]) - - if inspect.isclass(transform): - mappers[i] = (mappers[i][0], lambda e: transform(str(e))) - def decorator(func: Callable[..., Any]): @wraps(func) def wrapper(*args, **kwargs): - nonlocal mappers + nonlocal mapping try: result = func(*args, **kwargs) - except BaseException as e: - for check, transform in mappers: - if check(e): - raise transform(e) from e + except BaseException as error: + for check, transform in mapping.items(): + should_catch = ( + isinstance(error, check) + if isinstance(check, type) + else check(error) + ) + + if should_catch: + new_error = ( + transform(str(error)) + if isinstance(transform, type) + else transform(error) + ) + + raise transform(error) from error raise diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 8ceb982ef..7d9a6306a 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -4586,28 +4586,29 @@ pyasn1 = ">=0.1.3" [[package]] name = "ruff" -version = "0.1.15" +version = "0.5.5" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:5fe8d54df166ecc24106db7dd6a68d44852d14eb0729ea4672bb4d96c320b7df"}, - {file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6f0bfbb53c4b4de117ac4d6ddfd33aa5fc31beeaa21d23c45c6dd249faf9126f"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0d432aec35bfc0d800d4f70eba26e23a352386be3a6cf157083d18f6f5881c8"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9405fa9ac0e97f35aaddf185a1be194a589424b8713e3b97b762336ec79ff807"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c66ec24fe36841636e814b8f90f572a8c0cb0e54d8b5c2d0e300d28a0d7bffec"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6f8ad828f01e8dd32cc58bc28375150171d198491fc901f6f98d2a39ba8e3ff5"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86811954eec63e9ea162af0ffa9f8d09088bab51b7438e8b6488b9401863c25e"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fd4025ac5e87d9b80e1f300207eb2fd099ff8200fa2320d7dc066a3f4622dc6b"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b17b93c02cdb6aeb696effecea1095ac93f3884a49a554a9afa76bb125c114c1"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ddb87643be40f034e97e97f5bc2ef7ce39de20e34608f3f829db727a93fb82c5"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:abf4822129ed3a5ce54383d5f0e964e7fef74a41e48eb1dfad404151efc130a2"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6c629cf64bacfd136c07c78ac10a54578ec9d1bd2a9d395efbee0935868bf852"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1bab866aafb53da39c2cadfb8e1c4550ac5340bb40300083eb8967ba25481447"}, - {file = "ruff-0.1.15-py3-none-win32.whl", hash = "sha256:2417e1cb6e2068389b07e6fa74c306b2810fe3ee3476d5b8a96616633f40d14f"}, - {file = "ruff-0.1.15-py3-none-win_amd64.whl", hash = "sha256:3837ac73d869efc4182d9036b1405ef4c73d9b1f88da2413875e34e0d6919587"}, - {file = "ruff-0.1.15-py3-none-win_arm64.whl", hash = "sha256:9a933dfb1c14ec7a33cceb1e49ec4a16b51ce3c20fd42663198746efc0427360"}, - {file = "ruff-0.1.15.tar.gz", hash = "sha256:f6dfa8c1b21c913c326919056c390966648b680966febcb796cc9d1aaab8564e"}, + {file = "ruff-0.5.5-py3-none-linux_armv6l.whl", hash = "sha256:605d589ec35d1da9213a9d4d7e7a9c761d90bba78fc8790d1c5e65026c1b9eaf"}, + {file = "ruff-0.5.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:00817603822a3e42b80f7c3298c8269e09f889ee94640cd1fc7f9329788d7bf8"}, + {file = "ruff-0.5.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:187a60f555e9f865a2ff2c6984b9afeffa7158ba6e1eab56cb830404c942b0f3"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fe26fc46fa8c6e0ae3f47ddccfbb136253c831c3289bba044befe68f467bfb16"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4ad25dd9c5faac95c8e9efb13e15803cd8bbf7f4600645a60ffe17c73f60779b"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f70737c157d7edf749bcb952d13854e8f745cec695a01bdc6e29c29c288fc36e"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:cfd7de17cef6ab559e9f5ab859f0d3296393bc78f69030967ca4d87a541b97a0"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a09b43e02f76ac0145f86a08e045e2ea452066f7ba064fd6b0cdccb486f7c3e7"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d0b856cb19c60cd40198be5d8d4b556228e3dcd545b4f423d1ad812bfdca5884"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3687d002f911e8a5faf977e619a034d159a8373514a587249cc00f211c67a091"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ac9dc814e510436e30d0ba535f435a7f3dc97f895f844f5b3f347ec8c228a523"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:af9bdf6c389b5add40d89b201425b531e0a5cceb3cfdcc69f04d3d531c6be74f"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d40a8533ed545390ef8315b8e25c4bb85739b90bd0f3fe1280a29ae364cc55d8"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:cab904683bf9e2ecbbe9ff235bfe056f0eba754d0168ad5407832928d579e7ab"}, + {file = "ruff-0.5.5-py3-none-win32.whl", hash = "sha256:696f18463b47a94575db635ebb4c178188645636f05e934fdf361b74edf1bb2d"}, + {file = "ruff-0.5.5-py3-none-win_amd64.whl", hash = "sha256:50f36d77f52d4c9c2f1361ccbfbd09099a1b2ea5d2b2222c586ab08885cf3445"}, + {file = "ruff-0.5.5-py3-none-win_arm64.whl", hash = "sha256:3191317d967af701f1b73a31ed5788795936e423b7acce82a2b63e26eb3e89d6"}, + {file = "ruff-0.5.5.tar.gz", hash = "sha256:cc5516bdb4858d972fbc31d246bdb390eab8df1a26e2353be2dbc0c2d7f5421a"}, ] [[package]] @@ -5956,4 +5957,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.11" -content-hash = "45cdf80d64f1773a6913588982e6e2f9727cd4a872d1d9fb0d27e620e59b0614" +content-hash = "59876a0cf86900c1991d386c4d577cb3db58d19e437d208f79177ff4a8085a4f" diff --git a/agents-api/pytype.toml b/agents-api/pytype.toml index e51024e6d..1b95217a6 100644 --- a/agents-api/pytype.toml +++ b/agents-api/pytype.toml @@ -14,7 +14,7 @@ inputs = [ ] # Keep going past errors to analyze as many files as possible. -keep_going = false +keep_going = true # Run N jobs in parallel. When 'auto' is used, this will be equivalent to the # number of CPUs on the host system. diff --git a/sdks/python/julep/api/types/entries_entry.py b/sdks/python/julep/api/types/entries_entry.py index c76038a11..2bc5f5c3f 100644 --- a/sdks/python/julep/api/types/entries_entry.py +++ b/sdks/python/julep/api/types/entries_entry.py @@ -16,7 +16,7 @@ class EntriesEntry(pydantic_v1.BaseModel): name: typing.Optional[str] = None content: EntriesEntryContent source: EntriesEntrySource - timestamp: int = pydantic_v1.Field() + timestamp: float = pydantic_v1.Field() """ This is the time that this event refers to. """ diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index e18f8fe02..2e75c4e07 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -1857,13 +1857,13 @@ files = [ [[package]] name = "pip" -version = "24.1.2" +version = "24.2" description = "The PyPA recommended tool for installing Python packages." optional = false python-versions = ">=3.8" files = [ - {file = "pip-24.1.2-py3-none-any.whl", hash = "sha256:7cd207eed4c60b0f411b444cd1464198fe186671c323b6cd6d433ed80fc9d247"}, - {file = "pip-24.1.2.tar.gz", hash = "sha256:e5458a0b89f2755e0ee8c0c77613fe5273e05f337907874d64f13171a898a7ff"}, + {file = "pip-24.2-py3-none-any.whl", hash = "sha256:2cd581cf58ab7fcfca4ce8efa6dcacd0de5bf8d0a3eb9ec927e07405f4d9e2a2"}, + {file = "pip-24.2.tar.gz", hash = "sha256:5b5e490b5e9cb275c879595064adce9ebd31b854e3e803740b72f9ccf34a45b8"}, ] [[package]] diff --git a/sdks/ts/src/api/schemas/$Entries_Entry.ts b/sdks/ts/src/api/schemas/$Entries_Entry.ts index 327efbb6f..843a1dea1 100644 --- a/sdks/ts/src/api/schemas/$Entries_Entry.ts +++ b/sdks/ts/src/api/schemas/$Entries_Entry.ts @@ -39,7 +39,6 @@ export const $Entries_Entry = { type: "number", description: `This is the time that this event refers to.`, isRequired: true, - format: "int32", }, created_at: { type: "string", diff --git a/typespec/entries/models.tsp b/typespec/entries/models.tsp index 12608869a..314bb8e71 100644 --- a/typespec/entries/models.tsp +++ b/typespec/entries/models.tsp @@ -92,7 +92,8 @@ model Entry { source: entrySource; /** This is the time that this event refers to. */ - timestamp: unixTimestamp32; + @minValue(0) + timestamp: float; /** This is the time it was added to the database */ ...HasCreatedAt; From d18f7da5deedb95a32ab35ac3026d828424e95bf Mon Sep 17 00:00:00 2001 From: Diwank Tomer Date: Sun, 28 Jul 2024 21:57:38 -0400 Subject: [PATCH 36/36] wip Signed-off-by: Diwank Tomer --- .../agents_api/models/entry/get_entries.py | 59 ----------- .../agents_api/models/entry/list_entries.py | 100 ++++++++++++++++++ sdks/python/julep/api/__init__.py | 6 -- sdks/python/julep/api/client.py | 84 +++------------ sdks/python/julep/api/reference.md | 42 +------- sdks/python/julep/api/types/__init__.py | 6 -- .../history_route_list_request_direction.py | 7 -- .../history_route_list_request_sort_by.py | 7 -- .../api/types/history_route_list_response.py | 43 -------- sdks/ts/src/api/services/DefaultService.ts | 66 ++++-------- typespec/common/interfaces.tsp | 53 +++------- typespec/entries/endpoints.tsp | 22 +++- 12 files changed, 169 insertions(+), 326 deletions(-) delete mode 100644 agents-api/agents_api/models/entry/get_entries.py create mode 100644 agents-api/agents_api/models/entry/list_entries.py delete mode 100644 sdks/python/julep/api/types/history_route_list_request_direction.py delete mode 100644 sdks/python/julep/api/types/history_route_list_request_sort_by.py delete mode 100644 sdks/python/julep/api/types/history_route_list_response.py diff --git a/agents-api/agents_api/models/entry/get_entries.py b/agents-api/agents_api/models/entry/get_entries.py deleted file mode 100644 index be9cbe347..000000000 --- a/agents-api/agents_api/models/entry/get_entries.py +++ /dev/null @@ -1,59 +0,0 @@ -from uuid import UUID - -from beartype import beartype - -from ..utils import cozo_query - - -@cozo_query -@beartype -def get_entries_query( - session_id: UUID, limit: int = 100, offset: int = 0 -) -> tuple[str, dict]: - """ - Constructs and executes a query to retrieve entries from the 'cozodb' database. - - Parameters: - session_id (UUID): The session ID to filter entries. - limit (int): The maximum number of entries to return. Defaults to 100. - offset (int): The offset from which to start returning entries. Defaults to 0. - client (CozoClient): The CozoClient instance to use for the query. - - Returns: - pd.DataFrame: The query results as a pandas DataFrame. - """ - # Construct the query string to select specific fields from the 'entries' relation - # where the source is either "api_request" or "api_response", sorted by timestamp. - # The query uses placeholders for session_id, limit, and offset to prevent SQL injection. - query = """ - { - ?[ - session_id, - entry_id, - role, - name, - content, - source, - token_count, - created_at, - timestamp, - ] := *entries{ - session_id, - entry_id, - role, - name, - content, - source, - token_count, - created_at, - timestamp, - }, - source in ["api_request", "api_response"], - session_id = to_uuid($session_id), - - :sort timestamp - :limit $limit - :offset $offset - }""" - - return (query, {"session_id": str(session_id), "limit": limit, "offset": offset}) diff --git a/agents-api/agents_api/models/entry/list_entries.py b/agents-api/agents_api/models/entry/list_entries.py new file mode 100644 index 000000000..9091b25d8 --- /dev/null +++ b/agents-api/agents_api/models/entry/list_entries.py @@ -0,0 +1,100 @@ +from typing import Literal +from uuid import UUID + +from beartype import beartype +from fastapi import HTTPException +from pycozo.client import QueryException +from pydantic import ValidationError + +from ...autogen.openapi_model import CreateEntryRequest, Entry +from ...common.utils.cozo import cozo_process_mutate_data +from ...common.utils.datetime import utcnow +from ...common.utils.messages import content_to_json +from ..utils import ( + cozo_query, + partialclass, + rewrap_exceptions, + verify_developer_id_query, + verify_developer_owns_resource_query, + wrap_in_class, +) + + +@rewrap_exceptions( + { + QueryException: partialclass(HTTPException, status_code=400), + ValidationError: partialclass(HTTPException, status_code=400), + TypeError: partialclass(HTTPException, status_code=400), + } +) +@wrap_in_class( + Entry, + transform=lambda d: { + "id": UUID(d.pop("entry_id")), + **d, + }, +) +@cozo_query +@beartype +def list_entries( + *, + developer_id: UUID, + session_id: UUID, + limit: int = 100, + allowed_sources: list[str] = ["api_request", "api_response"], +) -> tuple[str, dict]: + """ + Constructs and executes a query to retrieve entries from the 'cozodb' database. + + Parameters: + session_id (UUID): The session ID to filter entries. + limit (int): The maximum number of entries to return. Defaults to 100. + offset (int): The offset from which to start returning entries. Defaults to 0. + + """ + developer_id = str(developer_id) + session_id = str(session_id) + + list_query = """ + ?[ + session_id, + entry_id, + role, + name, + content, + source, + token_count, + created_at, + timestamp, + ] := *entries{ + session_id, + entry_id, + role, + name, + content, + source, + token_count, + created_at, + timestamp, + }, + source in $allowed_sources, + session_id = to_uuid($session_id), + + :sort timestamp + """ + + if limit > 0: + list_query += f"\n:limit {limit}" + + queries = [ + verify_developer_id_query(developer_id), + verify_developer_owns_resource_query( + developer_id, "sessions", session_id=session_id + ), + list_query, + ] + + query = "}\n\n{\n".join(queries) + query = f"{{ {query} }}" + + return (query, {"session_id": session_id, "allowed_sources": allowed_sources}) diff --git a/sdks/python/julep/api/__init__.py b/sdks/python/julep/api/__init__.py index 2c2b3a3cc..0c7e39653 100644 --- a/sdks/python/julep/api/__init__.py +++ b/sdks/python/julep/api/__init__.py @@ -115,9 +115,6 @@ ExecutionsUpdateExecutionRequest, ExecutionsUpdateExecutionRequest_Cancelled, ExecutionsUpdateExecutionRequest_Running, - HistoryRouteListRequestDirection, - HistoryRouteListRequestSortBy, - HistoryRouteListResponse, JobsJobState, JobsJobStatus, SessionsContextOverflowType, @@ -308,9 +305,6 @@ "ExecutionsUpdateExecutionRequest", "ExecutionsUpdateExecutionRequest_Cancelled", "ExecutionsUpdateExecutionRequest_Running", - "HistoryRouteListRequestDirection", - "HistoryRouteListRequestSortBy", - "HistoryRouteListResponse", "JobsJobState", "JobsJobStatus", "JulepApiEnvironment", diff --git a/sdks/python/julep/api/client.py b/sdks/python/julep/api/client.py index f085735e8..49ff34162 100644 --- a/sdks/python/julep/api/client.py +++ b/sdks/python/julep/api/client.py @@ -70,6 +70,7 @@ from .types.docs_doc import DocsDoc from .types.docs_embed_query_request import DocsEmbedQueryRequest from .types.docs_embed_query_response import DocsEmbedQueryResponse +from .types.entries_history import EntriesHistory from .types.execution_transitions_route_list_request_direction import ( ExecutionTransitionsRouteListRequestDirection, ) @@ -81,9 +82,6 @@ ) from .types.executions_execution import ExecutionsExecution from .types.executions_update_execution_request import ExecutionsUpdateExecutionRequest -from .types.history_route_list_request_direction import HistoryRouteListRequestDirection -from .types.history_route_list_request_sort_by import HistoryRouteListRequestSortBy -from .types.history_route_list_response import HistoryRouteListResponse from .types.jobs_job_status import JobsJobStatus from .types.sessions_context_overflow_type import SessionsContextOverflowType from .types.sessions_route_list_request_direction import ( @@ -2622,19 +2620,15 @@ def chat_route_generate( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def history_route_list( + def history_route_history( self, id: CommonUuid, *, limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + ) -> EntriesHistory: """ - Get history of a Session (paginated) + Get history of a Session Parameters ---------- @@ -2644,24 +2638,12 @@ def history_route_list( limit : CommonLimit Limit the number of items returned - offset : CommonOffset - Offset the items returned - - sort_by : HistoryRouteListRequestSortBy - Sort by a field - - direction : HistoryRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteListResponse + EntriesHistory The request has succeeded. Examples @@ -2672,30 +2654,20 @@ def history_route_list( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) - client.history_route_list( + client.history_route_history( id="id", limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) """ _response = self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}/history", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, + params={"limit": limit}, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(EntriesHistory, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) @@ -6332,19 +6304,15 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def history_route_list( + async def history_route_history( self, id: CommonUuid, *, limit: CommonLimit, - offset: CommonOffset, - sort_by: HistoryRouteListRequestSortBy, - direction: HistoryRouteListRequestDirection, - metadata_filter: str, request_options: typing.Optional[RequestOptions] = None, - ) -> HistoryRouteListResponse: + ) -> EntriesHistory: """ - Get history of a Session (paginated) + Get history of a Session Parameters ---------- @@ -6354,24 +6322,12 @@ async def history_route_list( limit : CommonLimit Limit the number of items returned - offset : CommonOffset - Offset the items returned - - sort_by : HistoryRouteListRequestSortBy - Sort by a field - - direction : HistoryRouteListRequestDirection - Sort direction - - metadata_filter : str - JSON string of object that should be used to filter objects by metadata - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HistoryRouteListResponse + EntriesHistory The request has succeeded. Examples @@ -6387,13 +6343,9 @@ async def history_route_list( async def main() -> None: - await client.history_route_list( + await client.history_route_history( id="id", limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) @@ -6402,18 +6354,12 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( f"sessions/{jsonable_encoder(id)}/history", method="GET", - params={ - "limit": limit, - "offset": offset, - "sort_by": sort_by, - "direction": direction, - "metadata_filter": metadata_filter, - }, + params={"limit": limit}, request_options=request_options, ) try: if 200 <= _response.status_code < 300: - return pydantic_v1.parse_obj_as(HistoryRouteListResponse, _response.json()) # type: ignore + return pydantic_v1.parse_obj_as(EntriesHistory, _response.json()) # type: ignore _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) diff --git a/sdks/python/julep/api/reference.md b/sdks/python/julep/api/reference.md index 7e8e230be..623e7a168 100644 --- a/sdks/python/julep/api/reference.md +++ b/sdks/python/julep/api/reference.md @@ -3630,7 +3630,7 @@ client.chat_route_generate(
-
client.history_route_list(...) +
client.history_route_history(...)
@@ -3642,7 +3642,7 @@ client.chat_route_generate(
-Get history of a Session (paginated) +Get history of a Session
@@ -3663,13 +3663,9 @@ client = JulepApi( auth_key="YOUR_AUTH_KEY", api_key="YOUR_API_KEY", ) -client.history_route_list( +client.history_route_history( id="id", limit=1, - offset=1, - sort_by="created_at", - direction="asc", - metadata_filter="metadata_filter", ) ``` @@ -3702,38 +3698,6 @@ client.history_route_list(
-**offset:** `CommonOffset` — Offset the items returned - -
-
- -
-
- -**sort_by:** `HistoryRouteListRequestSortBy` — Sort by a field - -
-
- -
-
- -**direction:** `HistoryRouteListRequestDirection` — Sort direction - -
-
- -
-
- -**metadata_filter:** `str` — JSON string of object that should be used to filter objects by metadata - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
diff --git a/sdks/python/julep/api/types/__init__.py b/sdks/python/julep/api/types/__init__.py index 4e11ae2f5..c1397222b 100644 --- a/sdks/python/julep/api/types/__init__.py +++ b/sdks/python/julep/api/types/__init__.py @@ -158,9 +158,6 @@ ExecutionsUpdateExecutionRequest_Cancelled, ExecutionsUpdateExecutionRequest_Running, ) -from .history_route_list_request_direction import HistoryRouteListRequestDirection -from .history_route_list_request_sort_by import HistoryRouteListRequestSortBy -from .history_route_list_response import HistoryRouteListResponse from .jobs_job_state import JobsJobState from .jobs_job_status import JobsJobStatus from .sessions_context_overflow_type import SessionsContextOverflowType @@ -366,9 +363,6 @@ "ExecutionsUpdateExecutionRequest", "ExecutionsUpdateExecutionRequest_Cancelled", "ExecutionsUpdateExecutionRequest_Running", - "HistoryRouteListRequestDirection", - "HistoryRouteListRequestSortBy", - "HistoryRouteListResponse", "JobsJobState", "JobsJobStatus", "SessionsContextOverflowType", diff --git a/sdks/python/julep/api/types/history_route_list_request_direction.py b/sdks/python/julep/api/types/history_route_list_request_direction.py deleted file mode 100644 index cd09bd721..000000000 --- a/sdks/python/julep/api/types/history_route_list_request_direction.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -HistoryRouteListRequestDirection = typing.Union[ - typing.Literal["asc", "desc"], typing.Any -] diff --git a/sdks/python/julep/api/types/history_route_list_request_sort_by.py b/sdks/python/julep/api/types/history_route_list_request_sort_by.py deleted file mode 100644 index 7e656e2c7..000000000 --- a/sdks/python/julep/api/types/history_route_list_request_sort_by.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -HistoryRouteListRequestSortBy = typing.Union[ - typing.Literal["created_at", "updated_at", "deleted_at"], typing.Any -] diff --git a/sdks/python/julep/api/types/history_route_list_response.py b/sdks/python/julep/api/types/history_route_list_response.py deleted file mode 100644 index 626facd34..000000000 --- a/sdks/python/julep/api/types/history_route_list_response.py +++ /dev/null @@ -1,43 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.datetime_utils import serialize_datetime -from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 -from .entries_history import EntriesHistory - - -class HistoryRouteListResponse(pydantic_v1.BaseModel): - results: typing.List[EntriesHistory] - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - kwargs_with_defaults_exclude_unset: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - kwargs_with_defaults_exclude_none: typing.Any = { - "by_alias": True, - "exclude_none": True, - **kwargs, - } - - return deep_union_pydantic_dicts( - super().dict(**kwargs_with_defaults_exclude_unset), - super().dict(**kwargs_with_defaults_exclude_none), - ) - - class Config: - frozen = True - smart_union = True - extra = pydantic_v1.Extra.allow - json_encoders = {dt.datetime: serialize_datetime} diff --git a/sdks/ts/src/api/services/DefaultService.ts b/sdks/ts/src/api/services/DefaultService.ts index 622a77ffa..0c8e756e9 100644 --- a/sdks/ts/src/api/services/DefaultService.ts +++ b/sdks/ts/src/api/services/DefaultService.ts @@ -1298,79 +1298,53 @@ export class DefaultService { }); } /** - * Get history of a Session (paginated) - * @returns any The request has succeeded. + * Clear the history of a Session (resets the Session) + * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. * @throws ApiError */ - public historyRouteList({ + public historyRouteDelete({ id, - limit = 100, - offset, - sortBy = "created_at", - direction = "asc", - metadataFilter = "{}", }: { /** - * ID of parent + * ID of the resource */ id: Common_uuid; - /** - * Limit the number of items returned - */ - limit?: Common_limit; - /** - * Offset the items returned - */ - offset: Common_offset; - /** - * Sort by a field - */ - sortBy?: "created_at" | "updated_at" | "deleted_at"; - /** - * Sort direction - */ - direction?: "asc" | "desc"; - /** - * JSON string of object that should be used to filter objects by metadata - */ - metadataFilter?: string; - }): CancelablePromise<{ - results: Array; - }> { + }): CancelablePromise { return this.httpRequest.request({ - method: "GET", + method: "DELETE", url: "/sessions/{id}/history", path: { id: id, }, - query: { - limit: limit, - offset: offset, - sort_by: sortBy, - direction: direction, - metadata_filter: metadataFilter, - }, }); } /** - * Clear the history of a Session (resets the Session) - * @returns Common_ResourceDeletedResponse The request has been accepted for processing, but processing has not yet completed. + * Get history of a Session + * @returns Entries_History The request has succeeded. * @throws ApiError */ - public historyRouteDelete({ + public historyRouteHistory({ id, + limit = 100, }: { /** - * ID of the resource + * ID of parent */ id: Common_uuid; - }): CancelablePromise { + /** + * Limit the number of items returned + */ + limit?: Common_limit; + }): CancelablePromise { return this.httpRequest.request({ - method: "DELETE", + method: "GET", url: "/sessions/{id}/history", path: { id: id, }, + query: { + limit: limit, + }, }); } /** diff --git a/typespec/common/interfaces.tsp b/typespec/common/interfaces.tsp index d83cf81ab..56beb423a 100644 --- a/typespec/common/interfaces.tsp +++ b/typespec/common/interfaces.tsp @@ -190,32 +190,22 @@ interface ChildCreateOrUpdateEndpoint< }; } -interface ChildDeleteEndpoint< - DocString extends valueof string = "Delete a resource owned by the given parent using its id" -> { +interface ChildDeleteEndpoint { @delete - @doc( - DocString - ) + @doc(DocString) delete( @path - @doc( - "ID of parent resource", - ) + @doc("ID of parent resource") id: uuid, @path - @doc( - "ID of the resource to be deleted", - ) + @doc("ID of the resource to be deleted") child_id: uuid, ): { @statusCode _: "202"; @body - @doc( - "Details of the resource deleted along with ID", - ) + @doc("Details of the resource deleted along with ID") body: ResourceDeletedResponse; }; } @@ -225,20 +215,14 @@ interface ChildUpdateEndpoint< DocString extends valueof string = "Update a resource owned by the given parent using its id" > { @put - @doc( - DocString - ) + @doc(DocString) update( @path - @doc( - "ID of parent resource", - ) + @doc("ID of parent resource") id: uuid, @path - @doc( - "ID of the resource to be updated", - ) + @doc("ID of the resource to be updated") child_id: uuid, ...UpdateType, @@ -246,9 +230,7 @@ interface ChildUpdateEndpoint< @statusCode _: "200"; @body - @doc( - "Details of the resource updated along with ID", - ) + @doc("Details of the resource updated along with ID") body: ResourceUpdatedResponse; }; } @@ -258,29 +240,22 @@ interface ChildPatchEndpoint< DocString extends valueof string = "Patch a resource owned by the given parent using its id" > { @patch - @doc( - DocString - ) + @doc(DocString) patch( @path - @doc( - "ID of parent resource", - ) + @doc("ID of parent resource") id: uuid, @path - @doc( - "ID of the resource to be patched", - ) + @doc("ID of the resource to be patched") child_id: uuid, + ...PatchType, ): { @statusCode _: "200"; @body - @doc( - "Details of the resource patched along with ID", - ) + @doc("Details of the resource patched along with ID") body: ResourceUpdatedResponse; }; } diff --git a/typespec/entries/endpoints.tsp b/typespec/entries/endpoints.tsp index 5c41984ce..bcb9459b6 100644 --- a/typespec/entries/endpoints.tsp +++ b/typespec/entries/endpoints.tsp @@ -1,7 +1,11 @@ +import "@typespec/http"; + import "../common"; import "../sessions"; import "./models.tsp"; +using TypeSpec.Http; + using Common; using Sessions; @@ -12,8 +16,16 @@ namespace Entries; // interface Endpoints - extends ChildLimitOffsetPagination< - History, - "Get history of a Session (paginated)" - >, - DeleteEndpoint<"Clear the history of a Session (resets the Session)"> {} + extends DeleteEndpoint<"Clear the history of a Session (resets the Session)"> { + @get + @doc("Get history of a Session") + history( + @path + @doc("ID of parent") + id: uuid, + + @query + @doc("Limit the number of items returned") + limit: limit = 100, + ): History; +}