Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@inkeep/ai-api

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inkeep/ai-api - npm Package Compare versions

Comparing version 0.4.3 to 0.5.0

6

lib/config.d.ts

@@ -27,6 +27,6 @@ import { HTTPClient } from "./http";

openapiDocVersion: "0.1.0";
sdkVersion: "0.4.3";
genVersion: "2.277.0";
userAgent: "speakeasy-sdk/typescript 0.4.3 2.277.0 0.1.0 @inkeep/ai-api";
sdkVersion: "0.5.0";
genVersion: "2.280.6";
userAgent: "speakeasy-sdk/typescript 0.5.0 2.280.6 0.1.0 @inkeep/ai-api";
}>;
//# sourceMappingURL=config.d.ts.map

@@ -21,4 +21,7 @@ "use strict";

const params = {};
const serverIdx = (_a = options.serverIdx) !== null && _a !== void 0 ? _a : 0;
if (!serverURL) {
const serverIdx = (_a = options.serverIdx) !== null && _a !== void 0 ? _a : 0;
if (serverIdx < 0 || serverIdx >= exports.ServerList.length) {
throw new Error(`Invalid server index ${serverIdx}`);
}
serverURL = exports.ServerList[serverIdx] || "";

@@ -33,6 +36,6 @@ }

openapiDocVersion: "0.1.0",
sdkVersion: "0.4.3",
genVersion: "2.277.0",
userAgent: "speakeasy-sdk/typescript 0.4.3 2.277.0 0.1.0 @inkeep/ai-api",
sdkVersion: "0.5.0",
genVersion: "2.280.6",
userAgent: "speakeasy-sdk/typescript 0.5.0 2.280.6 0.1.0 @inkeep/ai-api",
});
//# sourceMappingURL=config.js.map

@@ -69,6 +69,3 @@ "use strict";

