llm-interface 0.1.2__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {llm_interface-0.1.2 → llm_interface-0.1.4}/PKG-INFO +6 -3
- {llm_interface-0.1.2 → llm_interface-0.1.4}/README.md +2 -1
- llm_interface-0.1.4/llm_interface/testing/__init__.py +3 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/testing/mock_llm.py +3 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/pyproject.toml +2 -1
- llm_interface-0.1.2/llm_interface/testing/__init__.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/LICENSE +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/__init__.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/anthropic.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/llm_config.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/llm_interface.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/llm_tool.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/openai.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/pydantic_output_parser.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/remote_ollama.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/ssh.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/testing/helpers.py +0 -0
- {llm_interface-0.1.2 → llm_interface-0.1.4}/llm_interface/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: llm-interface
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: A flexible interface for working with various LLM providers
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: Niels Provos
|
|
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
15
|
Requires-Dist: anthropic (>=0.34.2)
|
|
15
16
|
Requires-Dist: diskcache (>=5.6.3)
|
|
16
17
|
Requires-Dist: ollama (>=0.3.1)
|
|
@@ -18,6 +19,7 @@ Requires-Dist: openai (>=1.42.0)
|
|
|
18
19
|
Requires-Dist: paramiko (>=3.4.1)
|
|
19
20
|
Requires-Dist: pydantic (>=2.8.2)
|
|
20
21
|
Requires-Dist: python-dotenv (>=1.0.1)
|
|
22
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
21
23
|
Description-Content-Type: text/markdown
|
|
22
24
|
|
|
23
25
|
# LLM Interface
|
|
@@ -25,6 +27,7 @@ Description-Content-Type: text/markdown
|
|
|
25
27
|
[](https://badge.fury.io/py/llm-interface)
|
|
26
28
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
27
29
|
[](https://pypi.org/project/llm-interface/)
|
|
30
|
+
[](https://codecov.io/gh/provos/llm-interface)
|
|
28
31
|
|
|
29
32
|
A flexible Python interface for working with various Language Model providers, including OpenAI, Anthropic, and Ollama. This library provides a unified way to interact with different LLM providers while supporting features like structured outputs, tool execution, and response caching.
|
|
30
33
|
|
|
@@ -156,7 +159,7 @@ Required environment variables based on provider:
|
|
|
156
159
|
|
|
157
160
|
- OpenAI: `OPENAI_API_KEY`
|
|
158
161
|
- Anthropic: `ANTHROPIC_API_KEY`
|
|
159
|
-
- Remote Ollama: SSH key loaded in SSH agent
|
|
162
|
+
- Remote Ollama: requires an SSH key to be loaded in SSH agent
|
|
160
163
|
|
|
161
164
|
## Development
|
|
162
165
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://badge.fury.io/py/llm-interface)
|
|
4
4
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
5
|
[](https://pypi.org/project/llm-interface/)
|
|
6
|
+
[](https://codecov.io/gh/provos/llm-interface)
|
|
6
7
|
|
|
7
8
|
A flexible Python interface for working with various Language Model providers, including OpenAI, Anthropic, and Ollama. This library provides a unified way to interact with different LLM providers while supporting features like structured outputs, tool execution, and response caching.
|
|
8
9
|
|
|
@@ -134,7 +135,7 @@ Required environment variables based on provider:
|
|
|
134
135
|
|
|
135
136
|
- OpenAI: `OPENAI_API_KEY`
|
|
136
137
|
- Anthropic: `ANTHROPIC_API_KEY`
|
|
137
|
-
- Remote Ollama: SSH key loaded in SSH agent
|
|
138
|
+
- Remote Ollama: requires an SSH key to be loaded in SSH agent
|
|
138
139
|
|
|
139
140
|
## Development
|
|
140
141
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import re
|
|
2
3
|
from typing import Dict, List, Optional, Pattern, Type, Union
|
|
3
4
|
|
|
@@ -66,6 +67,8 @@ class MockLLM(LLMInterface):
|
|
|
66
67
|
elif msg["role"] == "user":
|
|
67
68
|
full_prompt += f"User: {msg['content']}\n"
|
|
68
69
|
|
|
70
|
+
logging.info(f"Mock LLM received prompt: {full_prompt}")
|
|
71
|
+
|
|
69
72
|
# Try to match the prompt against our patterns
|
|
70
73
|
for mock_response in self.responses:
|
|
71
74
|
if mock_response.pattern.search(full_prompt):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "llm-interface"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.4"
|
|
4
4
|
description = "A flexible interface for working with various LLM providers"
|
|
5
5
|
authors = ["Niels Provos <provos@gmail.com>"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -16,6 +16,7 @@ ollama = ">=0.3.1"
|
|
|
16
16
|
diskcache = ">=5.6.3"
|
|
17
17
|
openai = ">=1.42.0"
|
|
18
18
|
anthropic = ">=0.34.2"
|
|
19
|
+
requests = "^2.32.3"
|
|
19
20
|
|
|
20
21
|
[tool.poetry.group.dev.dependencies]
|
|
21
22
|
pytest = ">=8.3.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|