snowflake-cortex-agent-sdk 0.0.2__tar.gz → 1.0.0__tar.gz

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 (134) hide show
  1. snowflake_cortex_agent_sdk-1.0.0/LICENSE +202 -0
  2. snowflake_cortex_agent_sdk-1.0.0/PKG-INFO +242 -0
  3. snowflake_cortex_agent_sdk-1.0.0/README.md +214 -0
  4. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/__init__.py +55 -0
  5. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/__init__.pyi +4 -0
  6. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_base_client.pyi +11 -0
  7. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_constants.pyi +2 -0
  8. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_generated/__init__.pyi +1 -0
  9. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_generated/agent_runs.pyi +1 -0
  10. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_generated/data_agent.pyi +1 -0
  11. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_generated/events.pyi +1 -0
  12. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_generated/lite_agent.pyi +1 -0
  13. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_generated/threads.pyi +1 -0
  14. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_partner_attribution.pyi +2 -0
  15. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_request_options.pyi +6 -0
  16. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_resource.pyi +4 -0
  17. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_telemetry.pyi +2 -0
  18. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_transport.pyi +1 -0
  19. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_types.pyi +3 -0
  20. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/_version.pyi +4 -0
  21. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/api.pyi +2 -0
  22. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/api_response.pyi +2 -0
  23. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/auth.pyi +4 -0
  24. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/client.pyi +10 -0
  25. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/constants.pyi +2 -0
  26. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/conversation.pyi +14 -0
  27. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/__init__.pyi +4 -0
  28. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/_errors.pyi +1 -0
  29. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/_internal/__init__.pyi +1 -0
  30. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/_internal/message_parser.pyi +1 -0
  31. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/_internal/query.pyi +4 -0
  32. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/_internal/transport/__init__.pyi +2 -0
  33. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/_internal/transport/subprocess_cli.pyi +13 -0
  34. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/client.pyi +1 -0
  35. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/fork_session.pyi +1 -0
  36. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/query.pyi +1 -0
  37. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/cortexcode/types.pyi +2 -0
  38. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/errors.pyi +4 -0
  39. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/models.pyi +2 -0
  40. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/origin.pyi +1 -0
  41. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/public_client.pyi +2 -0
  42. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/resources/__init__.pyi +2 -0
  43. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/resources/agent.pyi +9 -0
  44. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/resources/automations.pyi +2 -0
  45. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/resources/coding_agent.pyi +17 -0
  46. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/resources/feedback.pyi +6 -0
  47. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/resources/runs.pyi +5 -0
  48. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/resources/threads.pyi +8 -0
  49. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/stream.pyi +2 -0
  50. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/streaming/__init__.pyi +2 -0
  51. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/streaming/parser.pyi +5 -0
  52. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/streaming/run_stream.pyi +8 -0
  53. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/testing.pyi +3 -0
  54. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/threads_page.pyi +3 -0
  55. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/turn.pyi +4 -0
  56. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/views/__init__.pyi +2 -0
  57. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/views/agent_response.pyi +5 -0
  58. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/views/async_run.pyi +16 -0
  59. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/views/content_view.pyi +2 -0
  60. snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk/views/thread_message.pyi +2 -0
  61. {snowflake_cortex_agent_sdk-0.0.2 → snowflake_cortex_agent_sdk-1.0.0}/pyproject.toml +6 -5
  62. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/__init__.py +10 -3
  63. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/_account.py +36 -0
  64. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_base_client.py +165 -53
  65. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/_constants.py +77 -0
  66. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/_partner_attribution.py +18 -0
  67. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/_path.py +13 -0
  68. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/_redact.py +34 -0
  69. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_request_options.py +23 -4
  70. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_resource.py +17 -5
  71. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/_telemetry.py +24 -0
  72. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_transport.py +3 -2
  73. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_version.py +1 -1
  74. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/api.py +2 -1
  75. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/api_response.py +14 -0
  76. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/auth.py +16 -2
  77. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/client.py +53 -13
  78. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/conversation.py +217 -22
  79. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/__init__.py +1 -1
  80. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/_internal/query.py +22 -0
  81. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/_internal/transport/subprocess_cli.py +10 -0
  82. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/cortexcode/_user_input.py +93 -0
  83. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/client.py +36 -18
  84. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/types.py +11 -0
  85. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/errors.py +3 -1
  86. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/models.py +5 -5
  87. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/public_client.py +2 -0
  88. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/py.typed +0 -0
  89. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/resources/__init__.py +3 -0
  90. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/resources/_automation_update.py +130 -0
  91. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/resources/_coding_automation.py +85 -0
  92. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/resources/agent.py +88 -38
  93. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/resources/automations.py +578 -0
  94. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/resources/coding_agent.py +124 -16
  95. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/resources/feedback.py +23 -13
  96. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/resources/runs.py +433 -0
  97. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/resources/threads.py +60 -42
  98. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/stream.py +12 -0
  99. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/streaming/parser.py +49 -15
  100. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/streaming/run_stream.py +102 -18
  101. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/testing.py +98 -0
  102. snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/turn.py +214 -0
  103. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/views/agent_response.py +35 -21
  104. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/views/async_run.py +39 -5
  105. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/views/content_view.py +2 -2
  106. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/views/thread_message.py +1 -1
  107. snowflake_cortex_agent_sdk-0.0.2/LICENSE +0 -1
  108. snowflake_cortex_agent_sdk-0.0.2/PKG-INFO +0 -118
  109. snowflake_cortex_agent_sdk-0.0.2/README.md +0 -90
  110. snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk/_constants.py +0 -51
  111. snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk/resources/runs.py +0 -230
  112. snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk/stream.py +0 -12
  113. snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk/turn.py +0 -85
  114. {snowflake_cortex_agent_sdk-0.0.2 → snowflake_cortex_agent_sdk-1.0.0}/.gitignore +0 -0
  115. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk/cortexcode → snowflake_cortex_agent_sdk-1.0.0/cortex_agent_sdk}/py.typed +0 -0
  116. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_generated/__init__.py +0 -0
  117. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_generated/agent_runs.py +0 -0
  118. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_generated/data_agent.py +0 -0
  119. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_generated/events.py +0 -0
  120. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_generated/lite_agent.py +0 -0
  121. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_generated/threads.py +0 -0
  122. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/_types.py +0 -0
  123. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/constants.py +0 -0
  124. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/_errors.py +0 -0
  125. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/_internal/__init__.py +0 -0
  126. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/_internal/message_parser.py +0 -0
  127. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/_internal/transport/__init__.py +0 -0
  128. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/fork_session.py +0 -0
  129. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents/cortexcode}/py.typed +0 -0
  130. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/cortexcode/query.py +0 -0
  131. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/origin.py +0 -0
  132. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/streaming/__init__.py +0 -0
  133. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/threads_page.py +0 -0
  134. {snowflake_cortex_agent_sdk-0.0.2/cortex_agent_sdk → snowflake_cortex_agent_sdk-1.0.0/snowflake/cortex/agents}/views/__init__.py +0 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Snowflake Inc.
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,242 @@
1
+ Metadata-Version: 2.5
2
+ Name: snowflake-cortex-agent-sdk
3
+ Version: 1.0.0
4
+ Summary: Python SDK for the Snowflake Cortex Agent REST API (agent:run streaming, threads, feedback)
5
+ Author-email: "Snowflake, Inc." <support@snowflake.com>
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Keywords: cortex,cortex-agent,openapi,sdk,snowflake
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
12
+ Requires-Python: >=3.10
13
+ Requires-Dist: anyio>=4.0
14
+ Requires-Dist: httpx-sse>=0.4
15
+ Requires-Dist: httpx>=0.27
16
+ Requires-Dist: mcp<2,>=1.0
17
+ Requires-Dist: pydantic>=2.0
18
+ Requires-Dist: snowflake-connector-python[secure-local-storage]<5,>=4.7.1
19
+ Requires-Dist: typing-extensions>=4.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: datamodel-code-generator>=0.28; extra == 'dev'
22
+ Requires-Dist: mypy>=1.0; extra == 'dev'
23
+ Requires-Dist: pytest-asyncio>=0.20.0; extra == 'dev'
24
+ Requires-Dist: pytest-timeout>=2.0.0; extra == 'dev'
25
+ Requires-Dist: pytest>=8.0; extra == 'dev'
26
+ Requires-Dist: ruff>=0.6; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Snowflake Cortex Agent SDK for Python
30
+
31
+ Python SDK for the Snowflake Cortex Agent REST API. Covers the current public surface:
32
+
33
+ - Durable lite, data-agent, and coding-agent conversations
34
+ - Named + versioned data agents through the direct API client
35
+ - Coding-agent runs with sandbox, bash, skills, and workspace mounts
36
+ - Threads, background runs, streaming, and feedback through `snowflake.cortex.agents.api`
37
+ - High-level `Conversation.send()` -> `Turn` abstraction
38
+ - Route-test helpers in `snowflake.cortex.agents.testing` (see `docs/13-testing.md`)
39
+ - Curated `AgentResponse` content and usage view
40
+ - Synchronous and asyncio clients
41
+ - Claude-shaped local Cortex Code sessions via `snowflake.cortex.agents.cortexcode`
42
+
43
+ ## Automations
44
+
45
+ Schedule saved Cortex Agents and CoCo sandbox runs with `client.automations`.
46
+ Create, list, inspect, run,
47
+ pause, resume, and delete personal agent tasks using the same client authentication.
48
+ See [Automations](docs/15-automations.md) for examples and execution semantics.
49
+
50
+ ## Install
51
+
52
+ [View `snowflake-cortex-agent-sdk` on PyPI](https://pypi.org/project/snowflake-cortex-agent-sdk/).
53
+
54
+ ```bash
55
+ pip install snowflake-cortex-agent-sdk
56
+ ```
57
+
58
+ Requires Python 3.10 or newer.
59
+
60
+ Import the SDK from `snowflake.cortex.agents`. The install name remains
61
+ `snowflake-cortex-agent-sdk`; `snowflake-ml-python` separately provides ML APIs
62
+ under `snowflake.ml` and Cortex functions under `snowflake.cortex`.
63
+
64
+ Existing `cortex_agent_sdk` imports, including submodules such as
65
+ `cortex_agent_sdk.api`, continue to work as deprecated aliases. They issue a
66
+ `DeprecationWarning`; update imports to `snowflake.cortex.agents` when convenient.
67
+
68
+ ## Quickstart
69
+
70
+ ```python
71
+ import os
72
+ from snowflake.cortex.agents import (
73
+ AgentResponse,
74
+ Conversation,
75
+ ConversationMessage,
76
+ CortexAgentClient,
77
+ Turn,
78
+ )
79
+
80
+ client: CortexAgentClient = CortexAgentClient(
81
+ account="my_account",
82
+ auth=os.environ["SNOWFLAKE_PAT"],
83
+ )
84
+
85
+ conversation: Conversation = client.conversations.create(
86
+ origin_application="cortex_agent_sdk",
87
+ agent={"type": "inline", "spec": {"models": {"orchestration": "claude-sonnet-4-5"}}},
88
+ )
89
+
90
+ turn: Turn = conversation.send("What is Snowflake Arctic?")
91
+ print(f"run: {turn.id}")
92
+
93
+ answer: AgentResponse = turn.result()
94
+ print(answer.text)
95
+
96
+ history: list[ConversationMessage] = conversation.history()
97
+ ```
98
+
99
+ Set a default agent when creating a conversation. A send can override it for one
100
+ turn when needed:
101
+
102
+ ```python
103
+ inline_turn: Turn = conversation.send(
104
+ "Summarize the context.",
105
+ agent={"type": "inline", "spec": {"models": {"orchestration": "auto"}}},
106
+ )
107
+
108
+ data_turn: Turn = conversation.send(
109
+ "Which products grew fastest?",
110
+ agent={
111
+ "type": "data",
112
+ "spec": {"database": "ANALYTICS", "schema": "PUBLIC", "name": "SALES_AGENT"},
113
+ },
114
+ )
115
+
116
+ coding_turn: Turn = conversation.send(
117
+ "Fix the failing test.",
118
+ agent={
119
+ "type": "coding",
120
+ "spec": {
121
+ "models": {"orchestration": "claude-sonnet-4-5"},
122
+ "permission_policy": "always_allow",
123
+ "workspace_mounts": [{"name": "USER$MY_USER.PUBLIC.DEFAULT$"}],
124
+ },
125
+ },
126
+ )
127
+ ```
128
+
129
+ Use `turn.events()` for event-level progress and `turn.cancel()` to stop a run.
130
+
131
+ ## Async
132
+
133
+ The asynchronous API mirrors the sync API:
134
+
135
+ ```python
136
+ from snowflake.cortex.agents import AgentResponse, AsyncConversation, AsyncCortexAgentClient, AsyncTurn
137
+
138
+ async with AsyncCortexAgentClient(account="my_account", auth="<token>") as client:
139
+ conversation: AsyncConversation = await client.conversations.create(
140
+ origin_application="cortex_agent_sdk",
141
+ agent={"type": "inline", "spec": {"models": {"orchestration": "auto"}}},
142
+ )
143
+ turn: AsyncTurn = await conversation.send("Analyze this data.")
144
+ answer: AgentResponse = await turn.result()
145
+ ```
146
+
147
+ ## Cortex Code sessions (`snowflake.cortex.agents.cortexcode`)
148
+
149
+ `snowflake.cortex.agents.cortexcode` is the Cortex Code SDK for driving the local
150
+ `cortex` binary from Python. It exposes one-shot `query()` calls and long-lived
151
+ `CortexCodeSDKClient` sessions with permissions, hooks, MCP, plugins, structured
152
+ output, and session controls.
153
+
154
+ ```python
155
+ import asyncio
156
+ from snowflake.cortex.agents.cortexcode import AssistantMessage, ResultMessage, query
157
+
158
+ async def main() -> None:
159
+ async for message in query(prompt="Summarize this repository"):
160
+ if isinstance(message, AssistantMessage):
161
+ for block in message.content:
162
+ if hasattr(block, "text"):
163
+ print(block.text, end="")
164
+ elif isinstance(message, ResultMessage):
165
+ print(f"\nDone: {message.subtype}")
166
+
167
+ asyncio.run(main())
168
+ ```
169
+
170
+ This entry point runs the local Cortex Code CLI. For server-side integrations,
171
+ use the package-root `CortexAgentClient` with a coding-agent conversation
172
+ instead.
173
+
174
+ ## Resources at a glance
175
+
176
+ | Resource | Purpose |
177
+ | --- | --- |
178
+ | `client.conversations` | Create, attach, list, and search conversations |
179
+ | `client.feedback` | Send feedback for a data-agent turn |
180
+
181
+ `Conversation` binds a thread to an inline, data, or coding agent and hides
182
+ message and run plumbing. `send()` returns a `Turn` with `id`, `result()`,
183
+ `events()`, and `cancel()`.
184
+
185
+ For direct REST request shapes, streaming modes, raw response wrappers, or SSE
186
+ parsing, import `CortexAgentClient` and related types from
187
+ `snowflake.cortex.agents.api`.
188
+
189
+ Separate entry point, not a `client.*` resource:
190
+
191
+ | Entry point | Purpose |
192
+ | --- | --- |
193
+ | `snowflake.cortex.agents.cortexcode` | Python SDK for the local Cortex Code CLI: permissions, hooks, MCP, plugins, and session controls |
194
+
195
+ ## Auth at a glance
196
+
197
+ Authentication headers are rebuilt for every attempt. `refresh_auth` runs only
198
+ for recognized token/session expiry responses, including legacy `200` JSON error
199
+ envelopes; by default the SDK refreshes once
200
+ and replays the request once. SDK-generated errors do not include credential
201
+ values.
202
+
203
+ | Class | For | Header shape |
204
+ | --- | --- | --- |
205
+ | `PatAuth` (or string shorthand) | Programmatic Access Token | `Authorization: Bearer <token>` + `X-Snowflake-Authorization-Token-Type: PROGRAMMATIC_ACCESS_TOKEN` |
206
+ | `OAuthAuth` | External OAuth / Snowflake OAuth access tokens | `Authorization: Bearer <token>` + `X-Snowflake-Authorization-Token-Type: OAUTH` |
207
+ | `KeyPairJwtAuth` | Key-pair JWT auth | `Authorization: Bearer <token>` + `X-Snowflake-Authorization-Token-Type: KEYPAIR_JWT` |
208
+ | `SnowflakeSessionTokenAuth` | `snowflake-connector-python` session tokens | `Authorization: Snowflake Token="<token>"` |
209
+ | `CallableAuth` | Lazy token minting | Bearer + configurable token-type header |
210
+ | Custom `Authenticator` | Anything else | You return the header map |
211
+
212
+ ## Status
213
+
214
+ Preview. Expect breaking changes as the underlying API stabilizes.
215
+
216
+ ## License
217
+
218
+ Licensed under the [Apache License, Version 2.0](LICENSE).
219
+
220
+ ### Cross-language stream limits
221
+
222
+ The REST stream replay budget counts the UTF-8 bytes of each SSE JSON `data`
223
+ payload before parsing (including JSON whitespace and number spelling, excluding
224
+ SSE field prefixes). A discriminator injected from an SSE `event` header also
225
+ charges the UTF-8 bytes of that name (the SSE default is `message`). Multiline data is counted after SSE joins the lines with
226
+ newlines. The newest contiguous suffix is retained; eviction and `clearReplay()` /
227
+ `clear_replay()` preserve the accumulated final response. Python synthetic
228
+ `events=` iterators have no wire payload, so their budget uses compact JSON.
229
+
230
+ Streaming response headers and subsequent chunk gaps use `streamReadTimeoutMs` /
231
+ `stream_read_timeout` (10 minutes by default; `null` / `None` disables the read
232
+ limit). A general request timeout does not override that streaming read deadline.
233
+ Fetch has no separate connection/write deadlines; Python HTTPX still applies its
234
+ general timeout to connection and write operations. Non-streaming timeout behavior
235
+ is unchanged.
236
+
237
+ Built-in authenticators mask normal logging and exclude credential fields from
238
+ ordinary object enumeration. Explicit token/header access remains supported;
239
+ Python slot inspection is not equivalent to JavaScript runtime-private fields.
240
+ Both SDKs require non-negative safe integers (at most `2**53 - 1`) for replay
241
+ limits and count rendered error excerpts in Unicode code points; credential
242
+ redaction and raw programmatic bodies are preserved.
@@ -0,0 +1,214 @@
1
+ # Snowflake Cortex Agent SDK for Python
2
+
3
+ Python SDK for the Snowflake Cortex Agent REST API. Covers the current public surface:
4
+
5
+ - Durable lite, data-agent, and coding-agent conversations
6
+ - Named + versioned data agents through the direct API client
7
+ - Coding-agent runs with sandbox, bash, skills, and workspace mounts
8
+ - Threads, background runs, streaming, and feedback through `snowflake.cortex.agents.api`
9
+ - High-level `Conversation.send()` -> `Turn` abstraction
10
+ - Route-test helpers in `snowflake.cortex.agents.testing` (see `docs/13-testing.md`)
11
+ - Curated `AgentResponse` content and usage view
12
+ - Synchronous and asyncio clients
13
+ - Claude-shaped local Cortex Code sessions via `snowflake.cortex.agents.cortexcode`
14
+
15
+ ## Automations
16
+
17
+ Schedule saved Cortex Agents and CoCo sandbox runs with `client.automations`.
18
+ Create, list, inspect, run,
19
+ pause, resume, and delete personal agent tasks using the same client authentication.
20
+ See [Automations](docs/15-automations.md) for examples and execution semantics.
21
+
22
+ ## Install
23
+
24
+ [View `snowflake-cortex-agent-sdk` on PyPI](https://pypi.org/project/snowflake-cortex-agent-sdk/).
25
+
26
+ ```bash
27
+ pip install snowflake-cortex-agent-sdk
28
+ ```
29
+
30
+ Requires Python 3.10 or newer.
31
+
32
+ Import the SDK from `snowflake.cortex.agents`. The install name remains
33
+ `snowflake-cortex-agent-sdk`; `snowflake-ml-python` separately provides ML APIs
34
+ under `snowflake.ml` and Cortex functions under `snowflake.cortex`.
35
+
36
+ Existing `cortex_agent_sdk` imports, including submodules such as
37
+ `cortex_agent_sdk.api`, continue to work as deprecated aliases. They issue a
38
+ `DeprecationWarning`; update imports to `snowflake.cortex.agents` when convenient.
39
+
40
+ ## Quickstart
41
+
42
+ ```python
43
+ import os
44
+ from snowflake.cortex.agents import (
45
+ AgentResponse,
46
+ Conversation,
47
+ ConversationMessage,
48
+ CortexAgentClient,
49
+ Turn,
50
+ )
51
+
52
+ client: CortexAgentClient = CortexAgentClient(
53
+ account="my_account",
54
+ auth=os.environ["SNOWFLAKE_PAT"],
55
+ )
56
+
57
+ conversation: Conversation = client.conversations.create(
58
+ origin_application="cortex_agent_sdk",
59
+ agent={"type": "inline", "spec": {"models": {"orchestration": "claude-sonnet-4-5"}}},
60
+ )
61
+
62
+ turn: Turn = conversation.send("What is Snowflake Arctic?")
63
+ print(f"run: {turn.id}")
64
+
65
+ answer: AgentResponse = turn.result()
66
+ print(answer.text)
67
+
68
+ history: list[ConversationMessage] = conversation.history()
69
+ ```
70
+
71
+ Set a default agent when creating a conversation. A send can override it for one
72
+ turn when needed:
73
+
74
+ ```python
75
+ inline_turn: Turn = conversation.send(
76
+ "Summarize the context.",
77
+ agent={"type": "inline", "spec": {"models": {"orchestration": "auto"}}},
78
+ )
79
+
80
+ data_turn: Turn = conversation.send(
81
+ "Which products grew fastest?",
82
+ agent={
83
+ "type": "data",
84
+ "spec": {"database": "ANALYTICS", "schema": "PUBLIC", "name": "SALES_AGENT"},
85
+ },
86
+ )
87
+
88
+ coding_turn: Turn = conversation.send(
89
+ "Fix the failing test.",
90
+ agent={
91
+ "type": "coding",
92
+ "spec": {
93
+ "models": {"orchestration": "claude-sonnet-4-5"},
94
+ "permission_policy": "always_allow",
95
+ "workspace_mounts": [{"name": "USER$MY_USER.PUBLIC.DEFAULT$"}],
96
+ },
97
+ },
98
+ )
99
+ ```
100
+
101
+ Use `turn.events()` for event-level progress and `turn.cancel()` to stop a run.
102
+
103
+ ## Async
104
+
105
+ The asynchronous API mirrors the sync API:
106
+
107
+ ```python
108
+ from snowflake.cortex.agents import AgentResponse, AsyncConversation, AsyncCortexAgentClient, AsyncTurn
109
+
110
+ async with AsyncCortexAgentClient(account="my_account", auth="<token>") as client:
111
+ conversation: AsyncConversation = await client.conversations.create(
112
+ origin_application="cortex_agent_sdk",
113
+ agent={"type": "inline", "spec": {"models": {"orchestration": "auto"}}},
114
+ )
115
+ turn: AsyncTurn = await conversation.send("Analyze this data.")
116
+ answer: AgentResponse = await turn.result()
117
+ ```
118
+
119
+ ## Cortex Code sessions (`snowflake.cortex.agents.cortexcode`)
120
+
121
+ `snowflake.cortex.agents.cortexcode` is the Cortex Code SDK for driving the local
122
+ `cortex` binary from Python. It exposes one-shot `query()` calls and long-lived
123
+ `CortexCodeSDKClient` sessions with permissions, hooks, MCP, plugins, structured
124
+ output, and session controls.
125
+
126
+ ```python
127
+ import asyncio
128
+ from snowflake.cortex.agents.cortexcode import AssistantMessage, ResultMessage, query
129
+
130
+ async def main() -> None:
131
+ async for message in query(prompt="Summarize this repository"):
132
+ if isinstance(message, AssistantMessage):
133
+ for block in message.content:
134
+ if hasattr(block, "text"):
135
+ print(block.text, end="")
136
+ elif isinstance(message, ResultMessage):
137
+ print(f"\nDone: {message.subtype}")
138
+
139
+ asyncio.run(main())
140
+ ```
141
+
142
+ This entry point runs the local Cortex Code CLI. For server-side integrations,
143
+ use the package-root `CortexAgentClient` with a coding-agent conversation
144
+ instead.
145
+
146
+ ## Resources at a glance
147
+
148
+ | Resource | Purpose |
149
+ | --- | --- |
150
+ | `client.conversations` | Create, attach, list, and search conversations |
151
+ | `client.feedback` | Send feedback for a data-agent turn |
152
+
153
+ `Conversation` binds a thread to an inline, data, or coding agent and hides
154
+ message and run plumbing. `send()` returns a `Turn` with `id`, `result()`,
155
+ `events()`, and `cancel()`.
156
+
157
+ For direct REST request shapes, streaming modes, raw response wrappers, or SSE
158
+ parsing, import `CortexAgentClient` and related types from
159
+ `snowflake.cortex.agents.api`.
160
+
161
+ Separate entry point, not a `client.*` resource:
162
+
163
+ | Entry point | Purpose |
164
+ | --- | --- |
165
+ | `snowflake.cortex.agents.cortexcode` | Python SDK for the local Cortex Code CLI: permissions, hooks, MCP, plugins, and session controls |
166
+
167
+ ## Auth at a glance
168
+
169
+ Authentication headers are rebuilt for every attempt. `refresh_auth` runs only
170
+ for recognized token/session expiry responses, including legacy `200` JSON error
171
+ envelopes; by default the SDK refreshes once
172
+ and replays the request once. SDK-generated errors do not include credential
173
+ values.
174
+
175
+ | Class | For | Header shape |
176
+ | --- | --- | --- |
177
+ | `PatAuth` (or string shorthand) | Programmatic Access Token | `Authorization: Bearer <token>` + `X-Snowflake-Authorization-Token-Type: PROGRAMMATIC_ACCESS_TOKEN` |
178
+ | `OAuthAuth` | External OAuth / Snowflake OAuth access tokens | `Authorization: Bearer <token>` + `X-Snowflake-Authorization-Token-Type: OAUTH` |
179
+ | `KeyPairJwtAuth` | Key-pair JWT auth | `Authorization: Bearer <token>` + `X-Snowflake-Authorization-Token-Type: KEYPAIR_JWT` |
180
+ | `SnowflakeSessionTokenAuth` | `snowflake-connector-python` session tokens | `Authorization: Snowflake Token="<token>"` |
181
+ | `CallableAuth` | Lazy token minting | Bearer + configurable token-type header |
182
+ | Custom `Authenticator` | Anything else | You return the header map |
183
+
184
+ ## Status
185
+
186
+ Preview. Expect breaking changes as the underlying API stabilizes.
187
+
188
+ ## License
189
+
190
+ Licensed under the [Apache License, Version 2.0](LICENSE).
191
+
192
+ ### Cross-language stream limits
193
+
194
+ The REST stream replay budget counts the UTF-8 bytes of each SSE JSON `data`
195
+ payload before parsing (including JSON whitespace and number spelling, excluding
196
+ SSE field prefixes). A discriminator injected from an SSE `event` header also
197
+ charges the UTF-8 bytes of that name (the SSE default is `message`). Multiline data is counted after SSE joins the lines with
198
+ newlines. The newest contiguous suffix is retained; eviction and `clearReplay()` /
199
+ `clear_replay()` preserve the accumulated final response. Python synthetic
200
+ `events=` iterators have no wire payload, so their budget uses compact JSON.
201
+
202
+ Streaming response headers and subsequent chunk gaps use `streamReadTimeoutMs` /
203
+ `stream_read_timeout` (10 minutes by default; `null` / `None` disables the read
204
+ limit). A general request timeout does not override that streaming read deadline.
205
+ Fetch has no separate connection/write deadlines; Python HTTPX still applies its
206
+ general timeout to connection and write operations. Non-streaming timeout behavior
207
+ is unchanged.
208
+
209
+ Built-in authenticators mask normal logging and exclude credential fields from
210
+ ordinary object enumeration. Explicit token/header access remains supported;
211
+ Python slot inspection is not equivalent to JavaScript runtime-private fields.
212
+ Both SDKs require non-negative safe integers (at most `2**53 - 1`) for replay
213
+ limits and count rendered error excerpts in Unicode code points; credential
214
+ redaction and raw programmatic bodies are preserved.