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

A KeyError results for query if citation is also returned #182

Open
hpuri opened this issue Apr 12, 2024 · 0 comments
Open

A KeyError results for query if citation is also returned #182

hpuri opened this issue Apr 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hpuri
Copy link

hpuri commented Apr 12, 2024

Using the provided notebook I changed question #2 to ensure it is answered from the datastore

Test

user_query = 'Hello World!'
agent_answer = s.get_agent_answer(user_query)
print(f" Q: {user_query}\n A: {agent_answer}")

user_query = 'how many VPCs are in the CVS design'
agent_answer = s.get_agent_answer(user_query)
print(f" Q: {user_query}\n A: {agent_answer}")

I got the following error after an answer to the first question

Q: Hello World!
A: Greetings! How can I assist? ()

KeyError Traceback (most recent call last)
in <cell line: 7>()
5
6 user_query = 'how many VPCs are in the CVS design'
----> 7 agent_answer = s.get_agent_answer(user_query)
8 print(f" Q: {user_query}\n A: {agent_answer}")

/usr/local/lib/python3.10/dist-packages/dfcx_scrapi/core/sessions.py in get_agent_answer(self, user_query)
287
288 answer_text = res["responseMessages"][0]["text"]["text"][0]
--> 289 answer_link = res["responseMessages"][1]["payload"][
290 "richContent"][0][0]["actionLink"] if len(
291 res["responseMessages"]) > 1 else ""

KeyError: 'actionLink'

Expected Behavior

The response and a URL to the citation should be returned if there is one

Current Behavior

Error trace is emitted

Possible Solution

Steps to Reproduce

  1. Use the colab notebook
  2. change the agent id, project, location to your specifics
  3. Use a agent that connects to a Datastore
  4. Chage th eprompt so it is answered from the Datastrore

Context (Environment)

Trying to show a sample usage to a customer

Detailed Description

Possible Implementation

looks like a pointer error (in c++ terms )

@hpuri hpuri added the bug Something isn't working label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant