Rename project: maxclaw → langcode
- Renamed all references from maxclaw to langcode across all files - Renamed maxclaw.py → langcode.py - Renamed completion scripts: maxclaw.bash/zsh → langcode.bash/zsh - Updated Dockerfile, README, all Python files, HTML, JSON, YAML - New Gitea repository: http://192.168.0.183:8085/truetype/langcode_agent.git
This commit is contained in:
1 parent
0612b290d5
commit
eda22811ce
39 files changed
+231
-231
No files matched your search
+7
-7
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Performance optimizations for MaxClaw Agent
|
||||
Performance optimizations for LangCode Agent
|
||||
Enhanced with connection pooling, lazy loading, and advanced caching
|
||||
"""
|
||||
import os
|
||||
@@ -379,26 +379,26 @@ def optimize_provider_tools():
|
||||
|
||||
def optimize_agent_creation():
|
||||
"""Optimize agent creation with caching"""
|
||||
from main import create_maxclaw_agent
|
||||
from main import create_langcode_agent
|
||||
|
||||
# Cache agent creation
|
||||
original_create_maxclaw_agent = create_maxclaw_agent
|
||||
original_create_langcode_agent = create_langcode_agent
|
||||
|
||||
@functools.wraps(original_create_maxclaw_agent)
|
||||
def optimized_create_maxclaw_agent(system_prompt=None):
|
||||
@functools.wraps(original_create_langcode_agent)
|
||||
def optimized_create_langcode_agent(system_prompt=None):
|
||||
cache_key = f"agent:{system_prompt}"
|
||||
if cache_key in performance_monitor.cache:
|
||||
cached_time, cached_result = performance_monitor.cache[cache_key]
|
||||
if time.time() - cached_time < 600: # Cache for 10 minutes
|
||||
return cached_result
|
||||
|
||||
result = original_create_maxclaw_agent(system_prompt)
|
||||
result = original_create_langcode_agent(system_prompt)
|
||||
performance_monitor.cache[cache_key] = (time.time(), result)
|
||||
return result
|
||||
|
||||
# Replace function
|
||||
import main
|
||||
main.create_maxclaw_agent = optimized_create_maxclaw_agent
|
||||
main.create_langcode_agent = optimized_create_langcode_agent
|
||||
|
||||
print("✅ Agent creation optimized with caching")
|
||||
|
||||
|
||||
Reference in new issue
Block a user