lollms-client 0.25.0__tar.gz → 0.25.1__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.
Potentially problematic release.
This version of lollms-client might be problematic. Click here for more details.
- {lollms_client-0.25.0/lollms_client.egg-info → lollms_client-0.25.1}/PKG-INFO +1 -1
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/__init__.py +1 -1
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/openai/__init__.py +27 -7
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_core.py +10 -7
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_discussion.py +4 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/remote_mcp/__init__.py +80 -2
- {lollms_client-0.25.0 → lollms_client-0.25.1/lollms_client.egg-info}/PKG-INFO +1 -1
- {lollms_client-0.25.0 → lollms_client-0.25.1}/LICENSE +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/README.md +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/article_summary/article_summary.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/console_discussion/console_app.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/console_discussion.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/deep_analyze/deep_analyse.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/deep_analyze/deep_analyze_multiple_files.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/function_calling_with_local_custom_mcp.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_a_benchmark_for_safe_store.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_and_speak/generate_and_speak.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_game_sfx/generate_game_fx.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_text_with_multihop_rag_example.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/gradio_chat_app.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/gradio_lollms_chat.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/internet_search_with_rag.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/lollms_discussions_test.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/mcp_examples/external_mcp.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/mcp_examples/local_mcp.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/mcp_examples/openai_mcp.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/mcp_examples/run_remote_mcp_example_v2.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/mcp_examples/run_standard_mcp_example.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/simple_text_gen_test.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/simple_text_gen_with_image_test.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/test_local_models/local_chat.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/text_2_audio.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/text_2_image.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/text_2_image_diffusers.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/text_and_image_2_audio.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/text_gen.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/examples/text_gen_system_prompt.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/llamacpp/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/lollms/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/ollama/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/openllm/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/pythonllamacpp/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/tensor_rt/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/transformers/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/vllm/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_config.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_js_analyzer.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_llm_binding.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_mcp_binding.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_personality.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_python_analyzer.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_stt_binding.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_tti_binding.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_ttm_binding.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_tts_binding.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_ttv_binding.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_types.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/lollms_utilities.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/local_mcp/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/local_mcp/default_tools/file_writer/file_writer.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/local_mcp/default_tools/generate_image_from_prompt/generate_image_from_prompt.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/local_mcp/default_tools/internet_search/internet_search.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/local_mcp/default_tools/python_interpreter/python_interpreter.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/standard_mcp/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/stt_bindings/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/stt_bindings/lollms/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/stt_bindings/whisper/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/stt_bindings/whispercpp/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tti_bindings/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tti_bindings/dalle/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tti_bindings/diffusers/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tti_bindings/gemini/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tti_bindings/lollms/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/ttm_bindings/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/ttm_bindings/audiocraft/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/ttm_bindings/bark/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/ttm_bindings/lollms/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tts_bindings/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tts_bindings/bark/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tts_bindings/lollms/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tts_bindings/piper_tts/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tts_bindings/xtts/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/ttv_bindings/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/ttv_bindings/lollms/__init__.py +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client.egg-info/SOURCES.txt +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client.egg-info/dependency_links.txt +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client.egg-info/requires.txt +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client.egg-info/top_level.txt +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/pyproject.toml +0 -0
- {lollms_client-0.25.0 → lollms_client-0.25.1}/setup.cfg +0 -0
|
@@ -8,7 +8,7 @@ from lollms_client.lollms_utilities import PromptReshaper # Keep general utiliti
|
|
|
8
8
|
from lollms_client.lollms_mcp_binding import LollmsMCPBinding, LollmsMCPBindingManager
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
__version__ = "0.25.
|
|
11
|
+
__version__ = "0.25.1" # Updated version
|
|
12
12
|
|
|
13
13
|
# Optionally, you could define __all__ if you want to be explicit about exports
|
|
14
14
|
__all__ = [
|
|
@@ -104,15 +104,15 @@ class OpenAIBinding(LollmsLLMBinding):
|
|
|
104
104
|
"""
|
|
105
105
|
count = 0
|
|
106
106
|
output = ""
|
|
107
|
+
messages = [
|
|
108
|
+
{
|
|
109
|
+
"role": "system",
|
|
110
|
+
"content": system_prompt or "You are a helpful assistant.",
|
|
111
|
+
}
|
|
112
|
+
]
|
|
107
113
|
|
|
108
114
|
# Prepare messages based on whether images are provided
|
|
109
115
|
if images:
|
|
110
|
-
messages = [
|
|
111
|
-
{
|
|
112
|
-
"role": "system",
|
|
113
|
-
"content": system_prompt,
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
116
|
if split:
|
|
117
117
|
messages += self.split_discussion(prompt,user_keyword=user_keyword, ai_keyword=ai_keyword)
|
|
118
118
|
if images:
|
|
@@ -151,7 +151,27 @@ class OpenAIBinding(LollmsLLMBinding):
|
|
|
151
151
|
)
|
|
152
152
|
|
|
153
153
|
else:
|
|
154
|
-
|
|
154
|
+
|
|
155
|
+
if split:
|
|
156
|
+
messages += self.split_discussion(prompt,user_keyword=user_keyword, ai_keyword=ai_keyword)
|
|
157
|
+
if images:
|
|
158
|
+
messages[-1]["content"] = [
|
|
159
|
+
{
|
|
160
|
+
"type": "text",
|
|
161
|
+
"text": messages[-1]["content"]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
else:
|
|
165
|
+
messages.append({
|
|
166
|
+
'role': 'user',
|
|
167
|
+
'content': [
|
|
168
|
+
{
|
|
169
|
+
"type": "text",
|
|
170
|
+
"text": prompt
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
)
|
|
155
175
|
|
|
156
176
|
# Generate text using the OpenAI API
|
|
157
177
|
if self.completion_format == ELF_COMPLETION_FORMAT.Chat:
|
|
@@ -1443,7 +1443,7 @@ Provide your response as a single JSON object inside a JSON markdown tag. Use th
|
|
|
1443
1443
|
use_mcps: Union[None, bool, List[str]] = None,
|
|
1444
1444
|
use_data_store: Union[None, Dict[str, Callable]] = None,
|
|
1445
1445
|
system_prompt: str = None,
|
|
1446
|
-
reasoning_system_prompt: str = "You are a logical and
|
|
1446
|
+
reasoning_system_prompt: str = "You are a logical AI assistant. Your task is to achieve the user's goal by thinking step-by-step and using the available tools.",
|
|
1447
1447
|
images: Optional[List[str]] = None,
|
|
1448
1448
|
max_reasoning_steps: int = None,
|
|
1449
1449
|
decision_temperature: float = None,
|
|
@@ -1529,6 +1529,8 @@ Provide your response as a single JSON object inside a JSON markdown tag. Use th
|
|
|
1529
1529
|
def log_prompt(prompt, type="prompt"):
|
|
1530
1530
|
ASCIIColors.cyan(f"** DEBUG: {type} **")
|
|
1531
1531
|
ASCIIColors.magenta(prompt[-15000:])
|
|
1532
|
+
prompt_size = self.count_tokens(prompt)
|
|
1533
|
+
ASCIIColors.red(f"Prompt size:{prompt_size}/{self.default_ctx_size}")
|
|
1532
1534
|
ASCIIColors.cyan(f"** DEBUG: DONE **")
|
|
1533
1535
|
|
|
1534
1536
|
# --- Define Inner Helper Functions ---
|
|
@@ -1578,9 +1580,9 @@ Provide your response as a single JSON object inside a JSON markdown tag. Use th
|
|
|
1578
1580
|
|
|
1579
1581
|
# Add the new put_code_in_buffer tool definition
|
|
1580
1582
|
available_tools.append({
|
|
1581
|
-
"name": "
|
|
1582
|
-
"description": "Generates
|
|
1583
|
-
"input_schema": {"type": "object", "properties": {"prompt": {"type": "string", "description": "A detailed natural language description of the code's purpose and requirements."}}, "required": ["prompt"]}
|
|
1583
|
+
"name": "generate_code",
|
|
1584
|
+
"description": """Generates and stores code into a buffer to be used by another tool. You can put the uuid of the generated code into the fields that require long code among the tools. If no tool requires code as input do not use generate_code. generate_code do not execute the code nor does it audit it.""",
|
|
1585
|
+
"input_schema": {"type": "object", "properties": {"prompt": {"type": "string", "description": "A detailed natural language description of the code's purpose and requirements."}, "language": {"type": "string", "description": "The programming language of the generated code. By default it uses python."}}, "required": ["prompt"]}
|
|
1584
1586
|
})
|
|
1585
1587
|
# Add the new refactor_scratchpad tool definition
|
|
1586
1588
|
available_tools.append({
|
|
@@ -1602,8 +1604,7 @@ Provide your response as a single JSON object inside a JSON markdown tag. Use th
|
|
|
1602
1604
|
user_context = f'Original User Request: "{original_user_prompt}"'
|
|
1603
1605
|
if images: user_context += f'\n(Note: {len(images)} image(s) were provided with this request.)'
|
|
1604
1606
|
|
|
1605
|
-
reasoning_prompt_template = f"""
|
|
1606
|
-
|
|
1607
|
+
reasoning_prompt_template = f"""
|
|
1607
1608
|
--- AVAILABLE TOOLS ---
|
|
1608
1609
|
{formatted_tools_list}
|
|
1609
1610
|
--- CONTEXT ---
|
|
@@ -1762,7 +1763,7 @@ Provide your response as a single JSON object inside a JSON markdown tag. Use th
|
|
|
1762
1763
|
# --- Final Answer Synthesis ---
|
|
1763
1764
|
synthesis_id = log_event("Synthesizing final answer...", MSG_TYPE.MSG_TYPE_STEP_START)
|
|
1764
1765
|
|
|
1765
|
-
final_answer_prompt = f"""
|
|
1766
|
+
final_answer_prompt = f"""
|
|
1766
1767
|
--- Original User Request ---
|
|
1767
1768
|
"{original_user_prompt}"
|
|
1768
1769
|
--- Your Internal Scratchpad (Actions Taken & Findings) ---
|
|
@@ -1773,6 +1774,8 @@ Provide your response as a single JSON object inside a JSON markdown tag. Use th
|
|
|
1773
1774
|
- Do not talk about your internal process unless it's necessary to explain why you couldn't find an answer.
|
|
1774
1775
|
"""
|
|
1775
1776
|
if debug: log_prompt(final_answer_prompt, "FINAL ANSWER SYNTHESIS PROMPT")
|
|
1777
|
+
|
|
1778
|
+
|
|
1776
1779
|
final_answer_text = self.generate_text(prompt=final_answer_prompt, system_prompt=system_prompt, images=images, stream=streaming_callback is not None, streaming_callback=streaming_callback, temperature=final_answer_temperature, **llm_generation_kwargs)
|
|
1777
1780
|
final_answer = self.remove_thinking_blocks(final_answer_text)
|
|
1778
1781
|
if debug: log_prompt(final_answer_text, "FINAL ANSWER RESPONSE")
|
|
@@ -423,6 +423,10 @@ class LollmsDiscussion:
|
|
|
423
423
|
else:
|
|
424
424
|
return cls(lollmsClient=lollms_client, discussion_id=kwargs.get('id'), **init_args)
|
|
425
425
|
|
|
426
|
+
def get_messages(self):
|
|
427
|
+
"""Returns the list of messages"""
|
|
428
|
+
return self._db_discussion.messages
|
|
429
|
+
|
|
426
430
|
def __getattr__(self, name: str) -> Any:
|
|
427
431
|
"""Proxies attribute getting to the underlying discussion object."""
|
|
428
432
|
if name == 'metadata':
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/remote_mcp/__init__.py
RENAMED
|
@@ -119,7 +119,26 @@ class RemoteMCPBinding(LollmsMCPBinding):
|
|
|
119
119
|
future = asyncio.run_coroutine_threadsafe(coro, self._loop)
|
|
120
120
|
return future.result(timeout)
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
def _prepare_headers(self, alias: str) -> Dict[str, str]:
|
|
123
|
+
"""Prepares the headers dictionary from the server's auth_config."""
|
|
124
|
+
server_info = self.servers[alias]
|
|
125
|
+
auth_config = server_info.get("auth_config", {})
|
|
126
|
+
headers = {}
|
|
127
|
+
auth_type = auth_config.get("type")
|
|
128
|
+
if auth_type == "api_key":
|
|
129
|
+
api_key = auth_config.get("key")
|
|
130
|
+
header_name = auth_config.get("header_name", "X-API-Key") # Default to X-API-Key
|
|
131
|
+
if api_key:
|
|
132
|
+
headers[header_name] = api_key
|
|
133
|
+
ASCIIColors.info(f"{self.binding_name}: Using API Key authentication for server '{alias}'.")
|
|
134
|
+
|
|
135
|
+
elif auth_type == "bearer": # <-- NEW BLOCK
|
|
136
|
+
token = auth_config.get("token")
|
|
137
|
+
if token:
|
|
138
|
+
headers["Authorization"] = f"Bearer {token}"
|
|
139
|
+
|
|
140
|
+
return headers
|
|
141
|
+
|
|
123
142
|
async def _initialize_connection_async(self, alias: str) -> bool:
|
|
124
143
|
server_info = self.servers[alias]
|
|
125
144
|
if server_info["initialized"]:
|
|
@@ -128,10 +147,13 @@ class RemoteMCPBinding(LollmsMCPBinding):
|
|
|
128
147
|
server_url = server_info["url"]
|
|
129
148
|
ASCIIColors.info(f"{self.binding_name}: Initializing connection to '{alias}' ({server_url})...")
|
|
130
149
|
try:
|
|
150
|
+
# Prepare authentication headers
|
|
151
|
+
auth_headers = self._prepare_headers(alias)
|
|
152
|
+
|
|
131
153
|
exit_stack = AsyncExitStack()
|
|
132
154
|
|
|
133
155
|
client_streams = await exit_stack.enter_async_context(
|
|
134
|
-
streamablehttp_client(server_url)
|
|
156
|
+
streamablehttp_client(url=server_url, headers=auth_headers) # Pass the headers here
|
|
135
157
|
)
|
|
136
158
|
read_stream, write_stream, _ = client_streams
|
|
137
159
|
|
|
@@ -343,3 +365,59 @@ class RemoteMCPBinding(LollmsMCPBinding):
|
|
|
343
365
|
|
|
344
366
|
def get_binding_config(self) -> Dict[str, Any]:
|
|
345
367
|
return self.config
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
def set_auth_config(self, alias: str, auth_config: Dict[str, Any]):
|
|
371
|
+
"""
|
|
372
|
+
Dynamically updates the authentication configuration for a specific server.
|
|
373
|
+
|
|
374
|
+
If a connection was already active for this server, it will be closed to force
|
|
375
|
+
a new connection with the new authentication details on the next call.
|
|
376
|
+
|
|
377
|
+
Args:
|
|
378
|
+
alias (str): The alias of the server to update (the key in servers_infos).
|
|
379
|
+
auth_config (Dict[str, Any]): The new authentication configuration dictionary.
|
|
380
|
+
Example: {"type": "bearer", "token": "new-token-here"}
|
|
381
|
+
"""
|
|
382
|
+
ASCIIColors.info(f"{self.binding_name}: Updating auth_config for server '{alias}'.")
|
|
383
|
+
|
|
384
|
+
server_info = self.servers.get(alias)
|
|
385
|
+
if not server_info:
|
|
386
|
+
raise ValueError(f"Server alias '{alias}' does not exist in the configuration.")
|
|
387
|
+
|
|
388
|
+
# Update the configuration in the binding's internal state
|
|
389
|
+
server_info["config"]["auth_config"] = auth_config
|
|
390
|
+
|
|
391
|
+
# If the server was already initialized, its connection is now obsolete.
|
|
392
|
+
# We must close it and mark it as uninitialized.
|
|
393
|
+
if server_info["initialized"]:
|
|
394
|
+
ASCIIColors.warning(f"{self.binding_name}: Existing connection for '{alias}' is outdated due to new authentication. It will be reset.")
|
|
395
|
+
try:
|
|
396
|
+
# Execute the close operation asynchronously on the event loop thread
|
|
397
|
+
self._run_async(self._close_connection_async(alias), timeout=10.0)
|
|
398
|
+
except Exception as e:
|
|
399
|
+
ASCIIColors.error(f"{self.binding_name}: Error while closing the outdated connection for '{alias}': {e}")
|
|
400
|
+
# Even on error, reset the state to force a new connection attempt
|
|
401
|
+
server_info.update({"session": None, "exit_stack": None, "initialized": False})
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
# --- NEW INTERNAL HELPER METHOD ---
|
|
405
|
+
async def _close_connection_async(self, alias: str):
|
|
406
|
+
"""Cleanly closes the connection for a specific server alias."""
|
|
407
|
+
server_info = self.servers.get(alias)
|
|
408
|
+
if not server_info or not server_info.get("exit_stack"):
|
|
409
|
+
return # Nothing to do.
|
|
410
|
+
|
|
411
|
+
ASCIIColors.info(f"{self.binding_name}: Closing connection for '{alias}'...")
|
|
412
|
+
try:
|
|
413
|
+
await server_info["exit_stack"].aclose()
|
|
414
|
+
except Exception as e:
|
|
415
|
+
trace_exception(e)
|
|
416
|
+
ASCIIColors.error(f"{self.binding_name}: Exception while closing the exit_stack for '{alias}': {e}")
|
|
417
|
+
finally:
|
|
418
|
+
# Reset the state for this alias, no matter what.
|
|
419
|
+
server_info.update({
|
|
420
|
+
"session": None,
|
|
421
|
+
"exit_stack": None,
|
|
422
|
+
"initialized": False
|
|
423
|
+
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/deep_analyze/deep_analyze_multiple_files.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/function_calling_with_local_custom_mcp.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_a_benchmark_for_safe_store.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_and_speak/generate_and_speak.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_game_sfx/generate_game_fx.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/generate_text_with_multihop_rag_example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/mcp_examples/run_remote_mcp_example_v2.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/examples/mcp_examples/run_standard_mcp_example.py
RENAMED
|
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
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/llamacpp/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/openllm/__init__.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/pythonllamacpp/__init__.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/tensor_rt/__init__.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/llm_bindings/transformers/__init__.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/local_mcp/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/mcp_bindings/standard_mcp/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/stt_bindings/whisper/__init__.py
RENAMED
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/stt_bindings/whispercpp/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tti_bindings/diffusers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/ttm_bindings/audiocraft/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lollms_client-0.25.0 → lollms_client-0.25.1}/lollms_client/tts_bindings/piper_tts/__init__.py
RENAMED
|
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
|