Skip to content

Commit

Permalink
chore(sdk-node): Update ts-rest contract
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjcsmith committed Nov 8, 2024
1 parent 3609beb commit 3d92016
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions sdk-node/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const agentDataSchema = z
.object({
done: z.boolean().optional(),
result: anyObject.optional(),
summary: z.string().optional(),
message: z.string().optional(),
learnings: z.array(learningSchema).optional(),
issue: z.string().optional(),
invocations: z
Expand Down Expand Up @@ -437,6 +437,12 @@ export const definition = {
.default(true)
.optional()
.describe("Enable summarization of oversized call results"),
interactive: z
.boolean()
.default(false)
.describe(
"Allow the run to be continued with follow-up messages / message edits",
),
}),
responses: {
201: z.object({
Expand Down Expand Up @@ -483,24 +489,7 @@ export const definition = {
type: z.enum(["human", "supervisor"]).optional(),
}),
responses: {
200: z.object({
messages: z.array(
z.object({
id: z.string(),
data: messageDataSchema,
type: z.enum([
"human",
"template",
"result",
"agent",
"agent-invalid",
"supervisor",
]),
createdAt: z.date(),
pending: z.boolean().default(false),
}),
),
}),
201: z.undefined(),
401: z.undefined(),
},
pathParams: z.object({
Expand All @@ -522,7 +511,7 @@ export const definition = {
type: z.enum([
"human",
"template",
"result",
"invocation-result",
"agent",
"agent-invalid",
"supervisor",
Expand Down Expand Up @@ -591,7 +580,6 @@ export const definition = {
feedbackComment: z.string().nullable(),
feedbackScore: z.number().nullable(),
result: anyObject.nullable(),
summary: z.string().nullable(),
metadata: z.record(z.string()).nullable(),
attachedFunctions: z.array(z.string()).nullable(),
}),
Expand Down Expand Up @@ -906,10 +894,10 @@ export const definition = {
id: z.string(),
data: messageDataSchema,
type: z.enum([
"human",
// TODO: Remove 'template' type
"template",
"result",
"invocation-result",
"human",
"agent",
"agent-invalid",
"supervisor",
Expand Down

0 comments on commit 3d92016

Please sign in to comment.