-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from elsoul/type
build types
- Loading branch information
Showing
77 changed files
with
548 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import aiplatform from '@google-cloud/aiplatform'; | ||
export { aiplatform }; | ||
import * as openai from 'openai'; | ||
export type { ChatCompletionChunk, ChatCompletion } from 'openai/resources/chat'; | ||
export { Stream } from 'openai/streaming'; | ||
export { openai }; | ||
export * from './lib/types/vertexaiTypes'; | ||
export * from './lib/types/openaiTypes'; | ||
export { OpenAI } from './lib/openai'; | ||
export { VertexAI } from './lib/vertexai'; | ||
export { translate } from './lib/translate'; | ||
export { generatePrompt } from './lib/genPrompt'; | ||
export { SkeetAI, type SkeetAIOptions } from './lib/skeetai'; | ||
export type { AIPrompt, AIType, AIExample } from './lib/genPrompt'; | ||
export type { Example, InputOutput, MODEL_PATH } from './lib/types/skeetaiTypes'; | ||
export { NamingEnum } from './lib/types/skeetaiTypes'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { OpenAIPromptParams, VertexPromptParams } from './types'; | ||
/** | ||
* Represents the AI platforms supported by the generatePrompt function. | ||
*/ | ||
export type AIType = 'VertexAI' | 'OpenAI'; | ||
/** | ||
* Represents an example consisting of input and output content. | ||
*/ | ||
export type AIExample = { | ||
/** | ||
* The input content for the AI platform. | ||
*/ | ||
input: string; | ||
/** | ||
* The expected output content from the AI platform. | ||
*/ | ||
output: string; | ||
}; | ||
/** | ||
* Represents the structure of the AI prompt which includes context and examples. | ||
*/ | ||
export interface AIPrompt { | ||
/** | ||
* The context or background information for the AI prompt. | ||
*/ | ||
context: string; | ||
/** | ||
* An array of examples, each consisting of input and output pairs. | ||
*/ | ||
examples: AIExample[]; | ||
} | ||
export declare function generatePrompt(context: string, examples: AIExample[], content: string, ai: AIType): VertexPromptParams | OpenAIPromptParams; | ||
export declare const migrationPrompt: { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; | ||
export declare const namingPrompt: { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './openAi'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { OpenAI as OpenAIApi } from 'openai'; | ||
import { OpenAIOptions, OpenAIPromptParams } from '@/lib/types/openaiTypes'; | ||
import { AIPromptable } from '@/lib/skeetai'; | ||
import { Stream } from 'openai/streaming'; | ||
export declare class OpenAI implements AIPromptable { | ||
private options; | ||
aiInstance: OpenAIApi; | ||
constructor(options?: OpenAIOptions); | ||
prompt(promptParams: any): Promise<string>; | ||
chat(content: string): Promise<string>; | ||
generateTitle(content: string): Promise<string>; | ||
promptStream(prompt: OpenAIPromptParams): Promise<Stream<OpenAIApi.Chat.Completions.ChatCompletionChunk>>; | ||
uploadFile(filePath: string): Promise<OpenAIApi.Files.FileObject>; | ||
createFineTuningJob(fileId: string, model?: string): Promise<OpenAIApi.FineTuning.Jobs.FineTuningJob>; | ||
showFineTuningJob(jobId: string): Promise<OpenAIApi.FineTuning.Jobs.FineTuningJob>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { OpenAIPromptParams } from '@/lib/types/openaiTypes'; | ||
export declare const randomChat: (content: string) => OpenAIPromptParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare const systemContentEN = "### Instructions ###\nGive a title to the content of the message coming from the user. The maximum number of characters for the title is 50 characters. Please make the title as short and descriptive as possible. Do not ask users questions in interrogative sentences. Be sure to respond with only the title. Don't answer questions from users.\nHere are some examples: Never answer user questions.\nExample 1: User's question: [Question] I want to start learning Javascript.\nAnswer: How to start learning Javascript\nExample 2: User's question: [Question] Can you write the code to create the file in Javascript?\nAnswer: How to create a file with JavaScript\nPreferred response format: [content] <summary of text>\n<question>:"; | ||
export declare const systemContentJA = "### \u6307\u793A ###\n\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u6765\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u5185\u5BB9\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u3064\u3051\u307E\u3059\u3002\u30BF\u30A4\u30C8\u30EB\u306E\u6587\u5B57\u6570\u306F\u6700\u5927\u306750\u6587\u5B57\u3067\u3059\u3002\u3067\u304D\u308B\u3060\u3051\u77ED\u304F\u308F\u304B\u308A\u3084\u3059\u3044\u30BF\u30A4\u30C8\u30EB\u3092\u3064\u3051\u3066\u304F\u3060\u3055\u3044\u3002\u7591\u554F\u6587\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u306F\u8CEA\u554F\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\u5FC5\u305A\u30BF\u30A4\u30C8\u30EB\u306E\u307F\u3092\u30EC\u30B9\u30DD\u30F3\u30B9\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u6765\u308B\u8CEA\u554F\u306B\u306F\u7B54\u3048\u3066\u306F\u3044\u3051\u307E\u305B\u3093\u3002\n\u4EE5\u4E0B\u306B\u3044\u304F\u3064\u304B\u306E\u4F8B\u3092\u793A\u3057\u307E\u3059\u3002\u7D76\u5BFE\u306B\u30E6\u30FC\u30B6\u30FC\u306E\u8CEA\u554F\u306B\u7B54\u3048\u3066\u306F\u3044\u3051\u307E\u305B\u3093\u3002\u3059\u3079\u3066\u82F1\u8A9E\u3067\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u6765\u305F\u5834\u5408\u306F\u82F1\u8A9E\u306E\u30BF\u30A4\u30C8\u30EB\u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002\n<\u91CD\u8981>\u30EC\u30B9\u30DD\u30F3\u30B9\u306F\u30BF\u30A4\u30C8\u30EB\u306E\u307F\u3092\u8FD4\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u4F8B1: \u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u8CEA\u554F: [\u8CEA\u554F]Javascript\u306E\u52C9\u5F37\u3092\u59CB\u3081\u305F\u3044\u306E\u3067\u3059\u304C\u3001\u3069\u3046\u3059\u308C\u3070\u3044\u3044\u3067\u3059\u304B?\n \u7B54\u3048\uFF1A Javascript\u306E\u52C9\u5F37\u306E\u59CB\u3081\u65B9\n\u4F8B2: \u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u8CEA\u554F: [\u8CEA\u554F]Javascript\u3067\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3059\u308B\u30B3\u30FC\u30C9\u3092\u66F8\u3044\u3066\u304F\u308C\u307E\u3059\u304B?\n \u7B54\u3048\uFF1A JavaScript\u3067\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3059\u308B\u65B9\u6CD5\n\u4F8B2: \u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u8CEA\u554F: \u4ECA\u65E5\u30821\u65E5\u304C\u3093\u3070\u308B\u305E!\n \u7B54\u3048\uFF1A \u6C17\u5408\u8868\u660E\n\u4F8B3: \u30E6\u30FC\u30B6\u30FC\u304B\u3089\u306E\u8CEA\u554F: \u3042\u306A\u305F\u306E\u4ECA\u65E5\u306E\u4E88\u5B9A\u306F\uFF1F\n \u7B54\u3048\uFF1A \u4ECA\u65E5\u306E\u4E88\u5B9A\n\u671B\u307E\u3057\u3044\u56DE\u7B54\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\uFF1A<\u6587\u7AE0\u3092\u8981\u7D04\u3057\u305F\u30BF\u30A4\u30C8\u30EB>\n<\u8CEA\u554F>:"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const example1: () => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
export declare const skeetDebug: (content: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI, debugFile: string) => Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export declare const debugPrompt: (tsconfigJson: string, packageJson: string, debugFile: string) => { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { OpenAI } from '@/lib/openai'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
export declare const createFineTuningJob: (uploadFileId: string, model: string | undefined, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<import("openai/resources/fine-tuning").FineTuningJob | undefined>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './uploadFile'; | ||
export * from './createFineTuningJob'; | ||
export * from './showFineTuningJob'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { OpenAI } from '@/lib/openai'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
export declare const showFineTuningJob: (jobId: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<import("openai/resources/fine-tuning").FineTuningJob | undefined>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { OpenAI } from '@/lib/openai'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
export declare const uploadJsonlFile: (filePath: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<import("openai/resources").FileObject | undefined>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
export declare const skeetFirestore: (content: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { AIPrompt } from '@/lib/genPrompt'; | ||
export declare const firestorePrompt: () => AIPrompt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { OpenAI } from '../openai'; | ||
import { VertexAI } from '../vertexai'; | ||
import { NamingEnum } from '../types/skeetaiTypes'; | ||
/** | ||
* Configuration options for initializing a SkeetAI instance. | ||
*/ | ||
export interface SkeetAIOptions { | ||
/** | ||
* AI platform type (either 'VertexAI' or 'OpenAI'). Default is 'VertexAI'. | ||
*/ | ||
ai?: 'VertexAI' | 'OpenAI'; | ||
/** | ||
* Model name to be used by the chosen AI platform. Defaults are 'chat-bison@001' for VertexAI and 'gpt-4' for OpenAI. | ||
*/ | ||
model?: string; | ||
/** | ||
* Maximum number of tokens to be returned in the response. Default is 1000. | ||
*/ | ||
maxTokens?: number; | ||
/** | ||
* Temperature parameter for the AI platform. Default is 0.2. | ||
* @see https://beta.openai.com/docs/api-reference/completions/create#temperature | ||
*/ | ||
temperature?: number; | ||
} | ||
export interface AIPromptable { | ||
prompt(input: string): Promise<any>; | ||
} | ||
/** | ||
* The main SkeetAI class for handling AI interactions. | ||
*/ | ||
export declare class SkeetAI { | ||
ai: 'VertexAI' | 'OpenAI'; | ||
model: string; | ||
maxTokens: number; | ||
temperature: number; | ||
private _initOptions; | ||
static readonly PRISMA_SCHEMA_PATH: string; | ||
aiInstance: VertexAI | OpenAI; | ||
/** | ||
* Creates an instance of SkeetAI. | ||
* @param options - Configuration options for initializing the SkeetAI. | ||
* @example | ||
* ```typescript | ||
* // Using default settings: | ||
* const defaultSkeet = new SkeetAI(); | ||
* | ||
* // Specifying the AI platform and model: | ||
* const customSkeet = new SkeetAI({ | ||
* ai: 'OpenAI', | ||
* model: 'gpt-4', | ||
* maxTokens: 500 | ||
* }); | ||
* ``` | ||
*/ | ||
constructor(options?: SkeetAIOptions); | ||
get initOptions(): SkeetAIOptions; | ||
prisma(content: string): Promise<string | undefined>; | ||
skeet(content: string): Promise<string>; | ||
uploadFile(filePath: string): Promise<import("openai/resources").FileObject | undefined>; | ||
createFineTuningJob(fileId: string, model?: string): Promise<import("openai/resources/fine-tuning").FineTuningJob | undefined>; | ||
showFineTuningJob(jobId: string): Promise<import("openai/resources/fine-tuning").FineTuningJob | undefined>; | ||
typedoc(content: string): Promise<string | undefined>; | ||
naming(content: string, namingEnum?: NamingEnum): Promise<string | undefined>; | ||
translates(paths: string[], langFrom?: string, langTo?: string): Promise<void>; | ||
firestore(content: string): Promise<string | undefined>; | ||
private handleError; | ||
} | ||
export default SkeetAI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
import { NamingEnum } from '../../../lib/types/skeetaiTypes'; | ||
export declare const skeetNaming: (content: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI, namingEnum: NamingEnum) => Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export declare const migrationNamingPrompt: { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; | ||
export declare const functionNamingPrompt: { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; | ||
export declare const modelNamingPrompt: { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { OpenAI } from '@/lib/openai'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { AIType } from '@/lib/genPrompt'; | ||
export declare const skeetAiPrisma: (content: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { AIPrompt } from '@/lib/genPrompt'; | ||
export declare const prismaPrompt: () => AIPrompt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export declare const skeetPromptVertex: (content: string) => { | ||
context: string; | ||
examples: { | ||
input: { | ||
content: string; | ||
}; | ||
output: { | ||
content: string; | ||
}; | ||
}[]; | ||
messages: { | ||
author: string; | ||
content: string; | ||
}[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
export declare const skeetPrompt: (content: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<string>; |
1 change: 1 addition & 0 deletions
1
dist/types/src/lib/skeetai/tranlsate/extractSectionsFromMd.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const extractSectionsFromMd: (path: string) => string[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
export declare const skeetAiTranslates: (paths: string[], langFrom: string, langTo: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type Paths = { | ||
mdFiles: string[]; | ||
jsonFiles: string[]; | ||
}; | ||
export declare const organizeFilesByExtension: (paths: string[]) => Paths; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export declare const markdownTranslatePrompt: (langFrom?: string, langTo?: string) => { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; | ||
export declare const jsonTranslatePrompt: (langFrom?: string, langTo?: string) => { | ||
context: string; | ||
examples: { | ||
input: string; | ||
output: string; | ||
}[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
export declare const translateDocument: (content: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI, mode: 'markdown' | 'json', langFrom?: string, langTo?: string) => Promise<string>; |
5 changes: 5 additions & 0 deletions
5
dist/types/src/lib/skeetai/tranlsate/translateJsonDocuments.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
export declare const splitContentIntoChunks: (content: string, linesPerChunk: number) => string[]; | ||
export declare const translateJsonDocuments: (paths: string[], langFrom: string | undefined, langTo: string | undefined, ai: AIType, aiInstance: VertexAI | OpenAI) => Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const eslintrc: () => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const prettierrc: () => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const tsconfig: () => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AIType } from '@/lib/genPrompt'; | ||
import { VertexAI } from '@/lib/vertexai'; | ||
import { OpenAI } from '@/lib/openai'; | ||
export declare const skeetGenTypedoc: (content: string, thisAi: AIType, thisAiInstance: VertexAI | OpenAI) => Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { AIPrompt } from '@/lib/genPrompt'; | ||
export declare const typedocPrompt: () => AIPrompt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './translate'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Translates the provided text into the specified target language. | ||
* | ||
* @param text - The text to be translated. | ||
* @param target - The target language code for the translation (defaults to 'ja' for Japanese). | ||
* @returns A promise that resolves with the translated string. | ||
* @throws Will throw an error if the translation fails. | ||
* | ||
* @example | ||
* ```typescript | ||
* import { translate } from "@skeet-framework/ai" | ||
* | ||
* const translatedText = await translate("Hello", "es") | ||
* console.log(translatedText); // Outputs: "Hola" | ||
* ``` | ||
*/ | ||
export declare const translate: (text: string, target?: string) => Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './openaiTypes'; | ||
export * from './vertexaiTypes'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export type OpenAIPromptParams = { | ||
messages: OpenAIMessage[]; | ||
}; | ||
export type OpenAIOptions = { | ||
organizationKey?: string; | ||
apiKey?: string; | ||
model?: string; | ||
temperature?: number; | ||
maxTokens?: number; | ||
topP?: number; | ||
n?: number; | ||
stream?: boolean; | ||
}; | ||
export type OpenAIRole = 'function' | 'system' | 'assistant' | 'user'; | ||
export type OpenAIMessage = { | ||
role: OpenAIRole; | ||
content: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export type Example = { | ||
context: string; | ||
examples: InputOutput[]; | ||
}; | ||
export type InputOutput = { | ||
input: string; | ||
output: string; | ||
}; | ||
export declare enum NamingEnum { | ||
MIGRATION = "migration", | ||
FUNCTION = "function", | ||
MODEL = "model" | ||
} | ||
export declare const MODEL_PATH = "./functions/skeet/src/models"; |
Oops, something went wrong.