roksta 0.2.4__cp314-cp314t-win_amd64.whl → 0.2.6__cp314-cp314t-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__.cp314t-win_amd64.pyd +0 -0
  2. roksta/ai/__init__.cp314t-win_amd64.pyd +0 -0
  3. roksta/ai/call_ai.cp314t-win_amd64.pyd +0 -0
  4. roksta/ai/gemini.cp314t-win_amd64.pyd +0 -0
  5. roksta/ai/generic.cp314t-win_amd64.pyd +0 -0
  6. roksta/ai/llm.cp314t-win_amd64.pyd +0 -0
  7. roksta/ai/openai.cp314t-win_amd64.pyd +0 -0
  8. roksta/ai/tools.cp314t-win_amd64.pyd +0 -0
  9. roksta/analytics.cp314t-win_amd64.pyd +0 -0
  10. roksta/balance.cp314t-win_amd64.pyd +0 -0
  11. roksta/build_project.cp314t-win_amd64.pyd +0 -0
  12. roksta/chat_workflow.cp314t-win_amd64.pyd +0 -0
  13. roksta/check_for_updates.cp314t-win_amd64.pyd +0 -0
  14. roksta/checkpoints.cp314t-win_amd64.pyd +0 -0
  15. roksta/clarify_goal.cp314t-win_amd64.pyd +0 -0
  16. roksta/codebase_listing.cp314t-win_amd64.pyd +0 -0
  17. roksta/command_handlers.cp314t-win_amd64.pyd +0 -0
  18. roksta/create_default_config.cp314t-win_amd64.pyd +0 -0
  19. roksta/default_config.cp314t-win_amd64.pyd +0 -0
  20. roksta/enums.cp314t-win_amd64.pyd +0 -0
  21. roksta/env.cp314t-win_amd64.pyd +0 -0
  22. roksta/extended_text_area.cp314t-win_amd64.pyd +0 -0
  23. roksta/firebase.cp314t-win_amd64.pyd +0 -0
  24. roksta/firebase_auth_web.cp314t-win_amd64.pyd +0 -0
  25. roksta/firebase_config.cp314t-win_amd64.pyd +0 -0
  26. roksta/fix_tests.cp314t-win_amd64.pyd +0 -0
  27. roksta/gen_codebase_summaries.cp314t-win_amd64.pyd +0 -0
  28. roksta/gen_one_line_goal.cp314t-win_amd64.pyd +0 -0
  29. roksta/get_codebase_structure.cp314t-win_amd64.pyd +0 -0
  30. roksta/get_failing_tests.cp314t-win_amd64.pyd +0 -0
  31. roksta/goal_workflow.cp314t-win_amd64.pyd +0 -0
  32. roksta/init_codebase.cp314t-win_amd64.pyd +0 -0
  33. roksta/lint_code.cp314t-win_amd64.pyd +0 -0
  34. roksta/logger.cp314t-win_amd64.pyd +0 -0
  35. roksta/main.cp314t-win_amd64.pyd +0 -0
  36. roksta/make_issue.cp314t-win_amd64.pyd +0 -0
  37. roksta/new_features.cp314t-win_amd64.pyd +0 -0
  38. roksta/parse_readme.cp314t-win_amd64.pyd +0 -0
  39. roksta/propose_solution.cp314t-win_amd64.pyd +0 -0
  40. roksta/response_formats.cp314t-win_amd64.pyd +0 -0
  41. roksta/rewrite_goal.cp314t-win_amd64.pyd +0 -0
  42. roksta/roksta.cp314t-win_amd64.pyd +0 -0
  43. roksta/run_cli_goal.cp314t-win_amd64.pyd +0 -0
  44. roksta/select_files.cp314t-win_amd64.pyd +0 -0
  45. roksta/tips.cp314t-win_amd64.pyd +0 -0
  46. roksta/utils.cp314t-win_amd64.pyd +0 -0
  47. roksta/write_code.cp314t-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
