roksta 0.2.4__cp313-cp313-macosx_10_13_universal2.whl → 0.2.6__cp313-cp313-macosx_10_13_universal2.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 (54) hide show
  1. roksta/ai/gemini.cpython-313-darwin.so +0 -0
  2. roksta/ai/generic.cpython-313-darwin.so +0 -0
  3. roksta/ai/llm.cpython-313-darwin.so +0 -0
  4. roksta/ai/openai.cpython-313-darwin.so +0 -0
  5. roksta/ai/tools.cpython-313-darwin.so +0 -0
  6. roksta/analytics.cpython-313-darwin.so +0 -0
  7. roksta/chat_workflow.cpython-313-darwin.so +0 -0
  8. roksta/command_handlers.cpython-313-darwin.so +0 -0
  9. roksta/env.cpython-313-darwin.so +0 -0
  10. roksta/extended_text_area.cpython-313-darwin.so +0 -0
  11. roksta/firebase_auth_web.cpython-313-darwin.so +0 -0
  12. roksta/gen_codebase_summaries.cpython-313-darwin.so +0 -0
  13. roksta/goal_workflow.cpython-313-darwin.so +0 -0
  14. roksta/lint_code.cpython-313-darwin.so +0 -0
  15. roksta/main.cpython-313-darwin.so +0 -0
  16. roksta/make_issue.cpython-313-darwin.so +0 -0
  17. roksta/new_features.cpython-313-darwin.so +0 -0
  18. roksta/parse_readme.cpython-313-darwin.so +0 -0
  19. roksta/roksta.cpython-313-darwin.so +0 -0
  20. roksta/run_cli_goal.cpython-313-darwin.so +0 -0
  21. roksta/tips.cpython-313-darwin.so +0 -0
  22. roksta/utils.cpython-313-darwin.so +0 -0
  23. {roksta-0.2.4.dist-info → roksta-0.2.6.dist-info}/METADATA +1 -1
  24. roksta-0.2.6.dist-info/RECORD +78 -0
  25. {roksta-0.2.4.dist-info → roksta-0.2.6.dist-info}/top_level.txt +1 -0
  26. tests/__init__.py +2 -0
  27. tests/conftest.py +169 -0
  28. tests/functions/__init__.py +2 -0
  29. tests/functions/api_v0_01/__init__.py +2 -0
  30. tests/functions/api_v0_01/test__analytics.py +417 -0
  31. tests/functions/api_v0_01/test__gemini_proxy.py +307 -0
  32. tests/functions/api_v0_01/test__generic_proxy.py +399 -0
  33. tests/functions/api_v0_01/test__get_payment_details.py +356 -0
  34. tests/functions/api_v0_01/test__openai_proxy.py +413 -0
  35. tests/functions/api_v0_01/test__redeem_credit_code.py +167 -0
  36. tests/functions/api_v0_01/test__sync_emails.py +324 -0
  37. tests/functions/api_v0_01/test__take_payment.py +491 -0
  38. tests/functions/api_v0_01/test__use_activation_code.py +437 -0
  39. tests/functions/api_v1_00/__init__.py +2 -0
  40. tests/functions/api_v1_00/test__analytics.py +416 -0
  41. tests/functions/api_v1_00/test__gemini_proxy.py +352 -0
  42. tests/functions/api_v1_00/test__generic_proxy.py +428 -0
  43. tests/functions/api_v1_00/test__get_payment_details.py +356 -0
  44. tests/functions/api_v1_00/test__openai_proxy.py +449 -0
  45. tests/functions/api_v1_00/test__redeem_credit_code.py +167 -0
  46. tests/functions/api_v1_00/test__sync_emails.py +325 -0
  47. tests/functions/api_v1_00/test__take_payment.py +491 -0
  48. tests/functions/api_v1_00/test__use_activation_code.py +438 -0
  49. tests/functions/test_auth.py +24 -0
  50. tests/functions/test_main_functions.py +73 -0
  51. tests/functions/test_utils_functions.py +222 -0
  52. roksta-0.2.4.dist-info/RECORD +0 -51
  53. {roksta-0.2.4.dist-info → roksta-0.2.6.dist-info}/WHEEL +0 -0
  54. {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
@@ -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-0.2.6.dist-info/RECORD,,
2
+ roksta-0.2.6.dist-info/WHEEL,sha256=YOKbiIEZep2WTRrpKV0dvEfsSeIOVH2NqduVxoKQt6I,142
3
+ roksta-0.2.6.dist-info/entry_points.txt,sha256=mzRdYg_DlzZRwjxYUt9-gyoRCkM1QBTeTbwETgiTdGw,44
4
+ roksta-0.2.6.dist-info/top_level.txt,sha256=lvciNZQ1dPGXpiCLdWVXK03n9fKHjbQdwjqQbnUjeYM,13
5
+ roksta-0.2.6.dist-info/METADATA,sha256=gBXNX4iwCT9vychi5wNnmihf7ptAXoiAymfGKYchiNo,1427
6
+ roksta/command_handlers.cpython-313-darwin.so,sha256=qda6tnEvSVJYlZxOuCWcYGAkkQqF2TWxCZZ9ZksY20s,950088
7
+ roksta/analytics.cpython-313-darwin.so,sha256=iJvu-a1EGDlio1bxufPn9tk7QzQlv_oCIY7P7VKdq6I,273168
8
+ roksta/check_for_updates.cpython-313-darwin.so,sha256=9UTWaI6rhY9MJC7jW8pvhiLTDH-z1fZ2y0UMCOvKkQs,206904
9
+ roksta/response_formats.cpython-313-darwin.so,sha256=9MmD_FwyFDeKd8-Zr8xjmc68_lqPX1FZZcygbJQdu1M,120968
10
+ roksta/utils.cpython-313-darwin.so,sha256=z3_9_CpCNlsqJEAjCdMY1zoUPM424LK28yX3i_wng3g,589128
11
+ roksta/main.cpython-313-darwin.so,sha256=3NyhZAgrWzmR2dYqq5NANg69St9Jwdo9udE-6HNJmvw,122184
12
+ roksta/env.cpython-313-darwin.so,sha256=RGJ2m5ZSV6n25Sc8K21zrQl6WhI--VZNUf9iGjPzmDs,87832
13
+ roksta/get_failing_tests.cpython-313-darwin.so,sha256=tLzNpROqCTf-X8_B2Avv_dDSfU-_7D064lxoJ29GN3Q,224296
14
+ roksta/fix_tests.cpython-313-darwin.so,sha256=EdUGStPlnC3BNk7DNeZpxSwb8WOKdMZISFR748CYpnQ,240704
15
+ roksta/firebase_auth_web.cpython-313-darwin.so,sha256=LduXEbNR5K7Ri7GNmsiAyaZW7Lq3jY9fiw4ovlrPLK4,472664
16
+ roksta/build_project.cpython-313-darwin.so,sha256=yOFozWXQoqi9yZ_AhrOWH1hO8i1G_ETEbsPNAVl_Vwo,191184
17
+ roksta/rewrite_goal.cpython-313-darwin.so,sha256=syFaNtvZI0UAUsfsTBG6seUCP6FBUKM5vDhYfvi9pcY,191088
18
+ roksta/run_cli_goal.cpython-313-darwin.so,sha256=LnBKx9tOvohdAsLqlprdzk0FOx9aI8anNBKoFDXAtdE,223968
19
+ roksta/clarify_goal.cpython-313-darwin.so,sha256=TWlse-HG03UP5ks8esK7M0KEGxZYbdeMEkd9eO-5hp8,207808
20
+ roksta/roksta.cpython-313-darwin.so,sha256=xZ4dfNZM2p1N-6gTgXG3roP4m0QX9fHTi44DR3SPTTU,571632
21
+ roksta/default_config.cpython-313-darwin.so,sha256=CEOgjGLlkENoK58rGQ2CeppwFvsR2fO21NyyTOJyRJo,102248
22
+ roksta/__init__.cpython-313-darwin.so,sha256=9NPz72fxGkIQXx2OtFYdnleayh6ielrbliTgVxswNCc,85648
23
+ roksta/codebase_listing.cpython-313-darwin.so,sha256=MrLu0cfolSbjQKv6Y9HZP8SRMzVOtSpmVmJS7YidByk,155608
24
+ roksta/make_issue.cpython-313-darwin.so,sha256=BRmIoFb5UL_FqoY-NTHKyJFGRzw2GbjddJI02uS9nZ8,221856
25
+ roksta/create_default_config.cpython-313-darwin.so,sha256=yWxoCIZpvdvv3nSW29_3hKY2xe9R3Hph7GWPYvZJ4bc,121608
26
+ roksta/gen_codebase_summaries.cpython-313-darwin.so,sha256=Q4jftsyTfDIIxibQpfCBj2x1PdXPH6il7tXHA0WJZeQ,621568
27
+ roksta/propose_solution.cpython-313-darwin.so,sha256=mGEgZ6KldraDTbvBdP_x7Vvd5bZTy6VMWQmZ10Jh9x8,207496
28
+ roksta/balance.cpython-313-darwin.so,sha256=OSdYm3L2CHEunnka4bcXFcZ5iw7pI-U18geHk2YjOpo,340432
29
+ roksta/logger.cpython-313-darwin.so,sha256=Twgl3_qXUJ0c3gVV5ek-pHZUtqaAzVsmt4rlNIaMCYg,122032
30
+ roksta/lint_code.cpython-313-darwin.so,sha256=aHh_KZ-bBRXLOe9t0f-Vw6rgwVorID3YPjmLG09EWIM,208048
31
+ roksta/extended_text_area.cpython-313-darwin.so,sha256=qiKWR3-mZMyrD2tytHEA9zrlrVhGIFNOMkHFMfkov74,307208
32
+ roksta/checkpoints.cpython-313-darwin.so,sha256=kyBklHRV54PUjhwdeKD0xBPXVb2AQTp-IuqRDSufJrc,254320
33
+ roksta/get_codebase_structure.cpython-313-darwin.so,sha256=SCMaKJp2Mf_GkOp-TW-Rc7pFnYovHdZz44B3CG7-IDk,206240
34
+ roksta/init_codebase.cpython-313-darwin.so,sha256=iMX6o1d5yIIZyMu6mmJW-Fk7QSQ0J4bX0VeMxsUKYSw,291824
35
+ roksta/gen_one_line_goal.cpython-313-darwin.so,sha256=j1_I9b-5ZBfRga_YSATSsKpPFv24LosQ2b-uchv5cOc,207768
36
+ roksta/new_features.cpython-313-darwin.so,sha256=In_WCFLFSYl__Uhu2PlIisavXZlFnSol1_OMLb-r7A4,85728
37
+ roksta/firebase_config.cpython-313-darwin.so,sha256=mvrDiJcrsSU4E5c4SQakAnPT0gXvYEzex8H1IdCobdI,86328
38
+ roksta/chat_workflow.cpython-313-darwin.so,sha256=KNPbclDrtzlWl7SWehDTQBhI9jEh06PrnzwpPx4g7Xk,273888
39
+ roksta/select_files.cpython-313-darwin.so,sha256=FjCx9U4P4K14hK4IA5sULYTvnd-LraTlOaOvb9JDPfc,207792
40
+ roksta/tips.cpython-313-darwin.so,sha256=ChSe7J5lQhO7xm1IqKIR0_qAQmOCD0AttuaNS6zTay4,85688
41
+ roksta/write_code.cpython-313-darwin.so,sha256=CPbozpwjCoRmDnhVs4TyuEp6Veo32kdigdB8NO4ozQ0,191152
42
+ roksta/enums.cpython-313-darwin.so,sha256=N0YUW8hXLJ_Zr0dwbnyszPlU-Xt5pb1NETdnYCKPY-k,338344
43
+ roksta/parse_readme.cpython-313-darwin.so,sha256=MjcG8euvVPS3m4UsEdUm9f_lFLRdwIREsJlsspD_qtg,207280
44
+ roksta/firebase.cpython-313-darwin.so,sha256=z7M7rhJEIr5YTJ45Io-5_Gm7XTkTviyN9PbzyUpeMxU,488176
45
+ roksta/goal_workflow.cpython-313-darwin.so,sha256=DRLEnFs8PPKFIHxwulpu0n0uPjZGn0Cfgkllqr2bK90,504496
46
+ roksta/ai/generic.cpython-313-darwin.so,sha256=wic1Tq1BNy1yrNvTXwykMrlOeroud80ueDf1xEeTqy0,306944
47
+ roksta/ai/__init__.cpython-313-darwin.so,sha256=gnpXADu43zbYSsPXDFkSMAm1_tnAAFb9g3UClsQVlSQ,85648
48
+ roksta/ai/tools.cpython-313-darwin.so,sha256=jgY3s6Z7ogwMg51-U_FmnePYLrQWJ0D4K26cmlx1hpU,653976
49
+ roksta/ai/openai.cpython-313-darwin.so,sha256=PzQfRWUzZQP6tPTB3pFPcqy8zM1tWFGwETllE8sW2pQ,306928
50
+ roksta/ai/call_ai.cpython-313-darwin.so,sha256=gfKcuUEKzcgUxeKbjAgGhbxqJaTQAwreVoyMKIl6UBs,240784
51
+ roksta/ai/llm.cpython-313-darwin.so,sha256=vgstbNLxeOb5fQve1RgEcrw9X_jYzoGG76hpCmIqrko,271496
52
+ roksta/ai/gemini.cpython-313-darwin.so,sha256=s9HCxBZihX1bv9kZomcticx7HqhP3LlO0ApPgXRl7fU,422624
53
+ tests/conftest.py,sha256=WBja46X2wduZRF2t4LARhbNvLlU8oRhSW_HB6ara8Yg,6295
54
+ tests/__init__.py,sha256=J6ztnXNqM8TSQCgHXMWb6NRq1kN_h4ql63Jq-TYR8XE,124
55
+ tests/functions/test_auth.py,sha256=I3oFTw2LTuUsnQ75v5SCfgUPnpel_pDKqUH0VAJpXQw,992
56
+ tests/functions/__init__.py,sha256=mLXx3UARcv07vs_fGJuy3L5ZRn9IRsF9zIuL5IOnwdk,95
57
+ tests/functions/test_utils_functions.py,sha256=gS-SxnK0QnVUooxcXlJKodjqOB1HVmUxufwzUPQ7qAk,7368
58
+ tests/functions/test_main_functions.py,sha256=h0W_4ISo95WzRy2HpXZw3cuNOTcYk_2QCIZffZJEfEU,2575
59
+ tests/functions/api_v1_00/test__sync_emails.py,sha256=OTyf2YbBK7e4pWIQTUGYR4x6il1Hb3g4FYqQ_fRj1nA,12699
60
+ tests/functions/api_v1_00/test__take_payment.py,sha256=I-XJasGuLW5wTMAu4nAgFkA8Mo_zVpGPvkJ2LrrJGCk,18022
61
+ tests/functions/api_v1_00/test__gemini_proxy.py,sha256=mf8ubRmNxxxN80H6EA-iDPwu6Oue6Rmgxl6tiFNpfrU,13344
62
+ tests/functions/api_v1_00/test__analytics.py,sha256=oKjd7_zjnttcb-5BuA93yllkm0OOF4YWnfTUW1-icnM,15806
63
+ tests/functions/api_v1_00/__init__.py,sha256=3RCSoj_5UQPw9Z5NeAgYz2s4gfcZIi7g36qk_Ed5TiA,124
64
+ tests/functions/api_v1_00/test__use_activation_code.py,sha256=tNyTkkRtrpjei-7F31UNwrcU-PbP-QnkWNU7h2n5Yqo,16960
65
+ tests/functions/api_v1_00/test__redeem_credit_code.py,sha256=7GD3tGgO2Lk0BCjUmzZACJiwocEhLBvXrrut0x13IWU,6347
66
+ tests/functions/api_v1_00/test__openai_proxy.py,sha256=xlO2zmG64LlrKrbjFz-ds6Map7vy4SjIuHfZJDAqGK8,17726
67
+ tests/functions/api_v1_00/test__get_payment_details.py,sha256=i5Px3NkLxqw8D3tVPrYdRJJF5jlNmysSuX_NNolbIa4,13735
68
+ tests/functions/api_v1_00/test__generic_proxy.py,sha256=KZkOtmc71aOnWlz2L7B6CFhRNEV73bExG3GR14oD2L0,17673
69
+ tests/functions/api_v0_01/test__sync_emails.py,sha256=zCfuh1M6qJlGaCpCWuUE0Ao9Pp5pVkBJXXjoctldkpk,12698
70
+ tests/functions/api_v0_01/test__take_payment.py,sha256=2WDv_7cYTozVMl7hDLNDTF9gmfrgna3oR8xgfRa-plA,18022
71
+ tests/functions/api_v0_01/test__gemini_proxy.py,sha256=R-lzyVsNtqJFGILKhgy1cUIHg1SYPSFKNDbKp2fua-k,11152
72
+ tests/functions/api_v0_01/test__analytics.py,sha256=nMs_aYuXDEFWz9aY21MYwbgugF-czRbucAzis4-8kgc,15807
73
+ tests/functions/api_v0_01/__init__.py,sha256=BOIFrFcANRAbpnX0Bez6rtkj6xJnOli1fqzFX5SpkV0,124
74
+ tests/functions/api_v0_01/test__use_activation_code.py,sha256=EgifjM9wkW1fkQoBK9z5PEEM5xwpRHyt_g7QWy6xrec,16959
75
+ tests/functions/api_v0_01/test__redeem_credit_code.py,sha256=WSs7CE2pkHsied_tg3XCR3RJ9blwQEkOzy-s3lkV_w0,6347
76
+ tests/functions/api_v0_01/test__openai_proxy.py,sha256=Nda-RDUVYBQl2wI5mxxr9Ca-9k9HJV5EgEmdIvyytGs,15761
77
+ tests/functions/api_v0_01/test__get_payment_details.py,sha256=3LYAp9m1RDsf928HGJ6P_YTji7F4srkDv0iWcKTwW54,13735
78
+ tests/functions/api_v0_01/test__generic_proxy.py,sha256=cJftek6njsphK_yesUX1QxphGcD5TEkhQNC5ROvnaIg,16190
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.