gemini-agent-framework 0.1.13__tar.gz → 0.1.14__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.
Files changed (29) hide show
  1. gemini_agent_framework-0.1.14/.github/workflows/deploy-docs.yml +1 -0
  2. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/PKG-INFO +2 -2
  3. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/pyproject.toml +2 -2
  4. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/src/gemini_agent/__init__.py +1 -1
  5. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/src/gemini_agent/agent.py +31 -25
  6. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/.flake8 +0 -0
  7. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/.github/workflows/ci.yml +0 -0
  8. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/.github/workflows/docs.yml +0 -0
  9. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/.github/workflows/python-publish.yml +0 -0
  10. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/.github/workflows/tests.yml +0 -0
  11. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/.gitignore +0 -0
  12. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/CHANGELOG.md +0 -0
  13. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/CODE_OF_CONDUCT.md +0 -0
  14. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/CONTRIBUTING.md +0 -0
  15. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/LICENSE +0 -0
  16. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/README.md +0 -0
  17. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/docs/api_reference.md +0 -0
  18. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/docs/architecture.md +0 -0
  19. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/docs/best_practices.md +0 -0
  20. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/docs/index.md +0 -0
  21. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/docs/installation.md +0 -0
  22. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/docs/tutorials.md +0 -0
  23. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/mkdocs.yml +0 -0
  24. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/payload_variable_0.json +0 -0
  25. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/requirements.txt +0 -0
  26. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/tests/__init__.py +0 -0
  27. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/tests/test_agent.py +0 -0
  28. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/tests/test_class_methods.py +0 -0
  29. {gemini_agent_framework-0.1.13 → gemini_agent_framework-0.1.14}/tests/test_variables.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gemini-agent-framework
3
- Version: 0.1.13
3
+ Version: 0.1.14
4
4
  Summary: A framework for building agents that use Gemini's function calling capabilities
5
5
  Project-URL: Homepage, https://github.com/m7mdony/gemini-agent-framework
6
- Project-URL: Documentation, https://github.com/m7mdony/gemini-agent-framework/wiki
6
+ Project-URL: Documentation, https://m7mdony.github.io/gemini-agent-framework
7
7
  Project-URL: Repository, https://github.com/m7mdony/gemini-agent-framework.git
8
8
  Project-URL: Issues, https://github.com/m7mdony/gemini-agent-framework/issues
9
9
  Author-email: Mohamed Baathman <mohamed.baathman2001@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "gemini-agent-framework"
7
- version = "0.1.13"
7
+ version = "0.1.14"
8
8
  description = "A framework for building agents that use Gemini's function calling capabilities"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -30,7 +30,7 @@ dependencies = [
30
30
 
31
31
  [project.urls]
32
32
  Homepage = "https://github.com/m7mdony/gemini-agent-framework"
33
- Documentation = "https://github.com/m7mdony/gemini-agent-framework/wiki"
33
+ Documentation = "https://m7mdony.github.io/gemini-agent-framework"
34
34
  Repository = "https://github.com/m7mdony/gemini-agent-framework.git"
35
35
  Issues = "https://github.com/m7mdony/gemini-agent-framework/issues"
36
36
 
@@ -1,4 +1,4 @@
1
1
  from .agent import Agent
2
2
 
3
- __version__ = "0.1.13"
3
+ __version__ = "0.1.14"
4
4
  __all__ = ["Agent"]
@@ -4,9 +4,12 @@ from datetime import datetime
4
4
  from functools import wraps
5
5
  from typing import Any, Callable, Dict, List, Optional, Type, Union, Collection
6
6
 
7
+
7
8
  import requests
8
9
  from dotenv import load_dotenv
9
10
 
11
+
12
+
10
13
  load_dotenv()
11
14
 
12
15
 
@@ -237,14 +240,7 @@ class Agent:
237
240
  ]
238
241
  )
239
242
 
240
- return """You are an AI assistant that can break down complex tasks into sequential steps using available tools.
241
- When faced with a complex request:
242
- 1. Analyze the request to identify which tools can be used
243
- 2. Break down the request into sequential steps
244
- 3. For each step:
245
- - Use the most appropriate tool
246
- - Store the result for use in subsequent steps
247
- 4. Combine the results to provide a final answer
243
+ return """
248
244
 
249
245
  Available tools:
250
246
  {tools_list}
@@ -281,11 +277,26 @@ class Agent:
281
277
  """Substitutes variable references in arguments with their actual values."""
282
278
  result = {}
283
279
  for key, value in args.items():
280
+ print("substituting variables", key, value)
284
281
  if isinstance(value, str) and value.startswith("$"):
282
+ print("is string and starts with $")
283
+ # Handle $ prefixed variables
285
284
  var_name = value[1:]
286
285
  if var_name in self._stored_variables:
286
+ print("substituted")
287
+
288
+ result[key] = self._stored_variables[var_name]["value"]
289
+ else:
290
+ result[key] = value
291
+ elif isinstance(value, dict) and "variable" in value:
292
+ print("is dict and has variable")
293
+ # Handle dictionary-style variable references
294
+ var_name = value["variable"]
295
+ if var_name in self._stored_variables:
296
+ print("substituted")
287
297
  result[key] = self._stored_variables[var_name]["value"]
288
298
  else:
299
+ print("substituted")
289
300
  result[key] = value
290
301
  else:
291
302
  result[key] = value
@@ -328,21 +339,17 @@ class Agent:
328
339
  system_prompt = self._get_system_prompt() + system_prompt
329
340
 
330
341
  current_contents = conversation_history if conversation_history else []
331
- if system_prompt and not current_contents:
332
- current_contents.append({"role": "user", "parts": [{"text": system_prompt}]})
333
- current_contents.append(
334
- {
335
- "role": "model",
336
- "parts": [
337
- {
338
- "text": "I understand I should break down complex tasks into sequential steps using the available tools and variables."
339
- }
340
- ],
341
- }
342
- )
342
+
343
+ # Add system instruction to payload
344
+ payload: Dict[str, Any] = {
345
+ "system_instruction": {
346
+ "parts": [{"text": system_prompt}]
347
+ },
348
+ "contents": current_contents
349
+ }
343
350
 
344
- current_contents.append({"role": "user", "parts": [{"text": user_prompt}]})
345
- payload: Dict[str, Any] = {"contents": current_contents}
351
+ # Add user prompt to contents
352
+ payload["contents"].append({"role": "user", "parts": [{"text": user_prompt}]})
346
353
 
347
354
  if self._registered_tools_json:
348
355
  payload["tools"] = [{"functionDeclarations": self._registered_tools_json}]
@@ -366,9 +373,9 @@ class Agent:
366
373
  }
367
374
  final_mime_type = "application/json"
368
375
  final_response_schema = response_structure
369
-
376
+
370
377
  while True:
371
-
378
+
372
379
  response_data = self._call_gemini_api(payload)
373
380
  if "error" in response_data:
374
381
  print(
@@ -577,7 +584,6 @@ class Agent:
577
584
  )
578
585
  return final_text
579
586
  return final_text
580
-
581
587
  continue
582
588
 
583
589
  except (KeyError, IndexError) as e: