Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Added
- Diff mechanism for small circuit simulation config.

### Changed
- Switch to gpt-5-mini.

Expand Down
1 change: 1 addition & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies = [
"asyncpg",
"boto3",
"fastapi",
"jsonpatch",
"mcp",
"obp-accounting-sdk",
"openai",
Expand Down
6 changes: 5 additions & 1 deletion backend/src/neuroagent/app/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
ExperimentalNeuronDensityGetOneTool,
ExperimentalSynapsesPerConnectionGetAllTool,
ExperimentalSynapsesPerConnectionGetOneTool,
GenerateSimulationsConfigTool,
IonChannelModelGetAllTool,
IonChannelModelGetOneTool,
MeasurementAnnotationGetAllTool,
Expand Down Expand Up @@ -98,6 +97,9 @@
SubjectGetOneTool,
)
from neuroagent.tools.base_tool import BaseTool
from neuroagent.tools.obione_generatesimulationsconfig import (
GenerateSimulationsConfigTool,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -626,6 +628,7 @@ async def get_context_variables(
# Get the current frontend url
body = await request.json()
current_frontend_url = body.get("frontend_url")
shared_state = body.get("shared_state")
# Get the url for entitycore links
if thread.vlab_id and thread.project_id:
entity_frontend_url = (
Expand All @@ -651,6 +654,7 @@ async def get_context_variables(
"project_id": thread.project_id,
"s3_client": s3_client,
"sanity_url": settings.tools.sanity.url,
"shared_state": shared_state,
"thread_id": thread.thread_id,
"thumbnail_generation_url": settings.tools.thumbnail_generation.url,
"usage_dict": {},
Expand Down
9 changes: 8 additions & 1 deletion backend/src/neuroagent/new_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

from typing import Any, Callable

# Third-party imports
from pydantic import BaseModel, ConfigDict

from neuroagent.tools.autogenerated_types.obione import SimulationsForm
from neuroagent.tools.base_tool import BaseTool


class SharedState(BaseModel):
"""State shared between backend and frontend."""

smc_simulation_config: SimulationsForm | None = None


class Agent(BaseModel):
"""Agent class."""

Expand Down Expand Up @@ -64,6 +70,7 @@ class ClientRequest(BaseModel):
tool_selection: list[str] | None = None
model: str = "openai/gpt-5-mini"
frontend_url: str | None = None
shared_state: SharedState | None = None

model_config = ConfigDict(extra="ignore")

Expand Down
4 changes: 0 additions & 4 deletions backend/src/neuroagent/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@
from neuroagent.tools.generate_plot import PlotGeneratorTool
from neuroagent.tools.obi_expert import OBIExpertTool
from neuroagent.tools.obione_ephysmetrics_getone import EphysMetricsGetOneTool
from neuroagent.tools.obione_generatesimulationsconfig import (
GenerateSimulationsConfigTool,
)
Comment on lines -128 to -130
Copy link
Collaborator Author

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

from neuroagent.tools.obione_morphometrics_getone import MorphometricsGetOneTool
from neuroagent.tools.thumbnailgen_electricalcellrecording_getone import (
PlotElectricalCellRecordingGetOneTool,
Expand Down Expand Up @@ -163,7 +160,6 @@
"ExperimentalNeuronDensityGetOneTool",
"ExperimentalSynapsesPerConnectionGetAllTool",
"ExperimentalSynapsesPerConnectionGetOneTool",
"GenerateSimulationsConfigTool",
"IonChannelModelGetAllTool",
"IonChannelModelGetOneTool",
"MeasurementAnnotationGetAllTool",
Expand Down
Loading