Praison AI
Bot
Use Cases
University
Docs
Get Started
Say when it is not there
Run
from praisonai import Agent, KeywordIndex lines = [ "Apples grow on trees in the orchard.", "The secret colour of the boat is blue.", "Tickets for the ferry cost four pounds.", ] index = KeywordIndex() index.add_documents(lines) question = "Where is the boat kept?" section = index.query(question, top_k=1)[0]["text"] print(section) agent = Agent(instructions="Answer in one sentence. Use only the note. If the note does not say, reply: Not in the note.") print(agent.start(question + "\nNote: " + section))
Press Run. The result appears here.