Skip to content

Which models are supported? #12

Closed

Description

@729973389

Hello, there is only
GPT-4o
GPT-4o Mini
Claude 3.5 Sonnet
LLama 3.1 405B
These four models have passed the test of this project, and the other LangChain chat models have not been tested, right? I used two models, Qianfan and Tongyi

My code is as follows:
from langchain_community.llms import QianfanLLMEndpoint
from langchain_community.llms import Tongyi
from browser_use import Agent

chatBot=Tongyi()
result=Tongyi().invoke("What NFL team won the Super Bowl in the year Justin Bieber was born?"
"请说中文")
print(result)

agent = Agent(
task="请你帮我打开这个网站:https://www.bilibili.com",
llm=chatBot,
)

运行 agent

result = await agent.run()

输出结果

print(result)

Activity

  1. 2br-2b commented on Nov 10, 2024

    @2br-2b
  2. MagMueller commented on Nov 10, 2024

    @MagMueller
    Collaborator

    Yes, all from the list, which are able of tool-calling, structured-output and multimodal.

    For some models, the task is still quite hard and they tend to forget quickly your defined task.

  3. 729973389 commented on Nov 11, 2024

    @729973389
    Author

    Yes, the author said so, but I found in the process of using, at present, it is OK to call openai, I only use tongyi is not OK, but I can use the api to call openai

    Here is the code available:

    import asyncio
    from langchain_openai import ChatOpenAI
    from browser_use import Agent

    chat = ChatOpenAI(
    api_key="", # my tongyi API Key
    model="qwen-plus", # model name
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
    )

    agent = Agent(
    task="请你去百度中搜索 2024 年排名前 3 的 AI 公司(不要用谷歌),找出每家公司为他们的模型使用的具体硬件是什么。",
    llm=chat,

    )

    async def main():
    #Run agent
    try:
    result = await agent.run()
    # print(result)
    print("result-------->",result[0].text)
    # print("result-------->")
    except Exception as e:
    print("发生了一个错误,",e)
    # except :
    # print("The structured output feature is not implemented in this model. Please use a different model.")

    asyncio.run(main())

    This is not available code:

    import asyncio
    from browser_use import Agent

    from langchain_community.llms import Tongyi

    chatBot=Tongyi()
    result=Tongyi().invoke("What NFL team won the Super Bowl in the year Justin Bieber was born?"
    "请说中文")
    print(result)

    agent = Agent(
    task="Go to bilibili and give me top 10 post titles, their points and hours. Calculate for each the ratio of points per hour.",
    llm=chatBot,

    )

    async def main():
    # 运行 agent
    result = await agent.run()
    print(result)

    asyncio.run(main())

  4. manugarri commented on Nov 21, 2024

    @manugarri

    @izambe do you have a replicable snippet?

  5. izambe commented on Nov 26, 2024

    @izambe

    @izambe do you have a replicable snippet?

    Sure,

    import os
    from asyncio import run
    from browser_use import Agent
    from langchain_ollama import ChatOllama
    from dotenv import load_dotenv
    from langchain_openai import ChatOpenAI
    
    load_dotenv()
    
    llm = ChatOpenAI(
        base_url="https://models.inference.ai.azure.com",
        api_key=os.environ["GITHUB_TOKEN"],
        model="gpt-4o-mini"
    )
    
    agent = Agent(
        task="open https://www.google.com/ and search for jesus",
        llm=llm,
    )
    
    run(agent.run())
    
  6. TerminalDZ commented on Jan 11, 2025

    @TerminalDZ

    Use:

    import os
    from asyncio import run
    from browser_use import Agent
    from langchain_ollama import ChatOllama
    from dotenv import load_dotenv
    from langchain_openai import ChatOpenAI
    from langchain_openai import AzureChatOpenAI
    
    
    load_dotenv()
    
    llm = AzureChatOpenAI(
        azure_endpoint="https://models.inference.ai.azure.com",
        model="gpt-4o",
        api_version="2024-08-01-preview",
        api_key=os.environ["GITHUB_TOKEN"]
    )
    
    agent = Agent(
        task="""
        1. Navigate to https://algeria.blsspainvisa.com/
        2. Select location: Algiers
        3. Choose visa type: Tourist (First Time)
        4. Schedule appointment:
           a. Click "Schedule Appointment"
           b. Fill personal details: name, passport number, email, phone
           c. Select date and time
        5. Review and confirm appointment
        6. Note payment instructions if applicable
        7. Save/print appointment confirmation
        """,
        llm=llm,
    )
    
    run(agent.run())
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions