langchain/libs/community/langchain_community/agent_toolkits/cogniswitch/toolkit.py
Leonid Kuligin 893a924b90
core[minor], community[patch], langchain[patch]: move BaseChatLoader to core (#19607)
Thank you for contributing to LangChain!

- [ ] **PR title**: "core: move BaseChatLoader and BaseToolkit from
community"


- [ ] **PR message**: move BaseChatLoader and BaseToolkit

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
2024-04-26 21:45:51 +00:00

42 lines
1.3 KiB
Python

from typing import List
from langchain_core.tools import BaseToolkit
from langchain_community.tools import BaseTool
from langchain_community.tools.cogniswitch.tool import (
CogniswitchKnowledgeRequest,
CogniswitchKnowledgeSourceFile,
CogniswitchKnowledgeSourceURL,
CogniswitchKnowledgeStatus,
)
class CogniswitchToolkit(BaseToolkit):
"""
Toolkit for CogniSwitch.
Use the toolkit to get all the tools present in the cogniswitch and
use them to interact with your knowledge
"""
cs_token: str # cogniswitch token
OAI_token: str # OpenAI API token
apiKey: str # Cogniswitch OAuth token
def get_tools(self) -> List[BaseTool]:
"""Get the tools in the toolkit."""
return [
CogniswitchKnowledgeStatus(
cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
),
CogniswitchKnowledgeRequest(
cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
),
CogniswitchKnowledgeSourceFile(
cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
),
CogniswitchKnowledgeSourceURL(
cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
),
]