Skip to content
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

added openai docs #6088

Merged
merged 6 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions apps/portal/src/app/nebula/plugins/openAI/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Chat Completions API
saminacodes marked this conversation as resolved.
Show resolved Hide resolved

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..." }}
)
saminacodes marked this conversation as resolved.
Show resolved Hide resolved

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)
```
10 changes: 3 additions & 7 deletions apps/portal/src/app/nebula/plugins/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import { Callout } from '@doc'

# Plugins

- [OpenAI](/nebula/plugins/openai)
saminacodes marked this conversation as resolved.
Show resolved Hide resolved
- [Eliza](/nebula/plugins/eliza)

<Callout variant='info' title='Coming Soon'>

We are actively developing plugins to develop with other frameworks and languages.

If you have a specific request, please [contact us](https://thirdweb.com/contact).

</Callout>
We are actively adding more integrations, for any specific requests please [contact us](https://thirdweb.com/contact).
6 changes: 5 additions & 1 deletion apps/portal/src/app/nebula/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ export const sidebar: SideBar = {
],
},
{
name: "Plugins",
name: "Plugins & Integrations",
href: "/nebula/plugins",
icon: <Blocks />,
links: [
{
name: "OpenAI",
href: "/nebula/plugins/openai",
},
{
name: "Eliza",
href: "/nebula/plugins/eliza",
Expand Down
Loading