From ca02a9c88218aebfa76dc9d37fbd74aaf3b58975 Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 28 Jan 2025 17:43:40 -0800 Subject: [PATCH 1/7] added openai docs --- .../src/app/nebula/plugins/openAI/page.mdx | 38 +++++++++++++++++++ apps/portal/src/app/nebula/plugins/page.mdx | 10 ++--- apps/portal/src/app/nebula/sidebar.tsx | 6 ++- 3 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 apps/portal/src/app/nebula/plugins/openAI/page.mdx diff --git a/apps/portal/src/app/nebula/plugins/openAI/page.mdx b/apps/portal/src/app/nebula/plugins/openAI/page.mdx new file mode 100644 index 00000000000..a497ae6f419 --- /dev/null +++ b/apps/portal/src/app/nebula/plugins/openAI/page.mdx @@ -0,0 +1,38 @@ +**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="", + 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) +``` \ No newline at end of file diff --git a/apps/portal/src/app/nebula/plugins/page.mdx b/apps/portal/src/app/nebula/plugins/page.mdx index b24e771a43d..1a95ec2d7b1 100644 --- a/apps/portal/src/app/nebula/plugins/page.mdx +++ b/apps/portal/src/app/nebula/plugins/page.mdx @@ -2,11 +2,7 @@ import { Callout } from '@doc' # Plugins +- [OpenAI](/nebula/plugins/openai) +- [Eliza](/nebula/plugins/eliza) - - -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). - - \ No newline at end of file +We are actively adding more integrations, for any specific requests please [contact us](https://thirdweb.com/contact). \ No newline at end of file diff --git a/apps/portal/src/app/nebula/sidebar.tsx b/apps/portal/src/app/nebula/sidebar.tsx index 1edb18d2bcd..9ede09d6026 100644 --- a/apps/portal/src/app/nebula/sidebar.tsx +++ b/apps/portal/src/app/nebula/sidebar.tsx @@ -110,10 +110,14 @@ export const sidebar: SideBar = { ], }, { - name: "Plugins", + name: "Plugins & Integrations", href: "/nebula/plugins", icon: , links: [ + { + name: "OpenAI", + href: "/nebula/plugins/openai", + }, { name: "Eliza", href: "/nebula/plugins/eliza", From b5e327e5ec745ce1beb9a79404fa5b11d0c5588e Mon Sep 17 00:00:00 2001 From: Jonas Daniels Date: Tue, 28 Jan 2025 18:20:57 -0800 Subject: [PATCH 2/7] add billingPlanVersion to TeamResponse (#6084) --- .changeset/friendly-trainers-taste.md | 5 +++++ packages/service-utils/src/core/api.ts | 1 + packages/service-utils/src/mocks.ts | 1 + 3 files changed, 7 insertions(+) create mode 100644 .changeset/friendly-trainers-taste.md diff --git a/.changeset/friendly-trainers-taste.md b/.changeset/friendly-trainers-taste.md new file mode 100644 index 00000000000..6faf44f15bd --- /dev/null +++ b/.changeset/friendly-trainers-taste.md @@ -0,0 +1,5 @@ +--- +"@thirdweb-dev/service-utils": patch +--- + +add `billingPlanVersion` to `TeamResponse` diff --git a/packages/service-utils/src/core/api.ts b/packages/service-utils/src/core/api.ts index 20dbb489ed1..e2b5db9bde4 100644 --- a/packages/service-utils/src/core/api.ts +++ b/packages/service-utils/src/core/api.ts @@ -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; diff --git a/packages/service-utils/src/mocks.ts b/packages/service-utils/src/mocks.ts index 5902dacd5aa..85627a7247c 100644 --- a/packages/service-utils/src/mocks.ts +++ b/packages/service-utils/src/mocks.ts @@ -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: "test@example.com", billingStatus: "noPayment", growthTrialEligible: false, From 1cff849b697773eb1ed686e9b3259d9a55aa71b0 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Tue, 28 Jan 2025 18:22:36 -0800 Subject: [PATCH 3/7] Version Packages (#6089) Co-authored-by: github-actions[bot] --- .changeset/friendly-trainers-taste.md | 5 ----- packages/service-utils/CHANGELOG.md | 6 ++++++ packages/service-utils/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/friendly-trainers-taste.md diff --git a/.changeset/friendly-trainers-taste.md b/.changeset/friendly-trainers-taste.md deleted file mode 100644 index 6faf44f15bd..00000000000 --- a/.changeset/friendly-trainers-taste.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@thirdweb-dev/service-utils": patch ---- - -add `billingPlanVersion` to `TeamResponse` diff --git a/packages/service-utils/CHANGELOG.md b/packages/service-utils/CHANGELOG.md index 4fb828a3a14..ae330819bd6 100644 --- a/packages/service-utils/CHANGELOG.md +++ b/packages/service-utils/CHANGELOG.md @@ -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 diff --git a/packages/service-utils/package.json b/packages/service-utils/package.json index 9123815b242..373716f225e 100644 --- a/packages/service-utils/package.json +++ b/packages/service-utils/package.json @@ -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", From fbd5f379a7b973cd82b6b74b6e4a688a95df36a1 Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 28 Jan 2025 19:14:36 -0800 Subject: [PATCH 4/7] added changes --- apps/portal/src/app/nebula/plugins/openAI/page.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/portal/src/app/nebula/plugins/openAI/page.mdx b/apps/portal/src/app/nebula/plugins/openAI/page.mdx index a497ae6f419..84677fe5cce 100644 --- a/apps/portal/src/app/nebula/plugins/openAI/page.mdx +++ b/apps/portal/src/app/nebula/plugins/openAI/page.mdx @@ -1,11 +1,12 @@ -**Chat Completions API** +# 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="", + base_url="https://nebula-api.thirdweb.com", api_key="{{THIRDWEB_SECRET_KEY}}", ) From 7614a8b175cfcfabaf04119e5b0e78e8480532d6 Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 28 Jan 2025 19:18:56 -0800 Subject: [PATCH 5/7] fixed indent --- apps/portal/src/app/nebula/plugins/openAI/page.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/portal/src/app/nebula/plugins/openAI/page.mdx b/apps/portal/src/app/nebula/plugins/openAI/page.mdx index 84677fe5cce..a9f879408e9 100644 --- a/apps/portal/src/app/nebula/plugins/openAI/page.mdx +++ b/apps/portal/src/app/nebula/plugins/openAI/page.mdx @@ -9,7 +9,6 @@ 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!"}], From e9bb5af77e329db7dee11919144413f72be4e602 Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 28 Jan 2025 19:38:27 -0800 Subject: [PATCH 6/7] fixed headers --- apps/portal/src/app/nebula/plugins/openAI/page.mdx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/portal/src/app/nebula/plugins/openAI/page.mdx b/apps/portal/src/app/nebula/plugins/openAI/page.mdx index a9f879408e9..0f5688f17de 100644 --- a/apps/portal/src/app/nebula/plugins/openAI/page.mdx +++ b/apps/portal/src/app/nebula/plugins/openAI/page.mdx @@ -1,4 +1,6 @@ -# Chat Completions API +# OpenAI + +### Chat Completions API Compatible with OpenAI’s Chat Completion API to process chat history and generate context-aware responses. @@ -12,14 +14,14 @@ client = OpenAI( chat_completion = client.chat.completions.create( model="t0", messages=[{"role": "user", "content": "Hello Nebula!"}], - stream=False, + stream=False,git extra_body={ "context": { "wallet_address": "0x..." }} ) print(chat_completion) ``` -**Models API** +### Models API Compatible with OpenAI’s Models API to list out models used. From 2fcdf0094b63ea8b0286a614899a414d71217fdb Mon Sep 17 00:00:00 2001 From: samina Date: Tue, 28 Jan 2025 19:39:54 -0800 Subject: [PATCH 7/7] removed git line --- apps/portal/src/app/nebula/plugins/openAI/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/portal/src/app/nebula/plugins/openAI/page.mdx b/apps/portal/src/app/nebula/plugins/openAI/page.mdx index 0f5688f17de..e3df8ab6ae6 100644 --- a/apps/portal/src/app/nebula/plugins/openAI/page.mdx +++ b/apps/portal/src/app/nebula/plugins/openAI/page.mdx @@ -14,7 +14,7 @@ client = OpenAI( chat_completion = client.chat.completions.create( model="t0", messages=[{"role": "user", "content": "Hello Nebula!"}], - stream=False,git + stream=False, extra_body={ "context": { "wallet_address": "0x..." }} )