Skip to content

Commit 2b16f90

Browse files
jnsdlssaminacodesjoaquim-vergesgithub-actions[bot]
authored
Open ai docs (#6102)
Co-authored-by: samina <samina@thirdweb.com> Co-authored-by: Joaquim Verges <joaquim.verges@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: samina <57885104+saminacodes@users.noreply.github.com>
1 parent e8892b1 commit 2b16f90

File tree

3 files changed

+48
-8
lines changed

3 files changed

+48
-8
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# OpenAI
2+
3+
### Chat Completions API
4+
5+
Compatible with OpenAI’s Chat Completion API to process chat history and generate context-aware responses.
6+
7+
```python
8+
from openai import OpenAI
9+
10+
client = OpenAI(
11+
base_url="https://nebula-api.thirdweb.com",
12+
api_key="{{THIRDWEB_SECRET_KEY}}",
13+
)
14+
chat_completion = client.chat.completions.create(
15+
model="t0",
16+
messages=[{"role": "user", "content": "Hello Nebula!"}],
17+
stream=False,
18+
extra_body={ "context": { "wallet_address": "0x..." }}
19+
)
20+
21+
print(chat_completion)
22+
```
23+
24+
### Models API
25+
26+
Compatible with OpenAI’s Models API to list out models used.
27+
28+
```python
29+
from openai import OpenAI
30+
31+
# https://nebula-api.thirdweb.com/models
32+
33+
client = OpenAI(
34+
base_url="https://nebula-api.thirdweb.com/",
35+
api_key="",
36+
)
37+
38+
models = client.models.list()
39+
print(models)
40+
```

apps/portal/src/app/nebula/plugins/page.mdx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import { Callout } from '@doc'
22

33
# Plugins
44

5+
- [OpenAI](/nebula/plugins/openai)
6+
- [Eliza](/nebula/plugins/eliza)
57

6-
<Callout variant='info' title='Coming Soon'>
7-
8-
We are actively developing plugins to develop with other frameworks and languages.
9-
10-
If you have a specific request, please [contact us](https://thirdweb.com/contact).
11-
12-
</Callout>
8+
We are actively adding more integrations, for any specific requests please [contact us](https://thirdweb.com/contact).

apps/portal/src/app/nebula/sidebar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,14 @@ export const sidebar: SideBar = {
110110
],
111111
},
112112
{
113-
name: "Plugins",
113+
name: "Plugins & Integrations",
114114
href: "/nebula/plugins",
115115
icon: <Blocks />,
116116
links: [
117+
{
118+
name: "OpenAI",
119+
href: "/nebula/plugins/openai",
120+
},
117121
{
118122
name: "Eliza",
119123
href: "/nebula/plugins/eliza",

0 commit comments

Comments
 (0)