Skip to content

Commit

Permalink
refactor(generate-text): remove duplicate clean
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Dec 19, 2024
1 parent 3355011 commit 0c1ffd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/generate-object/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface GenerateObjectResult<T extends Schema> extends Omit<GenerateTex
* @remarks Ollama doesn't support this, see {@link https://github.com/ollama/ollama/issues/6473}
*/
export const generateObject = async <T extends Schema>(options: GenerateObjectOptions<T>): Promise<GenerateObjectResult<T>> =>
await generateText(clean({
await generateText({
...options,
response_format: {
json_schema: {
Expand All @@ -35,7 +35,7 @@ export const generateObject = async <T extends Schema>(options: GenerateObjectOp
schema: undefined,
schemaDescription: undefined,
schemaName: undefined,
}))
})
.then(({ finishReason, steps, text, usage }) => ({
finishReason,
// TODO: import { validate } from '@typeschema/main'
Expand Down

0 comments on commit 0c1ffd8

Please sign in to comment.