Open spiez opened 2 months ago
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:
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
Describe the solution you'd like Support for new o1-preview and o1-mini from OpenAI