Skip to content

Commit

Permalink
docs: integrations updates 18 (#27054)
Browse files Browse the repository at this point in the history
Added missed provider pages. Added descriptions and links. Fixed
inconsistency in text formatting.

Co-authored-by: Erick Friis <erick@langchain.dev>
  • Loading branch information
leo-gan and efriis authored Oct 8, 2024
1 parent b716d80 commit c3cb56a
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 7 deletions.
20 changes: 20 additions & 0 deletions docs/docs/integrations/providers/koboldai.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# KoboldAI

>[KoboldAI](https://koboldai.com/) is a free, open-source project that allows users to run AI models locally
> on their own computer.
> It's a browser-based front-end that can be used for writing or role playing with an AI.
>[KoboldAI](https://github.com/KoboldAI/KoboldAI-Client) is a "a browser-based front-end for
> AI-assisted writing with multiple local & remote AI models...".
> It has a public and local API that can be used in LangChain.
## Installation and Setup

Check out the [installation guide](https://github.com/KoboldAI/KoboldAI-Client).

## LLMs

See a [usage example](/docs/integrations/llms/koboldai).

```python
from langchain_community.llms import KoboldApiLLM
```
89 changes: 85 additions & 4 deletions docs/docs/integrations/tools/jira.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"\n",
"The `Jira` toolkit allows agents to interact with a given Jira instance, performing actions such as searching for issues and creating issues, the tool wraps the atlassian-python-api library, for more see: https://atlassian-python-api.readthedocs.io/jira.html\n",
"\n",
"## Installation and setup\n",
"\n",
"To use this tool, you must first set as environment variables:\n",
" JIRA_API_TOKEN\n",
" JIRA_USERNAME\n",
Expand Down Expand Up @@ -58,6 +60,13 @@
"ExecuteTime": {
"end_time": "2023-04-17T10:21:23.730922Z",
"start_time": "2023-04-17T10:21:22.911233Z"
},
"execution": {
"iopub.execute_input": "2024-10-02T17:40:07.356954Z",
"iopub.status.busy": "2024-10-02T17:40:07.356792Z",
"iopub.status.idle": "2024-10-02T17:40:07.359943Z",
"shell.execute_reply": "2024-10-02T17:40:07.359476Z",
"shell.execute_reply.started": "2024-10-02T17:40:07.356942Z"
}
},
"outputs": [],
Expand All @@ -72,14 +81,21 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "b3050b55",
"metadata": {
"ExecuteTime": {
"end_time": "2023-04-17T10:22:42.505412Z",
"start_time": "2023-04-17T10:22:42.499447Z"
},
"collapsed": false,
"execution": {
"iopub.execute_input": "2024-10-02T17:40:16.201684Z",
"iopub.status.busy": "2024-10-02T17:40:16.200922Z",
"iopub.status.idle": "2024-10-02T17:40:16.208035Z",
"shell.execute_reply": "2024-10-02T17:40:16.207564Z",
"shell.execute_reply.started": "2024-10-02T17:40:16.201634Z"
},
"jupyter": {
"outputs_hidden": false
}
Expand All @@ -93,6 +109,74 @@
"os.environ[\"JIRA_CLOUD\"] = \"True\""
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "c0768000-227b-4aa1-a838-4befbdefadb1",
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-02T17:42:00.792867Z",
"iopub.status.busy": "2024-10-02T17:42:00.792365Z",
"iopub.status.idle": "2024-10-02T17:42:00.816979Z",
"shell.execute_reply": "2024-10-02T17:42:00.816419Z",
"shell.execute_reply.started": "2024-10-02T17:42:00.792827Z"
}
},
"outputs": [],
"source": [
"llm = OpenAI(temperature=0)\n",
"jira = JiraAPIWrapper()\n",
"toolkit = JiraToolkit.from_jira_api_wrapper(jira)"
]
},
{
"cell_type": "markdown",
"id": "961b3187-daf0-4907-9cc0-a69796fba4aa",
"metadata": {},
"source": [
"## Tool usage\n",
"\n",
"Let's see what individual tools are in the Jira toolkit:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "eb5cf521-9a91-44bc-b68e-bc4067d05a76",
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-02T17:42:27.232022Z",
"iopub.status.busy": "2024-10-02T17:42:27.231140Z",
"iopub.status.idle": "2024-10-02T17:42:27.240169Z",
"shell.execute_reply": "2024-10-02T17:42:27.239693Z",
"shell.execute_reply.started": "2024-10-02T17:42:27.231949Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"[('JQL Query',\n",
" '\\n This tool is a wrapper around atlassian-python-api\\'s Jira jql API, useful when you need to search for Jira issues.\\n The input to this tool is a JQL query string, and will be passed into atlassian-python-api\\'s Jira `jql` function,\\n For example, to find all the issues in project \"Test\" assigned to the me, you would pass in the following string:\\n project = Test AND assignee = currentUser()\\n or to find issues with summaries that contain the word \"test\", you would pass in the following string:\\n summary ~ \\'test\\'\\n '),\n",
" ('Get Projects',\n",
" \"\\n This tool is a wrapper around atlassian-python-api's Jira project API, \\n useful when you need to fetch all the projects the user has access to, find out how many projects there are, or as an intermediary step that involv searching by projects. \\n there is no input to this tool.\\n \"),\n",
" ('Create Issue',\n",
" '\\n This tool is a wrapper around atlassian-python-api\\'s Jira issue_create API, useful when you need to create a Jira issue. \\n The input to this tool is a dictionary specifying the fields of the Jira issue, and will be passed into atlassian-python-api\\'s Jira `issue_create` function.\\n For example, to create a low priority task called \"test issue\" with description \"test description\", you would pass in the following dictionary: \\n {{\"summary\": \"test issue\", \"description\": \"test description\", \"issuetype\": {{\"name\": \"Task\"}}, \"priority\": {{\"name\": \"Low\"}}}}\\n '),\n",
" ('Catch all Jira API call',\n",
" '\\n This tool is a wrapper around atlassian-python-api\\'s Jira API.\\n There are other dedicated tools for fetching all projects, and creating and searching for issues, \\n use this tool if you need to perform any other actions allowed by the atlassian-python-api Jira API.\\n The input to this tool is a dictionary specifying a function from atlassian-python-api\\'s Jira API, \\n as well as a list of arguments and dictionary of keyword arguments to pass into the function.\\n For example, to get all the users in a group, while increasing the max number of results to 100, you would\\n pass in the following dictionary: {{\"function\": \"get_all_users_from_group\", \"args\": [\"group\"], \"kwargs\": {{\"limit\":100}} }}\\n or to find out how many projects are in the Jira instance, you would pass in the following string:\\n {{\"function\": \"projects\"}}\\n For more information on the Jira API, refer to https://atlassian-python-api.readthedocs.io/jira.html\\n '),\n",
" ('Create confluence page',\n",
" 'This tool is a wrapper around atlassian-python-api\\'s Confluence \\natlassian-python-api API, useful when you need to create a Confluence page. The input to this tool is a dictionary \\nspecifying the fields of the Confluence page, and will be passed into atlassian-python-api\\'s Confluence `create_page` \\nfunction. For example, to create a page in the DEMO space titled \"This is the title\" with body \"This is the body. You can use \\n<strong>HTML tags</strong>!\", you would pass in the following dictionary: {{\"space\": \"DEMO\", \"title\":\"This is the \\ntitle\",\"body\":\"This is the body. You can use <strong>HTML tags</strong>!\"}} ')]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"[(tool.name, tool.description) for tool in toolkit.get_tools()]"
]
},
{
"cell_type": "code",
"execution_count": 5,
Expand All @@ -105,9 +189,6 @@
},
"outputs": [],
"source": [
"llm = OpenAI(temperature=0)\n",
"jira = JiraAPIWrapper()\n",
"toolkit = JiraToolkit.from_jira_api_wrapper(jira)\n",
"agent = initialize_agent(\n",
" toolkit.get_tools(), llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True\n",
")"
Expand Down
62 changes: 59 additions & 3 deletions docs/docs/integrations/tools/json.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "ff988466-c389-4ec6-b6ac-14364a537fd5",
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-02T17:52:40.107644Z",
"iopub.status.busy": "2024-10-02T17:52:40.107485Z",
"iopub.status.idle": "2024-10-02T17:52:40.110169Z",
"shell.execute_reply": "2024-10-02T17:52:40.109841Z",
"shell.execute_reply.started": "2024-10-02T17:52:40.107633Z"
},
"tags": []
},
"outputs": [],
Expand All @@ -50,23 +57,72 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"id": "9ecd1ba0-3937-4359-a41e-68605f0596a1",
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-02T17:59:54.134295Z",
"iopub.status.busy": "2024-10-02T17:59:54.134138Z",
"iopub.status.idle": "2024-10-02T17:59:54.137250Z",
"shell.execute_reply": "2024-10-02T17:59:54.136636Z",
"shell.execute_reply.started": "2024-10-02T17:59:54.134283Z"
},
"tags": []
},
"outputs": [],
"source": [
"with open(\"openai_openapi.yml\") as f:\n",
" data = yaml.load(f, Loader=yaml.FullLoader)\n",
"json_spec = JsonSpec(dict_=data, max_value_length=4000)\n",
"json_spec = JsonSpec(dict_={}, max_value_length=4000)\n",
"json_toolkit = JsonToolkit(spec=json_spec)\n",
"\n",
"json_agent_executor = create_json_agent(\n",
" llm=OpenAI(temperature=0), toolkit=json_toolkit, verbose=True\n",
")"
]
},
{
"cell_type": "markdown",
"id": "910eccbc-9d42-49b6-a4ca-1fbc418fcee7",
"metadata": {},
"source": [
"## Individual tools\n",
"\n",
"Let's see what individual tools are inside the Jira toolkit."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "b16a3ee5-ca16-452e-993f-c27228b945ac",
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-02T18:00:30.527665Z",
"iopub.status.busy": "2024-10-02T18:00:30.527053Z",
"iopub.status.idle": "2024-10-02T18:00:30.538483Z",
"shell.execute_reply": "2024-10-02T18:00:30.537672Z",
"shell.execute_reply.started": "2024-10-02T18:00:30.527626Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"[('json_spec_list_keys',\n",
" '\\n Can be used to list all keys at a given path. \\n Before calling this you should be SURE that the path to this exists.\\n The input is a text representation of the path to the dict in Python syntax (e.g. data[\"key1\"][0][\"key2\"]).\\n '),\n",
" ('json_spec_get_value',\n",
" '\\n Can be used to see value in string format at a given path.\\n Before calling this you should be SURE that the path to this exists.\\n The input is a text representation of the path to the dict in Python syntax (e.g. data[\"key1\"][0][\"key2\"]).\\n ')]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"[(el.name, el.description) for el in json_toolkit.get_tools()]"
]
},
{
"cell_type": "markdown",
"id": "05cfcb24-4389-4b8f-ad9e-466e3fca8db0",
Expand Down

0 comments on commit c3cb56a

Please sign in to comment.