together-code
Version:
AI-powered coding assistant that plans, then builds
56 lines (55 loc) • 1.33 kB
TypeScript
interface Step {
id: string;
title: string;
description: string;
estimatedTime?: string;
dependencies?: string[];
}
interface Plan {
overview: string;
steps: Step[];
}
interface CodeGenerationRequest {
prompt: string;
language?: string;
framework?: string;
context?: Array<{
role: 'user' | 'assistant';
content: string;
}>;
}
interface PlanRequest {
prompt: string;
context?: Array<{
role: 'user' | 'assistant';
content: string;
}>;
}
interface StepExecutionRequest {
step: Step;
plan: Plan;
context?: Array<{
role: 'user' | 'assistant';
content: string;
}>;
}
export declare class TogetherAIService {
private apiKey;
private baseURL;
constructor(apiKey?: string);
generateCode(request: CodeGenerationRequest): Promise<{
content: string;
tokens?: number;
}>;
streamCode(request: CodeGenerationRequest): Promise<AsyncGenerator<string, void, unknown>>;
generatePlan(request: PlanRequest): Promise<{
plan: Plan;
tokens?: number;
}>;
executeStep(request: StepExecutionRequest): Promise<{
content: string;
tokens?: number;
}>;
private parseStreamResponse;
}
export type { Step, Plan, PlanRequest, StepExecutionRequest };