New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@fadeaway-ai/sdk

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fadeaway-ai/sdk - npm Package Compare versions

Comparing version

to
0.1.9

@@ -28,3 +28,2 @@ "use strict";

FadeawayStop: () => FadeawayStop,
FunctionResponse: () => FunctionResponse,
View: () => View,

@@ -101,9 +100,12 @@ deserializeFromTypename: () => deserializeFromTypename,

schema: arg.schema || import_zod.z.object({}),
run: arg.run
run: async (data) => {
const response = await arg.run(data);
if (Array.isArray(response)) {
return response;
} else {
return [response];
}
}
};
}
var FunctionResponse = {
message: (message) => [message],
messages: (messages) => messages
};
var FadeawayMessage = class _FadeawayMessage {

@@ -125,4 +127,4 @@ constructor(data) {

}
serizlize() {
return serizlizeWithTypename(this.data);
serialize() {
return serializeWithTypename(this.data);
}

@@ -137,3 +139,3 @@ };

};
function serizlizeWithTypename(obj) {
function serializeWithTypename(obj) {
return JSON.stringify({

@@ -173,3 +175,2 @@ __typename: obj.constructor.name,

FadeawayStop,
FunctionResponse,
View,

@@ -176,0 +177,0 @@ deserializeFromTypename,

@@ -10,15 +10,17 @@ import { ChatCompletionRequestMessage } from 'openai-edge';

type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
interface LLMFunction<Input, Output> {
interface LLMFunctionMeta<Input> {
name: string;
description: string;
schema?: ZodType<Input>;
run: (data: Input) => IFunctionResponseMeta | Promise<IFunctionResponseMeta>;
}
interface LLMFunction<Input> {
name: string;
description: string;
schema: ZodType<Input>;
run: (data: Input) => IFunctionResponse | Promise<IFunctionResponse>;
}
declare function llmFunction<Input = Record<string, never>, Output = any>(arg: Optional<LLMFunction<Input, Output>, 'schema'>): LLMFunction<Input, Output>;
declare function llmFunction<Input = Record<string, never>>(arg: LLMFunctionMeta<Input>): LLMFunction<Input>;
type IFunctionResponseMeta = FadeawayMessage | FadeawayMessage[];
type IFunctionResponse = FadeawayMessage[];
declare const FunctionResponse: {
message: (message: FadeawayMessage) => FadeawayMessage[];
messages: (messages: FadeawayMessage[]) => FadeawayMessage[];
};
declare class FadeawayMessage {

@@ -31,3 +33,3 @@ data?: any;

static redirect(href: string): FadeawayMessage;
serizlize(): string;
serialize(): string;
}

@@ -50,3 +52,3 @@ declare class FadeawayStop {

prompt?: string;
functions?: LLMFunction<any, any>[];
functions?: LLMFunction<any>[];
init?: string;

@@ -78,2 +80,2 @@ }

export { FadeawayAPI, FadeawayMessage, FadeawayRedirect, FadeawayRoute, FadeawaySession, FadeawayStop, FunctionResponse, IFadeawayRoute, IFunctionResponse, LLMFunction, View, deserializeFromTypename, llmFunction };
export { FadeawayAPI, FadeawayMessage, FadeawayRedirect, FadeawayRoute, FadeawaySession, FadeawayStop, IFadeawayRoute, IFunctionResponse, LLMFunction, View, deserializeFromTypename, llmFunction };

@@ -28,3 +28,2 @@ "use strict";

FadeawayStop: () => FadeawayStop,
FunctionResponse: () => FunctionResponse,
View: () => View,

@@ -101,9 +100,12 @@ deserializeFromTypename: () => deserializeFromTypename,

schema: arg.schema || import_zod.z.object({}),
run: arg.run
run: async (data) => {
const response = await arg.run(data);
if (Array.isArray(response)) {
return response;
} else {
return [response];
}
}
};
}
var FunctionResponse = {
message: (message) => [message],
messages: (messages) => messages
};
var FadeawayMessage = class _FadeawayMessage {

@@ -125,4 +127,4 @@ constructor(data) {

}
serizlize() {
return serizlizeWithTypename(this.data);
serialize() {
return serializeWithTypename(this.data);
}

@@ -137,3 +139,3 @@ };

};
function serizlizeWithTypename(obj) {
function serializeWithTypename(obj) {
return JSON.stringify({

@@ -173,3 +175,2 @@ __typename: obj.constructor.name,

FadeawayStop,
FunctionResponse,
View,

@@ -176,0 +177,0 @@ deserializeFromTypename,

{
"name": "@fadeaway-ai/sdk",
"version": "0.1.8",
"version": "0.1.9",
"description": "",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet