Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: "Edit model" generates problematic code when the prompt is "Add a transition ..." #5762

Closed
liunelson opened this issue Dec 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@liunelson
Copy link
Member

Describe the bug
When you ask the agent to add new transitions, it produces code where it retrieves existing states and parameters or define new ones.

When it defines new parameters and no units are given in the prompt, it sets the units to be "". This is a bad idea since MIRA does not accept "" as a unit for parameters.

if "v" not in model.parameters: #note this is checks for paremeter's symbol
    parameter_unit = Unit(expression = sympy.Symbol(""))
    parameters = {
        "v": Parameter(name = "v", value = 1.0, units = parameter_unit, description = "Rate of transition from S to R due to vaccination")
    }
else: 
    parameters = {"v": model.parameters.get("v")}

Expected behavior
Change the agent instruction set to ensure that the generated code does not set the parameter units to be ""

    parameters = {
        "v": Parameter(name = "v", value = 1.0, description = "Rate of transition from S to R due to vaccination")
    }
@liunelson liunelson added the bug Something isn't working label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants