-
Notifications
You must be signed in to change notification settings - Fork 619
Open ai docs #6102
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
Merged
Merged
Open ai docs #6102
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ca02a9c
added openai docs
saminacodes b5e327e
add billingPlanVersion to TeamResponse (#6084)
jnsdls 1cff849
Version Packages (#6089)
joaquim-verges fbd5f37
added changes
saminacodes 7614a8b
fixed indent
saminacodes 4727e57
Merge branch 'main' into openAI-docs
saminacodes e9bb5af
fixed headers
saminacodes 2fcdf00
removed git line
saminacodes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # OpenAI | ||
|
|
||
| ### Chat Completions API | ||
|
|
||
| Compatible with OpenAI’s Chat Completion API to process chat history and generate context-aware responses. | ||
|
|
||
| ```python | ||
| from openai import OpenAI | ||
|
|
||
| client = OpenAI( | ||
| base_url="https://nebula-api.thirdweb.com", | ||
| api_key="{{THIRDWEB_SECRET_KEY}}", | ||
| ) | ||
| chat_completion = client.chat.completions.create( | ||
| model="t0", | ||
| messages=[{"role": "user", "content": "Hello Nebula!"}], | ||
| stream=False, | ||
| extra_body={ "context": { "wallet_address": "0x..." }} | ||
| ) | ||
|
|
||
| print(chat_completion) | ||
| ``` | ||
|
|
||
| ### Models API | ||
|
|
||
| Compatible with OpenAI’s Models API to list out models used. | ||
|
|
||
| ```python | ||
| from openai import OpenAI | ||
|
|
||
| # https://nebula-api.thirdweb.com/models | ||
|
|
||
| client = OpenAI( | ||
| base_url="https://nebula-api.thirdweb.com/", | ||
| api_key="", | ||
| ) | ||
|
|
||
| models = client.models.list() | ||
| print(models) | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ export const validTeamResponse: TeamResponse = { | |
| createdAt: new Date("2024-06-01"), | ||
| updatedAt: new Date("2024-06-01"), | ||
| billingPlan: "free", | ||
| billingPlanVersion: 1, | ||
| billingEmail: "[email protected]", | ||
| billingStatus: "noPayment", | ||
| growthTrialEligible: false, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The Python code mixes tabs and spaces for indentation which violates PEP 8 and will cause runtime errors. Recommend standardizing on 4 spaces per indentation level throughout the code block. The affected lines are the function parameters in the
OpenAI()andchat.completions.create()calls.Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.