Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnl committed Mar 29, 2024
1 parent b887b2e commit 492f671
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
10 changes: 5 additions & 5 deletions docs/concepts/partial.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ print(extraction.model_dump_json(indent=2))
"twitter": "@CodeMaster2023"
}
],
"date": "March 15th, 2024",
"location": "Grand Tech Arena located at 4521 Innovation Drive",
"date": "2024-03-15",
"location": "Grand Tech Arena, 4521 Innovation Drive",
"budget": 50000,
"deadline": "February 20th"
"deadline": "2024-02-20"
}
"""
```
Expand Down Expand Up @@ -161,8 +161,8 @@ async def print_partial_results():
async for m in user:
print(m)
#> name=None age=None
#> name='' age=None
#> name='Jason' age=None
#> name=None age=12
#> name='' age=12
#> name='Jason' age=12


Expand Down
5 changes: 3 additions & 2 deletions docs/concepts/patching.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ import instructor
from anthropic import Anthropic

create = instructor.patch(
create=anthropic.Anthropic().messages.create,
mode=instructor.Mode.ANTHROPIC_JSON
create=anthropic.Anthropic().messages.create, mode=instructor.Mode.ANTHROPIC_JSON
)


class User(BaseModel):
name: str
age: int


resp = create(
model="claude-3-haiku-20240307",
max_tokens=1024,
Expand Down
8 changes: 4 additions & 4 deletions docs/concepts/raw_response.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ user: UserExtract = client.chat.completions.create(
print(user._raw_response)
"""
ChatCompletion(
id='chatcmpl-8zpltT9vXJdO5OE3AfDsOhAUr911A',
id='chatcmpl-97whMjk6Nyh2s2Nacd4Yi1r5a4RvV',
choices=[
Choice(
finish_reason='stop',
Expand All @@ -37,7 +37,7 @@ ChatCompletion(
function_call=None,
tool_calls=[
ChatCompletionMessageToolCall(
id='call_vXI3foz7jqlzFILU9pwuYJZB',
id='call_kjS8AZWNS5yElb0ZxmkjTHY0',
function=Function(
arguments='{"name":"Jason","age":25}', name='UserExtract'
),
Expand All @@ -47,10 +47,10 @@ ChatCompletion(
),
)
],
created=1709747709,
created=1711680960,
model='gpt-3.5-turbo-0125',
object='chat.completion',
system_fingerprint='fp_2b778c6b35',
system_fingerprint='fp_3bc1b5746c',
usage=CompletionUsage(completion_tokens=9, prompt_tokens=82, total_tokens=91),
)
"""
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ print(response.model_dump_json(indent=2))
print(user._raw_response.model_dump_json(indent=2))
"""
{
"id": "chatcmpl-8zplvRbNM8iKSVa3Ld9NmVICeXZZ9",
"id": "chatcmpl-97whNVWUbRXd44lZd9gG8sS0xKDXF",
"choices": [
{
"finish_reason": "stop",
Expand All @@ -145,7 +145,7 @@ print(response.model_dump_json(indent=2))
"function_call": null,
"tool_calls": [
{
"id": "call_V5FRMSXrHFFTTqTjpwA76h7t",
"id": "call_CsCj1hzAMZ3mik8rvRfMienA",
"function": {
"arguments": "{\"name\":\"Jason\",\"age\":25}",
"name": "UserDetail"
Expand All @@ -156,10 +156,10 @@ print(response.model_dump_json(indent=2))
}
}
],
"created": 1709747711,
"created": 1711680961,
"model": "gpt-3.5-turbo-0125",
"object": "chat.completion",
"system_fingerprint": "fp_2b778c6b35",
"system_fingerprint": "fp_3bc1b5746c",
"usage": {
"completion_tokens": 9,
"prompt_tokens": 81,
Expand Down

0 comments on commit 492f671

Please sign in to comment.