semvec/pypi-packages huggingface dataset:
llm_store 0.1.7
LLM Gateway Service
Requires Python: <4.0,>=3.8

# Feature

- LLM 配置读取远程存储
- Prompt 配置读取远程存储
- LLM 对话记录 存储到远程
- 远程存储: 支持 Baserow
- 支持使用 Jinja2 模板渲染 Prompt

# 使用示例
```python
from llm_store.gateway import LLMGateway
from llm_store.store.baserowstore import BaseRowStore
import os

store = BaseRowStore(
    api_host=os.environ.get("BASEROW_API_HOST", "localhost"),
    api_key=os.environ.get("BASEROW_API_KEY", ""),
    db_code="3",
    model_table_code="614",
    prompt_table_code="308",
    chat_log_table_code="309")

llm_gateway = LLMGateway(store)
prompt_code = "system_blank"

# -- 获取 AI 模型
llm_model = llm_gateway.get_model(prompt_code)

# -- 渲染 Prompt
messages = llm_gateway.render_prompt(prompt_code, {"content": "你是谁"})

# -- 执行对话
chatCompletion = llm_gateway.completions(llm_model, messages, trace_id="1234567890")
print(chatCompletion)
``````

# 约定
## 内置Prompt_code
- system_blank: 格式为 {{content}} , 模型为小参数模型, 一般为 4o-mini
- system_blank_advanced: 格式为: {{content}},  模型为大参数模型, 一般为 4o
llama-index-packs-docugami-kg-rag 0.3.0
This template contains a reference architecture for Retrieval Augmented Generation against a set of documents using Docugami's XML Knowledge Graph (KG-RAG).
Requires Python: <4.0,>=3.9
Keywords: infer, rag, retrieve, retriever

# Docugami KG-RAG Pack

This LlamaPack provides an end-to-end Knowledge Graph Retrieval Augmented Generation flow using Docugami.

## Process Documents in Docugami (before you use this template)

Before you use this llamapack, you must have some documents already processed in Docugami. Here's what you need to get started:

1. Create a [Docugami workspace](https://app.docugami.com/) (free trials available)
1. Create an access token via the Developer Playground for your workspace. [Detailed instructions](https://help.docugami.com/home/docugami-api).
1. Add your documents to Docugami for processing. There are two ways to do this:
   - Upload via the simple Docugami web experience. [Detailed instructions](https://help.docugami.com/home/adding-documents).
   - Upload via the Docugami API, specifically the [documents](https://api-docs.docugami.com/#tag/documents/operation/upload-document) endpoint. Code samples are available for python and JavaScript or you can use the [docugami](https://pypi.org/project/docugami/) python library.

Once your documents are in Docugami, they are processed and organized into sets of similar documents, e.g. NDAs, Lease Agreements, and Service Agreements. Docugami is not limited to any particular types of documents, and the clusters created depend on your particular documents. You can [change the docset assignments](https://help.docugami.com/home/working-with-the-doc-sets-view) later if you wish. You can monitor file status in the simple Docugami webapp, or use a [webhook](https://api-docs.docugami.com/#tag/webhooks) to be informed when your documents are done processing.

## Environment Variables

You need to set some required environment variables before using your new app based on this template. These are used to index as well as run the application, and exceptions are raised if the following required environment variables are not set:

1. `OPENAI_API_KEY`: from the OpenAI platform.
1. `DOCUGAMI_API_KEY`: from the [Docugami Developer Playground](https://help.docugami.com/home/docugami-api)

```shell
export OPENAI_API_KEY=...
export DOCUGAMI_API_KEY=...
```

## Using the llamapack

Once your documents are finished processing, you can build and use the agent by adding the following code

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
DocugamiKgRagPack = download_llama_pack(
    "DocugamiKgRagPack", "./docugami_kg_rag"
)

docset_id = ...
pack = DocugamiKgRagPack()
pack.build_agent_for_docset(docset_id)
pack.run(...)
```