Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o1-preview and o1-mini support #604

Open
spiez opened this issue Sep 17, 2024 · 1 comment
Open

o1-preview and o1-mini support #604

spiez opened this issue Sep 17, 2024 · 1 comment

Comments

@spiez
Copy link

spiez commented Sep 17, 2024

Describe the solution you'd like
Support for new o1-preview and o1-mini from OpenAI

@lyie28
Copy link
Contributor

lyie28 commented Oct 15, 2024

If you upgrade your llama-index-llms-openai package you can use 01-preview and 01-mini.

However, this may cause some dependency issues. I had to change my version of llama-index-core to make this work. I used:

  • llama-index-core==0.10.68.post1
  • llama-index-llms-openai==0.2.13

You can then pass the model of your choice to the 'llm' option when initializing your ActionEngine or 'mm_llm' option when initializing your WorldModel, like so (it doesn't work with our OpenAI Context because of some breaking changes on llama-index's side - so you have to initialize and pass the model directly):

from lavague.contexts.openai import OpenaiContext
from llama_index.llms.openai import OpenAI

from lavague.drivers.selenium import SeleniumDriver
from lavague.core import ActionEngine, WorldModel
from lavague.core.agents import WebAgent

# Set up our three key components: Driver, Action Engine, World Model
driver = SeleniumDriver(headless=False)
model =  OpenAI(
    model="o1-preview",
    max_completion_tokens=4096,
    temperature=0.0,
)
action_engine = ActionEngine(llm=model, driver=driver)
world_model = WorldModel()

# Create Web Agent
agent = WebAgent(world_model, action_engine)

# Set URL
agent.get("https://huggingface.co/docs")

# Run agent with a specific objective
agent.run("Go on the quicktour of PEFT")

Full list of OpenAI models supported with latest openai llama-index package:
o1-preview, o1-preview-2024-09-12, o1-mini, o1-mini-2024-09-12, gpt-4, gpt-4-32k, gpt-4-1106-preview, gpt-4-0125-preview, gpt-4-turbo-preview, gpt-4-vision-preview, gpt-4-1106-vision-preview, gpt-4-turbo-2024-04-09, gpt-4-turbo, gpt-4o, gpt-4o-2024-05-13, gpt-4o-2024-08-06, chatgpt-4o-latest, gpt-4o-mini, gpt-4o-mini-2024-07-18, gpt-4-0613, gpt-4-32k-0613, gpt-4-0314, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-16k, gpt-3.5-turbo-0125, gpt-3.5-turbo-1106, gpt-3.5-turbo-0613, gpt-3.5-turbo-16k-0613, gpt-3.5-turbo-0301, text-davinci-003, text-davinci-002, gpt-3.5-turbo-instruct, text-ada-001, text-babbage-001, text-curie-001, ada, babbage, curie, davinci, gpt-35-turbo-16k, gpt-35-turbo, gpt-35-turbo-0125, gpt-35-turbo-1106, gpt-35-turbo-0613, gpt-35-turbo-16k-0613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants