```python
import json
import re
from pathlib import Path
def parse_markdown_to_sidebar(markdown_content):
lines = markdown_content.splitlines()
sidebar = []
current_category = None
current_subcategory = None
for line in lines:
if line.startswith('### '):
# Subcategory
if current_subcategory is not None:
current_category['items'].append(current_subcategory)
subcategory_title = line.strip('# ').strip()
current_subcategory = {
"type": "category",
"label": subcategory_title,
"collapsed": True,
"items": [],
"link": {"type": "generated-index"}
}
elif line.startswith('## '):
# Category
if current_category is not None:
if current_subcategory is not None:
current_category['items'].append(current_subcategory)
current_subcategory = None
sidebar.append(current_category)
category_title = line.strip('# ').strip()
current_category = {
"type": "category",
"label": category_title,
"collapsed": True,
"items": [],
"link": {"type": "generated-index"}
}
elif line.startswith('- ['):
# Link
match = re.match(r'- \[(.*?)\]\((.*?)\)', line)
if match:
title, link = match.groups()
link = link.replace('/docs/', '') # Remove '/docs/' prefix
if current_subcategory is not None:
current_subcategory['items'].append(link)
elif current_category is not None:
current_category['items'].append(link)
# Add the last category and subcategory if they exist
if current_subcategory is not None:
current_category['items'].append(current_subcategory)
if current_category is not None:
sidebar.append(current_category)
return sidebar
def generate_sidebar_json(file_path):
with open(file_path, 'r') as md_file:
markdown_content = md_file.read()
sidebar = parse_markdown_to_sidebar(markdown_content)
sidebar_json = json.dumps({"items": sidebar}, indent=2)
return sidebar_json
```
**Description**: ToolKit and Tools for accessing data in a Cassandra
Database primarily for Agent integration. Initially, this includes the
following tools:
- `cassandra_db_schema` Gathers all schema information for the connected
database or a specific schema. Critical for the agent when determining
actions.
- `cassandra_db_select_table_data` Selects data from a specific keyspace
and table. The agent can pass paramaters for a predicate and limits on
the number of returned records.
- `cassandra_db_query` Expiriemental alternative to
`cassandra_db_select_table_data` which takes a query string completely
formed by the agent instead of parameters. May be removed in future
versions.
Includes unit test and two notebooks to demonstrate usage.
**Dependencies**: cassio
**Twitter handle**: @PatrickMcFadin
---------
Co-authored-by: Phil Miesle <phil.miesle@datastax.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
**Description:** This pull request introduces a new feature to community
tools, enhancing its search capabilities by integrating the Mojeek
search engine
**Dependencies:** None
---------
Co-authored-by: Igor Brai <igor@mojeek.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: ccurme <chester.curme@gmail.com>
Thank you for contributing to LangChain!
- [ ] **PR title**: "docs: switched GCSLoaders docs to
langchain-google-community"
- [ ] **PR message**: ***Delete this entire checklist*** and replace
with
- **Description:** switched GCSLoaders docs to
langchain-google-community
Implemented bind_tools for OllamaFunctions.
Made OllamaFunctions sub class of ChatOllama.
Implemented with_structured_output for OllamaFunctions.
integration unit test has been updated.
notebook has been updated.
---------
Co-authored-by: Bagatur <baskaryan@gmail.com>
MindsDB integrates with LangChain, enabling users to deploy, serve, and
fine-tune models available via LangChain within MindsDB, making them
accessible to numerous data sources.
---------
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
* Groundedness Check takes `str` or `list[Document]` as input.
* Deprecate `GroundednessCheck` due to its naming.
* Added `UpstageGroundednessCheck`.
* Hotfix for Groundedness Check parameter.
The name `query` was misleading and it should be `answer` instead.
---------
Co-authored-by: Erick Friis <erick@langchain.dev>
- [ ] **Kinetica Document Loader**: "community: a class to load
Documents from Kinetica"
- [ ] **Kinetica Document Loader**:
- **Description:** implemented KineticaLoader in `kinetica_loader.py`
- **Dependencies:** install the Kinetica API using `pip install
gpudb==7.2.0.1 `
- **Description**:
- **add support for more data types**: by default `IpexLLM` will load
the model in int4 format. This PR adds more data types support such as
`sym_in5`, `sym_int8`, etc. Data formats like NF3, NF4, FP4 and FP8 are
only supported on GPU and will be added in future PR.
- Fix a small issue in saving/loading, update api docs
- **Dependencies**: `ipex-llm` library
- **Document**: In `docs/docs/integrations/llms/ipex_llm.ipynb`, added
instructions for saving/loading low-bit model.
- **Tests**: added new test cases to
`libs/community/tests/integration_tests/llms/test_ipex_llm.py`, added
config params.
- **Contribution maintainer**: @shane-huang