llama-index-tools-cogniswitch


Namellama-index-tools-cogniswitch JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
Summaryllama-index tools cogniswitch integration
upload_time2024-11-17 23:05:08
maintainercogniswitch
docs_urlNone
authorYour Name
requires_python<4.0,>=3.9
licenseMIT
keywords embedding graph knowledge graph neural symbolic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Cogniswitch ToolSpec

**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 just three simple steps**

visit [https://www.cogniswitch.ai/developer](https://www.cogniswitch.ai/developer?utm_source=llamaindex&utm_medium=llamaindexbuild&utm_id=dev).

**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: Instantiate the Cogniswitch ToolSpec:**

- Use your Cogniswitch token, openAI API key, OAuth token to instantiate the toolspec.

**Step 2: Instantiate the Agent:**

- Instantiate the agent with the list of tools from the toolspec.

**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](- You can check the status of document processing with a call to the agent. Alternatively you can also check in [cogniswitch console](https://console.cogniswitch.ai:8443/login?utm_source=llamaindex&utm_medium=llamaindexbuild&utm_id=dev).

**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.

### Import Required Libraries

```python
import warnings

warnings.filterwarnings("ignore")
import os
from llama_index.tools.cogniswitch import CogniswitchToolSpec
from llama_index.core.agent import ReActAgent
```

### Cogniswitch Credentials and OpenAI token

```python
# os.environ["OPENAI_API_KEY"] = <your openai token>
# cs_token = <your cogniswitch platform token>
# oauth_token = <your cogniswitch apikey>
```

### Instantiate the Tool Spec

```python
toolspec = CogniswitchToolSpec(cs_token=cs_token, apiKey=oauth_token)
```

### Get the list of tools

```python
tool_lst = toolspec.to_tool_list()
```

### Instantiate the agent with the tool list

```python
agent = ReActAgent.from_tools(tool_lst)
```

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

```python
store_response = agent.chat(
    """
                            https://cogniswitch.ai/developer
                            this site is about cogniswitch website for developers.
                           """
)
print(store_response)
```

    {'data': {'knowledgeSourceId': 43, 'sourceType': 'https://cogniswitch.ai/developer', 'sourceURL': None, 'sourceFileName': None, 'sourceName': 'Cogniswitch dev', 'sourceDescription': 'This is a cogniswitch website for developers.', 'status': 'UPLOADED'}, 'list': None, 'message': "We're processing your content & will send you an email on completion, hang tight!", 'statusCode': 1000}

### Use the agent to know the document status with a single call

```python
response = agent.chat("Tell me the status of Cogniswitch Developer Website")
```

```python
print(response)
```

    The document "Cogniswitch Developer Website" is currently being processed.

### Use the agent for answering a query with a single call

```python
answer_response = agent.chat("tell me about cogniswitch")
print(answer_response)
```

    {'data': {'answer': 'CogniSwitch is a technology platform that enhances the reliability of Generative AI applications for enterprises. It does this by gathering and organizing knowledge from documented sources, eliminating hallucinations and bias in AI responses. The platform uses AI to automatically gather and organize knowledge, which can then be reviewed and curated by experts before being published. The CogniSwitch API enables Gen AI applications to access this knowledge as needed, ensuring reliability. It is specifically designed to complement Generative AI and offers customized solutions for different business functions within an enterprise.'}, 'list': None, 'message': None, 'statusCode': 1000}

The tool is designed to store data and retrieve answers based on the knowledge provided. check out the [link](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-cogniswitch/examples/cogniswitch.ipynb) for examples.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-tools-cogniswitch",
    "maintainer": "cogniswitch",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "embedding, graph, knowledge graph, neural, symbolic",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/f7/09/3403ae739b6561cac6934f3c0971ac7c03fabf6059f62619701476ccd19a/llama_index_tools_cogniswitch-0.3.0.tar.gz",
    "platform": null,
    "description": "## Cogniswitch ToolSpec\n\n**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 just three simple steps**\n\nvisit [https://www.cogniswitch.ai/developer](https://www.cogniswitch.ai/developer?utm_source=llamaindex&utm_medium=llamaindexbuild&utm_id=dev).\n\n**Registration:**\n\n- Signup with your email and verify your registration\n- You will get a mail with a platform token and OAuth token for using the services.\n\n**Step 1: Instantiate the Cogniswitch ToolSpec:**\n\n- Use your Cogniswitch token, openAI API key, OAuth token to instantiate the toolspec.\n\n**Step 2: Instantiate the Agent:**\n\n- Instantiate the agent with the list of tools from the toolspec.\n\n**Step 3: Cogniswitch Store data:**\n\n- Make the call to the agent by giving the file path or url to the agent input.\n- The agent will pick the tool and use the file/url and it will be processed and stored in your knowledge store.\n- You can check the status of document processing with a call to the agent. Alternatively you can also check in [cogniswitch console](- You can check the status of document processing with a call to the agent. Alternatively you can also check in [cogniswitch console](https://console.cogniswitch.ai:8443/login?utm_source=llamaindex&utm_medium=llamaindexbuild&utm_id=dev).\n\n**Step 4: Cogniswitch Answer:**\n\n- Make the call to the agent by giving query as agent input.\n- You will get the answer from your knowledge as the response.\n\n### Import Required Libraries\n\n```python\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nimport os\nfrom llama_index.tools.cogniswitch import CogniswitchToolSpec\nfrom llama_index.core.agent import ReActAgent\n```\n\n### Cogniswitch Credentials and OpenAI token\n\n```python\n# os.environ[\"OPENAI_API_KEY\"] = <your openai token>\n# cs_token = <your cogniswitch platform token>\n# oauth_token = <your cogniswitch apikey>\n```\n\n### Instantiate the Tool Spec\n\n```python\ntoolspec = CogniswitchToolSpec(cs_token=cs_token, apiKey=oauth_token)\n```\n\n### Get the list of tools\n\n```python\ntool_lst = toolspec.to_tool_list()\n```\n\n### Instantiate the agent with the tool list\n\n```python\nagent = ReActAgent.from_tools(tool_lst)\n```\n\n### Use the agent for storing data in cogniswitch with a single call\n\n```python\nstore_response = agent.chat(\n    \"\"\"\n                            https://cogniswitch.ai/developer\n                            this site is about cogniswitch website for developers.\n                           \"\"\"\n)\nprint(store_response)\n```\n\n    {'data': {'knowledgeSourceId': 43, 'sourceType': 'https://cogniswitch.ai/developer', 'sourceURL': None, 'sourceFileName': None, 'sourceName': 'Cogniswitch dev', 'sourceDescription': 'This is a cogniswitch website for developers.', 'status': 'UPLOADED'}, 'list': None, 'message': \"We're processing your content & will send you an email on completion, hang tight!\", 'statusCode': 1000}\n\n### Use the agent to know the document status with a single call\n\n```python\nresponse = agent.chat(\"Tell me the status of Cogniswitch Developer Website\")\n```\n\n```python\nprint(response)\n```\n\n    The document \"Cogniswitch Developer Website\" is currently being processed.\n\n### Use the agent for answering a query with a single call\n\n```python\nanswer_response = agent.chat(\"tell me about cogniswitch\")\nprint(answer_response)\n```\n\n    {'data': {'answer': 'CogniSwitch is a technology platform that enhances the reliability of Generative AI applications for enterprises. It does this by gathering and organizing knowledge from documented sources, eliminating hallucinations and bias in AI responses. The platform uses AI to automatically gather and organize knowledge, which can then be reviewed and curated by experts before being published. The CogniSwitch API enables Gen AI applications to access this knowledge as needed, ensuring reliability. It is specifically designed to complement Generative AI and offers customized solutions for different business functions within an enterprise.'}, 'list': None, 'message': None, 'statusCode': 1000}\n\nThe tool is designed to store data and retrieve answers based on the knowledge provided. check out the [link](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-cogniswitch/examples/cogniswitch.ipynb) for examples.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index tools cogniswitch integration",
    "version": "0.3.0",
    "project_urls": null,
    "split_keywords": [
        "embedding",
        " graph",
        " knowledge graph",
        " neural",
        " symbolic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23925f0255a0abcd500ba75412d6bfe6b7753f8cef7ca61cc26675d1ecde89bc",
                "md5": "7fabb363aa9af69a5f4d2a8e98e61b6d",
                "sha256": "d47139d55f13cb56d293fed3b90d3888c23ace27fa8a9d00f802b2fe6b2412e2"
            },
            "downloads": -1,
            "filename": "llama_index_tools_cogniswitch-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7fabb363aa9af69a5f4d2a8e98e61b6d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 4651,
            "upload_time": "2024-11-17T23:05:06",
            "upload_time_iso_8601": "2024-11-17T23:05:06.327084Z",
            "url": "https://files.pythonhosted.org/packages/23/92/5f0255a0abcd500ba75412d6bfe6b7753f8cef7ca61cc26675d1ecde89bc/llama_index_tools_cogniswitch-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7093403ae739b6561cac6934f3c0971ac7c03fabf6059f62619701476ccd19a",
                "md5": "73820e7c8f09de16ff492f596ef55f84",
                "sha256": "b0834963f819074ba574b7f8dbc49696ccae8e976f25289fc2a19e629979e891"
            },
            "downloads": -1,
            "filename": "llama_index_tools_cogniswitch-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "73820e7c8f09de16ff492f596ef55f84",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 4367,
            "upload_time": "2024-11-17T23:05:08",
            "upload_time_iso_8601": "2024-11-17T23:05:08.060623Z",
            "url": "https://files.pythonhosted.org/packages/f7/09/3403ae739b6561cac6934f3c0971ac7c03fabf6059f62619701476ccd19a/llama_index_tools_cogniswitch-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-17 23:05:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-tools-cogniswitch"
}
        
Elapsed time: 0.50047s