roksta 0.2.4__cp314-cp314t-win_amd64.whl → 0.2.5__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 (78) 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/select_files.cp314t-win_amd64.pyd +0 -0
  44. roksta/tips.cp314t-win_amd64.pyd +0 -0
  45. roksta/utils.cp314t-win_amd64.pyd +0 -0
  46. roksta/write_code.cp314t-win_amd64.pyd +0 -0
  47. {roksta-0.2.4.dist-info → roksta-0.2.5.dist-info}/METADATA +1 -1
  48. roksta-0.2.5.dist-info/RECORD +77 -0
  49. {roksta-0.2.4.dist-info → roksta-0.2.5.dist-info}/top_level.txt +1 -0
  50. tests/__init__.py +2 -0
  51. tests/conftest.py +169 -0
  52. tests/functions/__init__.py +2 -0
  53. tests/functions/api_v0_01/__init__.py +2 -0
  54. tests/functions/api_v0_01/test__analytics.py +417 -0
  55. tests/functions/api_v0_01/test__gemini_proxy.py +307 -0
  56. tests/functions/api_v0_01/test__generic_proxy.py +399 -0
  57. tests/functions/api_v0_01/test__get_payment_details.py +356 -0
  58. tests/functions/api_v0_01/test__openai_proxy.py +413 -0
  59. tests/functions/api_v0_01/test__redeem_credit_code.py +167 -0
  60. tests/functions/api_v0_01/test__sync_emails.py +324 -0
  61. tests/functions/api_v0_01/test__take_payment.py +491 -0
  62. tests/functions/api_v0_01/test__use_activation_code.py +437 -0
  63. tests/functions/api_v1_00/__init__.py +2 -0
  64. tests/functions/api_v1_00/test__analytics.py +416 -0
  65. tests/functions/api_v1_00/test__gemini_proxy.py +352 -0
  66. tests/functions/api_v1_00/test__generic_proxy.py +428 -0
  67. tests/functions/api_v1_00/test__get_payment_details.py +356 -0
  68. tests/functions/api_v1_00/test__openai_proxy.py +449 -0
  69. tests/functions/api_v1_00/test__redeem_credit_code.py +167 -0
  70. tests/functions/api_v1_00/test__sync_emails.py +325 -0
  71. tests/functions/api_v1_00/test__take_payment.py +491 -0
  72. tests/functions/api_v1_00/test__use_activation_code.py +438 -0
  73. tests/functions/test_auth.py +24 -0
  74. tests/functions/test_main_functions.py +73 -0
  75. tests/functions/test_utils_functions.py +222 -0
  76. roksta-0.2.4.dist-info/RECORD +0 -51
  77. {roksta-0.2.4.dist-info → roksta-0.2.5.dist-info}/WHEEL +0 -0
  78. {roksta-0.2.4.dist-info → roksta-0.2.5.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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roksta
3
- Version: 0.2.4
3
+ Version: 0.2.5
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,77 @@
1
+ roksta/__init__.cp314t-win_amd64.pyd,sha256=UVNHonnz79D6AGqcmkRDTvyOz6C21ZHDD3lIJRGxE2k,17408
2
+ roksta/analytics.cp314t-win_amd64.pyd,sha256=FIEtzHc9RR6mKzBPRWQ66NQE8uawO_0-D-qoaR4XChY,117248
3
+ roksta/balance.cp314t-win_amd64.pyd,sha256=fxdhiS5WPN2jtN6ZqezpkUy0tOMWshsfT8eJT8eE_84,139264
4
+ roksta/build_project.cp314t-win_amd64.pyd,sha256=gW3I02zG65tYb95vzedMY2r435FQht_MqGBjXEazfXA,70656
5
+ roksta/chat_workflow.cp314t-win_amd64.pyd,sha256=N8PaOH_zxC42bIPAHb60zYhXg4eZdvq_ZEZr5fuEHm4,111616
6
+ roksta/check_for_updates.cp314t-win_amd64.pyd,sha256=Fu_riPoloESsyDePngX4K5drCGC5i2VdMIYUct9F3J8,74752
7
+ roksta/checkpoints.cp314t-win_amd64.pyd,sha256=8aFaAzk-ZofS8gvGLJ-tMKi2bIE7rxNktm3X4t8GPx8,92160
8
+ roksta/clarify_goal.cp314t-win_amd64.pyd,sha256=6uqNli6LI-aP2aRUniURbm7uKx8gnCazhilvz8idzQ8,76288
9
+ roksta/codebase_listing.cp314t-win_amd64.pyd,sha256=ObcKVkDjmV81rtnUX6cQ06rSjYtucb3uebYbaqbHsp4,55296
10
+ roksta/command_handlers.cp314t-win_amd64.pyd,sha256=Br5Pi7cZFtQFqmWGW6DqCqYBG5UbciiXI9cpejpu1IY,401408
11
+ roksta/create_default_config.cp314t-win_amd64.pyd,sha256=a6v50nfTg0Moc0BVhl5thWiUHDDMiC_JlQt-PGC6XW4,33792
12
+ roksta/default_config.cp314t-win_amd64.pyd,sha256=bH8pbtXJVQIvbzdXiVDywwGt5okR3lwymzI05tZ26BI,32768
13
+ roksta/enums.cp314t-win_amd64.pyd,sha256=S-R8VdajbPWzQnvKfNXdwdVTKc4-0MzhjuU2ghMXsQw,125440
14
+ roksta/env.cp314t-win_amd64.pyd,sha256=rXoNycGvKr-LZskfMkDQhTuWHtaV6xXj0A-uoknY82w,27648
15
+ roksta/extended_text_area.cp314t-win_amd64.pyd,sha256=mlS-PVI6dq16JFUOE207zt6I9q0pnCJyP2GHkbv1xeM,125440
16
+ roksta/firebase.cp314t-win_amd64.pyd,sha256=Mq9bLmcs41-A48LVxfF6lGwxDhksMz5vy_oJgra8mLc,204288
17
+ roksta/firebase_auth_web.cp314t-win_amd64.pyd,sha256=Q7xeX6eNXYcp2zSvt82tycdkNjkmRZ2OSUxbR1Y3GPQ,206336
18
+ roksta/firebase_config.cp314t-win_amd64.pyd,sha256=RqAfy_ZxgNvIu8z7g9ylZliLzozt_2vA-Lz6nMU3m1I,20992
19
+ roksta/fix_tests.cp314t-win_amd64.pyd,sha256=otJ0v_lsYGbLe1_x8_ZrVIu9JOtS9Pvl7Xw33E7oCR0,91648
20
+ roksta/gen_codebase_summaries.cp314t-win_amd64.pyd,sha256=T6DHtyz0CAdGHtclr6WxTJ-vUt_puQwPtgjdKoyKDtk,277504
21
+ roksta/gen_one_line_goal.cp314t-win_amd64.pyd,sha256=IDDIERbGti78EeYL5VErCcgk2eo9AUCuFHeg55cSNpo,78336
22
+ roksta/get_codebase_structure.cp314t-win_amd64.pyd,sha256=EvvqjqZ520xdOihVzU9-tmTvNEnrNU2_GqOD161peKc,80896
23
+ roksta/get_failing_tests.cp314t-win_amd64.pyd,sha256=7-wF__9EjcF91XMWMSHvQQ6XmrU-z7ZEu40DIF6-Nus,83456
24
+ roksta/goal_workflow.cp314t-win_amd64.pyd,sha256=Fgh-JMZ1RGlFgHtbU-c3xwM7FqkgiFMiN9-VnkHNWdI,222720
25
+ roksta/init_codebase.cp314t-win_amd64.pyd,sha256=h9NM8XNm876TlBIiEj7cG08YlsUEHKMDsr1mGsb3BGM,120320
26
+ roksta/lint_code.cp314t-win_amd64.pyd,sha256=oN5UZZ-yH9-_8Yyu5LBTiTqy3Jfm7sXh-qNtPGtij88,83456
27
+ roksta/logger.cp314t-win_amd64.pyd,sha256=qB14MG-6P08C-5yja5BomJ10sRCyGSICakd32V3YkRg,45056
28
+ roksta/main.cp314t-win_amd64.pyd,sha256=L-CRuYPCCjl8j6774cOEGpORAO4yWfoKaS0Bsj34fwE,23040
29
+ roksta/make_issue.cp314t-win_amd64.pyd,sha256=PArx0Ql1_QnUwj1cOHaE82avtf-JBuvbYVmJReiQH-U,83968
30
+ roksta/new_features.cp314t-win_amd64.pyd,sha256=Gd0SsrWAWaubgpL4fPa1jHLusdIeL6z-KjLs9X7GJhg,18432
31
+ roksta/parse_readme.cp314t-win_amd64.pyd,sha256=ljKa7lZHKN7537zLihr5dFzjEaUbWwZI2P2wxm7bqAU,72192
32
+ roksta/propose_solution.cp314t-win_amd64.pyd,sha256=5NaRTwXohSVLu9njSyZVAjLv0wBajT8bAr9KU6dzgJg,72192
33
+ roksta/response_formats.cp314t-win_amd64.pyd,sha256=qd266uet8Vh0e-y8XQzZt8VeuVJpdvO6skPIf4EmLYQ,38912
34
+ roksta/rewrite_goal.cp314t-win_amd64.pyd,sha256=Ma0BE3w704WBsPF2_pYizNfxUCVQmaR-V-m6qguHhuI,65024
35
+ roksta/roksta.cp314t-win_amd64.pyd,sha256=Wp8_PgRJSPzZgo3gB9DuIseDOvCVTfXxIaEldvDOGWM,269312
36
+ roksta/select_files.cp314t-win_amd64.pyd,sha256=-O_MSHMsP5BtWyR6iWu-v6Seio3TS_hF4QaBFGwBqn4,77312
37
+ roksta/tips.cp314t-win_amd64.pyd,sha256=IxqLIGlhfQqCYzd1t8-XCCxxM4_qIYEarTBRgF39vlg,21504
38
+ roksta/utils.cp314t-win_amd64.pyd,sha256=eBeUtCem7IrSOccHY6fsJSHah4qhUGuht5ezaCGhM04,270336
39
+ roksta/write_code.cp314t-win_amd64.pyd,sha256=eAh-xL1-8JPeVipLfPGowDdppVgNoEkAwfDnOqQS6-A,68608
40
+ roksta/ai/__init__.cp314t-win_amd64.pyd,sha256=jhQRTKXWZTQ4FL6RdKsCFmckWEI1IUqCx_u6-EXPl8E,17408
41
+ roksta/ai/call_ai.cp314t-win_amd64.pyd,sha256=13QAHgNZRRZYu3iDvU8fRdCMJW_BpRFFdv2hGxQIzPE,84480
42
+ roksta/ai/gemini.cp314t-win_amd64.pyd,sha256=1iA3Ak-sU94HPW1cuOtFj9tpLT0Y-KsyBxdP_nujA04,176640
43
+ roksta/ai/generic.cp314t-win_amd64.pyd,sha256=Lfq7sJ4lcmj5JjOWP8IVdLJhjEEiwvOZ1wUzJBfZr7E,134144
44
+ roksta/ai/llm.cp314t-win_amd64.pyd,sha256=ut3I9oitf8JbcTfjr-x-r2-pj5CpsGKu5JvgybX0YhY,94720
45
+ roksta/ai/openai.cp314t-win_amd64.pyd,sha256=J3A8oJ-dhCpbZnNkWTVjoltJpmwtgInwHwkrjsZ00Hk,131584
46
+ roksta/ai/tools.cp314t-win_amd64.pyd,sha256=RGSEqRoML7xIMUprUgt5Fuln5MsufFD2Y99OBzwjYjc,278016
47
+ tests/__init__.py,sha256=meQjVtD2zimtDw3tIP6nNWHGDQVC42as-c_y038cYnk,126
48
+ tests/conftest.py,sha256=auOTmcnUGIgvlQsVEOhchjLgUtQmnzMtCc5N3Sr79Cw,6464
49
+ tests/functions/__init__.py,sha256=msAiuVOA8jfqVxichPYYyfBFCVEFB_xRvj4lrSpKK1w,97
50
+ tests/functions/test_auth.py,sha256=SNzmpkoxknrxx6cTE91MM2kN3F08GB1pRuupP5IrQs0,1016
51
+ tests/functions/test_main_functions.py,sha256=LgWLAOtSfDXNfHhAAr-j9Peb5JBLFtQ0eKAWqTxLNDU,2648
52
+ tests/functions/test_utils_functions.py,sha256=2x4W2JGnnKabTSTNKQ_DdcZl7K9HVF0N4kudTL05b3Y,7590
53
+ tests/functions/api_v0_01/__init__.py,sha256=6EY0sGI3Jkmk4BGjNzSgyLGxFIGy06vwD76KDKAHh4g,126
54
+ tests/functions/api_v0_01/test__analytics.py,sha256=d0zfl_ydtFc8cxlaL5GV76Rz2P7XsHoqEp2rYdN1zk0,16224
55
+ tests/functions/api_v0_01/test__gemini_proxy.py,sha256=BuT2IWS0NHCa1FzEN8YPf6t00TOjWbpF-SYSOZMWPCg,11459
56
+ tests/functions/api_v0_01/test__generic_proxy.py,sha256=2CSQ8OYUM0Ertq9PYueWDBWgPmz5bpRO8YICAwA_ZUc,16589
57
+ tests/functions/api_v0_01/test__get_payment_details.py,sha256=wvhH5xliVIkU6GvvWFKF-lAV8mSZfj0HCT284BjDYCw,14091
58
+ tests/functions/api_v0_01/test__openai_proxy.py,sha256=tXAz-Ukl3FD1Zdv083xczoQzG-dOS53uL2gBjB-Wcx8,16174
59
+ tests/functions/api_v0_01/test__redeem_credit_code.py,sha256=xDzTWQxcIztksCWpTNibNgZ2ZPT2gqgdtljZiE8wMlU,6514
60
+ tests/functions/api_v0_01/test__sync_emails.py,sha256=5nH4wxcqHqowc4C-pNShF4eWS52Pw6hZxsaOTn7f66I,13022
61
+ tests/functions/api_v0_01/test__take_payment.py,sha256=NFoIw4RVMT63c7diZ7gt6N03dp26vVlognZBchpWRLY,18513
62
+ tests/functions/api_v0_01/test__use_activation_code.py,sha256=3XS-N-fL7UIOev2kzphlDy-2ukykQLzb_0kmlkCr1gQ,17396
63
+ tests/functions/api_v1_00/__init__.py,sha256=VdV5Oy6FRVT4S1xK34YodylJ7FY6jqvjujkS2Qvbyt0,126
64
+ tests/functions/api_v1_00/test__analytics.py,sha256=s_pK4ySr86PC4ZBr7Y7bCHOEuFj36amaWrianBZ_QbU,16222
65
+ tests/functions/api_v1_00/test__gemini_proxy.py,sha256=ZNYBQ9agPyNYGAVYlWPY6IF8wP_5IQ4nbHOpY8TnKEw,13696
66
+ tests/functions/api_v1_00/test__generic_proxy.py,sha256=f2KjO8v_mh4nBwdkFXJLYfFUBpJS_RDtQNfn0ltE2oM,18101
67
+ tests/functions/api_v1_00/test__get_payment_details.py,sha256=GRMAn8WR-07EBZ0IkeVE4MARFUbDdDhEHO2dITRxnVA,14091
68
+ tests/functions/api_v1_00/test__openai_proxy.py,sha256=i1f7S8IFgWiG6WGG-YYptjTCOjSudujEMyhP16BVlW0,18175
69
+ tests/functions/api_v1_00/test__redeem_credit_code.py,sha256=A5WwuSXBX5TiZPdYrDRkUmpppBXG00lcP0LmRz0gNr0,6514
70
+ tests/functions/api_v1_00/test__sync_emails.py,sha256=e0rb637Ois25t__1G8Yp7Pj8WgC-R1I9SUgS6bK1dsU,13024
71
+ tests/functions/api_v1_00/test__take_payment.py,sha256=RQBUHcgN3-XOoPtAjca_72q4BaZxr_L3G_Nss5-gb2g,18513
72
+ tests/functions/api_v1_00/test__use_activation_code.py,sha256=ZOCwXHzenH0l1WhmZP8s8vaXIk58lHpKJ0igx0VEDwY,17398
73
+ roksta-0.2.5.dist-info/METADATA,sha256=fXswD4nH7c-890_N_UYGf1joNOhXYqOE5fk1QG0cvhc,1466
74
+ roksta-0.2.5.dist-info/WHEEL,sha256=IxxXYqBIlKEzFy9ulBJ928Gdqg6XQ3DHti4avqq3myk,102
75
+ roksta-0.2.5.dist-info/entry_points.txt,sha256=mzRdYg_DlzZRwjxYUt9-gyoRCkM1QBTeTbwETgiTdGw,44
76
+ roksta-0.2.5.dist-info/top_level.txt,sha256=lvciNZQ1dPGXpiCLdWVXK03n9fKHjbQdwjqQbnUjeYM,13
77
+ roksta-0.2.5.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.