feat: bootstrap BoxBrain foundation
This commit is contained in:
44
src/adapters.ts
Normal file
44
src/adapters.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import type { JsonValue } from 'identitydb';
|
||||
|
||||
export interface TextGenerationRequest {
|
||||
prompt: string;
|
||||
system?: string | undefined;
|
||||
model?: string | undefined;
|
||||
temperature?: number | undefined;
|
||||
metadata?: Record<string, JsonValue> | undefined;
|
||||
}
|
||||
|
||||
export interface TextModelAdapter {
|
||||
provider: string;
|
||||
model: string;
|
||||
generateText(request: TextGenerationRequest): Promise<string>;
|
||||
}
|
||||
|
||||
export interface StructuredGenerationRequest<TSchema = unknown> extends TextGenerationRequest {
|
||||
schema?: TSchema | undefined;
|
||||
}
|
||||
|
||||
export interface StructuredModelAdapter<TSchema = unknown> {
|
||||
provider: string;
|
||||
model: string;
|
||||
generateObject<TOutput>(request: StructuredGenerationRequest<TSchema>): Promise<TOutput>;
|
||||
}
|
||||
|
||||
export interface ImageGenerationRequest {
|
||||
prompt: string;
|
||||
model?: string | undefined;
|
||||
aspectRatio?: 'square' | 'portrait' | 'landscape' | undefined;
|
||||
metadata?: Record<string, JsonValue> | undefined;
|
||||
}
|
||||
|
||||
export interface ImageGenerationResult {
|
||||
url?: string | undefined;
|
||||
path?: string | undefined;
|
||||
revisedPrompt?: string | undefined;
|
||||
}
|
||||
|
||||
export interface ImageModelAdapter {
|
||||
provider: string;
|
||||
model: string;
|
||||
generateImage(request: ImageGenerationRequest): Promise<ImageGenerationResult>;
|
||||
}
|
||||
Reference in New Issue
Block a user