Easily enhance your browsing experience by integrating Novita AI with Browser Use for intelligent web interactions.
Browser Use is an open-source library that empowers LLMs to directly control web browsers, revolutionizing web interaction with advanced automation. By integrating Novita AI’s powerful LLMs and tools, Browser Use enables seamless browsing, content generation, and task automation for an optimized user experience.This tutorial will show you how to integrate the Novita AI API with Browser Use to automate browser interactions.
Generate your API Key: After logging in, navigate to the Key Management page to generate your API key. This key is essential to connect Novita AI’s models to Cursor.
Here’s a complete example of using Browser Use with Novita AI’s API:
Copy
Ask AI
"""Web automation using Novita AI and Browser Use"""import asyncioimport osfrom dotenv import load_dotenvfrom langchain_openai import ChatOpenAIfrom pydantic import SecretStrfrom browser_use import Agent# Load environment variablesload_dotenv()api_key = os.getenv('NOVITA_API_KEY', '')if not api_key: raise ValueError('NOVITA_API_KEY is not set')async def run_search(): agent = Agent( task=( '1. Go to https://www.reddit.com/r/LocalLLaMA ' "2. Search for 'browser use' in the search bar " '3. Click on first result ' '4. Return the first comment' ), llm=ChatOpenAI( base_url='https://api.novita.ai/openai', model='deepseek/deepseek-v3-0324', api_key=SecretStr(api_key), ), use_vision=False, ) await agent.run()if __name__ == '__main__': asyncio.run(run_search())
You can customize the task parameter to perform a wide variety of web tasks:
Copy
Ask AI
task="Compare the price of gpt-4o and DeepSeek-V3"
For more complex tasks, you might want to enable vision capabilities:
Copy
Ask AI
agent = Agent( task="Find and summarize the latest news about AI on TechCrunch", llm=ChatOpenAI( base_url='https://api.novita.ai/openai', model='deepseek/deepseek-v3-0324', api_key=SecretStr(api_key), ), use_vision=True,)