Skip to content

Commit

Permalink
add openai o1 example
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Sep 12, 2024
1 parent 8c90c9b commit 0b829f3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/apps-devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
run: hal9 deploy apps/browser --name browser --access unlisted --url https://api.devel.hal9.com --title Browser --description "Capable of browsing the web"
env:
HAL9_TOKEN: ${{ secrets.HAL9_TOKEN_DEVEL }}
- name: Deploy OpenAI
run: hal9 deploy apps/openai --name openai --access unlisted --url https://api.devel.hal9.com --title OpenAI --description "Makes use of OpenAI O1"
env:
HAL9_TOKEN: ${{ secrets.HAL9_TOKEN_DEVEL }}
4 changes: 4 additions & 0 deletions .github/workflows/apps-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
run: hal9 deploy apps/browser --name browser --access unlisted --title Browser --description "Capable of browsing the web"
env:
HAL9_TOKEN: ${{ secrets.HAL9_TOKEN }}
- name: Deploy OpenAI
run: hal9 deploy apps/openai --name openai --access unlisted --title OpenAI --description "Makes use of OpenAI O1"
env:
HAL9_TOKEN: ${{ secrets.HAL9_TOKEN }}
16 changes: 16 additions & 0 deletions apps/openai/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
from openai import OpenAI
import hal9 as h9

messages = h9.load("messages", [])

completion = OpenAI().chat.completions.create(
model = "o1-preview",
messages = [
{"role": "user", "content": input()},
]
)

h9.save("messages", messages, hidden = True)

print(completion.choices[0].message.content)
1 change: 1 addition & 0 deletions apps/openai/coworker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
welcome: Hi, I'm OpenAI O1 🍓
Binary file added apps/openai/thumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0b829f3

Please sign in to comment.