Skip to content

Commit

Permalink
Merge branch 'main' into feat/parameter-scan
Browse files Browse the repository at this point in the history
  • Loading branch information
gurdeep330 authored Jan 27, 2025
2 parents 5827df0 + 1da9c0a commit 527fb29
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aiagents4pharma/talk2biomodels/tests/test_langgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ def test_integration():
reversed_messages = current_state.values["messages"][::-1]
# Loop through the reversed messages
# until a ToolMessage is found.
expected_header = ['Time', 'CRP{serum}', 'CRPExtracellular']
expected_header = ['Time', 'CRP[serum]', 'CRPExtracellular']
expected_header += ['CRP Suppression (%)', 'CRP (% of baseline)']
expected_header += ['CRP{liver}']
expected_header += ['CRP[liver]']
predicted_artifact = []
for msg in reversed_messages:
if isinstance(msg, ToolMessage):
Expand Down
1 change: 0 additions & 1 deletion aiagents4pharma/talk2biomodels/tools/simulate_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def _run(self,
# Simulate the model
df = model_object.simulate(duration=duration, interval=interval)
logger.log(logging.INFO, "Simulation results ready with shape %s", df.shape)
# Prepare the dictionary of simulated data
dic_simulated_data = {
'name': arg_data.simulation_name,
'source': sys_bio_model.biomodel_id if sys_bio_model.biomodel_id else 'upload',
Expand Down
25 changes: 25 additions & 0 deletions app/frontend/streamlit_app_talk2biomodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
# Skip the Tool message if it is an error message
if msg.status == "error":
continue

# Create a unique message id to identify the tool call
# msg.name is the name of the tool
# msg.tool_call_id is the unique id of the tool call
Expand Down Expand Up @@ -321,6 +322,30 @@
# tool_call_id=msg.tool_call_id,
save_table=True)
st.empty()
# elif msg.name in ["ask_question"]:
# # df_simulated = pd.DataFrame.from_dict(
# # current_state.values["dic_simulated_data"])
# dic_simulated = current_state.values["dic_simulated_data"]
# # print (dic_simulated)
# print (msg.tool_call_id)
# for entry in dic_simulated:
# print (entry.keys())
# if msg.tool_call_id in entry:
# df_simulated = pd.DataFrame.from_dict(entry[msg.tool_call_id]['data'])
# break
# # Display the toggle button to suppress the table
# streamlit_utils.render_toggle(
# key="toggle_table_"+uniq_msg_id,
# toggle_text="Show Table",
# toggle_state=False,
# save_toggle=True)
# # Display the table
# streamlit_utils.render_table(
# df_simulated,
# key="dataframe_"+uniq_msg_id,
# tool_name=msg.name,
# save_table=True)
# st.empty()
# Collect feedback and display the thumbs feedback
if st.session_state.get("run_id"):
feedback = streamlit_feedback(
Expand Down

0 comments on commit 527fb29

Please sign in to comment.