roksta 0.2.4__cp313-cp313-win_amd64.whl → 0.2.6__cp313-cp313-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.
Files changed (79) hide show
  1. roksta/__init__.cp313-win_amd64.pyd +0 -0
  2. roksta/ai/__init__.cp313-win_amd64.pyd +0 -0
  3. roksta/ai/call_ai.cp313-win_amd64.pyd +0 -0
  4. roksta/ai/gemini.cp313-win_amd64.pyd +0 -0
  5. roksta/ai/generic.cp313-win_amd64.pyd +0 -0
  6. roksta/ai/llm.cp313-win_amd64.pyd +0 -0
  7. roksta/ai/openai.cp313-win_amd64.pyd +0 -0
  8. roksta/ai/tools.cp313-win_amd64.pyd +0 -0
  9. roksta/analytics.cp313-win_amd64.pyd +0 -0
  10. roksta/balance.cp313-win_amd64.pyd +0 -0
  11. roksta/build_project.cp313-win_amd64.pyd +0 -0
  12. roksta/chat_workflow.cp313-win_amd64.pyd +0 -0
  13. roksta/check_for_updates.cp313-win_amd64.pyd +0 -0
  14. roksta/checkpoints.cp313-win_amd64.pyd +0 -0
  15. roksta/clarify_goal.cp313-win_amd64.pyd +0 -0
  16. roksta/codebase_listing.cp313-win_amd64.pyd +0 -0
  17. roksta/command_handlers.cp313-win_amd64.pyd +0 -0
  18. roksta/create_default_config.cp313-win_amd64.pyd +0 -0
  19. roksta/default_config.cp313-win_amd64.pyd +0 -0
  20. roksta/enums.cp313-win_amd64.pyd +0 -0
  21. roksta/env.cp313-win_amd64.pyd +0 -0
  22. roksta/extended_text_area.cp313-win_amd64.pyd +0 -0
  23. roksta/firebase.cp313-win_amd64.pyd +0 -0
  24. roksta/firebase_auth_web.cp313-win_amd64.pyd +0 -0
  25. roksta/firebase_config.cp313-win_amd64.pyd +0 -0
  26. roksta/fix_tests.cp313-win_amd64.pyd +0 -0
  27. roksta/gen_codebase_summaries.cp313-win_amd64.pyd +0 -0
  28. roksta/gen_one_line_goal.cp313-win_amd64.pyd +0 -0
  29. roksta/get_codebase_structure.cp313-win_amd64.pyd +0 -0
  30. roksta/get_failing_tests.cp313-win_amd64.pyd +0 -0
  31. roksta/goal_workflow.cp313-win_amd64.pyd +0 -0
  32. roksta/init_codebase.cp313-win_amd64.pyd +0 -0
  33. roksta/lint_code.cp313-win_amd64.pyd +0 -0
  34. roksta/logger.cp313-win_amd64.pyd +0 -0
  35. roksta/main.cp313-win_amd64.pyd +0 -0
  36. roksta/make_issue.cp313-win_amd64.pyd +0 -0
  37. roksta/new_features.cp313-win_amd64.pyd +0 -0
  38. roksta/parse_readme.cp313-win_amd64.pyd +0 -0
  39. roksta/propose_solution.cp313-win_amd64.pyd +0 -0
  40. roksta/response_formats.cp313-win_amd64.pyd +0 -0
  41. roksta/rewrite_goal.cp313-win_amd64.pyd +0 -0
  42. roksta/roksta.cp313-win_amd64.pyd +0 -0
  43. roksta/run_cli_goal.cp313-win_amd64.pyd +0 -0
  44. roksta/select_files.cp313-win_amd64.pyd +0 -0
  45. roksta/tips.cp313-win_amd64.pyd +0 -0
  46. roksta/utils.cp313-win_amd64.pyd +0 -0
  47. roksta/write_code.cp313-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__.cp313-win_amd64.pyd,sha256=CBclEZpjMpXhW_fH9IcjPunF0tHw_EvBXNBJrbJFeqM,16384
