Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

load_context.py 383 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  1. def retrieve_documents(question: str) -> str:
  2. # Calculate embeddings, search vector db...
  3. return f"<Documents similar to {question}>"
  4. def get_var(var_name, prompt, other_vars):
  5. question = other_vars["question"]
  6. context = retrieve_documents(question)
  7. return {"output": context}
  8. # In case of error:
  9. # return {
  10. # 'error': 'Error message'
  11. # }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...