mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-08 18:57:52 +02:00
fix: Cron response types
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
ListNamespaceResponse,
|
||||
Item,
|
||||
ThreadStatus,
|
||||
CronCreateResponse,
|
||||
} from "./schema.js";
|
||||
import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.js";
|
||||
import {
|
||||
@@ -184,7 +185,7 @@ export class CronsClient extends BaseClient {
|
||||
threadId: string,
|
||||
assistantId: string,
|
||||
payload?: CronsCreatePayload,
|
||||
): Promise<Run> {
|
||||
): Promise<CronCreateResponse> {
|
||||
const json: Record<string, any> = {
|
||||
schedule: payload?.schedule,
|
||||
input: payload?.input,
|
||||
@@ -197,7 +198,7 @@ export class CronsClient extends BaseClient {
|
||||
multitask_strategy: payload?.multitaskStrategy,
|
||||
if_not_exists: payload?.ifNotExists,
|
||||
};
|
||||
return this.fetch<Run>(`/threads/${threadId}/runs/crons`, {
|
||||
return this.fetch<CronCreateResponse>(`/threads/${threadId}/runs/crons`, {
|
||||
method: "POST",
|
||||
json,
|
||||
});
|
||||
@@ -212,7 +213,7 @@ export class CronsClient extends BaseClient {
|
||||
async create(
|
||||
assistantId: string,
|
||||
payload?: CronsCreatePayload,
|
||||
): Promise<Run> {
|
||||
): Promise<CronCreateResponse> {
|
||||
const json: Record<string, any> = {
|
||||
schedule: payload?.schedule,
|
||||
input: payload?.input,
|
||||
@@ -225,7 +226,7 @@ export class CronsClient extends BaseClient {
|
||||
multitask_strategy: payload?.multitaskStrategy,
|
||||
if_not_exists: payload?.ifNotExists,
|
||||
};
|
||||
return this.fetch<Run>(`/runs/crons`, {
|
||||
return this.fetch<CronCreateResponse>(`/runs/crons`, {
|
||||
method: "POST",
|
||||
json,
|
||||
});
|
||||
|
||||
@@ -278,3 +278,17 @@ export interface SearchItem extends Item {
|
||||
export interface SearchItemsResponse {
|
||||
items: SearchItem[];
|
||||
}
|
||||
|
||||
export interface CronCreateResponse {
|
||||
cron_id: string;
|
||||
assistant_id: string;
|
||||
thread_id: string | undefined;
|
||||
user_id: string;
|
||||
payload: Record<string, unknown>;
|
||||
schedule: string;
|
||||
next_run_date: string;
|
||||
end_time: string | undefined;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
metadata: Metadata;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user