-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I tryed using Rag Collection in the Python Code but couldn't figure out how to make it inside of the code
import gradientai
import os
from gradientai import Gradient
os.environ['GRADIENT_ACCESS_TOKEN'] = ""
os.environ['GRADIENT_WORKSPACE_ID'] =""
Initialize your Gradient instance
gradient = Gradient()
Initialize your Gradient instance
gradient = Gradient()
def run_answer_example_with_rag_collection(*, gradient: Gradient) -> None:
question = "What is Mprofy?"
print("==== Q & A ====")
print(f"Question: {question}\n")
print("Answering question using RAG collection...")
try:
# Assuming the RAG Collection ID is passed as a separate parameter,
# which is not shown in the documentation snippet provided.
result = gradient.answer(
question=question,
RAG_Collections="Rag collection Id" # Speculative parameter
)
print(f"Answer: {result['answer']}")
except TypeError as e:
print(f"An error occurred: {e}")
print("================\n")
Run the function
run_answer_example_with_rag_collection(gradient=gradient)
This is the code i have tryed but i couldn't bring it working
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels