@hypermode/models-as
Advanced tools
Comparing version 0.1.5 to 0.1.6
import { Model } from "../.."; | ||
export default class LlamaModel extends Model<LlamaInput, LlamaOutput> { | ||
export class TextGenerationModel extends Model< | ||
TextGenerationInput, | ||
TextGenerationOutput | ||
> { | ||
/** | ||
@@ -11,4 +14,4 @@ * Creates a new input object for the model. | ||
*/ | ||
createInput(prompt: string): LlamaInput { | ||
return <LlamaInput>{ prompt }; | ||
createInput(prompt: string): TextGenerationInput { | ||
return <TextGenerationInput>{ prompt }; | ||
} | ||
@@ -19,3 +22,3 @@ } | ||
@json | ||
class LlamaInput { | ||
class TextGenerationInput { | ||
/** | ||
@@ -60,3 +63,3 @@ * The prompt text to pass to the model. | ||
@json | ||
class LlamaOutput { | ||
class TextGenerationOutput { | ||
/** | ||
@@ -63,0 +66,0 @@ * The generated text. |
@@ -5,9 +5,6 @@ import { Model } from "../.."; | ||
export default class ChatCompletionModel extends Model< | ||
ChatCompletionInput, | ||
ChatCompletionOutput | ||
> { | ||
createInput(messages: Message[]): ChatCompletionInput { | ||
export class ChatModel extends Model<ChatInput, ChatOutput> { | ||
createInput(messages: Message[]): ChatInput { | ||
const model = this.info.fullName; | ||
return <ChatCompletionInput>{ model, messages }; | ||
return <ChatInput>{ model, messages }; | ||
} | ||
@@ -18,3 +15,3 @@ } | ||
@json | ||
class ChatCompletionInput { | ||
class ChatInput { | ||
model!: string; | ||
@@ -104,3 +101,3 @@ messages!: Message[]; | ||
@json | ||
class ChatCompletionOutput { | ||
class ChatOutput { | ||
id!: string; | ||
@@ -107,0 +104,0 @@ object!: string; |
@@ -5,6 +5,3 @@ import { Model } from "../.."; | ||
export default class EmbeddingsModel extends Model< | ||
EmbeddingsInput, | ||
EmbeddingsOutput | ||
> { | ||
export class EmbeddingsModel extends Model<EmbeddingsInput, EmbeddingsOutput> { | ||
createInput(text: string): EmbeddingsInput { | ||
@@ -11,0 +8,0 @@ const model = this.info.fullName; |
{ | ||
"name": "@hypermode/models-as", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Hypermode Model Interface Library for AssemblyScript", | ||
@@ -5,0 +5,0 @@ "author": "Hypermode, Inc.", |
11923
357