auto-gpt-ts
Version:
my take of Auto-GPT in typescript
40 lines (39 loc) • 1.29 kB
TypeScript
export type Role = "system" | "user" | "assistant";
export interface Message {
/** The role of the message sender */
role: Role;
/** The content of the message */
content: string;
}
export interface ModelInfo {
/** The name of the model */
name: string;
/** The token cost for the model's prompt */
promptTokenCost: number;
/** The token cost for the model's completion */
completionTokenCost: number;
/** The maximum number of tokens allowed for the model */
maxTokens: number;
}
export interface ChatModelInfo extends ModelInfo {
}
export interface EmbeddingModelInfo extends ModelInfo {
/** The number of dimensions for the model's embeddings */
embeddingDimensions: number;
}
export interface LLMResponse {
/** Information about the model used for the response */
modelInfo: ModelInfo;
/** The number of tokens used for the prompt */
promptTokensUsed?: number;
/** The number of tokens used for the completion */
completionTokensUsed?: number;
}
export interface EmbeddingModelResponse extends LLMResponse {
/** The embedding generated by the model */
embedding: number[];
}
export interface ChatModelResponse extends LLMResponse {
/** The content generated by the model */
content?: string;
}