-
Notifications
You must be signed in to change notification settings - Fork 308
Open
Description
Product
BAML
Problem Statement / Use Case
I have a baml class that only contains dynamic fields:
class ToolCall {
@@dynamic
}
Im testing the following function:
def test_clear_baml(tb: TypeBuilder, cr: ClientRegistry):
# actual code
tb.ToolCall.add_property("tool", tb.ImageRequest.type())
tool = ToolStep(tool=ImageRequest(step_type="ImageRequest", reasoning="The user asked for an image", output_format="png", prompt="cat with likeness of the number one video game of 2024 with the mood of google's stock price", acknowledgement="generating an image"))
memory = [
Message(role="assistant", content="Observation from AskWebRequest: Google's stock price fell in June"),
Message(role="assistant", content="Observation from AskWebRequest: The number one video game of 2024 is Cyberpunk")
]
resp = b.RunWorker(memory=memory, tool=tool, baml_options={"client_registry": cr, "tb": tb})
assert "cyberpunk" in resp.tool["prompt"].lower()
# theoretical code
tb.remove_property("tool")
As indicated in the code, I'd like to be able to clear the properties of ToolCall, so that when I'm trying to map the parameters of another Tool, ToolCall
only has that one tool to choose from, reducing the possibility of generating the parameters of a another tool.
Proposed Solution
Method to remove property:
tb.remove_property("tool")
Alternative Solutions
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
No labels