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

DST-252: set up code for accordion implementation #41

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

ccheng26
Copy link
Collaborator

@ccheng26 ccheng26 commented Jun 14, 2024

Ticket

Resolves #DST-252

Changes

  • fix api call
  • add script calls in .toml file
  • remove metadata key
  • add uswds accordion

Testing

Testing instructions and expected behavior:

For API:

  1. pip install -r requirements.txt
  2. Update .env
  3. run ./ingest-guru-cards.py
  4. run /chatbot_api.py
  5. call api endpoint by sending query string to localhost:8001/query
  6. should receive json response

For chainlit UI:

  1. pip install -r requirements.txt
  2. . Update .env
  3. run ./ingest-guru-cards.py
  4. run ./chatbot-chainlit.py
  5. ask query in chat
  6. accordion of guru cards should appear

@@ -44,9 +44,8 @@ async def init_chat():
}

await cl.Message(
metadata=metadata,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed due to unexpected key error

@@ -47,8 +46,8 @@ def chat_engine(self):

# This function cannot be async because it uses a single non-thread-safe app_state
@app.post("/query")
def query(message: str | Dict):
response = app_state.chat_engine().gen_response(message)
def query(message: str):
Copy link
Collaborator Author

@ccheng26 ccheng26 Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed Dict type, causes error in populate_summaries in ll 196, key errors for gen_results.question

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixed the underlying error? I'm a bit surprised, since I didn't think type annotations could affect runtime!

@ccheng26 ccheng26 merged commit e3aedf2 into main Jun 18, 2024
1 check passed
@ccheng26 ccheng26 deleted the DST-252-addAccordionSourcesForPrompt branch June 18, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants