Generates code using the configured AI agent (Codex or Claude) with optional streaming callbacks and conversation history.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
prompt | string | Yes | - | The text prompt describing what code to generate or question to ask |
mode | "ask" | "code" | Yes | - | Interactive Q&A mode ("ask" ) or code generation mode ("code" ) |
branch | string | No | - | Branch identifier for version control or environment context |
history | Conversation[] | No | - | Previous conversation history to provide context for the generation |
callbacks | VibeKitStreamCallbacks | No | - | Streaming callbacks for real-time updates |
Property | Type | Required | Description |
---|---|---|---|
onUpdate | (message: string) => void | No | Called with streaming updates |
onError | (error: string) => void | No | Called when errors occur |
Type | Description |
---|---|
Promise<AgentResponse> | Promise that resolves to either a CodexResponse or ClaudeResponse depending on the configured agent |
Property | Type | Description |
---|---|---|
sandboxId | string | Unique identifier for the sandbox environment |
stdout | string | Standard output from code execution |
stderr | string | Standard error from code execution |
exitCode | number | Exit code from code execution |
Property | Type | Description |
---|---|---|
code | string | Generated code response |
mode
parameter is now required and must be specifiedbranch
parameter allows for version control or environment context