roksta 0.2.4__cp311-cp311-win_amd64.whl → 0.2.6__cp311-cp311-win_amd64.whl

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 roksta might be problematic. Click here for more details.

Files changed (79) hide show
  1. roksta/__init__.cp311-win_amd64.pyd +0 -0
  2. roksta/ai/__init__.cp311-win_amd64.pyd +0 -0
  3. roksta/ai/call_ai.cp311-win_amd64.pyd +0 -0
  4. roksta/ai/gemini.cp311-win_amd64.pyd +0 -0
  5. roksta/ai/generic.cp311-win_amd64.pyd +0 -0
  6. roksta/ai/llm.cp311-win_amd64.pyd +0 -0
  7. roksta/ai/openai.cp311-win_amd64.pyd +0 -0
  8. roksta/ai/tools.cp311-win_amd64.pyd +0 -0
  9. roksta/analytics.cp311-win_amd64.pyd +0 -0
  10. roksta/balance.cp311-win_amd64.pyd +0 -0
  11. roksta/build_project.cp311-win_amd64.pyd +0 -0
  12. roksta/chat_workflow.cp311-win_amd64.pyd +0 -0
  13. roksta/check_for_updates.cp311-win_amd64.pyd +0 -0
  14. roksta/checkpoints.cp311-win_amd64.pyd +0 -0
  15. roksta/clarify_goal.cp311-win_amd64.pyd +0 -0
  16. roksta/codebase_listing.cp311-win_amd64.pyd +0 -0
  17. roksta/command_handlers.cp311-win_amd64.pyd +0 -0
  18. roksta/create_default_config.cp311-win_amd64.pyd +0 -0
  19. roksta/default_config.cp311-win_amd64.pyd +0 -0
  20. roksta/enums.cp311-win_amd64.pyd +0 -0
  21. roksta/env.cp311-win_amd64.pyd +0 -0
  22. roksta/extended_text_area.cp311-win_amd64.pyd +0 -0
  23. roksta/firebase.cp311-win_amd64.pyd +0 -0
  24. roksta/firebase_auth_web.cp311-win_amd64.pyd +0 -0
  25. roksta/firebase_config.cp311-win_amd64.pyd +0 -0
  26. roksta/fix_tests.cp311-win_amd64.pyd +0 -0
  27. roksta/gen_codebase_summaries.cp311-win_amd64.pyd +0 -0
  28. roksta/gen_one_line_goal.cp311-win_amd64.pyd +0 -0
  29. roksta/get_codebase_structure.cp311-win_amd64.pyd +0 -0
  30. roksta/get_failing_tests.cp311-win_amd64.pyd +0 -0
  31. roksta/goal_workflow.cp311-win_amd64.pyd +0 -0
  32. roksta/init_codebase.cp311-win_amd64.pyd +0 -0
  33. roksta/lint_code.cp311-win_amd64.pyd +0 -0
  34. roksta/logger.cp311-win_amd64.pyd +0 -0
  35. roksta/main.cp311-win_amd64.pyd +0 -0
  36. roksta/make_issue.cp311-win_amd64.pyd +0 -0
  37. roksta/new_features.cp311-win_amd64.pyd +0 -0
  38. roksta/parse_readme.cp311-win_amd64.pyd +0 -0
  39. roksta/propose_solution.cp311-win_amd64.pyd +0 -0
  40. roksta/response_formats.cp311-win_amd64.pyd +0 -0
  41. roksta/rewrite_goal.cp311-win_amd64.pyd +0 -0
  42. roksta/roksta.cp311-win_amd64.pyd +0 -0
  43. roksta/run_cli_goal.cp311-win_amd64.pyd +0 -0
  44. roksta/select_files.cp311-win_amd64.pyd +0 -0
  45. roksta/tips.cp311-win_amd64.pyd +0 -0
  46. roksta/utils.cp311-win_amd64.pyd +0 -0
  47. roksta/write_code.cp311-win_amd64.pyd +0 -0
  48. {roksta-0.2.4.dist-info → roksta-0.2.6.dist-info}/METADATA +1 -1
  49. roksta-0.2.6.dist-info/RECORD +78 -0
  50. {roksta-0.2.4.dist-info → roksta-0.2.6.dist-info}/top_level.txt +1 -0
  51. tests/__init__.py +2 -0
  52. tests/conftest.py +169 -0
  53. tests/functions/__init__.py +2 -0
  54. tests/functions/api_v0_01/__init__.py +2 -0
  55. tests/functions/api_v0_01/test__analytics.py +417 -0
  56. tests/functions/api_v0_01/test__gemini_proxy.py +307 -0
  57. tests/functions/api_v0_01/test__generic_proxy.py +399 -0
  58. tests/functions/api_v0_01/test__get_payment_details.py +356 -0
  59. tests/functions/api_v0_01/test__openai_proxy.py +413 -0
  60. tests/functions/api_v0_01/test__redeem_credit_code.py +167 -0
  61. tests/functions/api_v0_01/test__sync_emails.py +324 -0
  62. tests/functions/api_v0_01/test__take_payment.py +491 -0
  63. tests/functions/api_v0_01/test__use_activation_code.py +437 -0
  64. tests/functions/api_v1_00/__init__.py +2 -0
  65. tests/functions/api_v1_00/test__analytics.py +416 -0
  66. tests/functions/api_v1_00/test__gemini_proxy.py +352 -0
  67. tests/functions/api_v1_00/test__generic_proxy.py +428 -0
  68. tests/functions/api_v1_00/test__get_payment_details.py +356 -0
  69. tests/functions/api_v1_00/test__openai_proxy.py +449 -0
  70. tests/functions/api_v1_00/test__redeem_credit_code.py +167 -0
  71. tests/functions/api_v1_00/test__sync_emails.py +325 -0
  72. tests/functions/api_v1_00/test__take_payment.py +491 -0
  73. tests/functions/api_v1_00/test__use_activation_code.py +438 -0
  74. tests/functions/test_auth.py +24 -0
  75. tests/functions/test_main_functions.py +73 -0
  76. tests/functions/test_utils_functions.py +222 -0
  77. roksta-0.2.4.dist-info/RECORD +0 -51
  78. {roksta-0.2.4.dist-info → roksta-0.2.6.dist-info}/WHEEL +0 -0
  79. {roksta-0.2.4.dist-info → roksta-0.2.6.dist-info}/entry_points.txt +0 -0
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roksta
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: An AI coding assistant
5
5
  Author-email: Prash Naidu <prash@roksta.ai>
