From cbd7d131520a0e73813294c9908c00f1b731bdbe Mon Sep 17 00:00:00 2001 From: POPPIN-FUMI Date: Tue, 7 Nov 2023 15:57:37 +0100 Subject: [PATCH] update: release v1.7.7 --- dist/lib/genPrompt.d.ts | 7 ++----- dist/lib/openai/openAi.d.ts | 3 +-- dist/lib/types/openaiTypes.d.ts | 3 ++- dist/lib/version.d.ts | 2 +- docs/classes/OpenAI-1.html | 4 ++-- docs/classes/SkeetAI.html | 4 ++-- docs/classes/VertexAI.html | 4 ++-- docs/enums/InstanceType.html | 4 ++-- docs/enums/NamingEnum.html | 4 ++-- docs/enums/SkeetAiMode.html | 4 ++-- docs/functions/generatePrompt.html | 2 +- docs/functions/translate.html | 2 +- docs/interfaces/AIPrompt.html | 6 +++--- docs/interfaces/SkeetAIOptions.html | 10 +++++----- docs/types/AIExample.html | 2 +- docs/types/AIType.html | 2 +- docs/types/AiInstance.html | 2 +- docs/types/Example.html | 2 +- docs/types/InputOutput.html | 2 +- docs/types/OpenAIMessage.html | 2 +- docs/types/OpenAIOptions.html | 2 +- docs/types/OpenAIPromptParams.html | 2 +- docs/types/OpenAIRole.html | 2 +- docs/types/VertexAiOptions.html | 2 +- docs/types/VertexExample.html | 2 +- docs/types/VertexExampleMessage.html | 2 +- docs/types/VertexMessage.html | 2 +- docs/types/VertexParameterParams.html | 2 +- docs/types/VertexPromptParams.html | 2 +- package.json | 2 +- src/lib/genPrompt.ts | 2 +- src/lib/openai/openAi.ts | 2 +- src/lib/types/openaiTypes.ts | 4 +++- src/lib/version.ts | 2 +- 34 files changed, 50 insertions(+), 51 deletions(-) diff --git a/dist/lib/genPrompt.d.ts b/dist/lib/genPrompt.d.ts index 052c6c75..ef07ecde 100644 --- a/dist/lib/genPrompt.d.ts +++ b/dist/lib/genPrompt.d.ts @@ -1,5 +1,4 @@ -import { VertexPromptParams } from './types'; -import { ChatCompletionMessageParam } from 'openai/resources'; +import { OpenAIPromptParams, VertexPromptParams } from './types'; /** * Represents the AI platforms supported by the generatePrompt function. */ @@ -30,9 +29,7 @@ export interface AIPrompt { */ examples: AIExample[]; } -export declare function generatePrompt(context: string, examples: AIExample[], content: string, ai: AIType): VertexPromptParams | { - messages: ChatCompletionMessageParam[]; -}; +export declare function generatePrompt(context: string, examples: AIExample[], content: string, ai: AIType): VertexPromptParams | OpenAIPromptParams; export declare const migrationPrompt: { context: string; examples: { diff --git a/dist/lib/openai/openAi.d.ts b/dist/lib/openai/openAi.d.ts index 3a3a084e..31e179a4 100644 --- a/dist/lib/openai/openAi.d.ts +++ b/dist/lib/openai/openAi.d.ts @@ -1,7 +1,6 @@ import { OpenAI as OpenAIApi } from 'openai'; import { OpenAIOptions } from '@/lib/types/openaiTypes'; import { AIPromptable } from '@/lib/skeetai'; -import { ChatCompletionMessageParam } from 'openai/resources/chat'; import { Stream } from 'openai/streaming'; export declare class OpenAI implements AIPromptable { private options; @@ -10,7 +9,7 @@ export declare class OpenAI implements AIPromptable { prompt(promptParams: any): Promise; chat(content: string): Promise; generateTitle(content: string): Promise; - promptStream(prompt: ChatCompletionMessageParam[]): Promise>; + promptStream(prompt: any): Promise>; uploadFile(filePath: string): Promise; createFineTuningJob(fileId: string, model?: string): Promise; showFineTuningJob(jobId: string): Promise; diff --git a/dist/lib/types/openaiTypes.d.ts b/dist/lib/types/openaiTypes.d.ts index 0dba0ab8..7a8ee076 100644 --- a/dist/lib/types/openaiTypes.d.ts +++ b/dist/lib/types/openaiTypes.d.ts @@ -1,5 +1,6 @@ +import { ChatCompletionMessageParam } from 'openai/resources'; export type OpenAIPromptParams = { - messages: OpenAIMessage[]; + messages: ChatCompletionMessageParam[]; }; export type OpenAIOptions = { organizationKey?: string; diff --git a/dist/lib/version.d.ts b/dist/lib/version.d.ts index cbdd388e..3304a310 100644 --- a/dist/lib/version.d.ts +++ b/dist/lib/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "1.7.6"; +export declare const VERSION = "1.7.7"; diff --git a/docs/classes/OpenAI-1.html b/docs/classes/OpenAI-1.html index 21ea4b4e..847addc4 100644 --- a/docs/classes/OpenAI-1.html +++ b/docs/classes/OpenAI-1.html @@ -1,4 +1,4 @@ -OpenAI | @skeet-framework/ai

Hierarchy

  • OpenAI

Implements

  • AIPromptable

Constructors

constructor +OpenAI | @skeet-framework/ai

Hierarchy

  • OpenAI

Implements

  • AIPromptable

Constructors

Properties

Methods

Constructors

Properties

aiInstance: openai.OpenAI
options: OpenAIOptions

Methods

  • Parameters

    • promptParams: any

    Returns Promise<string>

Generated using TypeDoc

\ No newline at end of file +

Constructors

Properties

aiInstance: openai.OpenAI
options: OpenAIOptions

Methods

  • Parameters

    • promptParams: any

    Returns Promise<string>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/SkeetAI.html b/docs/classes/SkeetAI.html index ce077b90..cf8ff7f1 100644 --- a/docs/classes/SkeetAI.html +++ b/docs/classes/SkeetAI.html @@ -1,5 +1,5 @@ SkeetAI | @skeet-framework/ai

The main SkeetAI class for handling AI interactions.

-

Hierarchy

  • SkeetAI

Constructors

Hierarchy

  • SkeetAI

Constructors

Properties

_initOptions ai aiInstance @@ -28,4 +28,4 @@

Parameters

  • options: SkeetAIOptions = {}

    Configuration options for initializing the SkeetAI.

Returns SkeetAI

Example

// Using default settings:
const defaultSkeet = new SkeetAI();

// Specifying the AI platform and model:
const customSkeet = new SkeetAI({
ai: 'OpenAI',
model: 'gpt-4',
maxTokens: 500
});
-

Properties

_initOptions: SkeetAIOptions
ai: "VertexAI" | "OpenAI"
aiInstance: VertexAI | OpenAI
maxTokens: number
model: string
temperature: number
FUNCTION_ROOT: "./functions" = './functions'
MODEL_PATH: string = './functions/skeet/src/models'
PRISMA_SCHEMA_PATH: string = './graphql/prisma/schema.prisma'

Accessors

Methods

  • Parameters

    • content: string

    Returns Promise<undefined | string>

  • Parameters

    • content: string
    • tsconfig: string
    • packageJson: string
    • prettierrc: string
    • existingFunctions: string
    • existingModels: string
    • instanceType: InstanceType

    Returns Promise<undefined | string>

  • Parameters

    • functionName: string

    Returns {
        packageJson: string;
        tsconfigJson: string;
    }

    • packageJson: string
    • tsconfigJson: string
  • Parameters

    • content: string
    • tsconfig: string
    • packageJson: string
    • prettierrc: string
    • existingFunctions: string
    • existingModels: string

    Returns Promise<undefined | string>

  • Parameters

    • content: string
    • namingEnum: NamingEnum = NamingEnum.FUNCTION

    Returns Promise<undefined | string>

  • Parameters

    • content: string

    Returns Promise<undefined | string>

  • Parameters

    • paths: string[]
    • langFrom: string = 'ja'
    • langTo: string = 'en'

    Returns Promise<void>

  • Parameters

    • content: string

    Returns Promise<undefined | string>

Generated using TypeDoc

\ No newline at end of file +

Properties

_initOptions: SkeetAIOptions
ai: "VertexAI" | "OpenAI"
aiInstance: VertexAI | OpenAI
maxTokens: number
model: string
temperature: number
FUNCTION_ROOT: "./functions" = './functions'
MODEL_PATH: string = './functions/skeet/src/models'
PRISMA_SCHEMA_PATH: string = './graphql/prisma/schema.prisma'

Accessors

Methods

  • Parameters

    • content: string

    Returns Promise<undefined | string>

  • Parameters

    • content: string
    • tsconfig: string
    • packageJson: string
    • prettierrc: string
    • existingFunctions: string
    • existingModels: string
    • instanceType: InstanceType

    Returns Promise<undefined | string>

  • Parameters

    • functionName: string

    Returns {
        packageJson: string;
        tsconfigJson: string;
    }

    • packageJson: string
    • tsconfigJson: string
  • Parameters

    • content: string
    • tsconfig: string
    • packageJson: string
    • prettierrc: string
    • existingFunctions: string
    • existingModels: string

    Returns Promise<undefined | string>

  • Parameters

    • content: string
    • namingEnum: NamingEnum = NamingEnum.FUNCTION

    Returns Promise<undefined | string>

  • Parameters

    • content: string

    Returns Promise<undefined | string>

  • Parameters

    • paths: string[]
    • langFrom: string = 'ja'
    • langTo: string = 'en'

    Returns Promise<void>

  • Parameters

    • content: string

    Returns Promise<undefined | string>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/VertexAI.html b/docs/classes/VertexAI.html index 6aa729bb..a63d449b 100644 --- a/docs/classes/VertexAI.html +++ b/docs/classes/VertexAI.html @@ -1,4 +1,4 @@ -VertexAI | @skeet-framework/ai

Hierarchy

  • VertexAI

Implements

  • AIPromptable

Constructors

constructor +VertexAI | @skeet-framework/ai

Hierarchy

  • VertexAI

Implements

  • AIPromptable

Constructors

Properties

Methods

Constructors

Properties

vertexParams: VertexParameterParams

Methods

  • Parameters

    Returns Promise<{
        endpoint: string;
        instanceValue: any;
        parameters: any;
    }>

Generated using TypeDoc

\ No newline at end of file +

Constructors

Properties

vertexParams: VertexParameterParams

Methods

  • Parameters

    Returns Promise<{
        endpoint: string;
        instanceValue: any;
        parameters: any;
    }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/InstanceType.html b/docs/enums/InstanceType.html index 86df4707..8bb9ab8f 100644 --- a/docs/enums/InstanceType.html +++ b/docs/enums/InstanceType.html @@ -1,6 +1,6 @@ -InstanceType | @skeet-framework/ai

Enumeration InstanceType

Enumeration Members

AUTH +InstanceType | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +

Enumeration Members

AUTH: "auth"
FIRESTORE: "firestore"
HTTP: "http"
PUBSUB: "pubsub"
SCHEDULE: "schedule"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/NamingEnum.html b/docs/enums/NamingEnum.html index 1aa51d8a..8fe4275c 100644 --- a/docs/enums/NamingEnum.html +++ b/docs/enums/NamingEnum.html @@ -1,4 +1,4 @@ -NamingEnum | @skeet-framework/ai

Enumeration NamingEnum

Enumeration Members

FUNCTION +NamingEnum | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +

Enumeration Members

FUNCTION: "function"
MIGRATION: "migration"
MODEL: "model"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/SkeetAiMode.html b/docs/enums/SkeetAiMode.html index 7a5af60e..865cb978 100644 --- a/docs/enums/SkeetAiMode.html +++ b/docs/enums/SkeetAiMode.html @@ -1,4 +1,4 @@ -SkeetAiMode | @skeet-framework/ai

Enumeration SkeetAiMode

Enumeration Members

Firestore +SkeetAiMode | @skeet-framework/ai

Enumeration SkeetAiMode

Enumeration Members

Enumeration Members

Firestore: "firestore"
Function: "function"
Method: "method"
Prisma: "prisma"
Skeet: "skeet"
Translate: "translate"
Typedoc: "typedoc"
YesOrNo: "yesOrNo"

Generated using TypeDoc

\ No newline at end of file +

Enumeration Members

Firestore: "firestore"
Function: "function"
Method: "method"
Prisma: "prisma"
Skeet: "skeet"
Translate: "translate"
Typedoc: "typedoc"
YesOrNo: "yesOrNo"

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/generatePrompt.html b/docs/functions/generatePrompt.html index a17aabaa..d6ecb86f 100644 --- a/docs/functions/generatePrompt.html +++ b/docs/functions/generatePrompt.html @@ -1 +1 @@ -generatePrompt | @skeet-framework/ai

Function generatePrompt

Generated using TypeDoc

\ No newline at end of file +generatePrompt | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/functions/translate.html b/docs/functions/translate.html index 0eac26a0..723fe181 100644 --- a/docs/functions/translate.html +++ b/docs/functions/translate.html @@ -5,4 +5,4 @@

Throws

Will throw an error if the translation fails.

Example

import { translate } from "@skeet-framework/ai"

const translatedText = await translate("Hello", "es")
console.log(translatedText); // Outputs: "Hola"
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/AIPrompt.html b/docs/interfaces/AIPrompt.html index 8a426b68..2b0f3ab4 100644 --- a/docs/interfaces/AIPrompt.html +++ b/docs/interfaces/AIPrompt.html @@ -1,6 +1,6 @@ AIPrompt | @skeet-framework/ai

Interface AIPrompt

Represents the structure of the AI prompt which includes context and examples.

-

Hierarchy

  • AIPrompt

Properties

Hierarchy

  • AIPrompt

Properties

Properties

context: string

The context or background information for the AI prompt.

-
examples: AIExample[]

An array of examples, each consisting of input and output pairs.

-

Generated using TypeDoc

\ No newline at end of file +
examples: AIExample[]

An array of examples, each consisting of input and output pairs.

+

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/SkeetAIOptions.html b/docs/interfaces/SkeetAIOptions.html index 2dec911f..4cf2c6f2 100644 --- a/docs/interfaces/SkeetAIOptions.html +++ b/docs/interfaces/SkeetAIOptions.html @@ -1,11 +1,11 @@ SkeetAIOptions | @skeet-framework/ai

Interface SkeetAIOptions

Configuration options for initializing a SkeetAI instance.

-

Hierarchy

  • SkeetAIOptions

Properties

ai? +

Hierarchy

  • SkeetAIOptions

Properties

ai?: "VertexAI" | "OpenAI"

AI platform type (either 'VertexAI' or 'OpenAI'). Default is 'VertexAI'.

-
maxTokens?: number

Maximum number of tokens to be returned in the response. Default is 1000.

-
model?: string

Model name to be used by the chosen AI platform. Defaults are 'chat-bison@001' for VertexAI and 'gpt-4' for OpenAI.

-
temperature?: number

Temperature parameter for the AI platform. Default is 0.2.

+
maxTokens?: number

Maximum number of tokens to be returned in the response. Default is 1000.

+
model?: string

Model name to be used by the chosen AI platform. Defaults are 'chat-bison@001' for VertexAI and 'gpt-4' for OpenAI.

+
temperature?: number

Temperature parameter for the AI platform. Default is 0.2.

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/AIExample.html b/docs/types/AIExample.html index d6ba4f0f..80275a6b 100644 --- a/docs/types/AIExample.html +++ b/docs/types/AIExample.html @@ -1,4 +1,4 @@ AIExample | @skeet-framework/ai

Type alias AIExample

AIExample: {
    input: string;
    output: string;
}

Represents an example consisting of input and output content.

Type declaration

  • input: string

    The input content for the AI platform.

  • output: string

    The expected output content from the AI platform.

    -

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/AIType.html b/docs/types/AIType.html index c7f3c4a4..48ddce49 100644 --- a/docs/types/AIType.html +++ b/docs/types/AIType.html @@ -1,2 +1,2 @@ AIType | @skeet-framework/ai

Type alias AIType

AIType: "VertexAI" | "OpenAI"

Represents the AI platforms supported by the generatePrompt function.

-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/AiInstance.html b/docs/types/AiInstance.html index f4cc730f..df231eab 100644 --- a/docs/types/AiInstance.html +++ b/docs/types/AiInstance.html @@ -1 +1 @@ -AiInstance | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +AiInstance | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/Example.html b/docs/types/Example.html index c7c49329..b0e22b17 100644 --- a/docs/types/Example.html +++ b/docs/types/Example.html @@ -1 +1 @@ -Example | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +Example | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/InputOutput.html b/docs/types/InputOutput.html index 7caeccf8..32798d16 100644 --- a/docs/types/InputOutput.html +++ b/docs/types/InputOutput.html @@ -1 +1 @@ -InputOutput | @skeet-framework/ai

Type alias InputOutput

InputOutput: {
    input: string;
    output: string;
}

Type declaration

  • input: string
  • output: string

Generated using TypeDoc

\ No newline at end of file +InputOutput | @skeet-framework/ai

Type alias InputOutput

InputOutput: {
    input: string;
    output: string;
}

Type declaration

  • input: string
  • output: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/OpenAIMessage.html b/docs/types/OpenAIMessage.html index 092b1aaf..fe132c90 100644 --- a/docs/types/OpenAIMessage.html +++ b/docs/types/OpenAIMessage.html @@ -1 +1 @@ -OpenAIMessage | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +OpenAIMessage | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/OpenAIOptions.html b/docs/types/OpenAIOptions.html index 16c41753..ea69ae9d 100644 --- a/docs/types/OpenAIOptions.html +++ b/docs/types/OpenAIOptions.html @@ -1 +1 @@ -OpenAIOptions | @skeet-framework/ai

Type alias OpenAIOptions

OpenAIOptions: {
    apiKey?: string;
    maxTokens?: number;
    model?: string;
    n?: number;
    organizationKey?: string;
    stream?: boolean;
    temperature?: number;
    topP?: number;
}

Type declaration

  • Optional apiKey?: string
  • Optional maxTokens?: number
  • Optional model?: string
  • Optional n?: number
  • Optional organizationKey?: string
  • Optional stream?: boolean
  • Optional temperature?: number
  • Optional topP?: number

Generated using TypeDoc

\ No newline at end of file +OpenAIOptions | @skeet-framework/ai

Type alias OpenAIOptions

OpenAIOptions: {
    apiKey?: string;
    maxTokens?: number;
    model?: string;
    n?: number;
    organizationKey?: string;
    stream?: boolean;
    temperature?: number;
    topP?: number;
}

Type declaration

  • Optional apiKey?: string
  • Optional maxTokens?: number
  • Optional model?: string
  • Optional n?: number
  • Optional organizationKey?: string
  • Optional stream?: boolean
  • Optional temperature?: number
  • Optional topP?: number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/OpenAIPromptParams.html b/docs/types/OpenAIPromptParams.html index 352650a9..a94cbb88 100644 --- a/docs/types/OpenAIPromptParams.html +++ b/docs/types/OpenAIPromptParams.html @@ -1 +1 @@ -OpenAIPromptParams | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +OpenAIPromptParams | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/OpenAIRole.html b/docs/types/OpenAIRole.html index 8a09e085..4c3c6a01 100644 --- a/docs/types/OpenAIRole.html +++ b/docs/types/OpenAIRole.html @@ -1 +1 @@ -OpenAIRole | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +OpenAIRole | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/VertexAiOptions.html b/docs/types/VertexAiOptions.html index 51afa1b1..992fe5ac 100644 --- a/docs/types/VertexAiOptions.html +++ b/docs/types/VertexAiOptions.html @@ -1 +1 @@ -VertexAiOptions | @skeet-framework/ai

Type alias VertexAiOptions

VertexAiOptions: {
    apiEndpoint?: string;
    delay?: number;
    isJapanese?: boolean;
    location?: string;
    maxOutputTokens?: number;
    model?: string;
    projectId?: string;
    publisher?: string;
    temperature?: number;
    topK?: number;
    topP?: number;
}

Type declaration

  • Optional apiEndpoint?: string
  • Optional delay?: number
  • Optional isJapanese?: boolean
  • Optional location?: string
  • Optional maxOutputTokens?: number
  • Optional model?: string
  • Optional projectId?: string
  • Optional publisher?: string
  • Optional temperature?: number
  • Optional topK?: number
  • Optional topP?: number

Generated using TypeDoc

\ No newline at end of file +VertexAiOptions | @skeet-framework/ai

Type alias VertexAiOptions

VertexAiOptions: {
    apiEndpoint?: string;
    delay?: number;
    isJapanese?: boolean;
    location?: string;
    maxOutputTokens?: number;
    model?: string;
    projectId?: string;
    publisher?: string;
    temperature?: number;
    topK?: number;
    topP?: number;
}

Type declaration

  • Optional apiEndpoint?: string
  • Optional delay?: number
  • Optional isJapanese?: boolean
  • Optional location?: string
  • Optional maxOutputTokens?: number
  • Optional model?: string
  • Optional projectId?: string
  • Optional publisher?: string
  • Optional temperature?: number
  • Optional topK?: number
  • Optional topP?: number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/VertexExample.html b/docs/types/VertexExample.html index a87a1d89..78bdd158 100644 --- a/docs/types/VertexExample.html +++ b/docs/types/VertexExample.html @@ -1 +1 @@ -VertexExample | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +VertexExample | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/VertexExampleMessage.html b/docs/types/VertexExampleMessage.html index b3050df6..b99748e1 100644 --- a/docs/types/VertexExampleMessage.html +++ b/docs/types/VertexExampleMessage.html @@ -1 +1 @@ -VertexExampleMessage | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file +VertexExampleMessage | @skeet-framework/ai

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/VertexMessage.html b/docs/types/VertexMessage.html index 973bae74..0dee8e66 100644 --- a/docs/types/VertexMessage.html +++ b/docs/types/VertexMessage.html @@ -1 +1 @@ -VertexMessage | @skeet-framework/ai

Type alias VertexMessage

VertexMessage: {
    author: string;
    content: string;
}

Type declaration

  • author: string
  • content: string

Generated using TypeDoc

\ No newline at end of file +VertexMessage | @skeet-framework/ai

Type alias VertexMessage

VertexMessage: {
    author: string;
    content: string;
}

Type declaration

  • author: string
  • content: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/VertexParameterParams.html b/docs/types/VertexParameterParams.html index b0aa4bcc..0b76b47f 100644 --- a/docs/types/VertexParameterParams.html +++ b/docs/types/VertexParameterParams.html @@ -1 +1 @@ -VertexParameterParams | @skeet-framework/ai

Type alias VertexParameterParams

VertexParameterParams: {
    maxOutputTokens: number;
    temperature: number;
    topK: number;
    topP: number;
}

Type declaration

  • maxOutputTokens: number
  • temperature: number
  • topK: number
  • topP: number

Generated using TypeDoc

\ No newline at end of file +VertexParameterParams | @skeet-framework/ai

Type alias VertexParameterParams

VertexParameterParams: {
    maxOutputTokens: number;
    temperature: number;
    topK: number;
    topP: number;
}

Type declaration

  • maxOutputTokens: number
  • temperature: number
  • topK: number
  • topP: number

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/types/VertexPromptParams.html b/docs/types/VertexPromptParams.html index 0d48553e..818bcbf4 100644 --- a/docs/types/VertexPromptParams.html +++ b/docs/types/VertexPromptParams.html @@ -1 +1 @@ -VertexPromptParams | @skeet-framework/ai

Type alias VertexPromptParams

VertexPromptParams: {
    context: string;
    examples: VertexExample[];
    messages: VertexMessage[];
}

Type declaration

Generated using TypeDoc

\ No newline at end of file +VertexPromptParams | @skeet-framework/ai

Type alias VertexPromptParams

VertexPromptParams: {
    context: string;
    examples: VertexExample[];
    messages: VertexMessage[];
}

Type declaration

Generated using TypeDoc

\ No newline at end of file diff --git a/package.json b/package.json index da51e607..557c5a05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skeet-framework/ai", - "version": "1.7.6", + "version": "1.7.7", "description": "Skeet Framework Plugin - AI", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/lib/genPrompt.ts b/src/lib/genPrompt.ts index a2b42523..663932d4 100644 --- a/src/lib/genPrompt.ts +++ b/src/lib/genPrompt.ts @@ -42,7 +42,7 @@ export function generatePrompt( examples: AIExample[], content: string, ai: AIType, -): VertexPromptParams | { messages: ChatCompletionMessageParam[] } { +): VertexPromptParams | OpenAIPromptParams { if (ai === 'VertexAI') { const exampleMessages = [] for (const example of examples) { diff --git a/src/lib/openai/openAi.ts b/src/lib/openai/openAi.ts index 6fdb987e..ee45ded0 100644 --- a/src/lib/openai/openAi.ts +++ b/src/lib/openai/openAi.ts @@ -112,7 +112,7 @@ export class OpenAI implements AIPromptable { } } - async promptStream(prompt: ChatCompletionMessageParam[]) { + async promptStream(prompt: any) { try { const openaiConfig = { model: this.options.model!, diff --git a/src/lib/types/openaiTypes.ts b/src/lib/types/openaiTypes.ts index 9ad34006..924a8db0 100644 --- a/src/lib/types/openaiTypes.ts +++ b/src/lib/types/openaiTypes.ts @@ -1,5 +1,7 @@ +import { ChatCompletionMessageParam } from 'openai/resources' + export type OpenAIPromptParams = { - messages: OpenAIMessage[] + messages: ChatCompletionMessageParam[] } export type OpenAIOptions = { diff --git a/src/lib/version.ts b/src/lib/version.ts index 76dd0767..0535c85a 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -1 +1 @@ -export const VERSION = '1.7.6' \ No newline at end of file +export const VERSION = '1.7.7' \ No newline at end of file