chore: update workflows SDK

This commit is contained in:
llama-org-ci-bot[bot]
2025-09-23 19:28:58 +00:00
committed by github-actions[bot]
parent 9ce7801a86
commit 78476f992a
6 changed files with 144 additions and 25 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@llamaindex/workflows-client": minor
---
+65 -11
View File
@@ -2,7 +2,7 @@
"openapi": "3.0.0",
"info": {
"title": "Workflows API",
"version": "2.2.2"
"version": "2.3.0"
},
"paths": {
"/workflows": {
@@ -301,25 +301,33 @@
"required": false,
"schema": {
"type": "boolean",
"default": false
"default": true
},
"description": "If true, stream as text/event-stream instead of NDJSON."
"description": "If false, as NDJSON instead of Server-Sent Events."
}
],
"responses": {
"200": {
"description": "Streaming started",
"content": {
"application/x-ndjson": {
"schema": {
"type": "string",
"description": "Newline-delimited JSON stream of events."
}
},
"text/event-stream": {
"schema": {
"type": "string",
"description": "Server-Sent Events stream of event data."
"type": "object",
"description": "Server-Sent Events stream of event data.",
"properties": {
"value": {
"type": "object",
"description": "The event value."
},
"qualified_name": {
"type": "string",
"description": "The qualified name of the event."
}
},
"required": [
"value",
"qualified_name"
]
}
}
}
@@ -474,6 +482,52 @@
}
}
}
},
"/workflows/{name}/representation": {
"get": {
"summary": "Get the representation of the workflow",
"description": "Get the representation of the workflow as a directed graph in JSON format\n",
"parameters": [
{
"in": "path",
"name": "name",
"required": true,
"schema": {
"type": "string"
},
"description": "Registered workflow name."
}
],
"requestBody": {
"required": false
},
"responses": {
"200": {
"description": "JSON representation successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"graph": {
"description": "the elements of the JSON representation of the workflow"
}
},
"required": [
"graph"
]
}
}
}
},
"404": {
"description": "Workflow not found"
},
"500": {
"description": "Error while getting JSON workflow representation"
}
}
}
}
}
}
@@ -1,7 +1,7 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { ClientOptions } from './types.gen';
import { type ClientOptions as DefaultClientOptions, type Config, createClient, createConfig } from './client';
import { type ClientOptions, type Config, createClient, createConfig } from './client';
import type { ClientOptions as ClientOptions2 } from './types.gen';
/**
* The `createClientConfig()` function will be called on client initialization
@@ -11,6 +11,6 @@ import { type ClientOptions as DefaultClientOptions, type Config, createClient,
* `setConfig()`. This is useful for example if you're using Next.js
* to ensure your client always has the correct values.
*/
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
export const client = createClient(createConfig<ClientOptions>());
export const client = createClient(createConfig<ClientOptions2>());
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export * from './types.gen';
export type * from './types.gen';
export * from './sdk.gen';
@@ -1,10 +1,10 @@
// This file is auto-generated by @hey-api/openapi-ts
import type { Options as ClientOptions, Client, TDataShape } from './client';
import type { GetWorkflowsData, GetWorkflowsResponses, PostWorkflowsByNameRunData, PostWorkflowsByNameRunResponses, PostWorkflowsByNameRunErrors, PostWorkflowsByNameRunNowaitData, PostWorkflowsByNameRunNowaitResponses, PostWorkflowsByNameRunNowaitErrors, GetWorkflowsByNameSchemaData, GetWorkflowsByNameSchemaResponses, GetWorkflowsByNameSchemaErrors, GetResultsByHandlerIdData, GetResultsByHandlerIdResponses, GetResultsByHandlerIdErrors, GetEventsByHandlerIdData, GetEventsByHandlerIdResponses, GetEventsByHandlerIdErrors, PostEventsByHandlerIdData, PostEventsByHandlerIdResponses, PostEventsByHandlerIdErrors, GetHealthData, GetHealthResponses, GetHandlersData, GetHandlersResponses } from './types.gen';
import type { Client, Options as Options2, TDataShape } from './client';
import { client } from './client.gen';
import type { GetEventsByHandlerIdData, GetEventsByHandlerIdErrors, GetEventsByHandlerIdResponses, GetHandlersData, GetHandlersResponses, GetHealthData, GetHealthResponses, GetResultsByHandlerIdData, GetResultsByHandlerIdErrors, GetResultsByHandlerIdResponses, GetWorkflowsByNameRepresentationData, GetWorkflowsByNameRepresentationErrors, GetWorkflowsByNameRepresentationResponses, GetWorkflowsByNameSchemaData, GetWorkflowsByNameSchemaErrors, GetWorkflowsByNameSchemaResponses, GetWorkflowsData, GetWorkflowsResponses, PostEventsByHandlerIdData, PostEventsByHandlerIdErrors, PostEventsByHandlerIdResponses, PostWorkflowsByNameRunData, PostWorkflowsByNameRunErrors, PostWorkflowsByNameRunNowaitData, PostWorkflowsByNameRunNowaitErrors, PostWorkflowsByNameRunNowaitResponses, PostWorkflowsByNameRunResponses } from './types.gen';
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
/**
* You can provide a client instance returned by `createClient()` instead of
* individual options. This might be also useful if you want to implement a
@@ -101,7 +101,7 @@ export const getResultsByHandlerId = <ThrowOnError extends boolean = false>(opti
*
*/
export const getEventsByHandlerId = <ThrowOnError extends boolean = false>(options: Options<GetEventsByHandlerIdData, ThrowOnError>) => {
return (options.client ?? client).get<GetEventsByHandlerIdResponses, GetEventsByHandlerIdErrors, ThrowOnError>({
return (options.client ?? client).sse.get<GetEventsByHandlerIdResponses, GetEventsByHandlerIdErrors, ThrowOnError>({
url: '/events/{handler_id}',
...options
});
@@ -143,3 +143,15 @@ export const getHandlers = <ThrowOnError extends boolean = false>(options?: Opti
...options
});
};
/**
* Get the representation of the workflow
* Get the representation of the workflow as a directed graph in JSON format
*
*/
export const getWorkflowsByNameRepresentation = <ThrowOnError extends boolean = false>(options: Options<GetWorkflowsByNameRepresentationData, ThrowOnError>) => {
return (options.client ?? client).get<GetWorkflowsByNameRepresentationResponses, GetWorkflowsByNameRepresentationErrors, ThrowOnError>({
url: '/workflows/{name}/representation',
...options
});
};
@@ -1,5 +1,9 @@
// This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = {
baseUrl: `${string}://${string}` | (string & {});
};
export type GetWorkflowsData = {
body?: never;
path?: never;
@@ -226,7 +230,7 @@ export type GetEventsByHandlerIdData = {
};
query?: {
/**
* If true, stream as text/event-stream instead of NDJSON.
* If false, as NDJSON instead of Server-Sent Events.
*/
sse?: boolean;
};
@@ -242,9 +246,20 @@ export type GetEventsByHandlerIdErrors = {
export type GetEventsByHandlerIdResponses = {
/**
* Newline-delimited JSON stream of events.
* Server-Sent Events stream of event data.
*/
200: string;
200: {
/**
* The event value.
*/
value: {
[key: string]: unknown;
};
/**
* The qualified name of the event.
*/
qualified_name: string;
};
};
export type GetEventsByHandlerIdResponse = GetEventsByHandlerIdResponses[keyof GetEventsByHandlerIdResponses];
@@ -341,6 +356,39 @@ export type GetHandlersResponses = {
export type GetHandlersResponse = GetHandlersResponses[keyof GetHandlersResponses];
export type ClientOptions = {
baseUrl: `${string}://${string}` | (string & {});
export type GetWorkflowsByNameRepresentationData = {
body?: never;
path: {
/**
* Registered workflow name.
*/
name: string;
};
query?: never;
url: '/workflows/{name}/representation';
};
export type GetWorkflowsByNameRepresentationErrors = {
/**
* Workflow not found
*/
404: unknown;
/**
* Error while getting JSON workflow representation
*/
500: unknown;
};
export type GetWorkflowsByNameRepresentationResponses = {
/**
* JSON representation successfully retrieved
*/
200: {
/**
* the elements of the JSON representation of the workflow
*/
graph: unknown;
};
};
export type GetWorkflowsByNameRepresentationResponse = GetWorkflowsByNameRepresentationResponses[keyof GetWorkflowsByNameRepresentationResponses];