roksta 0.2.4__cp312-cp312-win_amd64.whl → 0.2.5__cp312-cp312-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__.cp312-win_amd64.pyd +0 -0
  2. roksta/ai/__init__.cp312-win_amd64.pyd +0 -0
  3. roksta/ai/call_ai.cp312-win_amd64.pyd +0 -0
  4. roksta/ai/gemini.cp312-win_amd64.pyd +0 -0
  5. roksta/ai/generic.cp312-win_amd64.pyd +0 -0
  6. roksta/ai/llm.cp312-win_amd64.pyd +0 -0
  7. roksta/ai/openai.cp312-win_amd64.pyd +0 -0
  8. roksta/ai/tools.cp312-win_amd64.pyd +0 -0
  9. roksta/analytics.cp312-win_amd64.pyd +0 -0
  10. roksta/balance.cp312-win_amd64.pyd +0 -0
  11. roksta/build_project.cp312-win_amd64.pyd +0 -0
  12. roksta/chat_workflow.cp312-win_amd64.pyd +0 -0
  13. roksta/check_for_updates.cp312-win_amd64.pyd +0 -0
  14. roksta/checkpoints.cp312-win_amd64.pyd +0 -0
  15. roksta/clarify_goal.cp312-win_amd64.pyd +0 -0
  16. roksta/codebase_listing.cp312-win_amd64.pyd +0 -0
  17. roksta/command_handlers.cp312-win_amd64.pyd +0 -0
  18. roksta/create_default_config.cp312-win_amd64.pyd +0 -0
  19. roksta/default_config.cp312-win_amd64.pyd +0 -0
  20. roksta/enums.cp312-win_amd64.pyd +0 -0
  21. roksta/env.cp312-win_amd64.pyd +0 -0
  22. roksta/extended_text_area.cp312-win_amd64.pyd +0 -0
  23. roksta/firebase.cp312-win_amd64.pyd +0 -0
  24. roksta/firebase_auth_web.cp312-win_amd64.pyd +0 -0
  25. roksta/firebase_config.cp312-win_amd64.pyd +0 -0
  26. roksta/fix_tests.cp312-win_amd64.pyd +0 -0
  27. roksta/gen_codebase_summaries.cp312-win_amd64.pyd +0 -0
  28. roksta/gen_one_line_goal.cp312-win_amd64.pyd +0 -0
  29. roksta/get_codebase_structure.cp312-win_amd64.pyd +0 -0
  30. roksta/get_failing_tests.cp312-win_amd64.pyd +0 -0
  31. roksta/goal_workflow.cp312-win_amd64.pyd +0 -0
  32. roksta/init_codebase.cp312-win_amd64.pyd +0 -0
  33. roksta/lint_code.cp312-win_amd64.pyd +0 -0
  34. roksta/logger.cp312-win_amd64.pyd +0 -0
  35. roksta/main.cp312-win_amd64.pyd +0 -0
  36. roksta/make_issue.cp312-win_amd64.pyd +0 -0
  37. roksta/new_features.cp312-win_amd64.pyd +0 -0
  38. roksta/parse_readme.cp312-win_amd64.pyd +0 -0
  39. roksta/propose_solution.cp312-win_amd64.pyd +0 -0
  40. roksta/response_formats.cp312-win_amd64.pyd +0 -0
  41. roksta/rewrite_goal.cp312-win_amd64.pyd +0 -0
  42. roksta/roksta.cp312-win_amd64.pyd +0 -0
  43. roksta/select_files.cp312-win_amd64.pyd +0 -0
  44. roksta/tips.cp312-win_amd64.pyd +0 -0
  45. roksta/utils.cp312-win_amd64.pyd +0 -0
  46. roksta/write_code.cp312-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
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__.cp312-win_amd64.pyd,sha256=vW8RGH8t2320uu8qvTjCmoL3ZSrH05rBk9hTt5BqKRU,16896
2
+ roksta/analytics.cp312-win_amd64.pyd,sha256=stI7ycwlkx2jXnWCK4hFtxIM_1zj9_G4jme6wH9sI9I,91136
3
+ roksta/balance.cp312-win_amd64.pyd,sha256=kTiFsHsbWhrSRM3tOnPqQgkaODoNSgYtDn89vs9ErHs,119296
4
+ roksta/build_project.cp312-win_amd64.pyd,sha256=AxpFbe_reQm0GHqHlS7vQFTQBbuY-ZjZJl5zBaFRlSU,59904
5
+ roksta/chat_workflow.cp312-win_amd64.pyd,sha256=xjRUa_7q8iUBNWHwp8FKwQp85ZKfNj6_aJWulrpJyf0,88576
6
+ roksta/check_for_updates.cp312-win_amd64.pyd,sha256=vTAp7zRKTQpvUojR7TWNDyoGxnx84E1BrIp9SUElTYY,61952
7
+ roksta/checkpoints.cp312-win_amd64.pyd,sha256=mjgKRuqWmTZ_2CC3B8a7xQ8FgYcb2PhTtUBzZNeqLI8,78336
8
+ roksta/clarify_goal.cp312-win_amd64.pyd,sha256=H2JT6TsDtUa9KJMX4VdJzAQf7MTpmOgj-Nq1juDbGCU,64000
9
+ roksta/codebase_listing.cp312-win_amd64.pyd,sha256=lW9jSjecrL8OlocuDHZPXRYmuGKkj1x7glNGR9iOlFg,47104
10
+ roksta/command_handlers.cp312-win_amd64.pyd,sha256=vsNrih0i-w83xfpe4RRX8DWd5KqcjEc9_cAXIyHLDZU,343552
11
+ roksta/create_default_config.cp312-win_amd64.pyd,sha256=eoFZKCWpOEuEtBEf9J79n1o2dfs2Z8oq3igLL1YjoGI,31232
12
+ roksta/default_config.cp312-win_amd64.pyd,sha256=P19hI_JWF7OPiEMc-IXHo31xIP5D9o1U7eWI5Kb59IM,31744
13
+ roksta/enums.cp312-win_amd64.pyd,sha256=wOlJKLIwWhBvSnD5MKOI6psMJbktvuIrNwQMuAKUhu0,123392
14
+ roksta/env.cp312-win_amd64.pyd,sha256=rivOrg1kuaoSRlkN9Pf7-XK2aA-DLVAZAD9u7MQGKoA,27136
15
+ roksta/extended_text_area.cp312-win_amd64.pyd,sha256=DRL-a1yXSZyzs31KU5WAhPbShj3_edVXytiJPfaixCU,103936
16
+ roksta/firebase.cp312-win_amd64.pyd,sha256=uIvELj7SOO_mugpmlhS0vdTrGteFkwqd9Z9w3eBzjo8,175616
17
+ roksta/firebase_auth_web.cp312-win_amd64.pyd,sha256=r0IpSqyZgno-VsCrzpx6xvZgtkvkOB0uE7bjwiCSD4E,172032
18
+ roksta/firebase_config.cp312-win_amd64.pyd,sha256=6-9zOVIlFRuAAXU3PHxrrswDMiCLFaVlMpZkdv_Kfig,20992
19
+ roksta/fix_tests.cp312-win_amd64.pyd,sha256=S2h-4vOncsYt9cwqq1xT8fyxsdsJ56mLdkONP8iBDqY,72704
20
+ roksta/gen_codebase_summaries.cp312-win_amd64.pyd,sha256=moMJidA15jHRK7WRsqrXLcAMv1dgQisWTm6j0YboO-Q,231424
21
+ roksta/gen_one_line_goal.cp312-win_amd64.pyd,sha256=SBD2kF1mDjXeuzs0PJ0Eaxgg42IVwNJI6G_jwEjBOn4,64512
22
+ roksta/get_codebase_structure.cp312-win_amd64.pyd,sha256=wFyxsfsX-L0jUvWnxaO0SzZIysqLROLKDNwPVmqJYfY,65024
23
+ roksta/get_failing_tests.cp312-win_amd64.pyd,sha256=tATydjJa6_CHY4KnIIkaQWOoVhCS0suJcj_YbmT5608,68608
24
+ roksta/goal_workflow.cp312-win_amd64.pyd,sha256=aCqhA1O-N12Q-5F1Dy_WjpZwWzDfdgZYzaYzBPGmHuo,185856
25
+ roksta/init_codebase.cp312-win_amd64.pyd,sha256=aDn5ZIG2G2i21ayDX3JHOhLGUgzgxlx0NQbSsmg2evQ,98304
26
+ roksta/lint_code.cp312-win_amd64.pyd,sha256=LBtKhoCaRyAk7b4ajzmdPEhTicjpja5Kak9HCe3Z4WI,70656
27
+ roksta/logger.cp312-win_amd64.pyd,sha256=JKQaM2YyVw4DG59dUnhLdWytmaniOT7sogdbsUtPRms,38912
28
+ roksta/main.cp312-win_amd64.pyd,sha256=WT1YUikOniJMCHoD3gcP4aXTl8UsP5JfU5LhSQ86XZQ,22528
29
+ roksta/make_issue.cp312-win_amd64.pyd,sha256=sODWymM7N9Kb0QszeLKAk7IGfPWMrGEFakYDi2WvP2s,66560
30
+ roksta/new_features.cp312-win_amd64.pyd,sha256=Mbu4R8nW5coW5oJAN6Z6Zh6uApbFh7lEsFlcaBc64-g,16896
31
+ roksta/parse_readme.cp312-win_amd64.pyd,sha256=EJeK1QN5qXtVLB9B01ssLI4jg2U45AoeU3HA045kxFA,60416
32
+ roksta/propose_solution.cp312-win_amd64.pyd,sha256=jo_aJSDidkyVvejmHP_KvUBbvS3Vt3yhIQxJnHb2KuM,61440
33
+ roksta/response_formats.cp312-win_amd64.pyd,sha256=QLS1DqHsBVljG0UHWF0n8hK1ajZlo_4o9Nfdo9UTxWA,39424
34
+ roksta/rewrite_goal.cp312-win_amd64.pyd,sha256=HZj0VkZR0tm5_k3W1TmmBL5sLR8U99d-6UEWofIemoA,55296
35
+ roksta/roksta.cp312-win_amd64.pyd,sha256=H06qlm4NSlarbk0dsPYmZzMTSlp8T5b8Kf1yl0omQuM,225792
36
+ roksta/select_files.cp312-win_amd64.pyd,sha256=HcePbBFQrX4lWWtY9LbeoQ003hmR6adODC-1XjPTr-w,65536
37
+ roksta/tips.cp312-win_amd64.pyd,sha256=NNrTI7lzf5U9e8w9pI2b11M0LlBWrXBQ5GAaBPNn-s4,20992
38
+ roksta/utils.cp312-win_amd64.pyd,sha256=2vJcF6pbbgJXG--Fj4d2Dl2cez3Zj49ItJ9yCiGM578,210944
39
+ roksta/write_code.cp312-win_amd64.pyd,sha256=A4HkdNriWVXpTGO2M166kx_Ma0MZVynO3A4oX3VTJF8,58368
40
+ roksta/ai/__init__.cp312-win_amd64.pyd,sha256=Me-o19FXlMQJgjggLaDHOrRaWaWc7GfOXajJTsYx7UI,16896
41
+ roksta/ai/call_ai.cp312-win_amd64.pyd,sha256=j_n21Z5KDQY7TFfOx5sODR4lhowj2cyr1D8NtDp-yiE,73728
42
+ roksta/ai/gemini.cp312-win_amd64.pyd,sha256=aRcFzhDcOCksSMgrFFUqeHHsxZ1Gzk2BBLqxycRjmEM,144896
43
+ roksta/ai/generic.cp312-win_amd64.pyd,sha256=tgSsK9Nk1qYFFFET8RvcGueYx3-AxorcZ9RqJbwHTF8,106496
44
+ roksta/ai/llm.cp312-win_amd64.pyd,sha256=vhZ1brCMK94jJVSr7H-d89dok9lTZhvvwwfmIbUNcEM,83968
45
+ roksta/ai/openai.cp312-win_amd64.pyd,sha256=10HJKi1qJ0Y8ZHrqpMM7XgvsVeNMzB8sB5KYXnvueHk,103936
46
+ roksta/ai/tools.cp312-win_amd64.pyd,sha256=esIhuEMACIpGvcuRSTxStP6U-pe_Cp4nCcswNHPj5E0,232448
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=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
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.