chore: updated types (#1723)

This commit is contained in:
Isaac Francisco
2025-10-14 16:17:04 -07:00
committed by GitHub
parent 8580159f22
commit 636e142b3d
5 changed files with 35 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@langchain/langgraph-api": patch
---
Updated types to match python api
+2 -1
View File
@@ -14,6 +14,7 @@ import { getRuntimeGraphSchema } from "../graph/parser/index.mjs";
import { HTTPException } from "hono/http-exception";
import * as schemas from "../schemas.mjs";
import { assistants } from "../storage/context.mjs";
import { AssistantSelectField } from "../storage/types.mjs";
const api = new Hono();
const RunnableConfigSchema = z.object({
@@ -82,7 +83,7 @@ api.post(
offset: payload.offset ?? 0,
sort_by: payload.sort_by,
sort_order: payload.sort_order,
select: payload.select,
select: payload.select as AssistantSelectField[],
},
c.var.auth
)) {
+2 -1
View File
@@ -7,7 +7,7 @@ import { z } from "zod";
import * as schemas from "../schemas.mjs";
import { stateSnapshotToThreadState } from "../state.mjs";
import { threads } from "../storage/context.mjs";
import type { RunnableConfig } from "../storage/types.mjs";
import type { RunnableConfig, ThreadSelectField } from "../storage/types.mjs";
import { jsonExtra } from "../utils/hono.mjs";
const api = new Hono();
@@ -52,6 +52,7 @@ api.post(
offset: payload.offset ?? 0,
sort_by: payload.sort_by ?? "created_at",
sort_order: payload.sort_order ?? "desc",
select: payload.select as ThreadSelectField[],
},
c.var.auth
)) {
+1
View File
@@ -369,6 +369,7 @@ export const ThreadSearchRequest = z
.describe("Sort by field.")
.optional(),
sort_order: z.enum(["asc", "desc"]).describe("Sort order.").optional(),
select: z.array(z.string()).optional(),
})
.describe("Payload for listing threads.");
+25 -1
View File
@@ -17,6 +17,29 @@ export type StorageEnv = {
export type Metadata = Record<string, unknown>;
export type AssistantSelectField =
| "assistant_id"
| "graph_id"
| "name"
| "description"
| "config"
| "context"
| "created_at"
| "updated_at"
| "metadata"
| "version";
export type ThreadSelectField =
| "thread_id"
| "created_at"
| "updated_at"
| "metadata"
| "config"
| "context"
| "status"
| "values"
| "interrupts";
export type ThreadStatus = "idle" | "busy" | "interrupted" | "error";
export type RunStatus =
@@ -292,6 +315,7 @@ export interface ThreadsRepo {
offset: number;
sort_by?: "thread_id" | "status" | "created_at" | "updated_at";
sort_order?: "asc" | "desc";
select?: ThreadSelectField[];
},
auth: AuthContext | undefined
): AsyncGenerator<{ thread: Thread; total: number }>;
@@ -397,7 +421,7 @@ export interface AssistantsRepo {
| "name"
| "graph_id";
sort_order?: "asc" | "desc";
select?: string[];
select?: AssistantSelectField[];
},
auth: AuthContext | undefined
): AsyncGenerator<{ assistant: Assistant; total: number }>;