docs/examples/query_engine/cogniswitch_query_engine.ipynb
Use CogniSwitch to build production ready applications that can consume, organize and retrieve knowledge flawlessly. Using the framework of your choice, in this case LlamaIndex, CogniSwitch helps alleviate the stress of decision making when it comes to choosing the right storage and retrieval formats. It also eradicates reliability issues and hallucinations when it comes to responses that are generated. Start interacting with your knowledge in 3 simple steps!
Visit https://www.cogniswitch.ai/developer.
Registration:
Upload Knowledge:
You can sign-in to Cogniswitch website and upload your document files or submit a url from the Document Upload page.
You can use the CogniswitchToolSpec in llama-hub tools to add document or a url in Cogniswitch.
CogniswitchQueryEngine:
Instantiate the cogniswitchQueryEngine with the tokens and API keys.
Use query_knowledge function in the Query Engine and input your query.
You will get the answer from your knowledge as the response.
import warnings
warnings.filterwarnings("ignore")
from llama_index.core.query_engine import CogniswitchQueryEngine
# cs_token = <your cogniswitch platform token>
# OAI_token = <your openai token>
# oauth_token = <your cogniswitch apikey>
query_engine = CogniswitchQueryEngine(
cs_token=cs_token, OAI_token=OAI_token, apiKey=oauth_token
)
answer_response = query_engine.query_knowledge("tell me about cogniswitch")
print(answer_response)