Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the rest of the properties from the Vercel AI SDK generations #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ export async function generateAISDKCompletions<T extends z.ZodSchema<any>>(
topP: options?.topP,
mode: options?.mode,
})

const { object, ...rest } = result
return {
data: result.object,
url: page.url,
...rest
}
}

Expand Down Expand Up @@ -108,11 +109,12 @@ export async function generateAISDKCode<T extends z.ZodSchema<any>>(
maxTokens: options?.maxTokens,
topP: options?.topP,
})

return {
code: result.text,
url: page.url,
}
const { text, ...rest } = result
return {
code: result.text,
url: page.url,
...rest,
}
}

export async function generateLlamaCompletions<T extends z.ZodSchema<any>>(
Expand Down