Skip to main content
Loading navigation
Back to prompt library

Initial Agent Setup and Tool Definition

Linked challenge: Build an Advanced Visual Web Agent with OpenAI Agents SDK and GPT-5 Pro

Prompt source

planning7 lines1 sectionsNo variables1 code block
Using OpenAI Agents SDK, define a 'VisualNavigator' agent with GPT-5 Pro as its underlying model. This agent should be capable of basic web navigation (go to URL, click element) using a custom tool. Implement a simple 'navigate_to_url' tool. Ensure your setup includes initializing the OpenAI client and creating an assistant and thread. ```python
from openai import OpenAI client = OpenAI() # Define your custom tool schema here
navigate_tool_schema = { "type": "function", "function": { "name": "navigate_to_url", "description": "Navigates the browser to a specified URL.", "parameters": { "type": "object", "properties": { "url": {"type": "string", "description": "The URL to navigate to."} }, "required": ["url"] } }
} assistant = client.beta.assistants.create( name="VisualNavigator", instructions="You are an expert web navigator, capable of visiting URLs and interacting with web pages visually.", model="gpt-5-pro", # or appropriate GPT-5 Pro model ID tools=[navigate_tool_schema]
) thread = client.beta.threads.create() print(f"Assistant ID: {assistant.id}")
print(f"Thread ID: {thread.id}")
```