Skip to content

Commit

Permalink
Update examples with OpenAI's o3
Browse files Browse the repository at this point in the history
  • Loading branch information
tizkovatereza committed Jan 31, 2025
1 parent ee6690a commit 5ee6f04
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 143 deletions.
3 changes: 2 additions & 1 deletion examples/o1-and-gpt-4-js/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ async function chat(
// First, get the plan from o1-mini
try {
const responseO1 = await openai.chat.completions.create({
model: "o1-mini", // Assuming this model is accessible
model: "o3-mini", // Choose different model by uncommenting
//model: "o1-mini",
messages: [
{ role: "user", content: O1_PROMPT },
{ role: "user", content: userMessage },
Expand Down
Binary file modified examples/o1-and-gpt-4-js/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
232 changes: 94 additions & 138 deletions examples/o1-and-gpt-4-python/o1.ipynb

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion examples/o1-js/app.ts → examples/openai-js/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import * as dotenv from 'dotenv'

dotenv.config()

const MODEL_NAME = 'o1'
const MODEL_NAME = 'o3-mini' // Choose different model by uncommenting. You can choose from models with function-calling support, such as o1 or o3-mini.
// const MODEL_NAME = 'o1'

const SYSTEM_PROMPT = `
## your job & context
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Code Interpreting with o1 by OpenAI\n",
"This example uses the E2B's [Code Interpreter](https://github.com/e2b-dev/code-interpreter) as a tool for o1. "
"# Code Interpreting with OpenAi models\n",
"This example uses the E2B's [Code Interpreter](https://github.com/e2b-dev/code-interpreter) as a tool for OpenAI's model. You can choose from models with function-calling support, such as o1 or o3-mini."
]
},
{
Expand Down Expand Up @@ -167,7 +167,8 @@
" \n",
" print('Waiting for the LLM to respond...')\n",
" completion = client.chat.completions.create(\n",
" model=\"o1\",\n",
" model=\"o3\", #Choose different model by uncommenting\n",
" # model=\"o1\",\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": SYSTEM_PROMPT},\n",
" {\"role\": \"user\", \"content\": user_message}\n",
Expand Down

0 comments on commit 5ee6f04

Please sign in to comment.