-
Couldn't load subscription status.
- Fork 1
State sharing #507
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
base: main
Are you sure you want to change the base?
State sharing #507
Conversation
| from neuroagent.tools.obione_generatesimulationsconfig import ( | ||
| GenerateSimulationsConfigTool, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had an annoying cyclic dependency that I could resolve only by not importing this tools in the __init__. If you have a better idea let me know. The dependency is
conftest -> neuroagent.app.dependencies -> neuroagent.agent_routine -> neuroagent.new_types -> neuroagent.tools.autogenerated_types.obione -> neuroagent.tools.__init__ -> neuroagent.tools.obione_generatesimulationsconfig -> new_types
| >({ | ||
| smc_simulation_config: { | ||
| type: "SimulationsForm", | ||
| timestamps: {}, | ||
| stimuli: {}, | ||
| recordings: {}, | ||
| neuron_sets: {}, | ||
| synaptic_manipulations: {}, | ||
| initialize: { | ||
| type: "SimulationsForm.Initialize", | ||
| circuit: { | ||
| type: "CircuitFromID", | ||
| id_str: "", | ||
| }, | ||
| node_set: { | ||
| block_dict_name: "", | ||
| block_name: "", | ||
| type: "NeuronSetReference", | ||
| }, | ||
| simulation_length: 1000, | ||
| extracellular_calcium_concentration: 1.1, | ||
| v_init: -80, | ||
| random_seed: 1, | ||
| }, | ||
| info: { | ||
| type: "Info", | ||
| campaign_name: "name", | ||
| campaign_description: "description", | ||
| }, | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would store this default at the top of the file and just link here. Of course highly subjective.
| if base_simulation_form is None: | ||
| raise ValueError( | ||
| f"To edit a Small Microcircuit Simulation, first navigate to {self.metadata.entity_frontend_url + '/simulate?&s=new&t=small-microcircuit'}, pick a circuit, click 'New Simulation' and call the tool again." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed privately. Another option is to set base_simulation_form={}. Your call
| description: ClassVar[ | ||
| str | ||
| ] = """This tool generates JSON configurations for simulations based on natural language descriptions. It takes a user's request for a configuration (including modifications to existing configs) and uses an LLM with structured output to produce the corresponding JSON. | ||
| ] = """This tool generates JSON configurations for simulations based on natural language descriptions. It accepts both complete configuration specifications and modification requests for existing configurations, using an LLM with structured output to produce the corresponding JSON. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First time I see it. Sure I will prompt it.

Contributes to #489
How it works
The backend is adjusted to accept descriptions of full simulation campaigns or incremental changes. The frontend passes the current simulation config in the request body which the backend recovers. The final simulation json is split into json patches that are returned in the tool output. The frontend is responsible for applying them to their state.
The frontend shows a button next to relevant tools (smc simulation config in this case) which opens a sidebar. When the tool call is done, the JSON displayed updates. You can also modify it directly in the frontend, the changes will be seen by the backend on the next request
Disclaimer
obione-generatesimulationsconfigto see the button appear and to be able to open the sidebar. It currently shows only the simulation config json, not the whole state.The frontend is far from perfect, but tracking correctly this json and its diffs (tool + frontend) is too much of a task for this ticket imo. Feel free to disagree and make changes !