llm-dialog-manager 0.4.5__tar.gz → 0.4.7__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_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/PKG-INFO +3 -2
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager/__init__.py +1 -1
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager/agent.py +21 -11
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/PKG-INFO +3 -2
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/pyproject.toml +1 -1
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/LICENSE +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/README.md +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager/chat_history.py +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager/key_manager.py +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/SOURCES.txt +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/dependency_links.txt +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/requires.txt +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/top_level.txt +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/setup.cfg +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/tests/test_agent.py +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/tests/test_chat_history.py +0 -0
- {llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/tests/test_key_manager.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: llm_dialog_manager
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.7
|
4
4
|
Summary: A Python package for managing LLM chat conversation history
|
5
5
|
Author-email: xihajun <work@2333.fun>
|
6
6
|
License: MIT
|
@@ -44,6 +44,7 @@ Requires-Dist: pytest-asyncio>=0.21.1; extra == "all"
|
|
44
44
|
Requires-Dist: pytest-cov>=4.1.0; extra == "all"
|
45
45
|
Requires-Dist: black>=23.9.1; extra == "all"
|
46
46
|
Requires-Dist: isort>=5.12.0; extra == "all"
|
47
|
+
Dynamic: license-file
|
47
48
|
|
48
49
|
# LLM Dialog Manager
|
49
50
|
|
@@ -393,17 +393,27 @@ def completion(model: str, messages: List[Dict[str, Union[str, List[Union[str, I
|
|
393
393
|
else: # OpenAI models
|
394
394
|
if model.endswith("-openai"):
|
395
395
|
model = model[:-7] # Remove last 7 characters ("-openai")
|
396
|
-
|
397
|
-
#
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
396
|
+
|
397
|
+
# Initialize OpenAI client with only supported parameters
|
398
|
+
client_kwargs = {"api_key": api_key}
|
399
|
+
if base_url:
|
400
|
+
client_kwargs["base_url"] = base_url
|
401
|
+
client = openai.OpenAI(**client_kwargs)
|
402
|
+
|
403
|
+
# Create base parameters
|
404
|
+
params = {
|
405
|
+
"model": model,
|
406
|
+
"messages": formatted_messages,
|
407
|
+
}
|
408
|
+
|
409
|
+
# Add optional parameters
|
410
|
+
if json_format:
|
411
|
+
params["response_format"] = {"type": "json_object"}
|
412
|
+
if not ("o1" in model or "o3" in model):
|
413
|
+
params["max_tokens"] = max_tokens
|
414
|
+
params["temperature"] = temperature
|
415
|
+
|
416
|
+
response = client.chat.completions.create(**params)
|
407
417
|
return response.choices[0].message.content
|
408
418
|
|
409
419
|
# Release the API key after successful use
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: llm_dialog_manager
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.7
|
4
4
|
Summary: A Python package for managing LLM chat conversation history
|
5
5
|
Author-email: xihajun <work@2333.fun>
|
6
6
|
License: MIT
|
@@ -44,6 +44,7 @@ Requires-Dist: pytest-asyncio>=0.21.1; extra == "all"
|
|
44
44
|
Requires-Dist: pytest-cov>=4.1.0; extra == "all"
|
45
45
|
Requires-Dist: black>=23.9.1; extra == "all"
|
46
46
|
Requires-Dist: isort>=5.12.0; extra == "all"
|
47
|
+
Dynamic: license-file
|
47
48
|
|
48
49
|
# LLM Dialog Manager
|
49
50
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "llm_dialog_manager"
|
7
|
-
version = "0.4.
|
7
|
+
version = "0.4.7"
|
8
8
|
description = "A Python package for managing LLM chat conversation history"
|
9
9
|
readme = "README.md"
|
10
10
|
classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Scientific/Engineering :: Artificial Intelligence",]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/requires.txt
RENAMED
File without changes
|
{llm_dialog_manager-0.4.5 → llm_dialog_manager-0.4.7}/llm_dialog_manager.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|