Skip to content

Commit

Permalink
Bump version and add partial support (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanleomk authored Oct 8, 2024
1 parent 0d2204e commit c0a84b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions instructor/dsl/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,12 @@ def extract_json(
Mode.warn_mode_functions_deprecation()
if json_chunk := chunk.choices[0].delta.function_call.arguments:
yield json_chunk
elif mode in {Mode.JSON, Mode.MD_JSON, Mode.JSON_SCHEMA}:
elif mode in {
Mode.JSON,
Mode.MD_JSON,
Mode.JSON_SCHEMA,
Mode.CEREBRAS_JSON,
}:
if json_chunk := chunk.choices[0].delta.content:
yield json_chunk
elif mode in {Mode.TOOLS, Mode.TOOLS_STRICT}:
Expand Down Expand Up @@ -198,7 +203,12 @@ async def extract_json_async(
Mode.warn_mode_functions_deprecation()
if json_chunk := chunk.choices[0].delta.function_call.arguments:
yield json_chunk
elif mode in {Mode.JSON, Mode.MD_JSON, Mode.JSON_SCHEMA}:
elif mode in {
Mode.JSON,
Mode.MD_JSON,
Mode.JSON_SCHEMA,
Mode.CEREBRAS_JSON,
}:
if json_chunk := chunk.choices[0].delta.content:
yield json_chunk
elif mode in {Mode.TOOLS, Mode.TOOLS_STRICT}:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "instructor"
version = "1.5.1"
version = "1.5.2"
description = "structured outputs for llm"
authors = ["Jason Liu <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit c0a84b5

Please sign in to comment.