-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Fixed examples under Fast API section #256
Conversation
WalkthroughThe FastAPI application has been refactored to use the synchronous Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- docs/concepts/fastapi.md (3 hunks)
Additional comments: 4
docs/concepts/fastapi.md (4)
18-20: The summary mentions a change from
AsyncOpenAI
toOpenAI
, but the code snippets do not show any import statement changes. Please verify if the summary is accurate or if the import statement change is missing in the hunks.74-75: The summary indicates that method invocations have been changed from asynchronous to synchronous, but the
extract
function is still defined with theasync
keyword. Please verify if the function should be synchronous as per the summary.26-26: The addition of
UserData
andUserDetail
models aligns with the summary and is a good practice for defining structured data in FastAPI.74-74: The addition of the
/extract
endpoint is consistent with the summary and is a valuable addition for handling streaming responses in FastAPI.
should fundamentally be using async tho |
@Anmol6 can you take a look here? |
Good catch @waseemhnyc ! turns out async open ai calls with |
Oh nice - thanks for taking a look at this @Anmol6. Look forward to reading your fix/pr. Still getting familiar with some of this async python stuff 😬 |
Results:
https://jxnl.github.io/instructor/concepts/fastapi/#code-example-starting-a-fastapi-app-with-a-post-request
https://jxnl.github.io/instructor/concepts/fastapi/#streaming-responses-with-fastapi
Summary by CodeRabbit
New Features
/extract
for handling streaming events and returning user data.Documentation
OpenAI
library and new data models.Refactor
New Data Models
UserData
andUserDetail
models to standardize API input and output.