lambda-agent 0.1.1__tar.gz → 0.1.2__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.
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/PKG-INFO +1 -1
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/agent.py +7 -4
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/cli_setup.py +2 -2
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/config.py +7 -5
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/main.py +40 -4
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent.egg-info/PKG-INFO +1 -1
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/pyproject.toml +1 -1
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/LICENSE +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/README.md +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/__init__.py +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/context.py +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/scratchpad.py +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/spinner.py +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/subagent.py +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/todo.py +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent/tools.py +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent.egg-info/SOURCES.txt +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent.egg-info/dependency_links.txt +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent.egg-info/entry_points.txt +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent.egg-info/requires.txt +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/lambda_agent.egg-info/top_level.txt +0 -0
- {lambda_agent-0.1.1 → lambda_agent-0.1.2}/setup.cfg +0 -0
|
@@ -169,10 +169,13 @@ class Agent:
|
|
|
169
169
|
# Log the user message to the full transcript
|
|
170
170
|
self.transcript.log("user", user_input)
|
|
171
171
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
try:
|
|
173
|
+
# Send the initial user message
|
|
174
|
+
with Spinner():
|
|
175
|
+
response = self.chat_session.send_message(payload)
|
|
176
|
+
turn_usage = turn_usage + self._accumulate(response)
|
|
177
|
+
except Exception as e:
|
|
178
|
+
return f"An error occurred while contacting the API: {str(e)}", turn_usage
|
|
176
179
|
|
|
177
180
|
# The loop will continue as long as Gemini decides to call tools
|
|
178
181
|
while True:
|
|
@@ -17,7 +17,7 @@ def run_setup() -> tuple[str, str]:
|
|
|
17
17
|
if not api_key:
|
|
18
18
|
print("API Key cannot be empty. Please try again.")
|
|
19
19
|
|
|
20
|
-
default_model = "gemini-3.1-
|
|
20
|
+
default_model = "gemini-3.1-pro-preview"
|
|
21
21
|
model_name = input(f"Enter model name (default: {default_model}): ").strip()
|
|
22
22
|
if not model_name:
|
|
23
23
|
model_name = default_model
|
|
@@ -37,7 +37,7 @@ def run_setup() -> tuple[str, str]:
|
|
|
37
37
|
|
|
38
38
|
print(f"\n✅ Setup complete! Configuration saved to {config_file}\n")
|
|
39
39
|
except Exception as e:
|
|
40
|
-
print(f"\n
|
|
40
|
+
print(f"\n Error saving configuration: {e}")
|
|
41
41
|
print("Continuing with in-memory configuration for this session.\n")
|
|
42
42
|
|
|
43
43
|
return api_key, model_name
|
|
@@ -17,14 +17,16 @@ except ImportError:
|
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
API_KEY = os.getenv("API_KEY")
|
|
20
|
-
MODEL_NAME = os.getenv("MODEL_NAME", "gemini-3.1-
|
|
20
|
+
MODEL_NAME = os.getenv("MODEL_NAME", "gemini-3.1-pro-preview")
|
|
21
21
|
|
|
22
22
|
# Models available for /models switching
|
|
23
23
|
AVAILABLE_MODELS = [
|
|
24
|
+
"gemini-3.1-pro-preview",
|
|
25
|
+
"gemini-3-flash-preview",
|
|
24
26
|
"gemini-3.1-flash-lite-preview",
|
|
27
|
+
"gemini-2.5-pro",
|
|
25
28
|
"gemini-2.5-flash",
|
|
26
|
-
"gemini-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"gemini-2.0-flash-lite",
|
|
29
|
+
"gemini-2.5-flash-lite",
|
|
30
|
+
"gemma-4-26b-a4b-it",
|
|
31
|
+
"gemma-4-31b-it",
|
|
30
32
|
]
|
|
@@ -238,13 +238,43 @@ def main():
|
|
|
238
238
|
)
|
|
239
239
|
|
|
240
240
|
while True:
|
|
241
|
+
# Inner loop logic to handle prompt input vs command execution
|
|
241
242
|
try:
|
|
242
|
-
# Styled prompt — uses plain input to keep cursor on same line
|
|
243
243
|
user_input = Prompt.ask(
|
|
244
244
|
"\n[bold bright_yellow] You[/bold bright_yellow]",
|
|
245
245
|
console=console,
|
|
246
246
|
)
|
|
247
|
+
except KeyboardInterrupt:
|
|
248
|
+
console.print()
|
|
249
|
+
# Show session token summary before quitting
|
|
250
|
+
if agent.token_usage.total > 0:
|
|
251
|
+
console.print(
|
|
252
|
+
Panel(
|
|
253
|
+
Text.assemble(
|
|
254
|
+
("Session token usage\n", "bold white"),
|
|
255
|
+
(" Prompt (in): ", "dim"),
|
|
256
|
+
(f"{agent.token_usage.prompt:>10,}\n", "cyan"),
|
|
257
|
+
(" Completion (out): ", "dim"),
|
|
258
|
+
(f"{agent.token_usage.completion:>10,}\n", "cyan"),
|
|
259
|
+
(" Total: ", "dim"),
|
|
260
|
+
(f"{agent.token_usage.total:>10,}", "bold cyan"),
|
|
261
|
+
),
|
|
262
|
+
border_style="cyan",
|
|
263
|
+
box=box.ROUNDED,
|
|
264
|
+
title="[bold cyan]⚡ Token Summary[/bold cyan]",
|
|
265
|
+
title_align="left",
|
|
266
|
+
)
|
|
267
|
+
)
|
|
268
|
+
console.print(
|
|
269
|
+
Panel(
|
|
270
|
+
"[bold cyan]Goodbye! Lambda signing off.[/bold cyan]",
|
|
271
|
+
border_style="cyan",
|
|
272
|
+
box=box.ROUNDED,
|
|
273
|
+
)
|
|
274
|
+
)
|
|
275
|
+
break
|
|
247
276
|
|
|
277
|
+
try:
|
|
248
278
|
if user_input.lower() in ["exit", "quit"]:
|
|
249
279
|
console.print()
|
|
250
280
|
# Show session token summary before quitting
|
|
@@ -300,9 +330,15 @@ def main():
|
|
|
300
330
|
print_token_stats(turn_usage, agent.token_usage)
|
|
301
331
|
|
|
302
332
|
except KeyboardInterrupt:
|
|
303
|
-
console.print(
|
|
304
|
-
|
|
305
|
-
|
|
333
|
+
console.print(
|
|
334
|
+
"\n [bold yellow]⚠ Action cancelled by user.[/bold yellow]"
|
|
335
|
+
)
|
|
336
|
+
continue
|
|
337
|
+
except Exception as e:
|
|
338
|
+
console.print(
|
|
339
|
+
f"\n [bold red]⚠ An unexpected error occurred: {str(e)}[/bold red]"
|
|
340
|
+
)
|
|
341
|
+
continue
|
|
306
342
|
|
|
307
343
|
except Exception as e:
|
|
308
344
|
console.print(
|
|
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
|