Skip to main content

llama-index packs cogniswitch_agent integration

Project description

Cogniswitch LlamaPack

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. Get started by interacting with your knowledge in a few simple steps

visit https://www.cogniswitch.ai/developer.

Registration:

  • Signup with your email and verify your registration
  • You will get a mail with a platform token and OAuth token for using the services.

Step 1: Download the CogniSwitch Llama pack:

  • Download the CogniswitchAgentPack either with the llama-cli or import using the code.

Step 2: Instantiate the CogniswitchAgentPack:

  • Instantiate the cogniswitch agent pack with all the credentials.

Step 3: Cogniswitch Store data:

  • Make the call to the agent by giving the file path or url to the agent input.
  • The agent will pick the tool and use the file/url and it will be processed and stored in your knowledge store.
  • You can check the status of document processing with a call to the agent. Alternatively you can also check in cogniswitch console.

Step 4: Cogniswitch Answer:

  • Make the call to the agent by giving query as agent input.
  • You will get the answer from your knowledge as the response.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack CogniswitchAgentPack --download-dir ./cs_pack

Code Usage

import warnings

warnings.filterwarnings("ignore")
from llama_index.packs.cogniswitch_agent import CogniswitchAgentPack
import os


### Cogniswitch Credentials and OpenAI token
# os.environ["OPENAI_API_KEY"] = <your openai token>
# cogniswitch_tool_args = {
#   "cs_token":<your cogniswitch platform token>,
#   "apiKey":<your cogniswitch apikey>
# }

cogniswitch_agent_pack = CogniswitchAgentPack(cogniswitch_tool_args)

From here, you can use the pack, or inspect and modify the pack in ./cs_pack.

The run() function is a light wrapper around agent.chat().

Use the cogniswitch agent for storing data in cogniswitch with a single call

response = cogniswitch_agent_pack.run(
    "Upload this URL- https://cogniswitch.ai/developer"
)

Use the cogniswitch agent to know the status of the document with a call

response = cogniswitch_agent_pack.run(
    "Tell me the status of https://cogniswitch.ai/developer"
)

Use the cogniswitch agent for answering with a single call

response = cogniswitch_agent_pack.run(
    "Answer the question- Tell me about cogniswitch"
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file llama_index_packs_cogniswitch_agent-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_cogniswitch_agent-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a603efc7996799cadc26b4ebd551b8f9f726456857d621da59083ac84878015e
MD5 df493b16991891132ccded5946676c53
BLAKE2b-256 dad4c2127f166824dd11cd6e1b54427c12124bec53f08aff82dd5b6922aceabc

See more details on using hashes here.

File details

Details for the file llama_index_packs_cogniswitch_agent-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_cogniswitch_agent-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fed929584abb9a42e3ea07d83f523e05c227530f8dc1c4fba73815be9375d2d
MD5 93767e51707e83c751f2ade1bc4dd823
BLAKE2b-256 26ad17b5de267a4eb5dd21cae1c2052106dae5f9e63e3f1d5bf3c6259b934cc3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page