aicippy 2.2.2__tar.gz → 2.2.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.
- {aicippy-2.2.2/src/aicippy.egg-info → aicippy-2.2.4}/PKG-INFO +1 -1
- {aicippy-2.2.2 → aicippy-2.2.4}/pyproject.toml +1 -1
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/__init__.py +1 -1
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/agents/bedrock_agent.py +81 -19
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/main.py +1 -2
- {aicippy-2.2.2 → aicippy-2.2.4/src/aicippy.egg-info}/PKG-INFO +1 -1
- {aicippy-2.2.2 → aicippy-2.2.4}/LICENSE +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/README.md +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/setup.cfg +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/__main__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/agents/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/agents/formatter.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/agents/models.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/agents/orchestrator.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/agents/status.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/agents/usage.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/auth/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/auth/cognito.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/auth/file_storage.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/auth/keychain.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/auth/models.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/billing/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/billing/credit_manager.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/billing/models.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/billing/plan_validator.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/ai_command_executor.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/human_verify.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/interactive.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/mascot.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/screenshot.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/shell_executor.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/terminal_caps.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/themes.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/ui_components.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/cli/upload_manager.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/config.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/connectors/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/connectors/aws.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/connectors/base.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/connectors/firebase.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/connectors/github.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/connectors/registry.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/connectors/shell.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/exceptions.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/auto_updater.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/dependency_manager.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/env_manager.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/main.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/permission_manager.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/platform_detect.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/progress_ui.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/installer/session_manager.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/knowledge/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/knowledge/crawler.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/knowledge/indexer.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/knowledge/project_scanner.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/knowledge/summarizer.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/memory/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/memory/history.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/memory/tenant_memory.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/memory/workspace_memory.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/notifications/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/notifications/email.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/platform/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/platform/app_client.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/platform/client.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/platform/contracts.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/platform/db_reader.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/platform/models.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/platform/tenant_context.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/py.typed +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/security/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/security/audit_client.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/security/formatter.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/security/models.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/types.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/utils/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/utils/async_utils.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/utils/correlation.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/utils/logging.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/utils/network.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/utils/retry.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/websocket/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/websocket/client.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/websocket/models.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/workspace/__init__.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy/workspace/ref_folder.py +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy.egg-info/SOURCES.txt +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy.egg-info/dependency_links.txt +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy.egg-info/entry_points.txt +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy.egg-info/requires.txt +0 -0
- {aicippy-2.2.2 → aicippy-2.2.4}/src/aicippy.egg-info/top_level.txt +0 -0
|
@@ -29,7 +29,7 @@ from __future__ import annotations
|
|
|
29
29
|
from typing import Final
|
|
30
30
|
|
|
31
31
|
# Package metadata
|
|
32
|
-
__version__: Final[str] = "2.2.
|
|
32
|
+
__version__: Final[str] = "2.2.4"
|
|
33
33
|
__author__: Final[str] = "Aravind Jayamohan"
|
|
34
34
|
__email__: Final[str] = "support@aicippy.com"
|
|
35
35
|
__license__: Final[str] = "Proprietary"
|
|
@@ -31,6 +31,46 @@ AGENT_READ_TIMEOUT: Final[int] = 900
|
|
|
31
31
|
AGENT_CONNECT_TIMEOUT: Final[int] = 30
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
def _clean_agent_response(text: str) -> str:
|
|
35
|
+
"""Strip tool call artifacts leaked by the Bedrock agent orchestration.
|
|
36
|
+
|
|
37
|
+
Removes patterns like:
|
|
38
|
+
- AgentCommunication__sendMessage(recipient="User", content="...")
|
|
39
|
+
- get__codeinterpreteraction__execute(...)
|
|
40
|
+
- ", "recipient": "User"}}
|
|
41
|
+
- </sources> tags
|
|
42
|
+
- Trailing ") or "}) artifacts
|
|
43
|
+
"""
|
|
44
|
+
import re
|
|
45
|
+
|
|
46
|
+
# Remove AgentCommunication__sendMessage wrapper
|
|
47
|
+
text = re.sub(
|
|
48
|
+
r'AgentCommunication__sendMessage\s*\(\s*recipient\s*=\s*"User"\s*,\s*content\s*=\s*"',
|
|
49
|
+
"",
|
|
50
|
+
text,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# Remove tool call references like get__codeinterpreteraction__execute
|
|
54
|
+
text = re.sub(r'get__\w+__\w+\s*\([^)]*\)', "", text)
|
|
55
|
+
text = re.sub(
|
|
56
|
+
r'(I will call the|To get the final answer, I will call the)\s+`?\w+__\w+`?\s+(function|tool)[^.]*\.',
|
|
57
|
+
"",
|
|
58
|
+
text,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Remove trailing JSON artifacts from tool calls
|
|
62
|
+
text = re.sub(r',\s*"recipient"\s*:\s*"User"\s*\}\s*\}?\s*$', "", text)
|
|
63
|
+
|
|
64
|
+
# Remove </sources> tags
|
|
65
|
+
text = re.sub(r'</sources>\s*', "", text)
|
|
66
|
+
|
|
67
|
+
# Remove trailing ") or "}) from tool call closures
|
|
68
|
+
text = re.sub(r'"\s*\)\s*$', "", text)
|
|
69
|
+
text = re.sub(r'"\s*\}\s*\)\s*$', "", text)
|
|
70
|
+
|
|
71
|
+
return text.strip()
|
|
72
|
+
|
|
73
|
+
|
|
34
74
|
class BedrockAgentClient:
|
|
35
75
|
"""Client for invoking odin Bedrock Agent with streaming."""
|
|
36
76
|
|
|
@@ -101,31 +141,53 @@ class BedrockAgentClient:
|
|
|
101
141
|
},
|
|
102
142
|
)
|
|
103
143
|
|
|
144
|
+
# Buffer chunks and clean tool call artifacts before emitting
|
|
104
145
|
full_response = ""
|
|
105
|
-
|
|
146
|
+
_buffer = ""
|
|
147
|
+
_tool_prefix_seen = False
|
|
148
|
+
|
|
106
149
|
for event in response.get("completion", []):
|
|
107
150
|
if "chunk" in event:
|
|
108
151
|
chunk_bytes = event["chunk"].get("bytes", b"")
|
|
109
152
|
if chunk_bytes:
|
|
110
153
|
text = chunk_bytes.decode("utf-8")
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
154
|
+
_buffer += text
|
|
155
|
+
|
|
156
|
+
# Detect and strip tool call prefix at start of response
|
|
157
|
+
if not _tool_prefix_seen:
|
|
158
|
+
import re as _re
|
|
159
|
+
# Check if buffer contains the full tool call prefix
|
|
160
|
+
if 'content="' in _buffer:
|
|
161
|
+
_buffer = _re.sub(
|
|
162
|
+
r'^.*?AgentCommunication__sendMessage\s*\(\s*recipient\s*=\s*"User"\s*,\s*content\s*=\s*"',
|
|
163
|
+
"",
|
|
164
|
+
_buffer,
|
|
165
|
+
count=1,
|
|
166
|
+
)
|
|
167
|
+
_tool_prefix_seen = True
|
|
168
|
+
elif len(_buffer) > 200:
|
|
169
|
+
# No tool prefix found — emit as-is
|
|
170
|
+
_tool_prefix_seen = True
|
|
171
|
+
|
|
172
|
+
# Don't emit yet if we haven't resolved the prefix
|
|
173
|
+
if not _tool_prefix_seen:
|
|
174
|
+
continue
|
|
175
|
+
|
|
176
|
+
# Emit the buffered/cleaned text
|
|
177
|
+
to_emit = _buffer
|
|
178
|
+
_buffer = ""
|
|
179
|
+
full_response += to_emit
|
|
180
|
+
if on_token and to_emit:
|
|
181
|
+
on_token(to_emit)
|
|
182
|
+
|
|
183
|
+
# Flush remaining buffer
|
|
184
|
+
if _buffer:
|
|
185
|
+
full_response += _buffer
|
|
186
|
+
if on_token and _buffer:
|
|
187
|
+
on_token(_buffer)
|
|
188
|
+
|
|
189
|
+
# Final cleanup of the complete response
|
|
190
|
+
full_response = _clean_agent_response(full_response)
|
|
129
191
|
return full_response
|
|
130
192
|
|
|
131
193
|
# Run blocking boto3 call in thread pool
|
|
@@ -2169,8 +2169,7 @@ def chat(
|
|
|
2169
2169
|
)
|
|
2170
2170
|
raise typer.Exit(1)
|
|
2171
2171
|
|
|
2172
|
-
#
|
|
2173
|
-
console.print(f"[dim]OdIn agent | Llama 4 Maverick[/dim]")
|
|
2172
|
+
# Silent proceed — no header noise
|
|
2174
2173
|
|
|
2175
2174
|
# Build TenantContext for tenant-scoped orchestration
|
|
2176
2175
|
tenant_ctx = None
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|