@@ -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__.cp314t-win_amd64.pyd,sha256=ARkzyVGuYAeRmg-nvKZtBvCj9AqfjoolPQy18xVjqxM,17408
2
+ roksta/analytics.cp314t-win_amd64.pyd,sha256=Tj4ORor_wJFjI2QzhDBNCs-MnTBh1dbAi11xEE9UCzU,117248
3
+ roksta/balance.cp314t-win_amd64.pyd,sha256=LYKTFgb-UjQJS_HzxkVLyjSpMorGwu8nxD7cCh1n1kY,139264
4
+ roksta/build_project.cp314t-win_amd64.pyd,sha256=a42poIgnCpDjHI2Pd-lrq9i_BZo9r974b5PYxzXobEY,70656
5
+ roksta/chat_workflow.cp314t-win_amd64.pyd,sha256=q8-RfsXbYpd28EQLiv-EdHPegZU1Rfwo5zqu-hoqOP0,111616
6
+ roksta/check_for_updates.cp314t-win_amd64.pyd,sha256=_uYDlFrIJ4IKGI23ZyVzdOAmL0Xcy33s_fV14ZgFpA8,74752
7
+ roksta/checkpoints.cp314t-win_amd64.pyd,sha256=MNVLYOFL3PCyad7MuC5SrzTdkOroUiTppqW09zNe6Gs,92160
8
+ roksta/clarify_goal.cp314t-win_amd64.pyd,sha256=yty2iMjAvEc0RS1J_0ZUsblc2KODL7mizOBE4iB3Hg4,76288
9
+ roksta/codebase_listing.cp314t-win_amd64.pyd,sha256=odS5oHueDRBKb8Sx_lngGocDraG3iKkl2j_QZ5rMKHs,55296
10
+ roksta/command_handlers.cp314t-win_amd64.pyd,sha256=FC8s50sLd0n0oVpTgLxxXuqDdU9rf7FvtdId2VfBnzg,423424
11
+ roksta/create_default_config.cp314t-win_amd64.pyd,sha256=f509qolYZYyfnycbOi6-OG4x6InirLsENL9IYUlMH0k,33792
12
+ roksta/default_config.cp314t-win_amd64.pyd,sha256=-7jMfiH6StMPcuJApyze-0HgLu8-DY06if1qSh7ZHIo,32768
13
+ roksta/enums.cp314t-win_amd64.pyd,sha256=LIzu7vKK_MJVMMp7s22czq1WMo_hlmrFs6r75B5to4o,125440
14
+ roksta/env.cp314t-win_amd64.pyd,sha256=LzrRd9mw7OpnqJ1iIEdH4ajkyEjQD7g4CTVLWZtUl5U,27648
15
+ roksta/extended_text_area.cp314t-win_amd64.pyd,sha256=voQWskUiIg3NodmgyRJuMUAAWw63lOWNPiC-kweqbBg,125952
16
+ roksta/firebase.cp314t-win_amd64.pyd,sha256=WITm1LaJHgTzUi1zT1GvRkKezIiX_LqTFRxRyuzb4zY,204288
17
+ roksta/firebase_auth_web.cp314t-win_amd64.pyd,sha256=4FyFANEFr9IqIJJ8snj_TVBTOEO4iMi1q2Zq6pkn6bM,206336
18
+ roksta/firebase_config.cp314t-win_amd64.pyd,sha256=tm3xZghhuMlTLvXIKHffa9-r7zpOVTJfrApMfkCO7IY,20992
19
+ roksta/fix_tests.cp314t-win_amd64.pyd,sha256=jEA7IJVdk3eK7ke6q8c-SGe788Jgq_wUOX3yH0MUxuY,91648
20
+ roksta/gen_codebase_summaries.cp314t-win_amd64.pyd,sha256=Z-JyIad9YHVKL3q6t33y6BqRdS0HNS7a5QvIQJsbL3s,276992
21
+ roksta/gen_one_line_goal.cp314t-win_amd64.pyd,sha256=iFOzLoTks5mh67tbfukjZdKbBX3lYvZL2N32glCrKpo,78336
22
+ roksta/get_codebase_structure.cp314t-win_amd64.pyd,sha256=SfKi4gO-ZU-I94KlCEZ97fzn6PmpsLryMi_Y9BVG6tw,80896
23
+ roksta/get_failing_tests.cp314t-win_amd64.pyd,sha256=2BBd9WurLgjbhjU9rKpe0aiLrfqM9gy56RN8LwknEfw,83456
24
+ roksta/goal_workflow.cp314t-win_amd64.pyd,sha256=Pr7XWb0W7k7R0LIkLAb4xck3NEhr_H3OHNPr6Vfxo0Q,223232
25
+ roksta/init_codebase.cp314t-win_amd64.pyd,sha256=wr46ne8VthnAlNWpvKC9FFqqX6S9whLEMHDHVSG78CQ,120320
26
+ roksta/lint_code.cp314t-win_amd64.pyd,sha256=YUb4z8YITlS4rD5vQsmvIiTMtE1tEuEtKvnYgZrRgMg,83456
27
+ roksta/logger.cp314t-win_amd64.pyd,sha256=-BJZNvZzzy15tgTUDgXglT0li1FghlMqXw8XIgBy7Bk,45056
28
+ roksta/main.cp314t-win_amd64.pyd,sha256=UlrBfq4cof_FrlBBIl2KulwosR6YRWg0lOQIKnaXz6Y,41984
29
+ roksta/make_issue.cp314t-win_amd64.pyd,sha256=z9r5T9c1Kz2tgj4eXLdXeBKDckf6FDTT7ywOEU9lKeQ,83968
30
+ roksta/new_features.cp314t-win_amd64.pyd,sha256=qlTGgCUpO6_8Kz47W90IWnCiG61nZof0e87q3xUIEhQ,18432
31
+ roksta/parse_readme.cp314t-win_amd64.pyd,sha256=sYxdCRydKNp-pNFto9xFq9wrWgtOMYEr4CiJlwVSVQU,74240
32
+ roksta/propose_solution.cp314t-win_amd64.pyd,sha256=hu05JHOPdBfMwD-CHcqk4djJ8z_PpC_CWM23BxhCn_I,72192
33
+ roksta/response_formats.cp314t-win_amd64.pyd,sha256=Uoa8_bWRrp6U7l1eap6BwvcrlFhZA_ynP9Yp_A-qZ1E,38912
34
+ roksta/rewrite_goal.cp314t-win_amd64.pyd,sha256=-8mQEh84vfhB_jqz9D4bTp0BtcMqL9I-1BMoF3yPYq0,65024
35
+ roksta/roksta.cp314t-win_amd64.pyd,sha256=BHIrh1Gn7Zn1P-yZ1t9j1vN5cA52k-VkcuZ_SrHM96M,272384
36
+ roksta/run_cli_goal.cp314t-win_amd64.pyd,sha256=YAJPiXix5HWYnyqNUmcPBCO5gpdmxsv2Q2CZ0nV07h8,77824
37
+ roksta/select_files.cp314t-win_amd64.pyd,sha256=ggEmvwd9pUeT6ifEIRzbdCQD9e1h1hnaWlXENLHT8vU,77312
38
+ roksta/tips.cp314t-win_amd64.pyd,sha256=dUoCjEFTqTAFPd1S0tFaiXV_XguhAxxeO_ydP9jQMXU,22528
39
+ roksta/utils.cp314t-win_amd64.pyd,sha256=k5x-MyAjrj-DZ3iGf5pQCw7-wRzJx26X0PbfOVKphhA,280064
40
+ roksta/write_code.cp314t-win_amd64.pyd,sha256=ZLPrTmQmrLAQHVCt0yLSw7HlaRHBkBKopXvptryaG4s,68608
41
+ roksta/ai/__init__.cp314t-win_amd64.pyd,sha256=STywyvRdo7LOH4p_3HX86L4dqX8ZJKxkJo3dLMyYH_I,17408
42
+ roksta/ai/call_ai.cp314t-win_amd64.pyd,sha256=ogUsUlZXYKSEEwucw4I7EHu1TcsZmpRo0CFYTXYtmNY,84480
43
+ roksta/ai/gemini.cp314t-win_amd64.pyd,sha256=__7Qml_EXkbl0pRanmNetERjTf24kqnhqJWpKi0CMJQ,176640
44
+ roksta/ai/generic.cp314t-win_amd64.pyd,sha256=t4FzsiUx01CNzbQvDlhzG4s7Vgj3sCUVZo8xoACoWrg,134144
45
+ roksta/ai/llm.cp314t-win_amd64.pyd,sha256=NGCOtwkafrLfi4v-yPIlvmiaEgDD-insueVV7RDEpnU,94720
46
+ roksta/ai/openai.cp314t-win_amd64.pyd,sha256=vcym9hprgUc1o2cYJn_4pXWzITM0fSbbXn0Jp2-Yljc,131584
47
+ roksta/ai/tools.cp314t-win_amd64.pyd,sha256=iGfcsyHzFNO5ENoqeu578DIg4pbenzuhFkFjMqL8szM,278016
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=IxxXYqBIlKEzFy9ulBJ928Gdqg6XQ3DHti4avqq3myk,102
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.