wooden-umbrella-84098
11/05/2025, 8:24 PMimport os
from openhands.sdk import LLM, Conversation, Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
llm = LLM(
model="anthropic/claude-sonnet-4-5-20250929",
api_key=os.getenv("LLM_API_KEY"),
)
agent = Agent(
llm=llm,
tools=[
Tool(name=BashTool.name),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
],
)
cwd = os.getcwd()
conversation = Conversation(agent=agent, workspace=cwd)
conversation.send_message("Write 3 facts about the current project into FACTS.txt.")
conversation.run()wooden-umbrella-84098
11/05/2025, 8:25 PMBashTool.create()
and have that return a Tool object?chilly-france-44439
11/05/2025, 8:25 PMchilly-france-44439
11/05/2025, 8:26 PMwooden-umbrella-84098
11/05/2025, 8:27 PMwooden-umbrella-84098
11/05/2025, 8:27 PMchilly-france-44439
11/05/2025, 8:28 PMwooden-umbrella-84098
11/05/2025, 8:29 PMwooden-umbrella-84098
11/05/2025, 8:29 PMchilly-france-44439
11/05/2025, 8:30 PMchilly-france-44439
11/05/2025, 8:31 PMwooden-umbrella-84098
11/05/2025, 8:54 PMI have a pydantic class with a SecretStr attribute. Can I allow users to pass in a regular string, and have it automatically convert to a SecretStr
Yes! Pydantic will automatically convert a regular string tofor you. This works out of the box with no special configuration needed.SecretStr
wooden-umbrella-84098
11/05/2025, 8:55 PMchilly-france-44439
11/05/2025, 8:57 PMcalm-artist-7206
11/05/2025, 8:57 PMchilly-france-44439
11/05/2025, 8:57 PMchilly-france-44439
11/05/2025, 9:01 PMchilly-france-44439
11/05/2025, 9:01 PMchilly-france-44439
11/05/2025, 9:02 PMwooden-umbrella-84098
11/05/2025, 10:00 PM