2
+ roksta/analytics.cp313-win_amd64.pyd,sha256=xRtUJSou58zwXubc_b1ggsLedK311j3hGxBTSPrWAqY,91648
3
+ roksta/balance.cp313-win_amd64.pyd,sha256=0__JWtNTvDiQL7UDKYexZkN2llkmJwxFUBks9QlBqOc,119296
4
+ roksta/build_project.cp313-win_amd64.pyd,sha256=CQYkCRcCDTc5p89RBj6m1rUMdCVfaCZivKrScP19sxM,59392
5
+ roksta/chat_workflow.cp313-win_amd64.pyd,sha256=f-Ep91TfeZxn4rxZ0F-zaQIvr_ZnYBHQ8I209IFBxDw,88576
6
+ roksta/check_for_updates.cp313-win_amd64.pyd,sha256=pyxmGJDOFQpNO2pO91X2E6jc0Cf4a3XdAig4W5lgRH4,61952
7
+ roksta/checkpoints.cp313-win_amd64.pyd,sha256=rQxhqyfCJdDq2Fr5ib1UyanvTChHUeC9TUaWBKBdzyo,77312
8
+ roksta/clarify_goal.cp313-win_amd64.pyd,sha256=Sr6SSTz8gbjnXJpdd7qPJaUnK6EtkPgewfm0r1mKGvU,63488
9
+ roksta/codebase_listing.cp313-win_amd64.pyd,sha256=0ZZb2KKPj821BA_EfYW78Hv3MUxJ3VS-IaeIebL11XU,46592
10
+ roksta/command_handlers.cp313-win_amd64.pyd,sha256=JwFAOTwAfWrpB2gnrhPESpbkUq67akR5xXQkv37cY60,364032
11
+ roksta/create_default_config.cp313-win_amd64.pyd,sha256=q9llTPZVS8Wf0JlywfN_qI9_taXFS13ka-2NRitYETQ,29696
12
+ roksta/default_config.cp313-win_amd64.pyd,sha256=Mh0o89r0147u9qmC4LURMX9oPoQd135CfjLXkqf2AW8,31744
13
+ roksta/enums.cp313-win_amd64.pyd,sha256=HbVv_zRZUenpJrInjSafPazMkyd1phv-fKpsAz7ByUo,121344
14
+ roksta/env.cp313-win_amd64.pyd,sha256=ekulsRBQya0AenOJkssYVsJuNdWL0MmYIUe9v_f_hqo,25088
15
+ roksta/extended_text_area.cp313-win_amd64.pyd,sha256=WbKkibTkT1Siusr3TXzBLOSyreh70wylgyw6KdXaqrs,102400
16
+ roksta/firebase.cp313-win_amd64.pyd,sha256=o91MV0W81hHf39ao1liYRI-Cwin08v47dZnt5fXPXkM,175616
17
+ roksta/firebase_auth_web.cp313-win_amd64.pyd,sha256=R0Nx7GItEbsFd2Qd8g_0aPsd7ZF0OSUb1Istne1U_iQ,172032
18
+ roksta/firebase_config.cp313-win_amd64.pyd,sha256=jgxKe3Fvu6-cmDLZbwmQEDwidP1fy8lm8rt3BUEVCxg,19968
19
+ roksta/fix_tests.cp313-win_amd64.pyd,sha256=zM7Jjr5QHca7g7DG6dw1OpX6CZYl_1dVRMp9bHesK0g,72704
20
+ roksta/gen_codebase_summaries.cp313-win_amd64.pyd,sha256=cWhrBwMeDBhDUDRP09FlyzWziiyEKtIzKQwRJoPO5p0,231424
21
+ roksta/gen_one_line_goal.cp313-win_amd64.pyd,sha256=JCRHlAUxoU7kx1HoIyGO2HlVjoWnlQJN8aiPdfOTeho,64512
22
+ roksta/get_codebase_structure.cp313-win_amd64.pyd,sha256=OfHSQ-OFIScNOk3k6bIuxDWBwNP5GQ3v9q3yHJMbCUo,65024
23
+ roksta/get_failing_tests.cp313-win_amd64.pyd,sha256=KtS1hJWfiCwHE7K_IE9I5v401cxjyHK4gwOLQ-OoDrU,68608
24
+ roksta/goal_workflow.cp313-win_amd64.pyd,sha256=O7zE2u5QUVOi5t-kwpianmVm4gWgyJbyKD1OdUEA0c4,187392
25
+ roksta/init_codebase.cp313-win_amd64.pyd,sha256=Wv4bL-HIVA1J6S854jBfP1aSgrMb8j68GjTPzV5zX7E,97792
26
+ roksta/lint_code.cp313-win_amd64.pyd,sha256=qy7QIoRyMemUyPFTcI5rS1DJ-_Gi8HCgWZKNEFmnywU,69632
27
+ roksta/logger.cp313-win_amd64.pyd,sha256=chh-pge30aJJxIT5CHSOUAmPsNLmf6BsQ3um6giSSkk,37888
28
+ roksta/main.cp313-win_amd64.pyd,sha256=5wCV0EhipHJfpl2iB9b_16ReZCIBkPJyfV3sroS13IU,36864
29
+ roksta/make_issue.cp313-win_amd64.pyd,sha256=omEBCqEiQYYh58MvLFD7n2Tiy0Ya4QfQnDi-a_6zuaw,66560
30
+ roksta/new_features.cp313-win_amd64.pyd,sha256=oAaNYSbtsdYe_3Pcbz1_7EqyJfIp3L0AOuQI_5KfaEk,16896
31
+ roksta/parse_readme.cp313-win_amd64.pyd,sha256=FLoNi2034FDBEHwiZ8FDt0OjMy_5k3cNur9I1UPJL54,61952
32
+ roksta/propose_solution.cp313-win_amd64.pyd,sha256=trWtQkd23cpgcH4L7FCHq4P8yRtGaynGXMHqjf3yPHk,60928
33
+ roksta/response_formats.cp313-win_amd64.pyd,sha256=3xAQq4NOZ0rdkNGgtM6a5D7hW01VoXWq3jqO4Le1HlA,37888
34
+ roksta/rewrite_goal.cp313-win_amd64.pyd,sha256=P0Dwc3LGW8tb1PO9VkqzIUcwGvTxfNLIurrS3kV01mY,54784
35
+ roksta/roksta.cp313-win_amd64.pyd,sha256=SojQ9qaa37Icn3omPY7gTy4tx_3uO8GFU8Mu-rHBWho,226816
36
+ roksta/run_cli_goal.cp313-win_amd64.pyd,sha256=BRhqtJoKOlnTqWgfO_qlKhIfSQbtT23jT6h8gYJfovA,67584
37
+ roksta/select_files.cp313-win_amd64.pyd,sha256=vheDGZKYkvf4E-3Eif4Qm2Fd0VNNAWCYB16q_VMBrU4,65536
38
+ roksta/tips.cp313-win_amd64.pyd,sha256=TYVkhiqy3bX59CL3N3HbkjPc6qY1L_hD8tFUJJF6BYM,21504
39
+ roksta/utils.cp313-win_amd64.pyd,sha256=NbWi5XSvLMbVbz1uoXl6Lsw1AuGKsjm-yChXB4k3_eA,220672
40
+ roksta/write_code.cp313-win_amd64.pyd,sha256=ByNu6-6RwusRjYoQ66uOM3RFaTA5hz5nVFs8B_mihZc,58880
41
+ roksta/ai/__init__.cp313-win_amd64.pyd,sha256=SIHqr8iTPgFDHtywko2jjIOcPmlT9-mP0bpDWoiyU1k,16384
42
+ roksta/ai/call_ai.cp313-win_amd64.pyd,sha256=6UJo3hJwuy02eLvvEXS7jMdBHUg8yd8kAsg_0X3B7GA,73728
43
+ roksta/ai/gemini.cp313-win_amd64.pyd,sha256=cFH8zqi4byHY7TmxzBfSSD999vHXMbUqOWxUAjSRPMA,144384
44
+ roksta/ai/generic.cp313-win_amd64.pyd,sha256=FrL4E4oGSY_blHWPHpP-whVVy3JC29TzdLrMosbzMQw,106496
45
+ roksta/ai/llm.cp313-win_amd64.pyd,sha256=ECN3wsYT6gS05OZ2ZjUBAij5O6AjiEtIfHZ1cVcUlBw,83456
46
+ roksta/ai/openai.cp313-win_amd64.pyd,sha256=TSYeGUOW1bxZem7iA4DBtJIn0GjISg8GkSCARay7TfU,103936
47
+ roksta/ai/tools.cp313-win_amd64.pyd,sha256=KUINytIU0JyzuOTqRfuSYJfCyLNYN3WeEKd1g76eV7c,232960
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=qV0EIPljj1XC_vuSatRWjn02nZIz3N1t8jsZz7HBr2U,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.