6
6
  Project-URL: Homepage, https://roksta.ai
@@ -0,0 +1,78 @@
1
+ roksta/__init__.cp311-win_amd64.pyd,sha256=pvRfZ0zJcFsF8oWaS41RNnD5ZR2l7w1WjjIN_rHx5Rs,15872
2
+ roksta/analytics.cp311-win_amd64.pyd,sha256=Lw9a_w0hBelxawVHovwrHuIw2l2Rh50tePlSzs4lZPc,94208
3
+ roksta/balance.cp311-win_amd64.pyd,sha256=HpvHTk_CTEw1i0OQVwOB7kq-rcrCjEZS1_FIAeXD7Dc,117760
4
+ roksta/build_project.cp311-win_amd64.pyd,sha256=8LmXMPbR7aV88cvhrvF_A_bYHppYp5ZwcvcOtzTDubg,59904
5
+ roksta/chat_workflow.cp311-win_amd64.pyd,sha256=_1zkBEC_olz84ZeaYLPMkTFv5CnFNzyAOxWrBrC7OQQ,89088
6
+ roksta/check_for_updates.cp311-win_amd64.pyd,sha256=q4D6wCq04wwazaHFhzfuVgnQzr-0Kas7vNxPjIvwP3I,62464
7
+ roksta/checkpoints.cp311-win_amd64.pyd,sha256=2JNCFo0gAs0oUL0y2bXXzM9o52_3ZYgLhDmL2Vq-hkc,81408
8
+ roksta/clarify_goal.cp311-win_amd64.pyd,sha256=xNZbNmKW9_EBLm9pPLGKbM7d32GdmFjTTc4gM4TkhsM,64000
9
+ roksta/codebase_listing.cp311-win_amd64.pyd,sha256=lbGuekzFx-xlC21x0xRrmgux4Hn-aALR25FzJ6Db1J4,46592
10
+ roksta/command_handlers.cp311-win_amd64.pyd,sha256=GBsFtCXOcXBCZG8ZwCV8kwQf-1ZrcNvnKf-GaszpNvU,363008
11
+ roksta/create_default_config.cp311-win_amd64.pyd,sha256=7Yg4XDa7xTYS7AZeETienFWLu-fm84moKCCDk3wgI9g,31744
12
+ roksta/default_config.cp311-win_amd64.pyd,sha256=zXEalEH7tQciQfEtDYK-bjRksB1uKVTWnAUqaTyFwmE,30720
13
+ roksta/enums.cp311-win_amd64.pyd,sha256=1v4dGJu_1jCAgXA8zFjSufu04hep7aXwJtn_SGq5RXw,135168
14
+ roksta/env.cp311-win_amd64.pyd,sha256=3xkU_Ajj-HNgDjN3hiQfTXPp5_hEesLQNIAIimGI0PQ,27136
15
+ roksta/extended_text_area.cp311-win_amd64.pyd,sha256=xDwFceRE6TspFCJTmMy24mgoiejdV5Ady5mbnR9yJ6s,107520
16
+ roksta/firebase.cp311-win_amd64.pyd,sha256=btVwqUwC0GPHPwSXCvulWVu7LjXoZuzYRAkn4duy7y4,167936
17
+ roksta/firebase_auth_web.cp311-win_amd64.pyd,sha256=rwXsOROmK1Q3d-YzAzOsTg4-qB6EwAQwpg4-RjJFhKs,170496
18
+ roksta/firebase_config.cp311-win_amd64.pyd,sha256=yMCKb9Dmq8Zo_bJw5qN1mgb9s0Unzt-JLT6bUX3olGI,21504
19
+ roksta/fix_tests.cp311-win_amd64.pyd,sha256=wuVBV4V2ZuVjEG6Qg9eUX3AO6keIkRD20wIivtv0i_g,73728
20
+ roksta/gen_codebase_summaries.cp311-win_amd64.pyd,sha256=ymPHLtymiXIY1oOMAZf3UKztxDQdom2OcoFzpwLsX24,225280
21
+ roksta/gen_one_line_goal.cp311-win_amd64.pyd,sha256=n-ha85Qj8dtc-ed_evAq0rlkTuhPzRjSQyukrg1pUKI,63488
22
+ roksta/get_codebase_structure.cp311-win_amd64.pyd,sha256=zqVk1zKQuGffkHnpLykhWE_qy5_OUMzyDg0-rJ2JMhQ,66048
23
+ roksta/get_failing_tests.cp311-win_amd64.pyd,sha256=r8fkZCcNj5grWJZH9jgT_2d_aMDKVRPvtVjwnco4lTE,69120
24
+ roksta/goal_workflow.cp311-win_amd64.pyd,sha256=R_g7a3wFnNIOCsY3PQftYumSeNeg6Hy_HD6AoZWM9g8,184832
25
+ roksta/init_codebase.cp311-win_amd64.pyd,sha256=3r1bkQlmycbyh9MMCRkyXZlKwjQxt8KAa-jBnYG6ZhI,95232
26
+ roksta/lint_code.cp311-win_amd64.pyd,sha256=eXvh7WUzQS16yMUtD_dQUS46NQ3dDYMmj8jHEsuN3gk,69632
27
+ roksta/logger.cp311-win_amd64.pyd,sha256=1AzrC-5jSk0m_aus70_jUYzamUE3m3qfy8Tvs1RR92o,38400
28
+ roksta/main.cp311-win_amd64.pyd,sha256=bDl4U2YXVqTywuUo7GFfT0E6jReEF9n3CDyuCdQ4_P4,38912
29
+ roksta/make_issue.cp311-win_amd64.pyd,sha256=Nei9MPwWZLILCfxgTuOmmH1twGTkfg6lY3OxNLrp9_o,69632
30
+ roksta/new_features.cp311-win_amd64.pyd,sha256=MTKa3CsZAAeREfHhHRsKHuSxbt6sj_Bkr3ae6_D6uAY,16384
31
+ roksta/parse_readme.cp311-win_amd64.pyd,sha256=aqVbYbxFyE6ieJNjBw-iT0fuphyEggCZmfxDImKmWGk,61952
32
+ roksta/propose_solution.cp311-win_amd64.pyd,sha256=AqYpVmn_XSQ7hU1gkP9m_3xSBa6qdIo9ueddeThvSdk,61440
33
+ roksta/response_formats.cp311-win_amd64.pyd,sha256=JT_2VAGURXeL2HYilXq6jEEM5hZaZG8g4FCMAJpOOL0,41984
34
+ roksta/rewrite_goal.cp311-win_amd64.pyd,sha256=xj4Grx9nKr1UlYwCWeOmpGtkWgXGeUkH8sipGi-E1kA,55808
35
+ roksta/roksta.cp311-win_amd64.pyd,sha256=GY0iHM1PsuCodC6jum9S53M9-TjqX-VHRWaGsY-M9L4,229376
36
+ roksta/run_cli_goal.cp311-win_amd64.pyd,sha256=Toknabod95h9ANX0huxOuxkrjVh3StI0JcQySf9pG5A,69120
37
+ roksta/select_files.cp311-win_amd64.pyd,sha256=nUl9FhEj4s8zbOw34RbT2SiO22OsTob-wA7yB6aCTPY,66048
38
+ roksta/tips.cp311-win_amd64.pyd,sha256=uAP2U618RoPPDpXyhnnjeKrdM_fFA4BINLNtXqtpo40,20992
39
+ roksta/utils.cp311-win_amd64.pyd,sha256=pQduxpw_4IHdwYMwNbaoRB6sf43QcVqocfW4OKFULXs,217088
40
+ roksta/write_code.cp311-win_amd64.pyd,sha256=iuwUn_5J441r92CvePCnQGd1yl9ge8CWhFqQCyk_J7Y,58880
41
+ roksta/ai/__init__.cp311-win_amd64.pyd,sha256=vbZtSo8qxkywkyd6pJRwz8Ugfj9IauHPpyBFqy3uxPA,15872
42
+ roksta/ai/call_ai.cp311-win_amd64.pyd,sha256=EF7HnhclvkR9iu2-yT0ld99p37r4wm1YzNSI38kTUUo,72192
43
+ roksta/ai/gemini.cp311-win_amd64.pyd,sha256=XEWRbjhrzUwsY6Jxg2_CNZHYe1iYCywLrea7lOd7_g0,143872
44
+ roksta/ai/generic.cp311-win_amd64.pyd,sha256=Ml9jq1SOcrZrhxblZbc6Eb76wtjUQL6tLBJwnAlZX_E,105984
45
+ roksta/ai/llm.cp311-win_amd64.pyd,sha256=KaLoYCfm_g2pXgdre1Hp79v2WqJ_Kor7t1_McQ_aVro,92160
46
+ roksta/ai/openai.cp311-win_amd64.pyd,sha256=C8Slfhry8AQ6eV76uyXVCxobqFymnizphSLWTe3JmRs,103424
47
+ roksta/ai/tools.cp311-win_amd64.pyd,sha256=htHlPRFNP6Uy_nrkl_VbIriLNb8qHe48ctfXAB07gKk,231936
48
+ tests/__init__.py,sha256=meQjVtD2zimtDw3tIP6nNWHGDQVC42as-c_y038cYnk,126
49
+ tests/conftest.py,sha256=auOTmcnUGIgvlQsVEOhchjLgUtQmnzMtCc5N3Sr79Cw,6464
50
+ tests/functions/__init__.py,sha256=msAiuVOA8jfqVxichPYYyfBFCVEFB_xRvj4lrSpKK1w,97
51
+ tests/functions/test_auth.py,sha256=SNzmpkoxknrxx6cTE91MM2kN3F08GB1pRuupP5IrQs0,1016
52
+ tests/functions/test_main_functions.py,sha256=LgWLAOtSfDXNfHhAAr-j9Peb5JBLFtQ0eKAWqTxLNDU,2648
53
+ tests/functions/test_utils_functions.py,sha256=2x4W2JGnnKabTSTNKQ_DdcZl7K9HVF0N4kudTL05b3Y,7590
54
+ tests/functions/api_v0_01/__init__.py,sha256=6EY0sGI3Jkmk4BGjNzSgyLGxFIGy06vwD76KDKAHh4g,126
55
+ tests/functions/api_v0_01/test__analytics.py,sha256=d0zfl_ydtFc8cxlaL5GV76Rz2P7XsHoqEp2rYdN1zk0,16224
56
+ tests/functions/api_v0_01/test__gemini_proxy.py,sha256=BuT2IWS0NHCa1FzEN8YPf6t00TOjWbpF-SYSOZMWPCg,11459
57
+ tests/functions/api_v0_01/test__generic_proxy.py,sha256=2CSQ8OYUM0Ertq9PYueWDBWgPmz5bpRO8YICAwA_ZUc,16589
58
+ tests/functions/api_v0_01/test__get_payment_details.py,sha256=wvhH5xliVIkU6GvvWFKF-lAV8mSZfj0HCT284BjDYCw,14091
59
+ tests/functions/api_v0_01/test__openai_proxy.py,sha256=tXAz-Ukl3FD1Zdv083xczoQzG-dOS53uL2gBjB-Wcx8,16174
60
+ tests/functions/api_v0_01/test__redeem_credit_code.py,sha256=xDzTWQxcIztksCWpTNibNgZ2ZPT2gqgdtljZiE8wMlU,6514
61
+ tests/functions/api_v0_01/test__sync_emails.py,sha256=5nH4wxcqHqowc4C-pNShF4eWS52Pw6hZxsaOTn7f66I,13022
62
+ tests/functions/api_v0_01/test__take_payment.py,sha256=NFoIw4RVMT63c7diZ7gt6N03dp26vVlognZBchpWRLY,18513
63
+ tests/functions/api_v0_01/test__use_activation_code.py,sha256=3XS-N-fL7UIOev2kzphlDy-2ukykQLzb_0kmlkCr1gQ,17396
64
+ tests/functions/api_v1_00/__init__.py,sha256=VdV5Oy6FRVT4S1xK34YodylJ7FY6jqvjujkS2Qvbyt0,126
65
+ tests/functions/api_v1_00/test__analytics.py,sha256=s_pK4ySr86PC4ZBr7Y7bCHOEuFj36amaWrianBZ_QbU,16222
66
+ tests/functions/api_v1_00/test__gemini_proxy.py,sha256=ZNYBQ9agPyNYGAVYlWPY6IF8wP_5IQ4nbHOpY8TnKEw,13696
67
+ tests/functions/api_v1_00/test__generic_proxy.py,sha256=f2KjO8v_mh4nBwdkFXJLYfFUBpJS_RDtQNfn0ltE2oM,18101
68
+ tests/functions/api_v1_00/test__get_payment_details.py,sha256=GRMAn8WR-07EBZ0IkeVE4MARFUbDdDhEHO2dITRxnVA,14091
69
+ tests/functions/api_v1_00/test__openai_proxy.py,sha256=i1f7S8IFgWiG6WGG-YYptjTCOjSudujEMyhP16BVlW0,18175
70
+ tests/functions/api_v1_00/test__redeem_credit_code.py,sha256=A5WwuSXBX5TiZPdYrDRkUmpppBXG00lcP0LmRz0gNr0,6514
71
+ tests/functions/api_v1_00/test__sync_emails.py,sha256=e0rb637Ois25t__1G8Yp7Pj8WgC-R1I9SUgS6bK1dsU,13024
72
+ tests/functions/api_v1_00/test__take_payment.py,sha256=RQBUHcgN3-XOoPtAjca_72q4BaZxr_L3G_Nss5-gb2g,18513
73
+ tests/functions/api_v1_00/test__use_activation_code.py,sha256=ZOCwXHzenH0l1WhmZP8s8vaXIk58lHpKJ0igx0VEDwY,17398
74
+ roksta-0.2.6.dist-info/METADATA,sha256=CmGL4Rda6LVVQ867JJYy8RMNB1KlIT-aP1AgFrHmhto,1466
75
+ roksta-0.2.6.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
76
+ roksta-0.2.6.dist-info/entry_points.txt,sha256=mzRdYg_DlzZRwjxYUt9-gyoRCkM1QBTeTbwETgiTdGw,44
77
+ roksta-0.2.6.dist-info/top_level.txt,sha256=lvciNZQ1dPGXpiCLdWVXK03n9fKHjbQdwjqQbnUjeYM,13
78
+ roksta-0.2.6.dist-info/RECORD,,
tests/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ # tests package marker
2
+ # This file allows pytest to import tests using package-qualified names, avoiding import collisions.
tests/conftest.py ADDED
@@ -0,0 +1,169 @@
1
+ import os
2
+ import sys
3
+ import importlib
4
+ import types as _types_mod
5
+
6
+ # Ensure local package is imported before any globally installed packages.
7
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
8
+
9
+ # Ensure functions directory is on sys.path so top-level function helpers (e.g. 'utils')
10
+ # can be imported by tests after the functions/ reorganisation.
11
+ _functions_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'functions'))
12
+ if _functions_root not in sys.path:
13
+ sys.path.insert(0, _functions_root)
14
+
15
+ # Ensure functions/api_v0_01 (or a compatible API directory) is on sys.path so tests that import top-level function
16
+ # modules (e.g. '_analytics') can still find them after the functions/ reorganisation.
17
+ _api_candidates = ['api_v0_01', 'api_v001', 'api_v0_1', 'api_v01']
18
+ _functions_api_dir = None
19
+ for candidate in _api_candidates:
20
+ candidate_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'functions', candidate))
21
+ if os.path.isdir(candidate_path):
22
+ _functions_api_dir = candidate_path
23
+ break
24
+ if _functions_api_dir and _functions_api_dir not in sys.path:
25
+ sys.path.insert(0, _functions_api_dir)
26
+
27
+ # Provide a minimal google.genai.types stub if the real package is not available.
28
+ # This avoids import-time errors in tests that import modules which reference
29
+ # google.genai.types at import time. The stub is intentionally lightweight and
30
+ # only implements the attributes needed for import and simple spec-based mocks
31
+ # used in the test-suite. Individual tests may still override these with more
32
+ # detailed fakes when required.
33
+
34
+
35
+ def _attach_gtypes_stubs(gtypes_mod):
36
+ """
37
+ Attach minimal placeholder implementations to the provided module object.
38
+ Only attaches attributes that are missing on the module to avoid clobbering
39
+ a real installed package.
40
+ """
41
+ # Minimal placeholder implementations
42
+ class GenerateContentConfig:
43
+ def __init__(self, **kwargs):
44
+ self.__dict__.update(kwargs)
45
+ self.kwargs = kwargs
46
+ def to_json_dict(self):
47
+ return dict(self.kwargs)
48
+
49
+ class ThinkingConfig:
50
+ def __init__(self, thinking_budget=None):
51
+ self.thinking_budget = thinking_budget
52
+
53
+ class AutomaticFunctionCallingConfig:
54
+ def __init__(self, disable=False):
55
+ self.disable = disable
56
+
57
+ class GoogleSearch:
58
+ def __init__(self):
59
+ pass
60
+
61
+ class Tool:
62
+ def __init__(self, **kwargs):
63
+ self.kwargs = kwargs
64
+
65
+ class UsageMetadata:
66
+ def __init__(self, prompt_token_count=0, total_token_count=0):
67
+ self.prompt_token_count = prompt_token_count
68
+ self.total_token_count = total_token_count
69
+
70
+ class FinishReasonEnum:
71
+ def __init__(self, name='FINISH_REASON_UNSPECIFIED'):
72
+ self.name = name
73
+
74
+ class FinishReason:
75
+ FINISH_REASON_UNSPECIFIED = FinishReasonEnum('FINISH_REASON_UNSPECIFIED')
76
+
77
+ class Part:
78
+ def __init__(self, text=None, function_call=None):
79
+ self.text = text
80
+ self.function_call = function_call
81
+
82
+ @classmethod
83
+ def from_function_response(cls, name=None, response=None):
84
+ inst = cls()
85
+ inst.function_response = _types_mod.SimpleNamespace(name=name, response=response)
86
+ return inst
87
+
88
+ class Content:
89
+ def __init__(self, role=None, parts=None):
90
+ self.role = role
91
+ self.parts = parts or []
92
+
93
+ def model_dump(self, mode='json'):
94
+ return {'role': self.role, 'parts': [getattr(p, 'text', p) for p in self.parts]}
95
+
96
+ class FunctionCall:
97
+ def __init__(self, name=None, args=None):
98
+ self.name = name
99
+ self.args = args
100
+
101
+ class Candidate:
102
+ def __init__(self, content=None, finish_reason=None):
103
+ self.content = content
104
+ self.finish_reason = finish_reason
105
+
106
+ class GenerateContentResponse:
107
+ def __init__(self, **kwargs):
108
+ for k, v in kwargs.items():
109
+ setattr(self, k, v)
110
+ # sensible defaults
111
+ if not hasattr(self, 'text'):
112
+ self.text = ''
113
+ if not hasattr(self, 'candidates'):
114
+ self.candidates = []
115
+ if not hasattr(self, 'usage_metadata'):
116
+ self.usage_metadata = None
117
+
118
+ def to_json_dict(self):
119
+ return {k: getattr(self, k) for k in self.__dict__}
120
+
121
+ stubs = {
122
+ 'GenerateContentConfig': GenerateContentConfig,
123
+ 'ThinkingConfig': ThinkingConfig,
124
+ 'AutomaticFunctionCallingConfig': AutomaticFunctionCallingConfig,
125
+ 'GoogleSearch': GoogleSearch,
126
+ 'Tool': Tool,
127
+ 'UsageMetadata': UsageMetadata,
128
+ 'FinishReason': FinishReason,
129
+ 'Part': Part,
130
+ 'Content': Content,
131
+ 'FunctionCall': FunctionCall,
132
+ 'Candidate': Candidate,
133
+ 'GenerateContentResponse': GenerateContentResponse,
134
+ }
135
+
136
+ for name, obj in stubs.items():
137
+ if not hasattr(gtypes_mod, name):
138
+ setattr(gtypes_mod, name, obj)
139
+
140
+
141
+ # Try to import the real google.genai.types module. If it exists, only patch in
142
+ # any missing attributes. If it doesn't exist, create minimal stub modules and
143
+ # register them on sys.modules so imports like `from google.genai import types`
144
+ # work during the tests.
145
+ try:
146
+ gtypes = importlib.import_module('google.genai.types')
147
+ _attach_gtypes_stubs(gtypes)
148
+ except Exception:
149
+ # Ensure top-level `google` module exists in sys.modules, but do not overwrite
150
+ # a real `google` module if it is already installed.
151
+ try:
152
+ google = importlib.import_module('google')
153
+ except Exception:
154
+ google = _types_mod.ModuleType('google')
155
+ sys.modules['google'] = google
156
+
157
+ # Ensure `google.genai` exists; prefer the real module if present.
158
+ try:
159
+ genai = importlib.import_module('google.genai')
160
+ except Exception:
161
+ genai = _types_mod.ModuleType('google.genai')
162
+ sys.modules['google.genai'] = genai
163
+ setattr(google, 'genai', genai)
164
+
165
+ # Create and attach the minimal `google.genai.types` stub
166
+ gtypes = _types_mod.ModuleType('google.genai.types')
167
+ _attach_gtypes_stubs(gtypes)
168
+ genai.types = gtypes
169
+ sys.modules['google.genai.types'] = gtypes
@@ -0,0 +1,2 @@
1
+ # tests.functions package marker
2
+ # Ensures subtests are imported as package-qualified modules.
@@ -0,0 +1,2 @@
1
+ # tests.functions.api_v0_01 package marker
2
+ # Allows tests under this directory to be imported with package-qualified names.