File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
22import { websiteUrl } from '@codebuff/npm-app/config'
3- import { generateText } from 'ai'
3+ import { generateObject } from 'ai'
4+ import z from 'zod/v4'
45
56const codebuffBackendProvider = createOpenAICompatible ( {
67 name : 'codebuff' ,
78 apiKey : '12345' ,
89 baseURL : websiteUrl + '/api/v1' ,
10+ // apiKey: process.env.OPEN_ROUTER_API_KEY,
11+ // baseURL: 'https://openrouter.ai/api/v1',
12+ supportsStructuredOutputs : true ,
913} )
1014
11- // const response = await streamText({
12- const response = await generateText ( {
13- model : codebuffBackendProvider ( 'anthropic/claude-sonnet-4.5' ) ,
15+ const response = await generateObject ( {
16+ schema : z . object ( { greeting : z . string ( ) } ) ,
17+ // const response = await streamText({
18+ // const response = await generateText({
19+ model : codebuffBackendProvider ( 'openai/gpt-5' ) ,
1420 messages : [
1521 {
1622 role : 'user' ,
You can’t perform that action at this time.
0 commit comments