Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created February 1, 2025 17:00
Show Gist options
  • Select an option

  • Save KyMidd/d4897cc3a77c17265b19c9ba2affcaed to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/d4897cc3a77c17265b19c9ba2affcaed to your computer and use it in GitHub Desktop.
if os.environ.get("VERA_DEBUG", "False") == "True":
print(f"🚀 Knowledge base response: {knowledge_base_response}")
# Iterate through responses
for result in knowledge_base_response["retrievalResults"]:
citation_result = result['content']['text']
citation_url = result['location']['confluenceLocation']['url']
# Append to conversation
conversation.append(
{
"role": "user",
"content": [
{
"type": "text",
"text": f"Knowledge base citation to supplement your answer: {citation_result} from URL {citation_url}",
}
],
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment