You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get browser-use to work with Llama 3.3 via Bedrock, but I get an error when trying to use structured output. Structured output is necessary to make the model work in this context. It seems the issue comes from the with_structured_output method, as I can execute calls without it, but in that case, the output is not correct.
Error
"'RunnableSequence' object has no attribute 'with_structured_output'"
Steps to reproduce
Structured output
importasynciofromdotenvimportload_dotenvfromtypingimportAny, Dict, ListfrompydanticimportBaseModel, Fieldfromlangchain_openaiimportAzureChatOpenAIfromlangchain_ollamaimportChatOllamafromlangchain_awsimportChatBedrockConversefrombrowser_useimportAgent, Browser, BrowserConfigclassStructuredOutput(BaseModel):
current_state: CurrentState=Field(
description="Contains the current state details of the browser page."
)
action: List[Dict[str, Dict[str, Any]]] =Field(
description=(
"A list of actions to be executed in sequence. Each action should have one key ""that represents the action name and a value with the corresponding parameters."
)
)
Main method:
asyncdefmain():
llm=ChatBedrockConverse(
model_id="meta.llama3-3-70b-instruct-v1:0",
temperature=0,
verbose=True
)
structured_llm=llm.with_structured_output(StructuredOutput, include_raw=False)
agent=Agent(
task="Search for the weather in Copenhagen and return the latest.",
llm=structured_llm,
validate_output=True
)
result=awaitagent.run()
print(result)
if__name__=="__main__":
asyncio.run(main())
The text was updated successfully, but these errors were encountered:
Description
I am trying to get
browser-use
to work with Llama 3.3 via Bedrock, but I get an error when trying to use structured output. Structured output is necessary to make the model work in this context. It seems the issue comes from thewith_structured_output
method, as I can execute calls without it, but in that case, the output is not correct.Error
"'RunnableSequence' object has no attribute 'with_structured_output'"
Steps to reproduce
Structured output
Main method:
The text was updated successfully, but these errors were encountered: