LLM helper library.
Project description
llmhelper
LLM helper library.
安装
pip install llmhelper
环境变量
- OPENAI_API_KEY
- OPENAI_BASE_URL
- OPENAI_CHAT_MODEL
- OPENAI_EMBEDDINGS_MODEL
- OPENAI_RERANK_MODEL
- LLMHELPER_REDIS_STACK_URLS
LLMHELPER_REDIS_STACK_URLS
LLMHELPER_REDIS_STACK_URLS
是字典类型,表示指定索引的向量数据库地址。例如:
LLMHELPER_REDIS_STACK_URLS = {
"default": "redis://localhost:6379/0",
"kb:qa": "redis://192.168.1.31:6379/0",
"kb:doc": "redis://192.168.1.32:6379/0",
"ai:instruct": "redis://192.168.1.33:6379/0",
}
工具集
- exceptions
- ParseJsonResponseError
- ChatError
- GetTextEmbeddingsError
- GetRerankScoresError
- NoneValueError
- VectorStoreNoneValueError
- EmbeddingsNoneValueError
- RerankNoneValueError
- base
- get_llmhelper_config
- set_llmhelper_default_config
- set_llmhelper_config
- get_default_llm
- get_default_chat_model
- get_default_embeddings_model
- get_default_rerank_model
- get_template_engine
- get_llm_base_url
- get_llm_api_url
- template
- get_template_prompt_by_django_template_engine
- get_template_prompt_by_jinjia2
- get_template_prompt
- llm
- get_messages
- parse_json_response
- chat
- jsonchat
- streaming_chat
- embeddings
- OpenAIEmbeddings
- get_text_embeddings
- rerank
- get_rerank_scores
- vectorestores
- RedisVectorStore
版本记录
v0.1.0
- 版本首发。
v0.2.0
- 添加embeddings模型操作支持。
- 添加rerank模型操作支持。
v0.3.0
- 添加向量数据库操作支持。
v0.4.0
- 添加django_vectorstore_index_model抽象类。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
llmhelper-0.4.0.tar.gz
(16.4 kB
view details)
Built Distribution
llmhelper-0.4.0-py3-none-any.whl
(18.9 kB
view details)
File details
Details for the file llmhelper-0.4.0.tar.gz
.
File metadata
- Download URL: llmhelper-0.4.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c43583993cc30318d88586053b6feb5e0def2e17c6f526f154ee3000e8ffe6c6 |
|
MD5 | 677cad41cf038552d2faaee5fbe0d6d6 |
|
BLAKE2b-256 | 83b9b27889d8494be4b51e0826edb05676c79dc1f9db34ddfbbce453bec101b8 |
File details
Details for the file llmhelper-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: llmhelper-0.4.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ee0fe3bcf07e849ea0b76c1dd8bd46b3d172e306f90f7287d1f588d89f3299b |
|
MD5 | 84c380c5dfa608c97ec14492f32165a7 |
|
BLAKE2b-256 | e674e7fbc6cfcb41c7b48a147e61715559b5b6deb27e8749d3c62f0c5724056d |