feat: bootstrap BoxBrain foundation

This commit is contained in:
2026-05-11 15:56:56 +09:00
parent 964c9b3159
commit 7b474ddac3
15 changed files with 960 additions and 0 deletions

44
src/adapters.ts Normal file
View 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>;
}