Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 40 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,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..." }}
)
Comment on lines +10 to +19
Copy link
Contributor

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() and chat.completions.create() calls.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.


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)
- [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
6 changes: 6 additions & 0 deletions packages/service-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @thirdweb-dev/service-utils

## 0.7.3

### Patch Changes

- [#6084](https://github.com/thirdweb-dev/js/pull/6084) [`b5e327e`](https://github.com/thirdweb-dev/js/commit/b5e327e5ec745ce1beb9a79404fa5b11d0c5588e) Thanks [@jnsdls](https://github.com/jnsdls)! - add `billingPlanVersion` to `TeamResponse`

## 0.7.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/service-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/service-utils",
"version": "0.7.2",
"version": "0.7.3",
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
1 change: 1 addition & 0 deletions packages/service-utils/src/core/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export type TeamResponse = {
slug: string;
image: string | null;
billingPlan: "free" | "starter" | "growth" | "pro";
billingPlanVersion: number;
createdAt: Date;
updatedAt: Date | null;
billingEmail: string | null;
Expand Down
1 change: 1 addition & 0 deletions packages/service-utils/src/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading