Comparing version 0.7.3 to 0.7.4
1313
dist/index.d.ts
@@ -197,3 +197,3 @@ import OpenAI from 'openai'; | ||
declare function startWorkflow(baseUrl: string, apiKey: string): (query: string, modules?: string) => Promise<StartWorkflowRes>; | ||
type FunctionJson = { | ||
type FunctionJson$1 = { | ||
name: string; | ||
@@ -207,7 +207,1310 @@ description?: string; | ||
type putFunctionJsonsReq = { | ||
jsons: FunctionJson[]; | ||
jsons: FunctionJson$1[]; | ||
module?: string; | ||
}; | ||
declare function putFunctionJsons(baseUrl: string, apiKey: string): (jsons: FunctionJson[], module?: string) => Promise<void>; | ||
declare function putFunctionJsons(baseUrl: string, apiKey: string): (jsons: FunctionJson$1[], module?: string) => Promise<void>; | ||
/** | ||
* Recursive JSON object schema | ||
*/ | ||
type ObjectJsonSchema = { | ||
type: 'object'; | ||
properties: Record<string, ValueJsonSchema>; | ||
description?: string; | ||
}; | ||
type RecordJsonSchema = { | ||
type: 'object'; | ||
additionalProperties: ValueJsonSchema; | ||
description?: string; | ||
}; | ||
type ArrayJsonSchema = { | ||
type: 'array'; | ||
items: ValueJsonSchema; | ||
description?: string; | ||
}; | ||
type RealUnionJsonSchema = { | ||
anyOf: ValueJsonSchema[]; | ||
description?: string; | ||
}; | ||
declare const valueJsonSchema: z.ZodUnion<[z.ZodType<ObjectJsonSchema, z.ZodTypeDef, ObjectJsonSchema>, z.ZodType<RecordJsonSchema, z.ZodTypeDef, RecordJsonSchema>, z.ZodType<ArrayJsonSchema, z.ZodTypeDef, ArrayJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"array">; | ||
prefixItems: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"string">; | ||
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodUnion<[z.ZodLiteral<"number">, z.ZodLiteral<"integer">]>; | ||
description: z.ZodOptional<z.ZodString>; | ||
minimum: z.ZodOptional<z.ZodNumber>; | ||
maximum: z.ZodOptional<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"boolean">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodType<RealUnionJsonSchema, z.ZodTypeDef, RealUnionJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"unknown">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"null">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
$ref: z.ZodString; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>]>; | ||
type ValueJsonSchema = z.infer<typeof valueJsonSchema>; | ||
/** | ||
* OpenAI function json schema | ||
*/ | ||
declare const functionJsonSchema: z.ZodObject<{ | ||
name: z.ZodString; | ||
description: z.ZodString; | ||
parameters: z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"object">; | ||
properties: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodType<ObjectJsonSchema, z.ZodTypeDef, ObjectJsonSchema>, z.ZodType<RecordJsonSchema, z.ZodTypeDef, RecordJsonSchema>, z.ZodType<ArrayJsonSchema, z.ZodTypeDef, ArrayJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"array">; | ||
prefixItems: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"string">; | ||
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodUnion<[z.ZodLiteral<"number">, z.ZodLiteral<"integer">]>; | ||
description: z.ZodOptional<z.ZodString>; | ||
minimum: z.ZodOptional<z.ZodNumber>; | ||
maximum: z.ZodOptional<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"boolean">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodType<RealUnionJsonSchema, z.ZodTypeDef, RealUnionJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"unknown">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"null">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
$ref: z.ZodString; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>]>>; | ||
description: z.ZodOptional<z.ZodString>; | ||
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "object"; | ||
properties: Record<string, ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>; | ||
description?: string | undefined; | ||
required?: string[] | undefined; | ||
}, { | ||
type: "object"; | ||
properties: Record<string, ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>; | ||
description?: string | undefined; | ||
required?: string[] | undefined; | ||
}>, z.ZodArray<z.ZodUnion<[z.ZodType<ObjectJsonSchema, z.ZodTypeDef, ObjectJsonSchema>, z.ZodType<RecordJsonSchema, z.ZodTypeDef, RecordJsonSchema>, z.ZodType<ArrayJsonSchema, z.ZodTypeDef, ArrayJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"array">; | ||
prefixItems: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"string">; | ||
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodUnion<[z.ZodLiteral<"number">, z.ZodLiteral<"integer">]>; | ||
description: z.ZodOptional<z.ZodString>; | ||
minimum: z.ZodOptional<z.ZodNumber>; | ||
maximum: z.ZodOptional<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"boolean">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodType<RealUnionJsonSchema, z.ZodTypeDef, RealUnionJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"unknown">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"null">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
$ref: z.ZodString; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>]>, "many">]>; | ||
returns: z.ZodUnion<[z.ZodType<ObjectJsonSchema, z.ZodTypeDef, ObjectJsonSchema>, z.ZodType<RecordJsonSchema, z.ZodTypeDef, RecordJsonSchema>, z.ZodType<ArrayJsonSchema, z.ZodTypeDef, ArrayJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"array">; | ||
prefixItems: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"string">; | ||
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}, { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodUnion<[z.ZodLiteral<"number">, z.ZodLiteral<"integer">]>; | ||
description: z.ZodOptional<z.ZodString>; | ||
minimum: z.ZodOptional<z.ZodNumber>; | ||
maximum: z.ZodOptional<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}, { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"boolean">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}, { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodArray<z.ZodString, "many">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}, { | ||
type: string[]; | ||
description?: string | undefined; | ||
}>, z.ZodType<RealUnionJsonSchema, z.ZodTypeDef, RealUnionJsonSchema>, z.ZodObject<{ | ||
type: z.ZodLiteral<"unknown">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}, { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"null">; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}, { | ||
type: "null"; | ||
description?: string | undefined; | ||
}>, z.ZodObject<{ | ||
$ref: z.ZodString; | ||
description: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}, { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>]>; | ||
usageExample: z.ZodOptional<z.ZodString>; | ||
returnsExample: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
description: string; | ||
name: string; | ||
parameters: ({ | ||
type: "object"; | ||
properties: Record<string, ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>; | ||
description?: string | undefined; | ||
required?: string[] | undefined; | ||
} | (ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
})[]) & ({ | ||
type: "object"; | ||
properties: Record<string, ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>; | ||
description?: string | undefined; | ||
required?: string[] | undefined; | ||
} | (ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
})[] | undefined); | ||
returns: ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
} | (ObjectJsonSchema & RecordJsonSchema) | (ObjectJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (ObjectJsonSchema & RealUnionJsonSchema) | (ObjectJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | (RecordJsonSchema & ObjectJsonSchema) | (RecordJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (RecordJsonSchema & RealUnionJsonSchema) | (RecordJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | (ArrayJsonSchema & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | (ArrayJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (ArrayJsonSchema & RealUnionJsonSchema) | (ArrayJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & ArrayJsonSchema) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & ObjectJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & RecordJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & ArrayJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "null"; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & ObjectJsonSchema) | (RealUnionJsonSchema & RecordJsonSchema) | (RealUnionJsonSchema & ArrayJsonSchema) | (RealUnionJsonSchema & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "null"; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "null"; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "null"; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "null"; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & ObjectJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & RecordJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & ArrayJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "null"; | ||
description?: string | undefined; | ||
}); | ||
usageExample?: string | undefined; | ||
returnsExample?: string | undefined; | ||
}, { | ||
description: string; | ||
name: string; | ||
parameters: ({ | ||
type: "object"; | ||
properties: Record<string, ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>; | ||
description?: string | undefined; | ||
required?: string[] | undefined; | ||
} | (ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
})[]) & ({ | ||
type: "object"; | ||
properties: Record<string, ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
}>; | ||
description?: string | undefined; | ||
required?: string[] | undefined; | ||
} | (ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
})[] | undefined); | ||
returns: ObjectJsonSchema | RecordJsonSchema | ArrayJsonSchema | { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} | { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} | { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} | { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} | { | ||
type: string[]; | ||
description?: string | undefined; | ||
} | RealUnionJsonSchema | { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} | { | ||
type: "null"; | ||
description?: string | undefined; | ||
} | { | ||
$ref: string; | ||
description?: string | undefined; | ||
} | (ObjectJsonSchema & RecordJsonSchema) | (ObjectJsonSchema & RealUnionJsonSchema) | (RecordJsonSchema & ObjectJsonSchema) | (RecordJsonSchema & RealUnionJsonSchema) | (ArrayJsonSchema & RealUnionJsonSchema) | (RealUnionJsonSchema & ObjectJsonSchema) | (RealUnionJsonSchema & RecordJsonSchema) | (RealUnionJsonSchema & ArrayJsonSchema) | (ObjectJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (ObjectJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | (RecordJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (RecordJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | (ArrayJsonSchema & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | (ArrayJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (ArrayJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & ArrayJsonSchema) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "boolean"; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & ObjectJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & RecordJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & ArrayJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
type: "null"; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: string[]; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
type: "null"; | ||
description?: string | undefined; | ||
}) | (RealUnionJsonSchema & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "unknown"; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "null"; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
type: "null"; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
type: "null"; | ||
description?: string | undefined; | ||
} & { | ||
$ref: string; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & ObjectJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & RecordJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & ArrayJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "array"; | ||
prefixItems: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "string"; | ||
enum?: string[] | undefined; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "number" | "integer"; | ||
description?: string | undefined; | ||
minimum?: number | undefined; | ||
maximum?: number | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "boolean"; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: string[]; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & RealUnionJsonSchema) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "unknown"; | ||
description?: string | undefined; | ||
}) | ({ | ||
$ref: string; | ||
description?: string | undefined; | ||
} & { | ||
type: "null"; | ||
description?: string | undefined; | ||
}); | ||
usageExample?: string | undefined; | ||
returnsExample?: string | undefined; | ||
}>; | ||
type FunctionJson = z.infer<typeof functionJsonSchema>; | ||
declare const nullFunctionJson: FunctionJson; | ||
declare const DEFAULT_BASE_URL = "https://5pz08znmzj.execute-api.us-west-2.amazonaws.com"; | ||
@@ -240,3 +1543,3 @@ type IudexMessage = ChatTurn; | ||
}); | ||
uploadFunctions: (jsons: Array<OpenAI.ChatCompletionCreateParams.Function>, modules?: string) => Promise<void>; | ||
uploadFunctions: (jsons: Array<OpenAI.ChatCompletionCreateParams.Function | FunctionJson>, modules?: string) => Promise<void>; | ||
linkFunctions: (functionLinker: (fnName: string) => (...args: any[]) => any) => void; | ||
@@ -264,2 +1567,2 @@ sendMessage: (message: string) => Promise<string>; | ||
export { type ChatCompletionMessageWithIudex, type ChatCompletionWithIudex, DEFAULT_BASE_URL, Iudex, type IudexMessage, type NextMessageRes, type ReturnFunctionCallBody, type ReturnFunctionCallRes, type StartWorkflowRes, Iudex as default, extractMessageTextContent, mapIudexToOpenAi, nextMessage, putFunctionJsons, type putFunctionJsonsReq, returnFunctionCall, startWorkflow }; | ||
export { type ChatCompletionMessageWithIudex, type ChatCompletionWithIudex, DEFAULT_BASE_URL, type FunctionJson, Iudex, type IudexMessage, type NextMessageRes, type ObjectJsonSchema, type ReturnFunctionCallBody, type ReturnFunctionCallRes, type StartWorkflowRes, type ValueJsonSchema, Iudex as default, extractMessageTextContent, functionJsonSchema, mapIudexToOpenAi, nextMessage, nullFunctionJson, putFunctionJsons, type putFunctionJsonsReq, returnFunctionCall, startWorkflow }; |
@@ -27,4 +27,6 @@ "use strict"; | ||
extractMessageTextContent: () => extractMessageTextContent, | ||
functionJsonSchema: () => functionJsonSchema, | ||
mapIudexToOpenAi: () => mapIudexToOpenAi, | ||
nextMessage: () => nextMessage, | ||
nullFunctionJson: () => nullFunctionJson, | ||
putFunctionJsons: () => putFunctionJsons, | ||
@@ -123,2 +125,97 @@ returnFunctionCall: () => returnFunctionCall, | ||
// src/function-types.ts | ||
var import_zod = require("zod"); | ||
var objectJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("object"), | ||
properties: import_zod.z.record(import_zod.z.lazy(() => valueJsonSchema)), | ||
description: import_zod.z.string().optional(), | ||
required: import_zod.z.array(import_zod.z.string()).optional() | ||
}); | ||
var recordJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("object"), | ||
additionalProperties: import_zod.z.lazy(() => valueJsonSchema), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var arrayJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("array"), | ||
items: import_zod.z.lazy(() => valueJsonSchema), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var tupleJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("array"), | ||
prefixItems: import_zod.z.array(import_zod.z.string()), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var stringJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("string"), | ||
enum: import_zod.z.array(import_zod.z.string()).optional(), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var numberJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.union([import_zod.z.literal("number"), import_zod.z.literal("integer")]), | ||
description: import_zod.z.string().optional(), | ||
minimum: import_zod.z.number().optional(), | ||
maximum: import_zod.z.number().optional() | ||
}); | ||
var booleanJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("boolean"), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var unionJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.array(import_zod.z.string()), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var realUnionJsonSchema = import_zod.z.object({ | ||
anyOf: import_zod.z.array(import_zod.z.lazy(() => valueJsonSchema)), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var unknownJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("unknown"), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var nullJsonSchema = import_zod.z.object({ | ||
type: import_zod.z.literal("null"), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var refJsonSchema = import_zod.z.object({ | ||
$ref: import_zod.z.string(), | ||
description: import_zod.z.string().optional() | ||
}); | ||
var valueJsonSchema = import_zod.z.union([ | ||
objectJsonSchema, | ||
recordJsonSchema, | ||
arrayJsonSchema, | ||
tupleJsonSchema, | ||
stringJsonSchema, | ||
numberJsonSchema, | ||
booleanJsonSchema, | ||
unionJsonSchema, | ||
realUnionJsonSchema, | ||
unknownJsonSchema, | ||
nullJsonSchema, | ||
refJsonSchema | ||
]); | ||
var functionJsonSchema = import_zod.z.object({ | ||
name: import_zod.z.string(), | ||
description: import_zod.z.string(), | ||
parameters: import_zod.z.union([ | ||
import_zod.z.object({ | ||
type: import_zod.z.literal("object"), | ||
properties: import_zod.z.record(valueJsonSchema), | ||
description: import_zod.z.string().optional(), | ||
required: import_zod.z.array(import_zod.z.string()).optional() | ||
}), | ||
import_zod.z.array(valueJsonSchema) | ||
]), | ||
returns: valueJsonSchema, | ||
usageExample: import_zod.z.string().optional(), | ||
returnsExample: import_zod.z.string().optional() | ||
}); | ||
var nullFunctionJson = { | ||
name: "", | ||
description: "", | ||
parameters: [], | ||
returns: { type: "null" } | ||
}; | ||
// src/index.ts | ||
@@ -265,4 +362,6 @@ var DEFAULT_BASE_URL = "https://5pz08znmzj.execute-api.us-west-2.amazonaws.com"; | ||
extractMessageTextContent, | ||
functionJsonSchema, | ||
mapIudexToOpenAi, | ||
nextMessage, | ||
nullFunctionJson, | ||
putFunctionJsons, | ||
@@ -269,0 +368,0 @@ returnFunctionCall, |
{ | ||
"name": "iudex", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "Iudex client", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
173334
2251
6
9