Skip to content

Commit

Permalink
Merge branch 'main' into query-understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
roodboi authored Apr 22, 2024
2 parents a14f35c + 187fb92 commit 284e4e9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .changeset/curly-ants-tie.md

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @instructor-ai/instructor

## 1.2.1

### Patch Changes

- [#166](https://github.com/instructor-ai/instructor-js/pull/166) [`ddfe257`](https://github.com/instructor-ai/instructor-js/commit/ddfe2572c672708fb9ad20ad6726cb3af07c5148) Thanks [@roodboi](https://github.com/roodboi)! - make sure we pass through \_meta on non stream completions

## 1.2.0

### Minor Changes

- [#164](https://github.com/instructor-ai/instructor-js/pull/164) [`6942d65`](https://github.com/instructor-ai/instructor-js/commit/6942d652b7750fac4306c4d713399cdc03e86a9b) Thanks [@roodboi](https://github.com/roodboi)! - adding request option pass through + handling non validation errors a little bit better and not retrying if not validation error specifically

## 1.1.2

### Patch Changes
Expand Down
1 change: 1 addition & 0 deletions examples/extract_user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const user = await client.chat.completions.create({
})

console.log(user)

// {
// age: 30,
// name: "Jason Liu",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instructor-ai/instructor",
"version": "1.1.1",
"version": "1.2.1",
"description": "structured outputs for llms",
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion src/instructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class Instructor<C extends GenericClient | OpenAI> {
}
}

return validation.data
return { ...validation.data, _meta: data?._meta ?? {} }
} catch (error) {
if (!(error instanceof ZodError)) {
throw error
Expand Down
2 changes: 1 addition & 1 deletion tests/anthropic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe("LLMClient Anthropic Provider - mode: MD_JSON", () => {
}
})

expect(completion).toEqual({ name: "Dimitri Kennedy" })
expect(omit(["_meta"], completion)).toEqual({ name: "Dimitri Kennedy" })
})

test("complex schema - streaming", async () => {
Expand Down

0 comments on commit 284e4e9

Please sign in to comment.