Skip to content

Commit

Permalink
changed GAMER invoke method
Browse files Browse the repository at this point in the history
  • Loading branch information
sreyakumar committed Oct 28, 2024
1 parent 6369d3b commit 76506d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 5 additions & 6 deletions src/metadata_chatbot/agents/GAMER.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ def _call(
The model output as a string.
"""
inputs = {"query" : query}
for output in app.stream(inputs, stream_mode="updates"):
for key, value in output.items():
logging.info(f"Currently on node '{key}':")
return value['generation'] if value else None
answer = app.invoke(inputs)
return answer['generation']

# inputs = {"query" : query}
# answer = app.invoke(inputs)
# if isinstance(answer, dict):
Expand Down Expand Up @@ -117,8 +116,8 @@ def _llm_type(self) -> str:
"""Get the type of language model used by this chat model. Used for logging purposes only."""
return "Claude 3 Sonnet"

# llm = GAMER()
# print(llm.invoke("Can you give me a timeline of events for subject 675387?"))
llm = GAMER()
print(llm.invoke("What are the injections for SmartSPIM_675387_2023-05-23_23-05-56?"))

# async def main():
# result = await llm.ainvoke("Can you give me a timeline of events for subject 675387?")
Expand Down
8 changes: 4 additions & 4 deletions src/metadata_chatbot/agents/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def generate_vi(state):

app = workflow.compile()

# query = "Write a MongoDB query to find the genotype of SmartSPIM_675387_2023-05-23_23-05-56"
query = "What are the injections for SmartSPIM_675387_2023-05-23_23-05-56?"

# inputs = {"query" : query}
# answer = app.invoke(inputs)
# print(answer['generation'])
inputs = {"query" : query}
answer = app.invoke(inputs)
print(answer['generation'])

0 comments on commit 76506d5

Please sign in to comment.