// characters.
if (char1 == null ||
char2 == null ||
!NEWLINE_CHARS.has(char1) ||
!NEWLINE_CHARS.has(char2)) {
if (char1 == null || char2 == null || !NEWLINE_CHARS.has(char1) || !NEWLINE_CHARS.has(char2)) {
return null;

@@ -75,0 +72,0 @@ }

import { RecordsCited, RecordsCited$ } from "./recordscited";
import { z } from "zod";
import * as z from "zod";
export declare enum AssistantMessageRole {

@@ -4,0 +4,0 @@ Assistant = "assistant"

@@ -5,6 +5,29 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AssistantMessage$ = exports.AssistantMessageRole$ = exports.AssistantMessageRole = void 0;
const recordscited_1 = require("./recordscited");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
var AssistantMessageRole;

@@ -15,10 +38,10 @@ (function (AssistantMessageRole) {

/** @internal */
exports.AssistantMessageRole$ = zod_1.z.nativeEnum(AssistantMessageRole);
exports.AssistantMessageRole$ = z.nativeEnum(AssistantMessageRole);
/** @internal */
var AssistantMessage$;
(function (AssistantMessage$) {
AssistantMessage$.inboundSchema = zod_1.z
AssistantMessage$.inboundSchema = z
.object({
role: exports.AssistantMessageRole$,
content: zod_1.z.string(),
content: z.string(),
records_cited: recordscited_1.RecordsCited$.inboundSchema.optional(),

@@ -33,6 +56,6 @@ })

});
AssistantMessage$.outboundSchema = zod_1.z
AssistantMessage$.outboundSchema = z
.object({
role: exports.AssistantMessageRole$,
content: zod_1.z.string(),
content: z.string(),
recordsCited: recordscited_1.RecordsCited$.outboundSchema.optional(),

@@ -39,0 +62,0 @@ })

import { AssistantMessage, AssistantMessage$ } from "./assistantmessage";
import { z } from "zod";
import * as z from "zod";
export type ChatResult = {

@@ -4,0 +4,0 @@ chatSessionId: string;

@@ -5,12 +5,35 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatResult$ = void 0;
const assistantmessage_1 = require("./assistantmessage");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var ChatResult$;
(function (ChatResult$) {
ChatResult$.inboundSchema = zod_1.z
ChatResult$.inboundSchema = z
.object({
chat_session_id: zod_1.z.string(),
chat_session_id: z.string(),
message: assistantmessage_1.AssistantMessage$.inboundSchema,

@@ -24,5 +47,5 @@ })

});
ChatResult$.outboundSchema = zod_1.z
ChatResult$.outboundSchema = z
.object({
chatSessionId: zod_1.z.string(),
chatSessionId: z.string(),
message: assistantmessage_1.AssistantMessage$.outboundSchema,

@@ -29,0 +52,0 @@ })

import { MessageChunk, MessageChunk$ } from "./messagechunk";
import { z } from "zod";
import * as z from "zod";
export declare enum Event {

@@ -4,0 +4,0 @@ MessageChunk = "message_chunk"

@@ -5,6 +5,29 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatResultMessageChunkEvent$ = exports.Event$ = exports.Event = void 0;
const messagechunk_1 = require("./messagechunk");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
var Event;

@@ -15,10 +38,10 @@ (function (Event) {

/** @internal */
exports.Event$ = zod_1.z.nativeEnum(Event);
exports.Event$ = z.nativeEnum(Event);
/** @internal */
var ChatResultMessageChunkEvent$;
(function (ChatResultMessageChunkEvent$) {
ChatResultMessageChunkEvent$.inboundSchema = zod_1.z
ChatResultMessageChunkEvent$.inboundSchema = z
.object({
event: exports.Event$,
data: zod_1.z
data: z
.string()

@@ -31,6 +54,6 @@ .transform((v, ctx) => {

ctx.addIssue({
code: zod_1.z.ZodIssueCode.custom,
code: z.ZodIssueCode.custom,
message: `malformed json: ${err}`,
});
return zod_1.z.NEVER;
return z.NEVER;
}

@@ -46,3 +69,3 @@ })

});
ChatResultMessageChunkEvent$.outboundSchema = zod_1.z
ChatResultMessageChunkEvent$.outboundSchema = z
.object({

@@ -49,0 +72,0 @@ event: exports.Event$,

import { RecordsCited, RecordsCited$ } from "./recordscited";
import { z } from "zod";
import * as z from "zod";
export declare enum ChatResultRecordsCitedEventEvent {

@@ -4,0 +4,0 @@ RecordsCited = "records_cited"

@@ -5,6 +5,29 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatResultRecordsCitedEvent$ = exports.ChatResultRecordsCitedEventEvent$ = exports.ChatResultRecordsCitedEventEvent = void 0;
const recordscited_1 = require("./recordscited");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
var ChatResultRecordsCitedEventEvent;

@@ -15,10 +38,10 @@ (function (ChatResultRecordsCitedEventEvent) {

/** @internal */
exports.ChatResultRecordsCitedEventEvent$ = zod_1.z.nativeEnum(ChatResultRecordsCitedEventEvent);
exports.ChatResultRecordsCitedEventEvent$ = z.nativeEnum(ChatResultRecordsCitedEventEvent);
/** @internal */
var ChatResultRecordsCitedEvent$;
(function (ChatResultRecordsCitedEvent$) {
ChatResultRecordsCitedEvent$.inboundSchema = zod_1.z
ChatResultRecordsCitedEvent$.inboundSchema = z
.object({
event: exports.ChatResultRecordsCitedEventEvent$,
data: zod_1.z
data: z
.string()

@@ -31,6 +54,6 @@ .transform((v, ctx) => {

ctx.addIssue({
code: zod_1.z.ZodIssueCode.custom,
code: z.ZodIssueCode.custom,
message: `malformed json: ${err}`,
});
return zod_1.z.NEVER;
return z.NEVER;
}

@@ -46,3 +69,3 @@ })

});
ChatResultRecordsCitedEvent$.outboundSchema = zod_1.z
ChatResultRecordsCitedEvent$.outboundSchema = z
.object({

@@ -49,0 +72,0 @@ event: exports.ChatResultRecordsCitedEventEvent$,

import { ChatResultMessageChunkEvent, ChatResultMessageChunkEvent$, Event } from "./chatresultmessagechunkevent";
import { ChatResultRecordsCitedEvent, ChatResultRecordsCitedEvent$, ChatResultRecordsCitedEventEvent } from "./chatresultrecordscitedevent";
import { z } from "zod";
import * as z from "zod";
export type ChatResultStream = (ChatResultMessageChunkEvent & {

@@ -5,0 +5,0 @@ event: Event.MessageChunk;

@@ -5,2 +5,25 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -10,20 +33,20 @@ exports.ChatResultStream$ = void 0;

const chatresultrecordscitedevent_1 = require("./chatresultrecordscitedevent");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var ChatResultStream$;
(function (ChatResultStream$) {
ChatResultStream$.inboundSchema = zod_1.z.union([
chatresultmessagechunkevent_1.ChatResultMessageChunkEvent$.inboundSchema.and(zod_1.z
.object({ event: zod_1.z.literal(chatresultmessagechunkevent_1.Event.MessageChunk) })
ChatResultStream$.inboundSchema = z.union([
chatresultmessagechunkevent_1.ChatResultMessageChunkEvent$.inboundSchema.and(z
.object({ event: z.literal(chatresultmessagechunkevent_1.Event.MessageChunk) })
.transform((v) => ({ event: v.event }))),
chatresultrecordscitedevent_1.ChatResultRecordsCitedEvent$.inboundSchema.and(zod_1.z
.object({ event: zod_1.z.literal(chatresultrecordscitedevent_1.ChatResultRecordsCitedEventEvent.RecordsCited) })
chatresultrecordscitedevent_1.ChatResultRecordsCitedEvent$.inboundSchema.and(z
.object({ event: z.literal(chatresultrecordscitedevent_1.ChatResultRecordsCitedEventEvent.RecordsCited) })
.transform((v) => ({ event: v.event }))),
]);
ChatResultStream$.outboundSchema = zod_1.z.union([
chatresultmessagechunkevent_1.ChatResultMessageChunkEvent$.outboundSchema.and(zod_1.z
.object({ event: zod_1.z.literal(chatresultmessagechunkevent_1.Event.MessageChunk) })
ChatResultStream$.outboundSchema = z.union([
chatresultmessagechunkevent_1.ChatResultMessageChunkEvent$.outboundSchema.and(z
.object({ event: z.literal(chatresultmessagechunkevent_1.Event.MessageChunk) })
.transform((v) => ({ event: v.event }))),
chatresultrecordscitedevent_1.ChatResultRecordsCitedEvent$.outboundSchema.and(zod_1.z
.object({ event: zod_1.z.literal(chatresultrecordscitedevent_1.ChatResultRecordsCitedEventEvent.RecordsCited) })
chatresultrecordscitedevent_1.ChatResultRecordsCitedEvent$.outboundSchema.and(z
.object({ event: z.literal(chatresultrecordscitedevent_1.ChatResultRecordsCitedEventEvent.RecordsCited) })
.transform((v) => ({ event: v.event }))),

@@ -30,0 +53,0 @@ ]);

import { Message, Message$ } from "./message";
import { z } from "zod";
import * as z from "zod";
export type ChatSessionInput = {

@@ -4,0 +4,0 @@ guidance?: string | null | undefined;

@@ -5,14 +5,37 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatSessionInput$ = void 0;
const message_1 = require("./message");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var ChatSessionInput$;
(function (ChatSessionInput$) {
ChatSessionInput$.inboundSchema = zod_1.z
ChatSessionInput$.inboundSchema = z
.object({
guidance: zod_1.z.nullable(zod_1.z.string()).optional(),
context: zod_1.z.nullable(zod_1.z.string()).optional(),
messages: zod_1.z.array(message_1.Message$.inboundSchema),
guidance: z.nullable(z.string()).optional(),
context: z.nullable(z.string()).optional(),
messages: z.array(message_1.Message$.inboundSchema),
})

@@ -26,7 +49,7 @@ .transform((v) => {

});
ChatSessionInput$.outboundSchema = zod_1.z
ChatSessionInput$.outboundSchema = z
.object({
guidance: zod_1.z.nullable(zod_1.z.string()).optional(),
context: zod_1.z.nullable(zod_1.z.string()).optional(),
messages: zod_1.z.array(message_1.Message$.outboundSchema),
guidance: z.nullable(z.string()).optional(),
context: z.nullable(z.string()).optional(),
messages: z.array(message_1.Message$.outboundSchema),
})

@@ -33,0 +56,0 @@ .transform((v) => {

import { RecordT, RecordT$ } from "./record";
import { z } from "zod";
import * as z from "zod";
export type Citation = {

@@ -4,0 +4,0 @@ number?: number | undefined;

@@ -5,14 +5,37 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Citation$ = void 0;
const record_1 = require("./record");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var Citation$;
(function (Citation$) {
Citation$.inboundSchema = zod_1.z
Citation$.inboundSchema = z
.object({
number: zod_1.z.number().int().optional(),
number: z.number().int().optional(),
record: record_1.RecordT$.inboundSchema,
hit_url: zod_1.z.nullable(zod_1.z.string()).optional(),
hit_url: z.nullable(z.string()).optional(),
})

@@ -26,7 +49,7 @@ .transform((v) => {

});
Citation$.outboundSchema = zod_1.z
Citation$.outboundSchema = z
.object({
number: zod_1.z.number().int().optional(),
number: z.number().int().optional(),
record: record_1.RecordT$.outboundSchema,
hitUrl: zod_1.z.nullable(zod_1.z.string()).optional(),
hitUrl: z.nullable(z.string()).optional(),
})

@@ -33,0 +56,0 @@ .transform((v) => {

import { Message, Message$ } from "./message";
import { z } from "zod";
import * as z from "zod";
export type ContinueChatSessionWithChatResultInput = {

@@ -4,0 +4,0 @@ integrationId: string;

@@ -5,14 +5,37 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContinueChatSessionWithChatResultInput$ = void 0;
const message_1 = require("./message");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var ContinueChatSessionWithChatResultInput$;
(function (ContinueChatSessionWithChatResultInput$) {
ContinueChatSessionWithChatResultInput$.inboundSchema = zod_1.z
ContinueChatSessionWithChatResultInput$.inboundSchema = z
.object({
integration_id: zod_1.z.string(),
integration_id: z.string(),
message: message_1.Message$.inboundSchema,
stream: zod_1.z.boolean().default(false),
stream: z.boolean().default(false),
})

@@ -26,7 +49,7 @@ .transform((v) => {

});
ContinueChatSessionWithChatResultInput$.outboundSchema = zod_1.z
ContinueChatSessionWithChatResultInput$.outboundSchema = z
.object({
integrationId: zod_1.z.string(),
integrationId: z.string(),
message: message_1.Message$.outboundSchema,
stream: zod_1.z.boolean().default(false),
stream: z.boolean().default(false),
})

@@ -33,0 +56,0 @@ .transform((v) => {

import { ChatSessionInput, ChatSessionInput$ } from "./chatsessioninput";
import { z } from "zod";
import * as z from "zod";
export declare enum ChatModeOptions {

@@ -4,0 +4,0 @@ Turbo = "turbo",

@@ -5,6 +5,29 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateChatSessionWithChatResultInput$ = exports.ChatMode$ = exports.ChatModeOptions$ = exports.ChatModeOptions = void 0;
const chatsessioninput_1 = require("./chatsessioninput");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
var ChatModeOptions;

@@ -16,13 +39,13 @@ (function (ChatModeOptions) {

/** @internal */
exports.ChatModeOptions$ = zod_1.z.nativeEnum(ChatModeOptions);
exports.ChatModeOptions$ = z.nativeEnum(ChatModeOptions);
/** @internal */
var ChatMode$;
(function (ChatMode$) {
ChatMode$.inboundSchema = zod_1.z.union([
ChatMode$.inboundSchema = z.union([
exports.ChatModeOptions$,
zod_1.z.string(),
z.string(),
]);
ChatMode$.outboundSchema = zod_1.z.union([
ChatMode$.outboundSchema = z.union([
exports.ChatModeOptions$,
zod_1.z.string(),
z.string(),
]);

@@ -33,8 +56,8 @@ })(ChatMode$ || (exports.ChatMode$ = ChatMode$ = {}));

(function (CreateChatSessionWithChatResultInput$) {
CreateChatSessionWithChatResultInput$.inboundSchema = zod_1.z
CreateChatSessionWithChatResultInput$.inboundSchema = z
.object({
integration_id: zod_1.z.string(),
integration_id: z.string(),
chat_session: chatsessioninput_1.ChatSessionInput$.inboundSchema,
chat_mode: zod_1.z.union([exports.ChatModeOptions$, zod_1.z.string()]).optional(),
stream: zod_1.z.boolean().default(false),
chat_mode: z.union([exports.ChatModeOptions$, z.string()]).optional(),
stream: z.boolean().default(false),
})

@@ -49,8 +72,8 @@ .transform((v) => {

});
CreateChatSessionWithChatResultInput$.outboundSchema = zod_1.z
CreateChatSessionWithChatResultInput$.outboundSchema = z
.object({
integrationId: zod_1.z.string(),
integrationId: z.string(),
chatSession: chatsessioninput_1.ChatSessionInput$.outboundSchema,
chatMode: zod_1.z.union([exports.ChatModeOptions$, zod_1.z.string()]).optional(),
stream: zod_1.z.boolean().default(false),
chatMode: z.union([exports.ChatModeOptions$, z.string()]).optional(),
stream: z.boolean().default(false),
})

@@ -57,0 +80,0 @@ .transform((v) => {

import { AssistantMessage, AssistantMessage$, AssistantMessageRole } from "./assistantmessage";
import { Role, UserMessage, UserMessage$ } from "./usermessage";
import { z } from "zod";
import * as z from "zod";
export type Message = (UserMessage & {

@@ -5,0 +5,0 @@ role: Role.User;

@@ -5,2 +5,25 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -10,16 +33,16 @@ exports.Message$ = void 0;

const usermessage_1 = require("./usermessage");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var Message$;
(function (Message$) {
Message$.inboundSchema = zod_1.z.union([
usermessage_1.UserMessage$.inboundSchema.and(zod_1.z.object({ role: zod_1.z.literal(usermessage_1.Role.User) }).transform((v) => ({ role: v.role }))),
assistantmessage_1.AssistantMessage$.inboundSchema.and(zod_1.z
.object({ role: zod_1.z.literal(assistantmessage_1.AssistantMessageRole.Assistant) })
Message$.inboundSchema = z.union([
usermessage_1.UserMessage$.inboundSchema.and(z.object({ role: z.literal(usermessage_1.Role.User) }).transform((v) => ({ role: v.role }))),
assistantmessage_1.AssistantMessage$.inboundSchema.and(z
.object({ role: z.literal(assistantmessage_1.AssistantMessageRole.Assistant) })
.transform((v) => ({ role: v.role }))),
]);
Message$.outboundSchema = zod_1.z.union([
usermessage_1.UserMessage$.outboundSchema.and(zod_1.z.object({ role: zod_1.z.literal(usermessage_1.Role.User) }).transform((v) => ({ role: v.role }))),
assistantmessage_1.AssistantMessage$.outboundSchema.and(zod_1.z
.object({ role: zod_1.z.literal(assistantmessage_1.AssistantMessageRole.Assistant) })
Message$.outboundSchema = z.union([
usermessage_1.UserMessage$.outboundSchema.and(z.object({ role: z.literal(usermessage_1.Role.User) }).transform((v) => ({ role: v.role }))),
assistantmessage_1.AssistantMessage$.outboundSchema.and(z
.object({ role: z.literal(assistantmessage_1.AssistantMessageRole.Assistant) })
.transform((v) => ({ role: v.role }))),

@@ -26,0 +49,0 @@ ]);

@@ -1,2 +0,2 @@

import { z } from "zod";
import * as z from "zod";
export declare enum FinishReason {

@@ -3,0 +3,0 @@ Stop = "stop",

@@ -5,5 +5,28 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageChunk$ = exports.FinishReason$ = exports.FinishReason = void 0;
const zod_1 = require("zod");
const z = __importStar(require("zod"));
var FinishReason;

@@ -16,11 +39,11 @@ (function (FinishReason) {

/** @internal */
exports.FinishReason$ = zod_1.z.nativeEnum(FinishReason);
exports.FinishReason$ = z.nativeEnum(FinishReason);
/** @internal */
var MessageChunk$;
(function (MessageChunk$) {
MessageChunk$.inboundSchema = zod_1.z
MessageChunk$.inboundSchema = z
.object({
chat_session_id: zod_1.z.nullable(zod_1.z.string()).optional(),
content_chunk: zod_1.z.string(),
finish_reason: zod_1.z.nullable(exports.FinishReason$).optional(),
chat_session_id: z.nullable(z.string()).optional(),
content_chunk: z.string(),
finish_reason: z.nullable(exports.FinishReason$).optional(),
})

@@ -34,7 +57,7 @@ .transform((v) => {

});
MessageChunk$.outboundSchema = zod_1.z
MessageChunk$.outboundSchema = z
.object({
chatSessionId: zod_1.z.nullable(zod_1.z.string()).optional(),
contentChunk: zod_1.z.string(),
finishReason: zod_1.z.nullable(exports.FinishReason$).optional(),
chatSessionId: z.nullable(z.string()).optional(),
contentChunk: z.string(),
finishReason: z.nullable(exports.FinishReason$).optional(),
})

@@ -41,0 +64,0 @@ .transform((v) => {

import { RecordType, RecordType$ } from "./recordtype";
import { z } from "zod";
import * as z from "zod";
export type RecordT = {

@@ -4,0 +4,0 @@ /**

@@ -5,16 +5,39 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecordT$ = void 0;
const recordtype_1 = require("./recordtype");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var RecordT$;
(function (RecordT$) {
RecordT$.inboundSchema = zod_1.z
RecordT$.inboundSchema = z
.object({
type: recordtype_1.RecordType$.inboundSchema,
url: zod_1.z.nullable(zod_1.z.string()).optional(),
title: zod_1.z.nullable(zod_1.z.string()).optional(),
description: zod_1.z.nullable(zod_1.z.string()).optional(),
breadcrumbs: zod_1.z.nullable(zod_1.z.array(zod_1.z.string())).optional(),
url: z.nullable(z.string()).optional(),
title: z.nullable(z.string()).optional(),
description: z.nullable(z.string()).optional(),
breadcrumbs: z.nullable(z.array(z.string())).optional(),
})

@@ -30,9 +53,9 @@ .transform((v) => {

});
RecordT$.outboundSchema = zod_1.z
RecordT$.outboundSchema = z
.object({
type: recordtype_1.RecordType$.outboundSchema,
url: zod_1.z.nullable(zod_1.z.string()).optional(),
title: zod_1.z.nullable(zod_1.z.string()).optional(),
description: zod_1.z.nullable(zod_1.z.string()).optional(),
breadcrumbs: zod_1.z.nullable(zod_1.z.array(zod_1.z.string())).optional(),
url: z.nullable(z.string()).optional(),
title: z.nullable(z.string()).optional(),
description: z.nullable(z.string()).optional(),
breadcrumbs: z.nullable(z.array(z.string())).optional(),
})

@@ -39,0 +62,0 @@ .transform((v) => {

import { Citation, Citation$ } from "./citation";
import { z } from "zod";
import * as z from "zod";
export type RecordsCited = {

@@ -4,0 +4,0 @@ citations: Array<Citation>;

@@ -5,12 +5,35 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecordsCited$ = void 0;
const citation_1 = require("./citation");
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var RecordsCited$;
(function (RecordsCited$) {
RecordsCited$.inboundSchema = zod_1.z
RecordsCited$.inboundSchema = z
.object({
citations: zod_1.z.array(citation_1.Citation$.inboundSchema),
citations: z.array(citation_1.Citation$.inboundSchema),
})

@@ -22,5 +45,5 @@ .transform((v) => {

});
RecordsCited$.outboundSchema = zod_1.z
RecordsCited$.outboundSchema = z
.object({
citations: zod_1.z.array(citation_1.Citation$.outboundSchema),
citations: z.array(citation_1.Citation$.outboundSchema),
})

@@ -27,0 +50,0 @@ .transform((v) => {

@@ -1,2 +0,2 @@

import { z } from "zod";
import * as z from "zod";
export declare enum RecordTypeEnumerated {

@@ -3,0 +3,0 @@ Documentation = "documentation",

@@ -5,5 +5,28 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecordType$ = exports.RecordTypeEnumerated$ = exports.RecordTypeEnumerated = void 0;
const zod_1 = require("zod");
const z = __importStar(require("zod"));
var RecordTypeEnumerated;

@@ -22,15 +45,15 @@ (function (RecordTypeEnumerated) {

/** @internal */
exports.RecordTypeEnumerated$ = zod_1.z.nativeEnum(RecordTypeEnumerated);
exports.RecordTypeEnumerated$ = z.nativeEnum(RecordTypeEnumerated);
/** @internal */
var RecordType$;
(function (RecordType$) {
RecordType$.inboundSchema = zod_1.z.union([
RecordType$.inboundSchema = z.union([
exports.RecordTypeEnumerated$,
zod_1.z.string(),
z.string(),
]);
RecordType$.outboundSchema = zod_1.z.union([
RecordType$.outboundSchema = z.union([
exports.RecordTypeEnumerated$,
zod_1.z.string(),
z.string(),
]);
})(RecordType$ || (exports.RecordType$ = RecordType$ = {}));
//# sourceMappingURL=recordtype.js.map

@@ -1,2 +0,2 @@

import { z } from "zod";
import * as z from "zod";
export type Security = {

@@ -3,0 +3,0 @@ apiKey: string;

@@ -5,11 +5,34 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Security$ = void 0;
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var Security$;
(function (Security$) {
Security$.inboundSchema = zod_1.z
Security$.inboundSchema = z
.object({
api_key: zod_1.z.string(),
api_key: z.string(),
})

@@ -21,5 +44,5 @@ .transform((v) => {

});
Security$.outboundSchema = zod_1.z
Security$.outboundSchema = z
.object({
apiKey: zod_1.z.string(),
apiKey: z.string(),
})

@@ -26,0 +49,0 @@ .transform((v) => {

@@ -1,2 +0,2 @@

import { z } from "zod";
import * as z from "zod";
export declare enum Role {

@@ -3,0 +3,0 @@ User = "user"

@@ -5,5 +5,28 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserMessage$ = exports.Role$ = exports.Role = void 0;
const zod_1 = require("zod");
const z = __importStar(require("zod"));
var Role;

@@ -14,10 +37,10 @@ (function (Role) {

/** @internal */
exports.Role$ = zod_1.z.nativeEnum(Role);
exports.Role$ = z.nativeEnum(Role);
/** @internal */
var UserMessage$;
(function (UserMessage$) {
UserMessage$.inboundSchema = zod_1.z
UserMessage$.inboundSchema = z
.object({
role: exports.Role$,
content: zod_1.z.string(),
content: z.string(),
})

@@ -30,6 +53,6 @@ .transform((v) => {

});
UserMessage$.outboundSchema = zod_1.z
UserMessage$.outboundSchema = z
.object({
role: exports.Role$,
content: zod_1.z.string(),
content: z.string(),
})

@@ -36,0 +59,0 @@ .transform((v) => {

@@ -1,2 +0,2 @@

import { z } from "zod";
import * as z from "zod";
export type Loc = string | number;

@@ -3,0 +3,0 @@ export type ValidationError = {

@@ -5,15 +5,38 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidationError$ = exports.Loc$ = void 0;
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var Loc$;
(function (Loc$) {
Loc$.inboundSchema = zod_1.z.union([
zod_1.z.string(),
zod_1.z.number().int(),
Loc$.inboundSchema = z.union([
z.string(),
z.number().int(),
]);
Loc$.outboundSchema = zod_1.z.union([
zod_1.z.string(),
zod_1.z.number().int(),
Loc$.outboundSchema = z.union([
z.string(),
z.number().int(),
]);

@@ -24,7 +47,7 @@ })(Loc$ || (exports.Loc$ = Loc$ = {}));

(function (ValidationError$) {
ValidationError$.inboundSchema = zod_1.z
ValidationError$.inboundSchema = z
.object({
loc: zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.number().int()])),
msg: zod_1.z.string(),
type: zod_1.z.string(),
loc: z.array(z.union([z.string(), z.number().int()])),
msg: z.string(),
type: z.string(),
})

@@ -38,7 +61,7 @@ .transform((v) => {

});
ValidationError$.outboundSchema = zod_1.z
ValidationError$.outboundSchema = z
.object({
loc: zod_1.z.array(zod_1.z.union([zod_1.z.string(), zod_1.z.number().int()])),
msg: zod_1.z.string(),
type: zod_1.z.string(),
loc: z.array(z.union([z.string(), z.number().int()])),
msg: z.string(),
type: z.string(),
})

@@ -45,0 +68,0 @@ .transform((v) => {

import * as components from "../../models/components";
import { z } from "zod";
import * as z from "zod";
/**

@@ -4,0 +4,0 @@ * Validation Error

@@ -31,3 +31,3 @@ "use strict";

const components = __importStar(require("../../models/components"));
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/**

@@ -54,5 +54,5 @@ * Validation Error

(function (HTTPValidationError$) {
HTTPValidationError$.inboundSchema = zod_1.z
HTTPValidationError$.inboundSchema = z
.object({
detail: zod_1.z.array(components.ValidationError$.inboundSchema).optional(),
detail: z.array(components.ValidationError$.inboundSchema).optional(),
})

@@ -64,8 +64,8 @@ .transform((v) => {

});
HTTPValidationError$.outboundSchema = zod_1.z
HTTPValidationError$.outboundSchema = z
.instanceof(HTTPValidationError)
.transform((v) => v.data$)
.pipe(zod_1.z
.pipe(z
.object({
detail: zod_1.z.array(components.ValidationError$.outboundSchema).optional(),
detail: z.array(components.ValidationError$.outboundSchema).optional(),
})

@@ -72,0 +72,0 @@ .transform((v) => {

import { EventStream } from "../../lib/event-streams";
import * as components from "../../models/components";
import { z } from "zod";
import * as z from "zod";
export type ContinueRequest = {

@@ -5,0 +5,0 @@ chatSessionId: string;

@@ -32,9 +32,9 @@ "use strict";

const components = __importStar(require("../../models/components"));
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var ContinueRequest$;
(function (ContinueRequest$) {
ContinueRequest$.inboundSchema = zod_1.z
ContinueRequest$.inboundSchema = z
.object({
chat_session_id: zod_1.z.string(),
chat_session_id: z.string(),
ContinueChatSessionWithChatResultInput: components.ContinueChatSessionWithChatResultInput$.inboundSchema,

@@ -48,5 +48,5 @@ })

});
ContinueRequest$.outboundSchema = zod_1.z
ContinueRequest$.outboundSchema = z
.object({
chatSessionId: zod_1.z.string(),
chatSessionId: z.string(),
continueChatSessionWithChatResultInput: components.ContinueChatSessionWithChatResultInput$.outboundSchema,

@@ -64,9 +64,9 @@ })

(function (ContinueResponse$) {
ContinueResponse$.inboundSchema = zod_1.z
ContinueResponse$.inboundSchema = z
.object({
ContentType: zod_1.z.string(),
StatusCode: zod_1.z.number().int(),
RawResponse: zod_1.z.instanceof(Response),
ContentType: z.string(),
StatusCode: z.number().int(),
RawResponse: z.instanceof(Response),
ChatResult: components.ChatResult$.inboundSchema.optional(),
ChatResultStream: zod_1.z
ChatResultStream: z
.instanceof((ReadableStream))

@@ -95,11 +95,11 @@ .transform((stream) => {

});
ContinueResponse$.outboundSchema = zod_1.z
ContinueResponse$.outboundSchema = z
.object({
contentType: zod_1.z.string(),
statusCode: zod_1.z.number().int(),
rawResponse: zod_1.z.instanceof(Response).transform(() => {
contentType: z.string(),
statusCode: z.number().int(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}),
chatResult: components.ChatResult$.outboundSchema.optional(),
chatResultStream: zod_1.z.never().optional(),
chatResultStream: z.never().optional(),
})

@@ -106,0 +106,0 @@ .transform((v) => {

import { EventStream } from "../../lib/event-streams";
import * as components from "../../models/components";
import { z } from "zod";
import * as z from "zod";
export type CreateResponse = {

@@ -5,0 +5,0 @@ /**

@@ -32,13 +32,13 @@ "use strict";

const components = __importStar(require("../../models/components"));
const zod_1 = require("zod");
const z = __importStar(require("zod"));
/** @internal */
var CreateResponse$;
(function (CreateResponse$) {
CreateResponse$.inboundSchema = zod_1.z
CreateResponse$.inboundSchema = z
.object({
ContentType: zod_1.z.string(),
StatusCode: zod_1.z.number().int(),
RawResponse: zod_1.z.instanceof(Response),
ContentType: z.string(),
StatusCode: z.number().int(),
RawResponse: z.instanceof(Response),
ChatResult: components.ChatResult$.inboundSchema.optional(),
ChatResultStream: zod_1.z
ChatResultStream: z
.instanceof((ReadableStream))

@@ -67,11 +67,11 @@ .transform((stream) => {

});
CreateResponse$.outboundSchema = zod_1.z
CreateResponse$.outboundSchema = z
.object({
contentType: zod_1.z.string(),
statusCode: zod_1.z.number().int(),
rawResponse: zod_1.z.instanceof(Response).transform(() => {
contentType: z.string(),
statusCode: z.number().int(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}),
chatResult: components.ChatResult$.outboundSchema.optional(),
chatResultStream: zod_1.z.never().optional(),
chatResultStream: z.never().optional(),
})

@@ -78,0 +78,0 @@ .transform((v) => {

{
"name": "@inkeep/ai-api",
"version": "0.4.3",
"version": "0.5.0",
"author": "Nick Gomez",

@@ -32,5 +32,4 @@ "main": "./index.js",

"dependencies": {
"decimal.js": "^10.4.3",
"jsonpath": "^1.1.1"
}
}

@@ -41,5 +41,8 @@ /*

const params: Record<string, string> = {};
const serverIdx = options.serverIdx ?? 0;
if (!serverURL) {
const serverIdx = options.serverIdx ?? 0;
if (serverIdx < 0 || serverIdx >= ServerList.length) {
throw new Error(`Invalid server index ${serverIdx}`);
}
serverURL = ServerList[serverIdx] || "";

@@ -55,5 +58,5 @@ }

openapiDocVersion: "0.1.0",
sdkVersion: "0.4.3",
genVersion: "2.277.0",
userAgent: "speakeasy-sdk/typescript 0.4.3 2.277.0 0.1.0 @inkeep/ai-api",
sdkVersion: "0.5.0",
genVersion: "2.280.6",
userAgent: "speakeasy-sdk/typescript 0.5.0 2.280.6 0.1.0 @inkeep/ai-api",
});

@@ -6,6 +6,6 @@ /*

export type ServerEvent<T> = {
data?: T | undefined;
event?: string | undefined;
retry?: number | undefined;
id?: string | undefined;
data?: T | undefined;
event?: string | undefined;
retry?: number | undefined;
id?: string | undefined;
};

@@ -16,179 +16,174 @@ const LF = 0x0a;

const MESSAGE_BOUNDARIES = [
new Uint8Array([CR, LF, CR, LF]),
new Uint8Array([CR, CR]),
new Uint8Array([LF, LF]),
new Uint8Array([CR, LF, CR, LF]),
new Uint8Array([CR, CR]),
new Uint8Array([LF, LF]),
];
export class EventStream<Event extends ServerEvent<unknown>> {
private readonly stream: ReadableStream<Uint8Array>;
private readonly decoder: (rawEvent: ServerEvent<string>) => Event;
private readonly stream: ReadableStream<Uint8Array>;
private readonly decoder: (rawEvent: ServerEvent<string>) => Event;
constructor(init: {
stream: ReadableStream<Uint8Array>;
decoder: (rawEvent: ServerEvent<string>) => Event;
}) {
this.stream = init.stream;
this.decoder = init.decoder;
}
constructor(init: {
stream: ReadableStream<Uint8Array>;
decoder: (rawEvent: ServerEvent<string>) => Event;
}) {
this.stream = init.stream;
this.decoder = init.decoder;
}
async *[Symbol.asyncIterator]() {
const reader = this.stream.getReader();
let buffer = new Uint8Array([]);
let position = 0;
async *[Symbol.asyncIterator]() {
const reader = this.stream.getReader();
let buffer = new Uint8Array([]);
let position = 0;
try {
while (true) {
const { done, value } = await reader.read();
if (done) {
break;
}
try {
while (true) {
const { done, value } = await reader.read();
if (done) {
break;
}
const newBuffer = new Uint8Array(buffer.length + value.length);
newBuffer.set(buffer);
newBuffer.set(value, buffer.length);
buffer = newBuffer;
const newBuffer = new Uint8Array(buffer.length + value.length);
newBuffer.set(buffer);
newBuffer.set(value, buffer.length);
buffer = newBuffer;
for (let i = position; i < buffer.length; i++) {
const boundary = findBoundary(buffer, i);
if (boundary == null) {
continue;
}
for (let i = position; i < buffer.length; i++) {
const boundary = findBoundary(buffer, i);
if (boundary == null) {
continue;
}
const chunk = buffer.slice(position, i);
position = i + boundary.length;
const event = parseEvent(chunk, this.decoder);
if (event != null) {
yield event;
}
}
const chunk = buffer.slice(position, i);
position = i + boundary.length;
const event = parseEvent(chunk, this.decoder);
if (event != null) {
yield event;
}
}
if (position > 0) {
buffer = buffer.slice(position);
position = 0;
}
}
if (position > 0) {
buffer = buffer.slice(position);
position = 0;
}
}
if (buffer.length > 0) {
const event = parseEvent(buffer, this.decoder);
if (event != null) {
yield event;
if (buffer.length > 0) {
const event = parseEvent(buffer, this.decoder);
if (event != null) {
yield event;
}
}
} finally {
reader.releaseLock();
}
}
} finally {
reader.releaseLock();
}
}
}
function findBoundary(buffer: Uint8Array, start: number): Uint8Array | null {
const char1 = buffer[start];
const char2 = buffer[start + 1];
const char1 = buffer[start];
const char2 = buffer[start + 1];
// Don't bother checking if the first two characters are not new line
// characters.
if (
char1 == null ||
char2 == null ||
!NEWLINE_CHARS.has(char1) ||
!NEWLINE_CHARS.has(char2)
) {
return null;
}
// Don't bother checking if the first two characters are not new line
// characters.
if (char1 == null || char2 == null || !NEWLINE_CHARS.has(char1) || !NEWLINE_CHARS.has(char2)) {
return null;
}
for (const s of MESSAGE_BOUNDARIES) {
const seq = peekSequence(start, buffer, s);
if (seq != null) {
return seq;
for (const s of MESSAGE_BOUNDARIES) {
const seq = peekSequence(start, buffer, s);
if (seq != null) {
return seq;
}
}
}
return null;
return null;
}
function peekSequence(
position: number,
buffer: Uint8Array,
sequence: Uint8Array,
position: number,
buffer: Uint8Array,
sequence: Uint8Array
): Uint8Array | null {
if (sequence.length > buffer.length - position) {
return null;
}
if (sequence.length > buffer.length - position) {
return null;
}
for (let i = 0; i < sequence.length; i++) {
if (buffer[position + i] !== sequence[i]) {
return null;
for (let i = 0; i < sequence.length; i++) {
if (buffer[position + i] !== sequence[i]) {
return null;
}
}
}
return sequence;
return sequence;
}
function parseEvent<Event extends ServerEvent<unknown>>(
chunk: Uint8Array,
decoder: (rawEvent: ServerEvent<string>) => Event,
chunk: Uint8Array,
decoder: (rawEvent: ServerEvent<string>) => Event
) {
if (!chunk.length) {
return null;
}
if (!chunk.length) {
return null;
}
const td = new TextDecoder();
const raw = td.decode(chunk);
const lines = raw.split(/\r?\n|\r/g);
let publish = false;
const rawEvent: ServerEvent<string> = {};
const td = new TextDecoder();
const raw = td.decode(chunk);
const lines = raw.split(/\r?\n|\r/g);
let publish = false;
const rawEvent: ServerEvent<string> = {};
for (const line of lines) {
if (!line) {
continue;
}
for (const line of lines) {
if (!line) {
continue;
}
const delim = line.indexOf(":");
// Lines starting with a colon are ignored.
if (delim === 0) {
continue;
}
const delim = line.indexOf(":");
// Lines starting with a colon are ignored.
if (delim === 0) {
continue;
}
const field = delim > 0 ? line.substring(0, delim) : "";
let value = delim > 0 ? line.substring(delim + 1) : "";
if (value.charAt(0) === " ") {
value = value.substring(1);
}
const field = delim > 0 ? line.substring(0, delim) : "";
let value = delim > 0 ? line.substring(delim + 1) : "";
if (value.charAt(0) === " ") {
value = value.substring(1);
}
switch (field) {
case "event": {
publish = true;
rawEvent.event = value;
break;
}
case "data": {
publish = true;
rawEvent.data ??= "";
rawEvent.data += value + "\n";
break;
}
case "id": {
publish = true;
rawEvent.id = value;
break;
}
case "retry": {
const r = parseInt(value, 10);
if (!Number.isNaN(r)) {
publish = true;
rawEvent.retry = r;
switch (field) {
case "event": {
publish = true;
rawEvent.event = value;
break;
}
case "data": {
publish = true;
rawEvent.data ??= "";
rawEvent.data += value + "\n";
break;
}
case "id": {
publish = true;
rawEvent.id = value;
break;
}
case "retry": {
const r = parseInt(value, 10);
if (!Number.isNaN(r)) {
publish = true;
rawEvent.retry = r;
}
break;
}
}
break;
}
}
}
if (!publish) {
return null;
}
if (!publish) {
return null;
}
if (rawEvent.data != null) {
rawEvent.data = rawEvent.data.slice(0, -1);
}
if (rawEvent.data != null) {
rawEvent.data = rawEvent.data.slice(0, -1);
}
return decoder(rawEvent);
return decoder(rawEvent);
}

@@ -6,3 +6,3 @@ /*

import { RecordsCited, RecordsCited$ } from "./recordscited";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export enum AssistantMessageRole {

@@ -6,3 +6,3 @@ /*

import { AssistantMessage, AssistantMessage$ } from "./assistantmessage";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export type ChatResult = {

@@ -6,3 +6,3 @@ /*

import { MessageChunk, MessageChunk$ } from "./messagechunk";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export enum Event {

@@ -6,3 +6,3 @@ /*

import { RecordsCited, RecordsCited$ } from "./recordscited";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export enum ChatResultRecordsCitedEventEvent {

@@ -15,3 +15,3 @@ /*

} from "./chatresultrecordscitedevent";
import { z } from "zod";
import * as z from "zod";

@@ -35,3 +35,2 @@ export type ChatResultStream =

});
export const inboundSchema: z.ZodType<ChatResultStream, z.ZodTypeDef, Inbound> = z.union([

@@ -49,3 +48,2 @@ ChatResultMessageChunkEvent$.inboundSchema.and(

]);
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, ChatResultStream> = z.union([

@@ -52,0 +50,0 @@ ChatResultMessageChunkEvent$.outboundSchema.and(

@@ -6,3 +6,3 @@ /*

import { Message, Message$ } from "./message";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export type ChatSessionInput = {

@@ -6,3 +6,3 @@ /*

import { RecordT, RecordT$ } from "./record";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export type Citation = {

@@ -6,3 +6,3 @@ /*

import { Message, Message$ } from "./message";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export type ContinueChatSessionWithChatResultInput = {

@@ -6,3 +6,3 @@ /*

import { ChatSessionInput, ChatSessionInput$ } from "./chatsessioninput";
import { z } from "zod";
import * as z from "zod";

@@ -31,3 +31,2 @@ export enum ChatModeOptions {

export type Outbound = ChatModeOptions | string;
export const inboundSchema: z.ZodType<ChatMode, z.ZodTypeDef, Inbound> = z.union([

@@ -37,3 +36,2 @@ ChatModeOptions$,

]);
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, ChatMode> = z.union([

@@ -40,0 +38,0 @@ ChatModeOptions$,

@@ -7,3 +7,3 @@ /*

import { Role, UserMessage, UserMessage$ } from "./usermessage";
import { z } from "zod";
import * as z from "zod";

@@ -23,3 +23,2 @@ export type Message =

| (AssistantMessage$.Outbound & { role: AssistantMessageRole.Assistant });
export const inboundSchema: z.ZodType<Message, z.ZodTypeDef, Inbound> = z.union([

@@ -35,3 +34,2 @@ UserMessage$.inboundSchema.and(

]);
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, Message> = z.union([

@@ -38,0 +36,0 @@ UserMessage$.outboundSchema.and(

@@ -5,3 +5,3 @@ /*

import { z } from "zod";
import * as z from "zod";

@@ -8,0 +8,0 @@ export enum FinishReason {

@@ -6,3 +6,3 @@ /*

import { RecordType, RecordType$ } from "./recordtype";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export type RecordT = {

@@ -6,3 +6,3 @@ /*

import { Citation, Citation$ } from "./citation";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ export type RecordsCited = {

@@ -5,3 +5,3 @@ /*

import { z } from "zod";
import * as z from "zod";

@@ -33,3 +33,2 @@ export enum RecordTypeEnumerated {

export type Outbound = RecordTypeEnumerated | string;
export const inboundSchema: z.ZodType<RecordType, z.ZodTypeDef, Inbound> = z.union([

@@ -39,3 +38,2 @@ RecordTypeEnumerated$,

]);
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, RecordType> = z.union([

@@ -42,0 +40,0 @@ RecordTypeEnumerated$,

@@ -5,3 +5,3 @@ /*

import { z } from "zod";
import * as z from "zod";

@@ -8,0 +8,0 @@ export type Security = {

@@ -5,3 +5,3 @@ /*

import { z } from "zod";
import * as z from "zod";

@@ -8,0 +8,0 @@ export enum Role {

@@ -5,3 +5,3 @@ /*

import { z } from "zod";
import * as z from "zod";

@@ -21,3 +21,2 @@ export type Loc = string | number;

export type Outbound = string | number;
export const inboundSchema: z.ZodType<Loc, z.ZodTypeDef, Inbound> = z.union([

@@ -27,3 +26,2 @@ z.string(),

]);
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, Loc> = z.union([

@@ -30,0 +28,0 @@ z.string(),

@@ -6,3 +6,3 @@ /*

import * as components from "../../models/components";
import { z } from "zod";
import * as z from "zod";

@@ -9,0 +9,0 @@ /**

@@ -7,3 +7,3 @@ /*

import * as components from "../../models/components";
import { z } from "zod";
import * as z from "zod";

@@ -10,0 +10,0 @@ export type ContinueRequest = {

@@ -7,3 +7,3 @@ /*

import * as components from "../../models/components";
import { z } from "zod";
import * as z from "zod";

@@ -10,0 +10,0 @@ export type CreateResponse = {

@@ -5,3 +5,2 @@ /*

export { Decimal } from "./decimal";
export { RFCDate } from "./rfcdate";

@@ -8,0 +7,0 @@ export { blobLikeSchema, isBlobLike } from "./blobs";

@@ -1,2 +0,1 @@

export { Decimal } from "./decimal";
export { RFCDate } from "./rfcdate";

@@ -3,0 +2,0 @@ export { blobLikeSchema, isBlobLike } from "./blobs";

@@ -6,5 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createPageIterator = exports.isBlobLike = exports.blobLikeSchema = exports.RFCDate = exports.Decimal = void 0;
var decimal_1 = require("./decimal");
Object.defineProperty(exports, "Decimal", { enumerable: true, get: function () { return decimal_1.Decimal; } });
exports.createPageIterator = exports.isBlobLike = exports.blobLikeSchema = exports.RFCDate = void 0;
var rfcdate_1 = require("./rfcdate");

@@ -11,0 +9,0 @@ Object.defineProperty(exports, "RFCDate", { enumerable: true, get: function () { return rfcdate_1.RFCDate; } });

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

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

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

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

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

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

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

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

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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc