Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- graphrag-ollama/bin/distro +8 -0
- graphrag-ollama/bin/openai +8 -0
- graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/INSTALLER +1 -0
- graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/LICENSE +202 -0
- graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/METADATA +184 -0
- graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/RECORD +15 -0
- graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/WHEEL +5 -0
- graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/entry_points.txt +2 -0
- graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/top_level.txt +1 -0
- graphrag-ollama/lib/python3.12/site-packages/distro/__init__.py +54 -0
- graphrag-ollama/lib/python3.12/site-packages/distro/__main__.py +4 -0
- graphrag-ollama/lib/python3.12/site-packages/distro/__pycache__/__init__.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/distro/__pycache__/__main__.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/distro/__pycache__/distro.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/distro/distro.py +1403 -0
- graphrag-ollama/lib/python3.12/site-packages/distro/py.typed +0 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/INSTALLER +1 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/METADATA +145 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/RECORD +9 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/WHEEL +4 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter/__init__.py +5 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter/__init__.pyi +70 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter/__pycache__/__init__.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter/jiter.cpython-312-x86_64-linux-gnu.so +0 -0
- graphrag-ollama/lib/python3.12/site-packages/jiter/py.typed +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/INSTALLER +1 -0
- graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/METADATA +758 -0
- graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/RECORD +674 -0
- graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/REQUESTED +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/WHEEL +4 -0
- graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/entry_points.txt +2 -0
- graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/licenses/LICENSE +201 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__init__.py +361 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__main__.py +3 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/__init__.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/__main__.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_base_client.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_client.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_compat.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_constants.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_exceptions.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_files.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_legacy_response.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_models.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_module_client.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_qs.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_resource.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_response.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_streaming.cpython-312.pyc +0 -0
- graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_types.cpython-312.pyc +0 -0
graphrag-ollama/bin/distro
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/ryo_goto/GraphRAG-Ollama-UI/graphrag-ollama/bin/python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from distro.distro import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
graphrag-ollama/bin/openai
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/ryo_goto/GraphRAG-Ollama-UI/graphrag-ollama/bin/python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from openai.cli import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/LICENSE
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Apache License
|
2 |
+
Version 2.0, January 2004
|
3 |
+
http://www.apache.org/licenses/
|
4 |
+
|
5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6 |
+
|
7 |
+
1. Definitions.
|
8 |
+
|
9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
11 |
+
|
12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13 |
+
the copyright owner that is granting the License.
|
14 |
+
|
15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
16 |
+
other entities that control, are controlled by, or are under common
|
17 |
+
control with that entity. For the purposes of this definition,
|
18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
19 |
+
direction or management of such entity, whether by contract or
|
20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22 |
+
|
23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24 |
+
exercising permissions granted by this License.
|
25 |
+
|
26 |
+
"Source" form shall mean the preferred form for making modifications,
|
27 |
+
including but not limited to software source code, documentation
|
28 |
+
source, and configuration files.
|
29 |
+
|
30 |
+
"Object" form shall mean any form resulting from mechanical
|
31 |
+
transformation or translation of a Source form, including but
|
32 |
+
not limited to compiled object code, generated documentation,
|
33 |
+
and conversions to other media types.
|
34 |
+
|
35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
36 |
+
Object form, made available under the License, as indicated by a
|
37 |
+
copyright notice that is included in or attached to the work
|
38 |
+
(an example is provided in the Appendix below).
|
39 |
+
|
40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41 |
+
form, that is based on (or derived from) the Work and for which the
|
42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
44 |
+
of this License, Derivative Works shall not include works that remain
|
45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46 |
+
the Work and Derivative Works thereof.
|
47 |
+
|
48 |
+
"Contribution" shall mean any work of authorship, including
|
49 |
+
the original version of the Work and any modifications or additions
|
50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
54 |
+
means any form of electronic, verbal, or written communication sent
|
55 |
+
to the Licensor or its representatives, including but not limited to
|
56 |
+
communication on electronic mailing lists, source code control systems,
|
57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
59 |
+
excluding communication that is conspicuously marked or otherwise
|
60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
61 |
+
|
62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
64 |
+
subsequently incorporated within the Work.
|
65 |
+
|
66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
71 |
+
Work and such Derivative Works in Source or Object form.
|
72 |
+
|
73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76 |
+
(except as stated in this section) patent license to make, have made,
|
77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78 |
+
where such license applies only to those patent claims licensable
|
79 |
+
by such Contributor that are necessarily infringed by their
|
80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
82 |
+
institute patent litigation against any entity (including a
|
83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84 |
+
or a Contribution incorporated within the Work constitutes direct
|
85 |
+
or contributory patent infringement, then any patent licenses
|
86 |
+
granted to You under this License for that Work shall terminate
|
87 |
+
as of the date such litigation is filed.
|
88 |
+
|
89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
90 |
+
Work or Derivative Works thereof in any medium, with or without
|
91 |
+
modifications, and in Source or Object form, provided that You
|
92 |
+
meet the following conditions:
|
93 |
+
|
94 |
+
(a) You must give any other recipients of the Work or
|
95 |
+
Derivative Works a copy of this License; and
|
96 |
+
|
97 |
+
(b) You must cause any modified files to carry prominent notices
|
98 |
+
stating that You changed the files; and
|
99 |
+
|
100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
101 |
+
that You distribute, all copyright, patent, trademark, and
|
102 |
+
attribution notices from the Source form of the Work,
|
103 |
+
excluding those notices that do not pertain to any part of
|
104 |
+
the Derivative Works; and
|
105 |
+
|
106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107 |
+
distribution, then any Derivative Works that You distribute must
|
108 |
+
include a readable copy of the attribution notices contained
|
109 |
+
within such NOTICE file, excluding those notices that do not
|
110 |
+
pertain to any part of the Derivative Works, in at least one
|
111 |
+
of the following places: within a NOTICE text file distributed
|
112 |
+
as part of the Derivative Works; within the Source form or
|
113 |
+
documentation, if provided along with the Derivative Works; or,
|
114 |
+
within a display generated by the Derivative Works, if and
|
115 |
+
wherever such third-party notices normally appear. The contents
|
116 |
+
of the NOTICE file are for informational purposes only and
|
117 |
+
do not modify the License. You may add Your own attribution
|
118 |
+
notices within Derivative Works that You distribute, alongside
|
119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
120 |
+
that such additional attribution notices cannot be construed
|
121 |
+
as modifying the License.
|
122 |
+
|
123 |
+
You may add Your own copyright statement to Your modifications and
|
124 |
+
may provide additional or different license terms and conditions
|
125 |
+
for use, reproduction, or distribution of Your modifications, or
|
126 |
+
for any such Derivative Works as a whole, provided Your use,
|
127 |
+
reproduction, and distribution of the Work otherwise complies with
|
128 |
+
the conditions stated in this License.
|
129 |
+
|
130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
132 |
+
by You to the Licensor shall be under the terms and conditions of
|
133 |
+
this License, without any additional terms or conditions.
|
134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135 |
+
the terms of any separate license agreement you may have executed
|
136 |
+
with Licensor regarding such Contributions.
|
137 |
+
|
138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
140 |
+
except as required for reasonable and customary use in describing the
|
141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
142 |
+
|
143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144 |
+
agreed to in writing, Licensor provides the Work (and each
|
145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147 |
+
implied, including, without limitation, any warranties or conditions
|
148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150 |
+
appropriateness of using or redistributing the Work and assume any
|
151 |
+
risks associated with Your exercise of permissions under this License.
|
152 |
+
|
153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
154 |
+
whether in tort (including negligence), contract, or otherwise,
|
155 |
+
unless required by applicable law (such as deliberate and grossly
|
156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157 |
+
liable to You for damages, including any direct, indirect, special,
|
158 |
+
incidental, or consequential damages of any character arising as a
|
159 |
+
result of this License or out of the use or inability to use the
|
160 |
+
Work (including but not limited to damages for loss of goodwill,
|
161 |
+
work stoppage, computer failure or malfunction, or any and all
|
162 |
+
other commercial damages or losses), even if such Contributor
|
163 |
+
has been advised of the possibility of such damages.
|
164 |
+
|
165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168 |
+
or other liability obligations and/or rights consistent with this
|
169 |
+
License. However, in accepting such obligations, You may act only
|
170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171 |
+
of any other Contributor, and only if You agree to indemnify,
|
172 |
+
defend, and hold each Contributor harmless for any liability
|
173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
174 |
+
of your accepting any such warranty or additional liability.
|
175 |
+
|
176 |
+
END OF TERMS AND CONDITIONS
|
177 |
+
|
178 |
+
APPENDIX: How to apply the Apache License to your work.
|
179 |
+
|
180 |
+
To apply the Apache License to your work, attach the following
|
181 |
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
182 |
+
replaced with your own identifying information. (Don't include
|
183 |
+
the brackets!) The text should be enclosed in the appropriate
|
184 |
+
comment syntax for the file format. We also recommend that a
|
185 |
+
file or class name and description of purpose be included on the
|
186 |
+
same "printed page" as the copyright notice for easier
|
187 |
+
identification within third-party archives.
|
188 |
+
|
189 |
+
Copyright {yyyy} {name of copyright owner}
|
190 |
+
|
191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192 |
+
you may not use this file except in compliance with the License.
|
193 |
+
You may obtain a copy of the License at
|
194 |
+
|
195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
196 |
+
|
197 |
+
Unless required by applicable law or agreed to in writing, software
|
198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200 |
+
See the License for the specific language governing permissions and
|
201 |
+
limitations under the License.
|
202 |
+
|
graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/METADATA
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: distro
|
3 |
+
Version: 1.9.0
|
4 |
+
Summary: Distro - an OS platform information API
|
5 |
+
Home-page: https://github.com/python-distro/distro
|
6 |
+
Author: Nir Cohen
|
7 |
+
Author-email: nir36g@gmail.com
|
8 |
+
License: Apache License, Version 2.0
|
9 |
+
Platform: All
|
10 |
+
Classifier: Development Status :: 5 - Production/Stable
|
11 |
+
Classifier: Intended Audience :: Developers
|
12 |
+
Classifier: Intended Audience :: System Administrators
|
13 |
+
Classifier: License :: OSI Approved :: Apache Software License
|
14 |
+
Classifier: Operating System :: POSIX :: Linux
|
15 |
+
Classifier: Operating System :: POSIX :: BSD
|
16 |
+
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
|
17 |
+
Classifier: Operating System :: POSIX :: BSD :: NetBSD
|
18 |
+
Classifier: Operating System :: POSIX :: BSD :: OpenBSD
|
19 |
+
Classifier: Programming Language :: Python :: 3
|
20 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
21 |
+
Classifier: Programming Language :: Python :: 3.6
|
22 |
+
Classifier: Programming Language :: Python :: 3.7
|
23 |
+
Classifier: Programming Language :: Python :: 3.8
|
24 |
+
Classifier: Programming Language :: Python :: 3.9
|
25 |
+
Classifier: Programming Language :: Python :: 3.10
|
26 |
+
Classifier: Programming Language :: Python :: 3.11
|
27 |
+
Classifier: Programming Language :: Python :: 3.12
|
28 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
29 |
+
Classifier: Topic :: System :: Operating System
|
30 |
+
Requires-Python: >=3.6
|
31 |
+
Description-Content-Type: text/markdown
|
32 |
+
License-File: LICENSE
|
33 |
+
|
34 |
+
Distro - an OS platform information API
|
35 |
+
=======================================
|
36 |
+
|
37 |
+
[](https://github.com/python-distro/distro/actions/workflows/ci.yaml)
|
38 |
+
[](https://pypi.python.org/pypi/distro)
|
39 |
+
[](https://img.shields.io/pypi/pyversions/distro.svg)
|
40 |
+
[](https://codecov.io/github/python-distro/distro?branch=master)
|
41 |
+
[](https://pypi.python.org/pypi/distro)
|
42 |
+
[](http://distro.readthedocs.io/en/latest/)
|
43 |
+
|
44 |
+
`distro` provides information about the
|
45 |
+
OS distribution it runs on, such as a reliable machine-readable ID, or
|
46 |
+
version information.
|
47 |
+
|
48 |
+
It is the recommended replacement for Python's original
|
49 |
+
[`platform.linux_distribution`](https://docs.python.org/3.7/library/platform.html#platform.linux_distribution)
|
50 |
+
function (removed in Python 3.8). It also provides much more functionality
|
51 |
+
which isn't necessarily Python bound, like a command-line interface.
|
52 |
+
|
53 |
+
Distro currently supports Linux and BSD based systems but [Windows and OS X support](https://github.com/python-distro/distro/issues/177) is also planned.
|
54 |
+
|
55 |
+
For Python 2.6 support, see https://github.com/python-distro/distro/tree/python2.6-support
|
56 |
+
|
57 |
+
## Installation
|
58 |
+
|
59 |
+
Installation of the latest released version from PyPI:
|
60 |
+
|
61 |
+
```shell
|
62 |
+
pip install distro
|
63 |
+
```
|
64 |
+
|
65 |
+
Installation of the latest development version:
|
66 |
+
|
67 |
+
```shell
|
68 |
+
pip install https://github.com/python-distro/distro/archive/master.tar.gz
|
69 |
+
```
|
70 |
+
|
71 |
+
To use as a standalone script, download `distro.py` directly:
|
72 |
+
|
73 |
+
```shell
|
74 |
+
curl -O https://raw.githubusercontent.com/python-distro/distro/master/src/distro/distro.py
|
75 |
+
python distro.py
|
76 |
+
```
|
77 |
+
|
78 |
+
``distro`` is safe to vendor within projects that do not wish to add
|
79 |
+
dependencies.
|
80 |
+
|
81 |
+
```shell
|
82 |
+
cd myproject
|
83 |
+
curl -O https://raw.githubusercontent.com/python-distro/distro/master/src/distro/distro.py
|
84 |
+
```
|
85 |
+
|
86 |
+
## Usage
|
87 |
+
|
88 |
+
```bash
|
89 |
+
$ distro
|
90 |
+
Name: Antergos Linux
|
91 |
+
Version: 2015.10 (ISO-Rolling)
|
92 |
+
Codename: ISO-Rolling
|
93 |
+
|
94 |
+
$ distro -j
|
95 |
+
{
|
96 |
+
"codename": "ISO-Rolling",
|
97 |
+
"id": "antergos",
|
98 |
+
"like": "arch",
|
99 |
+
"version": "16.9",
|
100 |
+
"version_parts": {
|
101 |
+
"build_number": "",
|
102 |
+
"major": "16",
|
103 |
+
"minor": "9"
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
$ python
|
109 |
+
>>> import distro
|
110 |
+
>>> distro.name(pretty=True)
|
111 |
+
'CentOS Linux 8'
|
112 |
+
>>> distro.id()
|
113 |
+
'centos'
|
114 |
+
>>> distro.version(best=True)
|
115 |
+
'8.4.2105'
|
116 |
+
```
|
117 |
+
|
118 |
+
|
119 |
+
## Documentation
|
120 |
+
|
121 |
+
On top of the aforementioned API, several more functions are available. For a complete description of the
|
122 |
+
API, see the [latest API documentation](http://distro.readthedocs.org/en/latest/).
|
123 |
+
|
124 |
+
## Background
|
125 |
+
|
126 |
+
An alternative implementation became necessary because Python 3.5 deprecated
|
127 |
+
this function, and Python 3.8 removed it altogether. Its predecessor function
|
128 |
+
[`platform.dist`](https://docs.python.org/3.7/library/platform.html#platform.dist)
|
129 |
+
was already deprecated since Python 2.6 and removed in Python 3.8. Still, there
|
130 |
+
are many cases in which access to that information is needed. See [Python issue
|
131 |
+
1322](https://bugs.python.org/issue1322) for more information.
|
132 |
+
|
133 |
+
The `distro` package implements a robust and inclusive way of retrieving the
|
134 |
+
information about a distribution based on new standards and old methods,
|
135 |
+
namely from these data sources (from high to low precedence):
|
136 |
+
|
137 |
+
* The os-release file `/etc/os-release` if present, with a fall-back on `/usr/lib/os-release` if needed.
|
138 |
+
* The output of the `lsb_release` command, if available.
|
139 |
+
* The distro release file (`/etc/*(-|_)(release|version)`), if present.
|
140 |
+
* The `uname` command for BSD based distrubtions.
|
141 |
+
|
142 |
+
|
143 |
+
## Python and Distribution Support
|
144 |
+
|
145 |
+
`distro` is supported and tested on Python 3.6+ and PyPy and on any
|
146 |
+
distribution that provides one or more of the data sources covered.
|
147 |
+
|
148 |
+
This package is tested with test data that mimics the exact behavior of the data sources of [a number of Linux distributions](https://github.com/python-distro/distro/tree/master/tests/resources/distros).
|
149 |
+
|
150 |
+
|
151 |
+
## Testing
|
152 |
+
|
153 |
+
```shell
|
154 |
+
git clone git@github.com:python-distro/distro.git
|
155 |
+
cd distro
|
156 |
+
pip install tox
|
157 |
+
tox
|
158 |
+
```
|
159 |
+
|
160 |
+
|
161 |
+
## Contributions
|
162 |
+
|
163 |
+
Pull requests are always welcome to deal with specific distributions or just
|
164 |
+
for general merriment.
|
165 |
+
|
166 |
+
See [CONTRIBUTIONS](https://github.com/python-distro/distro/blob/master/CONTRIBUTING.md) for contribution info.
|
167 |
+
|
168 |
+
Reference implementations for supporting additional distributions and file
|
169 |
+
formats can be found here:
|
170 |
+
|
171 |
+
* https://github.com/saltstack/salt/blob/develop/salt/grains/core.py#L1172
|
172 |
+
* https://github.com/chef/ohai/blob/master/lib/ohai/plugins/linux/platform.rb
|
173 |
+
* https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/distribution.py
|
174 |
+
* https://github.com/puppetlabs/facter/blob/master/lib/src/facts/linux/os_linux.cc
|
175 |
+
|
176 |
+
## Package manager distributions
|
177 |
+
|
178 |
+
* https://src.fedoraproject.org/rpms/python-distro
|
179 |
+
* https://www.archlinux.org/packages/community/any/python-distro/
|
180 |
+
* https://launchpad.net/ubuntu/+source/python-distro
|
181 |
+
* https://packages.debian.org/stable/python3-distro
|
182 |
+
* https://packages.gentoo.org/packages/dev-python/distro
|
183 |
+
* https://pkgs.org/download/python3-distro
|
184 |
+
* https://slackbuilds.org/repository/14.2/python/python-distro/
|
graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/RECORD
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
../../../bin/distro,sha256=dD4VCgttonqEnA-JlZavh-tepgp5jYEgSoHJXqymt2w,257
|
2 |
+
distro-1.9.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
3 |
+
distro-1.9.0.dist-info/LICENSE,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325
|
4 |
+
distro-1.9.0.dist-info/METADATA,sha256=MWMqst5VkRMQkbM5e9zfeXcYV52Fp1GG8Gg53QwJ6B0,6791
|
5 |
+
distro-1.9.0.dist-info/RECORD,,
|
6 |
+
distro-1.9.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7 |
+
distro-1.9.0.dist-info/entry_points.txt,sha256=3ObjqQMbh1xeQQwsWtgbfDNDMDD-EbggR1Oj_z8s9hc,46
|
8 |
+
distro-1.9.0.dist-info/top_level.txt,sha256=ikde_V_XEdSBqaGd5tEriN_wzYHLgTX_zVtlsGLHvwQ,7
|
9 |
+
distro/__init__.py,sha256=2fHjF-SfgPvjyNZ1iHh_wjqWdR_Yo5ODHwZC0jLBPhc,981
|
10 |
+
distro/__main__.py,sha256=bu9d3TifoKciZFcqRBuygV3GSuThnVD_m2IK4cz96Vs,64
|
11 |
+
distro/__pycache__/__init__.cpython-312.pyc,,
|
12 |
+
distro/__pycache__/__main__.cpython-312.pyc,,
|
13 |
+
distro/__pycache__/distro.cpython-312.pyc,,
|
14 |
+
distro/distro.py,sha256=XqbefacAhDT4zr_trnbA15eY8vdK4GTghgmvUGrEM_4,49430
|
15 |
+
distro/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/WHEEL
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.42.0)
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-any
|
5 |
+
|
graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/entry_points.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[console_scripts]
|
2 |
+
distro = distro.distro:main
|
graphrag-ollama/lib/python3.12/site-packages/distro-1.9.0.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
distro
|
graphrag-ollama/lib/python3.12/site-packages/distro/__init__.py
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .distro import (
|
2 |
+
NORMALIZED_DISTRO_ID,
|
3 |
+
NORMALIZED_LSB_ID,
|
4 |
+
NORMALIZED_OS_ID,
|
5 |
+
LinuxDistribution,
|
6 |
+
__version__,
|
7 |
+
build_number,
|
8 |
+
codename,
|
9 |
+
distro_release_attr,
|
10 |
+
distro_release_info,
|
11 |
+
id,
|
12 |
+
info,
|
13 |
+
like,
|
14 |
+
linux_distribution,
|
15 |
+
lsb_release_attr,
|
16 |
+
lsb_release_info,
|
17 |
+
major_version,
|
18 |
+
minor_version,
|
19 |
+
name,
|
20 |
+
os_release_attr,
|
21 |
+
os_release_info,
|
22 |
+
uname_attr,
|
23 |
+
uname_info,
|
24 |
+
version,
|
25 |
+
version_parts,
|
26 |
+
)
|
27 |
+
|
28 |
+
__all__ = [
|
29 |
+
"NORMALIZED_DISTRO_ID",
|
30 |
+
"NORMALIZED_LSB_ID",
|
31 |
+
"NORMALIZED_OS_ID",
|
32 |
+
"LinuxDistribution",
|
33 |
+
"build_number",
|
34 |
+
"codename",
|
35 |
+
"distro_release_attr",
|
36 |
+
"distro_release_info",
|
37 |
+
"id",
|
38 |
+
"info",
|
39 |
+
"like",
|
40 |
+
"linux_distribution",
|
41 |
+
"lsb_release_attr",
|
42 |
+
"lsb_release_info",
|
43 |
+
"major_version",
|
44 |
+
"minor_version",
|
45 |
+
"name",
|
46 |
+
"os_release_attr",
|
47 |
+
"os_release_info",
|
48 |
+
"uname_attr",
|
49 |
+
"uname_info",
|
50 |
+
"version",
|
51 |
+
"version_parts",
|
52 |
+
]
|
53 |
+
|
54 |
+
__version__ = __version__
|
graphrag-ollama/lib/python3.12/site-packages/distro/__main__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .distro import main
|
2 |
+
|
3 |
+
if __name__ == "__main__":
|
4 |
+
main()
|
graphrag-ollama/lib/python3.12/site-packages/distro/__pycache__/__init__.cpython-312.pyc
ADDED
Binary file (964 Bytes). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/distro/__pycache__/__main__.cpython-312.pyc
ADDED
Binary file (296 Bytes). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/distro/__pycache__/distro.cpython-312.pyc
ADDED
Binary file (53.8 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/distro/distro.py
ADDED
@@ -0,0 +1,1403 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
# Copyright 2015-2021 Nir Cohen
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
"""
|
17 |
+
The ``distro`` package (``distro`` stands for Linux Distribution) provides
|
18 |
+
information about the Linux distribution it runs on, such as a reliable
|
19 |
+
machine-readable distro ID, or version information.
|
20 |
+
|
21 |
+
It is the recommended replacement for Python's original
|
22 |
+
:py:func:`platform.linux_distribution` function, but it provides much more
|
23 |
+
functionality. An alternative implementation became necessary because Python
|
24 |
+
3.5 deprecated this function, and Python 3.8 removed it altogether. Its
|
25 |
+
predecessor function :py:func:`platform.dist` was already deprecated since
|
26 |
+
Python 2.6 and removed in Python 3.8. Still, there are many cases in which
|
27 |
+
access to OS distribution information is needed. See `Python issue 1322
|
28 |
+
<https://bugs.python.org/issue1322>`_ for more information.
|
29 |
+
"""
|
30 |
+
|
31 |
+
import argparse
|
32 |
+
import json
|
33 |
+
import logging
|
34 |
+
import os
|
35 |
+
import re
|
36 |
+
import shlex
|
37 |
+
import subprocess
|
38 |
+
import sys
|
39 |
+
import warnings
|
40 |
+
from typing import (
|
41 |
+
Any,
|
42 |
+
Callable,
|
43 |
+
Dict,
|
44 |
+
Iterable,
|
45 |
+
Optional,
|
46 |
+
Sequence,
|
47 |
+
TextIO,
|
48 |
+
Tuple,
|
49 |
+
Type,
|
50 |
+
)
|
51 |
+
|
52 |
+
try:
|
53 |
+
from typing import TypedDict
|
54 |
+
except ImportError:
|
55 |
+
# Python 3.7
|
56 |
+
TypedDict = dict
|
57 |
+
|
58 |
+
__version__ = "1.9.0"
|
59 |
+
|
60 |
+
|
61 |
+
class VersionDict(TypedDict):
|
62 |
+
major: str
|
63 |
+
minor: str
|
64 |
+
build_number: str
|
65 |
+
|
66 |
+
|
67 |
+
class InfoDict(TypedDict):
|
68 |
+
id: str
|
69 |
+
version: str
|
70 |
+
version_parts: VersionDict
|
71 |
+
like: str
|
72 |
+
codename: str
|
73 |
+
|
74 |
+
|
75 |
+
_UNIXCONFDIR = os.environ.get("UNIXCONFDIR", "/etc")
|
76 |
+
_UNIXUSRLIBDIR = os.environ.get("UNIXUSRLIBDIR", "/usr/lib")
|
77 |
+
_OS_RELEASE_BASENAME = "os-release"
|
78 |
+
|
79 |
+
#: Translation table for normalizing the "ID" attribute defined in os-release
|
80 |
+
#: files, for use by the :func:`distro.id` method.
|
81 |
+
#:
|
82 |
+
#: * Key: Value as defined in the os-release file, translated to lower case,
|
83 |
+
#: with blanks translated to underscores.
|
84 |
+
#:
|
85 |
+
#: * Value: Normalized value.
|
86 |
+
NORMALIZED_OS_ID = {
|
87 |
+
"ol": "oracle", # Oracle Linux
|
88 |
+
"opensuse-leap": "opensuse", # Newer versions of OpenSuSE report as opensuse-leap
|
89 |
+
}
|
90 |
+
|
91 |
+
#: Translation table for normalizing the "Distributor ID" attribute returned by
|
92 |
+
#: the lsb_release command, for use by the :func:`distro.id` method.
|
93 |
+
#:
|
94 |
+
#: * Key: Value as returned by the lsb_release command, translated to lower
|
95 |
+
#: case, with blanks translated to underscores.
|
96 |
+
#:
|
97 |
+
#: * Value: Normalized value.
|
98 |
+
NORMALIZED_LSB_ID = {
|
99 |
+
"enterpriseenterpriseas": "oracle", # Oracle Enterprise Linux 4
|
100 |
+
"enterpriseenterpriseserver": "oracle", # Oracle Linux 5
|
101 |
+
"redhatenterpriseworkstation": "rhel", # RHEL 6, 7 Workstation
|
102 |
+
"redhatenterpriseserver": "rhel", # RHEL 6, 7 Server
|
103 |
+
"redhatenterprisecomputenode": "rhel", # RHEL 6 ComputeNode
|
104 |
+
}
|
105 |
+
|
106 |
+
#: Translation table for normalizing the distro ID derived from the file name
|
107 |
+
#: of distro release files, for use by the :func:`distro.id` method.
|
108 |
+
#:
|
109 |
+
#: * Key: Value as derived from the file name of a distro release file,
|
110 |
+
#: translated to lower case, with blanks translated to underscores.
|
111 |
+
#:
|
112 |
+
#: * Value: Normalized value.
|
113 |
+
NORMALIZED_DISTRO_ID = {
|
114 |
+
"redhat": "rhel", # RHEL 6.x, 7.x
|
115 |
+
}
|
116 |
+
|
117 |
+
# Pattern for content of distro release file (reversed)
|
118 |
+
_DISTRO_RELEASE_CONTENT_REVERSED_PATTERN = re.compile(
|
119 |
+
r"(?:[^)]*\)(.*)\()? *(?:STL )?([\d.+\-a-z]*\d) *(?:esaeler *)?(.+)"
|
120 |
+
)
|
121 |
+
|
122 |
+
# Pattern for base file name of distro release file
|
123 |
+
_DISTRO_RELEASE_BASENAME_PATTERN = re.compile(r"(\w+)[-_](release|version)$")
|
124 |
+
|
125 |
+
# Base file names to be looked up for if _UNIXCONFDIR is not readable.
|
126 |
+
_DISTRO_RELEASE_BASENAMES = [
|
127 |
+
"SuSE-release",
|
128 |
+
"altlinux-release",
|
129 |
+
"arch-release",
|
130 |
+
"base-release",
|
131 |
+
"centos-release",
|
132 |
+
"fedora-release",
|
133 |
+
"gentoo-release",
|
134 |
+
"mageia-release",
|
135 |
+
"mandrake-release",
|
136 |
+
"mandriva-release",
|
137 |
+
"mandrivalinux-release",
|
138 |
+
"manjaro-release",
|
139 |
+
"oracle-release",
|
140 |
+
"redhat-release",
|
141 |
+
"rocky-release",
|
142 |
+
"sl-release",
|
143 |
+
"slackware-version",
|
144 |
+
]
|
145 |
+
|
146 |
+
# Base file names to be ignored when searching for distro release file
|
147 |
+
_DISTRO_RELEASE_IGNORE_BASENAMES = (
|
148 |
+
"debian_version",
|
149 |
+
"lsb-release",
|
150 |
+
"oem-release",
|
151 |
+
_OS_RELEASE_BASENAME,
|
152 |
+
"system-release",
|
153 |
+
"plesk-release",
|
154 |
+
"iredmail-release",
|
155 |
+
"board-release",
|
156 |
+
"ec2_version",
|
157 |
+
)
|
158 |
+
|
159 |
+
|
160 |
+
def linux_distribution(full_distribution_name: bool = True) -> Tuple[str, str, str]:
|
161 |
+
"""
|
162 |
+
.. deprecated:: 1.6.0
|
163 |
+
|
164 |
+
:func:`distro.linux_distribution()` is deprecated. It should only be
|
165 |
+
used as a compatibility shim with Python's
|
166 |
+
:py:func:`platform.linux_distribution()`. Please use :func:`distro.id`,
|
167 |
+
:func:`distro.version` and :func:`distro.name` instead.
|
168 |
+
|
169 |
+
Return information about the current OS distribution as a tuple
|
170 |
+
``(id_name, version, codename)`` with items as follows:
|
171 |
+
|
172 |
+
* ``id_name``: If *full_distribution_name* is false, the result of
|
173 |
+
:func:`distro.id`. Otherwise, the result of :func:`distro.name`.
|
174 |
+
|
175 |
+
* ``version``: The result of :func:`distro.version`.
|
176 |
+
|
177 |
+
* ``codename``: The extra item (usually in parentheses) after the
|
178 |
+
os-release version number, or the result of :func:`distro.codename`.
|
179 |
+
|
180 |
+
The interface of this function is compatible with the original
|
181 |
+
:py:func:`platform.linux_distribution` function, supporting a subset of
|
182 |
+
its parameters.
|
183 |
+
|
184 |
+
The data it returns may not exactly be the same, because it uses more data
|
185 |
+
sources than the original function, and that may lead to different data if
|
186 |
+
the OS distribution is not consistent across multiple data sources it
|
187 |
+
provides (there are indeed such distributions ...).
|
188 |
+
|
189 |
+
Another reason for differences is the fact that the :func:`distro.id`
|
190 |
+
method normalizes the distro ID string to a reliable machine-readable value
|
191 |
+
for a number of popular OS distributions.
|
192 |
+
"""
|
193 |
+
warnings.warn(
|
194 |
+
"distro.linux_distribution() is deprecated. It should only be used as a "
|
195 |
+
"compatibility shim with Python's platform.linux_distribution(). Please use "
|
196 |
+
"distro.id(), distro.version() and distro.name() instead.",
|
197 |
+
DeprecationWarning,
|
198 |
+
stacklevel=2,
|
199 |
+
)
|
200 |
+
return _distro.linux_distribution(full_distribution_name)
|
201 |
+
|
202 |
+
|
203 |
+
def id() -> str:
|
204 |
+
"""
|
205 |
+
Return the distro ID of the current distribution, as a
|
206 |
+
machine-readable string.
|
207 |
+
|
208 |
+
For a number of OS distributions, the returned distro ID value is
|
209 |
+
*reliable*, in the sense that it is documented and that it does not change
|
210 |
+
across releases of the distribution.
|
211 |
+
|
212 |
+
This package maintains the following reliable distro ID values:
|
213 |
+
|
214 |
+
============== =========================================
|
215 |
+
Distro ID Distribution
|
216 |
+
============== =========================================
|
217 |
+
"ubuntu" Ubuntu
|
218 |
+
"debian" Debian
|
219 |
+
"rhel" RedHat Enterprise Linux
|
220 |
+
"centos" CentOS
|
221 |
+
"fedora" Fedora
|
222 |
+
"sles" SUSE Linux Enterprise Server
|
223 |
+
"opensuse" openSUSE
|
224 |
+
"amzn" Amazon Linux
|
225 |
+
"arch" Arch Linux
|
226 |
+
"buildroot" Buildroot
|
227 |
+
"cloudlinux" CloudLinux OS
|
228 |
+
"exherbo" Exherbo Linux
|
229 |
+
"gentoo" GenToo Linux
|
230 |
+
"ibm_powerkvm" IBM PowerKVM
|
231 |
+
"kvmibm" KVM for IBM z Systems
|
232 |
+
"linuxmint" Linux Mint
|
233 |
+
"mageia" Mageia
|
234 |
+
"mandriva" Mandriva Linux
|
235 |
+
"parallels" Parallels
|
236 |
+
"pidora" Pidora
|
237 |
+
"raspbian" Raspbian
|
238 |
+
"oracle" Oracle Linux (and Oracle Enterprise Linux)
|
239 |
+
"scientific" Scientific Linux
|
240 |
+
"slackware" Slackware
|
241 |
+
"xenserver" XenServer
|
242 |
+
"openbsd" OpenBSD
|
243 |
+
"netbsd" NetBSD
|
244 |
+
"freebsd" FreeBSD
|
245 |
+
"midnightbsd" MidnightBSD
|
246 |
+
"rocky" Rocky Linux
|
247 |
+
"aix" AIX
|
248 |
+
"guix" Guix System
|
249 |
+
"altlinux" ALT Linux
|
250 |
+
============== =========================================
|
251 |
+
|
252 |
+
If you have a need to get distros for reliable IDs added into this set,
|
253 |
+
or if you find that the :func:`distro.id` function returns a different
|
254 |
+
distro ID for one of the listed distros, please create an issue in the
|
255 |
+
`distro issue tracker`_.
|
256 |
+
|
257 |
+
**Lookup hierarchy and transformations:**
|
258 |
+
|
259 |
+
First, the ID is obtained from the following sources, in the specified
|
260 |
+
order. The first available and non-empty value is used:
|
261 |
+
|
262 |
+
* the value of the "ID" attribute of the os-release file,
|
263 |
+
|
264 |
+
* the value of the "Distributor ID" attribute returned by the lsb_release
|
265 |
+
command,
|
266 |
+
|
267 |
+
* the first part of the file name of the distro release file,
|
268 |
+
|
269 |
+
The so determined ID value then passes the following transformations,
|
270 |
+
before it is returned by this method:
|
271 |
+
|
272 |
+
* it is translated to lower case,
|
273 |
+
|
274 |
+
* blanks (which should not be there anyway) are translated to underscores,
|
275 |
+
|
276 |
+
* a normalization of the ID is performed, based upon
|
277 |
+
`normalization tables`_. The purpose of this normalization is to ensure
|
278 |
+
that the ID is as reliable as possible, even across incompatible changes
|
279 |
+
in the OS distributions. A common reason for an incompatible change is
|
280 |
+
the addition of an os-release file, or the addition of the lsb_release
|
281 |
+
command, with ID values that differ from what was previously determined
|
282 |
+
from the distro release file name.
|
283 |
+
"""
|
284 |
+
return _distro.id()
|
285 |
+
|
286 |
+
|
287 |
+
def name(pretty: bool = False) -> str:
|
288 |
+
"""
|
289 |
+
Return the name of the current OS distribution, as a human-readable
|
290 |
+
string.
|
291 |
+
|
292 |
+
If *pretty* is false, the name is returned without version or codename.
|
293 |
+
(e.g. "CentOS Linux")
|
294 |
+
|
295 |
+
If *pretty* is true, the version and codename are appended.
|
296 |
+
(e.g. "CentOS Linux 7.1.1503 (Core)")
|
297 |
+
|
298 |
+
**Lookup hierarchy:**
|
299 |
+
|
300 |
+
The name is obtained from the following sources, in the specified order.
|
301 |
+
The first available and non-empty value is used:
|
302 |
+
|
303 |
+
* If *pretty* is false:
|
304 |
+
|
305 |
+
- the value of the "NAME" attribute of the os-release file,
|
306 |
+
|
307 |
+
- the value of the "Distributor ID" attribute returned by the lsb_release
|
308 |
+
command,
|
309 |
+
|
310 |
+
- the value of the "<name>" field of the distro release file.
|
311 |
+
|
312 |
+
* If *pretty* is true:
|
313 |
+
|
314 |
+
- the value of the "PRETTY_NAME" attribute of the os-release file,
|
315 |
+
|
316 |
+
- the value of the "Description" attribute returned by the lsb_release
|
317 |
+
command,
|
318 |
+
|
319 |
+
- the value of the "<name>" field of the distro release file, appended
|
320 |
+
with the value of the pretty version ("<version_id>" and "<codename>"
|
321 |
+
fields) of the distro release file, if available.
|
322 |
+
"""
|
323 |
+
return _distro.name(pretty)
|
324 |
+
|
325 |
+
|
326 |
+
def version(pretty: bool = False, best: bool = False) -> str:
|
327 |
+
"""
|
328 |
+
Return the version of the current OS distribution, as a human-readable
|
329 |
+
string.
|
330 |
+
|
331 |
+
If *pretty* is false, the version is returned without codename (e.g.
|
332 |
+
"7.0").
|
333 |
+
|
334 |
+
If *pretty* is true, the codename in parenthesis is appended, if the
|
335 |
+
codename is non-empty (e.g. "7.0 (Maipo)").
|
336 |
+
|
337 |
+
Some distributions provide version numbers with different precisions in
|
338 |
+
the different sources of distribution information. Examining the different
|
339 |
+
sources in a fixed priority order does not always yield the most precise
|
340 |
+
version (e.g. for Debian 8.2, or CentOS 7.1).
|
341 |
+
|
342 |
+
Some other distributions may not provide this kind of information. In these
|
343 |
+
cases, an empty string would be returned. This behavior can be observed
|
344 |
+
with rolling releases distributions (e.g. Arch Linux).
|
345 |
+
|
346 |
+
The *best* parameter can be used to control the approach for the returned
|
347 |
+
version:
|
348 |
+
|
349 |
+
If *best* is false, the first non-empty version number in priority order of
|
350 |
+
the examined sources is returned.
|
351 |
+
|
352 |
+
If *best* is true, the most precise version number out of all examined
|
353 |
+
sources is returned.
|
354 |
+
|
355 |
+
**Lookup hierarchy:**
|
356 |
+
|
357 |
+
In all cases, the version number is obtained from the following sources.
|
358 |
+
If *best* is false, this order represents the priority order:
|
359 |
+
|
360 |
+
* the value of the "VERSION_ID" attribute of the os-release file,
|
361 |
+
* the value of the "Release" attribute returned by the lsb_release
|
362 |
+
command,
|
363 |
+
* the version number parsed from the "<version_id>" field of the first line
|
364 |
+
of the distro release file,
|
365 |
+
* the version number parsed from the "PRETTY_NAME" attribute of the
|
366 |
+
os-release file, if it follows the format of the distro release files.
|
367 |
+
* the version number parsed from the "Description" attribute returned by
|
368 |
+
the lsb_release command, if it follows the format of the distro release
|
369 |
+
files.
|
370 |
+
"""
|
371 |
+
return _distro.version(pretty, best)
|
372 |
+
|
373 |
+
|
374 |
+
def version_parts(best: bool = False) -> Tuple[str, str, str]:
|
375 |
+
"""
|
376 |
+
Return the version of the current OS distribution as a tuple
|
377 |
+
``(major, minor, build_number)`` with items as follows:
|
378 |
+
|
379 |
+
* ``major``: The result of :func:`distro.major_version`.
|
380 |
+
|
381 |
+
* ``minor``: The result of :func:`distro.minor_version`.
|
382 |
+
|
383 |
+
* ``build_number``: The result of :func:`distro.build_number`.
|
384 |
+
|
385 |
+
For a description of the *best* parameter, see the :func:`distro.version`
|
386 |
+
method.
|
387 |
+
"""
|
388 |
+
return _distro.version_parts(best)
|
389 |
+
|
390 |
+
|
391 |
+
def major_version(best: bool = False) -> str:
|
392 |
+
"""
|
393 |
+
Return the major version of the current OS distribution, as a string,
|
394 |
+
if provided.
|
395 |
+
Otherwise, the empty string is returned. The major version is the first
|
396 |
+
part of the dot-separated version string.
|
397 |
+
|
398 |
+
For a description of the *best* parameter, see the :func:`distro.version`
|
399 |
+
method.
|
400 |
+
"""
|
401 |
+
return _distro.major_version(best)
|
402 |
+
|
403 |
+
|
404 |
+
def minor_version(best: bool = False) -> str:
|
405 |
+
"""
|
406 |
+
Return the minor version of the current OS distribution, as a string,
|
407 |
+
if provided.
|
408 |
+
Otherwise, the empty string is returned. The minor version is the second
|
409 |
+
part of the dot-separated version string.
|
410 |
+
|
411 |
+
For a description of the *best* parameter, see the :func:`distro.version`
|
412 |
+
method.
|
413 |
+
"""
|
414 |
+
return _distro.minor_version(best)
|
415 |
+
|
416 |
+
|
417 |
+
def build_number(best: bool = False) -> str:
|
418 |
+
"""
|
419 |
+
Return the build number of the current OS distribution, as a string,
|
420 |
+
if provided.
|
421 |
+
Otherwise, the empty string is returned. The build number is the third part
|
422 |
+
of the dot-separated version string.
|
423 |
+
|
424 |
+
For a description of the *best* parameter, see the :func:`distro.version`
|
425 |
+
method.
|
426 |
+
"""
|
427 |
+
return _distro.build_number(best)
|
428 |
+
|
429 |
+
|
430 |
+
def like() -> str:
|
431 |
+
"""
|
432 |
+
Return a space-separated list of distro IDs of distributions that are
|
433 |
+
closely related to the current OS distribution in regards to packaging
|
434 |
+
and programming interfaces, for example distributions the current
|
435 |
+
distribution is a derivative from.
|
436 |
+
|
437 |
+
**Lookup hierarchy:**
|
438 |
+
|
439 |
+
This information item is only provided by the os-release file.
|
440 |
+
For details, see the description of the "ID_LIKE" attribute in the
|
441 |
+
`os-release man page
|
442 |
+
<http://www.freedesktop.org/software/systemd/man/os-release.html>`_.
|
443 |
+
"""
|
444 |
+
return _distro.like()
|
445 |
+
|
446 |
+
|
447 |
+
def codename() -> str:
|
448 |
+
"""
|
449 |
+
Return the codename for the release of the current OS distribution,
|
450 |
+
as a string.
|
451 |
+
|
452 |
+
If the distribution does not have a codename, an empty string is returned.
|
453 |
+
|
454 |
+
Note that the returned codename is not always really a codename. For
|
455 |
+
example, openSUSE returns "x86_64". This function does not handle such
|
456 |
+
cases in any special way and just returns the string it finds, if any.
|
457 |
+
|
458 |
+
**Lookup hierarchy:**
|
459 |
+
|
460 |
+
* the codename within the "VERSION" attribute of the os-release file, if
|
461 |
+
provided,
|
462 |
+
|
463 |
+
* the value of the "Codename" attribute returned by the lsb_release
|
464 |
+
command,
|
465 |
+
|
466 |
+
* the value of the "<codename>" field of the distro release file.
|
467 |
+
"""
|
468 |
+
return _distro.codename()
|
469 |
+
|
470 |
+
|
471 |
+
def info(pretty: bool = False, best: bool = False) -> InfoDict:
|
472 |
+
"""
|
473 |
+
Return certain machine-readable information items about the current OS
|
474 |
+
distribution in a dictionary, as shown in the following example:
|
475 |
+
|
476 |
+
.. sourcecode:: python
|
477 |
+
|
478 |
+
{
|
479 |
+
'id': 'rhel',
|
480 |
+
'version': '7.0',
|
481 |
+
'version_parts': {
|
482 |
+
'major': '7',
|
483 |
+
'minor': '0',
|
484 |
+
'build_number': ''
|
485 |
+
},
|
486 |
+
'like': 'fedora',
|
487 |
+
'codename': 'Maipo'
|
488 |
+
}
|
489 |
+
|
490 |
+
The dictionary structure and keys are always the same, regardless of which
|
491 |
+
information items are available in the underlying data sources. The values
|
492 |
+
for the various keys are as follows:
|
493 |
+
|
494 |
+
* ``id``: The result of :func:`distro.id`.
|
495 |
+
|
496 |
+
* ``version``: The result of :func:`distro.version`.
|
497 |
+
|
498 |
+
* ``version_parts -> major``: The result of :func:`distro.major_version`.
|
499 |
+
|
500 |
+
* ``version_parts -> minor``: The result of :func:`distro.minor_version`.
|
501 |
+
|
502 |
+
* ``version_parts -> build_number``: The result of
|
503 |
+
:func:`distro.build_number`.
|
504 |
+
|
505 |
+
* ``like``: The result of :func:`distro.like`.
|
506 |
+
|
507 |
+
* ``codename``: The result of :func:`distro.codename`.
|
508 |
+
|
509 |
+
For a description of the *pretty* and *best* parameters, see the
|
510 |
+
:func:`distro.version` method.
|
511 |
+
"""
|
512 |
+
return _distro.info(pretty, best)
|
513 |
+
|
514 |
+
|
515 |
+
def os_release_info() -> Dict[str, str]:
|
516 |
+
"""
|
517 |
+
Return a dictionary containing key-value pairs for the information items
|
518 |
+
from the os-release file data source of the current OS distribution.
|
519 |
+
|
520 |
+
See `os-release file`_ for details about these information items.
|
521 |
+
"""
|
522 |
+
return _distro.os_release_info()
|
523 |
+
|
524 |
+
|
525 |
+
def lsb_release_info() -> Dict[str, str]:
|
526 |
+
"""
|
527 |
+
Return a dictionary containing key-value pairs for the information items
|
528 |
+
from the lsb_release command data source of the current OS distribution.
|
529 |
+
|
530 |
+
See `lsb_release command output`_ for details about these information
|
531 |
+
items.
|
532 |
+
"""
|
533 |
+
return _distro.lsb_release_info()
|
534 |
+
|
535 |
+
|
536 |
+
def distro_release_info() -> Dict[str, str]:
|
537 |
+
"""
|
538 |
+
Return a dictionary containing key-value pairs for the information items
|
539 |
+
from the distro release file data source of the current OS distribution.
|
540 |
+
|
541 |
+
See `distro release file`_ for details about these information items.
|
542 |
+
"""
|
543 |
+
return _distro.distro_release_info()
|
544 |
+
|
545 |
+
|
546 |
+
def uname_info() -> Dict[str, str]:
|
547 |
+
"""
|
548 |
+
Return a dictionary containing key-value pairs for the information items
|
549 |
+
from the distro release file data source of the current OS distribution.
|
550 |
+
"""
|
551 |
+
return _distro.uname_info()
|
552 |
+
|
553 |
+
|
554 |
+
def os_release_attr(attribute: str) -> str:
|
555 |
+
"""
|
556 |
+
Return a single named information item from the os-release file data source
|
557 |
+
of the current OS distribution.
|
558 |
+
|
559 |
+
Parameters:
|
560 |
+
|
561 |
+
* ``attribute`` (string): Key of the information item.
|
562 |
+
|
563 |
+
Returns:
|
564 |
+
|
565 |
+
* (string): Value of the information item, if the item exists.
|
566 |
+
The empty string, if the item does not exist.
|
567 |
+
|
568 |
+
See `os-release file`_ for details about these information items.
|
569 |
+
"""
|
570 |
+
return _distro.os_release_attr(attribute)
|
571 |
+
|
572 |
+
|
573 |
+
def lsb_release_attr(attribute: str) -> str:
|
574 |
+
"""
|
575 |
+
Return a single named information item from the lsb_release command output
|
576 |
+
data source of the current OS distribution.
|
577 |
+
|
578 |
+
Parameters:
|
579 |
+
|
580 |
+
* ``attribute`` (string): Key of the information item.
|
581 |
+
|
582 |
+
Returns:
|
583 |
+
|
584 |
+
* (string): Value of the information item, if the item exists.
|
585 |
+
The empty string, if the item does not exist.
|
586 |
+
|
587 |
+
See `lsb_release command output`_ for details about these information
|
588 |
+
items.
|
589 |
+
"""
|
590 |
+
return _distro.lsb_release_attr(attribute)
|
591 |
+
|
592 |
+
|
593 |
+
def distro_release_attr(attribute: str) -> str:
|
594 |
+
"""
|
595 |
+
Return a single named information item from the distro release file
|
596 |
+
data source of the current OS distribution.
|
597 |
+
|
598 |
+
Parameters:
|
599 |
+
|
600 |
+
* ``attribute`` (string): Key of the information item.
|
601 |
+
|
602 |
+
Returns:
|
603 |
+
|
604 |
+
* (string): Value of the information item, if the item exists.
|
605 |
+
The empty string, if the item does not exist.
|
606 |
+
|
607 |
+
See `distro release file`_ for details about these information items.
|
608 |
+
"""
|
609 |
+
return _distro.distro_release_attr(attribute)
|
610 |
+
|
611 |
+
|
612 |
+
def uname_attr(attribute: str) -> str:
|
613 |
+
"""
|
614 |
+
Return a single named information item from the distro release file
|
615 |
+
data source of the current OS distribution.
|
616 |
+
|
617 |
+
Parameters:
|
618 |
+
|
619 |
+
* ``attribute`` (string): Key of the information item.
|
620 |
+
|
621 |
+
Returns:
|
622 |
+
|
623 |
+
* (string): Value of the information item, if the item exists.
|
624 |
+
The empty string, if the item does not exist.
|
625 |
+
"""
|
626 |
+
return _distro.uname_attr(attribute)
|
627 |
+
|
628 |
+
|
629 |
+
try:
|
630 |
+
from functools import cached_property
|
631 |
+
except ImportError:
|
632 |
+
# Python < 3.8
|
633 |
+
class cached_property: # type: ignore
|
634 |
+
"""A version of @property which caches the value. On access, it calls the
|
635 |
+
underlying function and sets the value in `__dict__` so future accesses
|
636 |
+
will not re-call the property.
|
637 |
+
"""
|
638 |
+
|
639 |
+
def __init__(self, f: Callable[[Any], Any]) -> None:
|
640 |
+
self._fname = f.__name__
|
641 |
+
self._f = f
|
642 |
+
|
643 |
+
def __get__(self, obj: Any, owner: Type[Any]) -> Any:
|
644 |
+
assert obj is not None, f"call {self._fname} on an instance"
|
645 |
+
ret = obj.__dict__[self._fname] = self._f(obj)
|
646 |
+
return ret
|
647 |
+
|
648 |
+
|
649 |
+
class LinuxDistribution:
|
650 |
+
"""
|
651 |
+
Provides information about a OS distribution.
|
652 |
+
|
653 |
+
This package creates a private module-global instance of this class with
|
654 |
+
default initialization arguments, that is used by the
|
655 |
+
`consolidated accessor functions`_ and `single source accessor functions`_.
|
656 |
+
By using default initialization arguments, that module-global instance
|
657 |
+
returns data about the current OS distribution (i.e. the distro this
|
658 |
+
package runs on).
|
659 |
+
|
660 |
+
Normally, it is not necessary to create additional instances of this class.
|
661 |
+
However, in situations where control is needed over the exact data sources
|
662 |
+
that are used, instances of this class can be created with a specific
|
663 |
+
distro release file, or a specific os-release file, or without invoking the
|
664 |
+
lsb_release command.
|
665 |
+
"""
|
666 |
+
|
667 |
+
def __init__(
|
668 |
+
self,
|
669 |
+
include_lsb: Optional[bool] = None,
|
670 |
+
os_release_file: str = "",
|
671 |
+
distro_release_file: str = "",
|
672 |
+
include_uname: Optional[bool] = None,
|
673 |
+
root_dir: Optional[str] = None,
|
674 |
+
include_oslevel: Optional[bool] = None,
|
675 |
+
) -> None:
|
676 |
+
"""
|
677 |
+
The initialization method of this class gathers information from the
|
678 |
+
available data sources, and stores that in private instance attributes.
|
679 |
+
Subsequent access to the information items uses these private instance
|
680 |
+
attributes, so that the data sources are read only once.
|
681 |
+
|
682 |
+
Parameters:
|
683 |
+
|
684 |
+
* ``include_lsb`` (bool): Controls whether the
|
685 |
+
`lsb_release command output`_ is included as a data source.
|
686 |
+
|
687 |
+
If the lsb_release command is not available in the program execution
|
688 |
+
path, the data source for the lsb_release command will be empty.
|
689 |
+
|
690 |
+
* ``os_release_file`` (string): The path name of the
|
691 |
+
`os-release file`_ that is to be used as a data source.
|
692 |
+
|
693 |
+
An empty string (the default) will cause the default path name to
|
694 |
+
be used (see `os-release file`_ for details).
|
695 |
+
|
696 |
+
If the specified or defaulted os-release file does not exist, the
|
697 |
+
data source for the os-release file will be empty.
|
698 |
+
|
699 |
+
* ``distro_release_file`` (string): The path name of the
|
700 |
+
`distro release file`_ that is to be used as a data source.
|
701 |
+
|
702 |
+
An empty string (the default) will cause a default search algorithm
|
703 |
+
to be used (see `distro release file`_ for details).
|
704 |
+
|
705 |
+
If the specified distro release file does not exist, or if no default
|
706 |
+
distro release file can be found, the data source for the distro
|
707 |
+
release file will be empty.
|
708 |
+
|
709 |
+
* ``include_uname`` (bool): Controls whether uname command output is
|
710 |
+
included as a data source. If the uname command is not available in
|
711 |
+
the program execution path the data source for the uname command will
|
712 |
+
be empty.
|
713 |
+
|
714 |
+
* ``root_dir`` (string): The absolute path to the root directory to use
|
715 |
+
to find distro-related information files. Note that ``include_*``
|
716 |
+
parameters must not be enabled in combination with ``root_dir``.
|
717 |
+
|
718 |
+
* ``include_oslevel`` (bool): Controls whether (AIX) oslevel command
|
719 |
+
output is included as a data source. If the oslevel command is not
|
720 |
+
available in the program execution path the data source will be
|
721 |
+
empty.
|
722 |
+
|
723 |
+
Public instance attributes:
|
724 |
+
|
725 |
+
* ``os_release_file`` (string): The path name of the
|
726 |
+
`os-release file`_ that is actually used as a data source. The
|
727 |
+
empty string if no distro release file is used as a data source.
|
728 |
+
|
729 |
+
* ``distro_release_file`` (string): The path name of the
|
730 |
+
`distro release file`_ that is actually used as a data source. The
|
731 |
+
empty string if no distro release file is used as a data source.
|
732 |
+
|
733 |
+
* ``include_lsb`` (bool): The result of the ``include_lsb`` parameter.
|
734 |
+
This controls whether the lsb information will be loaded.
|
735 |
+
|
736 |
+
* ``include_uname`` (bool): The result of the ``include_uname``
|
737 |
+
parameter. This controls whether the uname information will
|
738 |
+
be loaded.
|
739 |
+
|
740 |
+
* ``include_oslevel`` (bool): The result of the ``include_oslevel``
|
741 |
+
parameter. This controls whether (AIX) oslevel information will be
|
742 |
+
loaded.
|
743 |
+
|
744 |
+
* ``root_dir`` (string): The result of the ``root_dir`` parameter.
|
745 |
+
The absolute path to the root directory to use to find distro-related
|
746 |
+
information files.
|
747 |
+
|
748 |
+
Raises:
|
749 |
+
|
750 |
+
* :py:exc:`ValueError`: Initialization parameters combination is not
|
751 |
+
supported.
|
752 |
+
|
753 |
+
* :py:exc:`OSError`: Some I/O issue with an os-release file or distro
|
754 |
+
release file.
|
755 |
+
|
756 |
+
* :py:exc:`UnicodeError`: A data source has unexpected characters or
|
757 |
+
uses an unexpected encoding.
|
758 |
+
"""
|
759 |
+
self.root_dir = root_dir
|
760 |
+
self.etc_dir = os.path.join(root_dir, "etc") if root_dir else _UNIXCONFDIR
|
761 |
+
self.usr_lib_dir = (
|
762 |
+
os.path.join(root_dir, "usr/lib") if root_dir else _UNIXUSRLIBDIR
|
763 |
+
)
|
764 |
+
|
765 |
+
if os_release_file:
|
766 |
+
self.os_release_file = os_release_file
|
767 |
+
else:
|
768 |
+
etc_dir_os_release_file = os.path.join(self.etc_dir, _OS_RELEASE_BASENAME)
|
769 |
+
usr_lib_os_release_file = os.path.join(
|
770 |
+
self.usr_lib_dir, _OS_RELEASE_BASENAME
|
771 |
+
)
|
772 |
+
|
773 |
+
# NOTE: The idea is to respect order **and** have it set
|
774 |
+
# at all times for API backwards compatibility.
|
775 |
+
if os.path.isfile(etc_dir_os_release_file) or not os.path.isfile(
|
776 |
+
usr_lib_os_release_file
|
777 |
+
):
|
778 |
+
self.os_release_file = etc_dir_os_release_file
|
779 |
+
else:
|
780 |
+
self.os_release_file = usr_lib_os_release_file
|
781 |
+
|
782 |
+
self.distro_release_file = distro_release_file or "" # updated later
|
783 |
+
|
784 |
+
is_root_dir_defined = root_dir is not None
|
785 |
+
if is_root_dir_defined and (include_lsb or include_uname or include_oslevel):
|
786 |
+
raise ValueError(
|
787 |
+
"Including subprocess data sources from specific root_dir is disallowed"
|
788 |
+
" to prevent false information"
|
789 |
+
)
|
790 |
+
self.include_lsb = (
|
791 |
+
include_lsb if include_lsb is not None else not is_root_dir_defined
|
792 |
+
)
|
793 |
+
self.include_uname = (
|
794 |
+
include_uname if include_uname is not None else not is_root_dir_defined
|
795 |
+
)
|
796 |
+
self.include_oslevel = (
|
797 |
+
include_oslevel if include_oslevel is not None else not is_root_dir_defined
|
798 |
+
)
|
799 |
+
|
800 |
+
def __repr__(self) -> str:
|
801 |
+
"""Return repr of all info"""
|
802 |
+
return (
|
803 |
+
"LinuxDistribution("
|
804 |
+
"os_release_file={self.os_release_file!r}, "
|
805 |
+
"distro_release_file={self.distro_release_file!r}, "
|
806 |
+
"include_lsb={self.include_lsb!r}, "
|
807 |
+
"include_uname={self.include_uname!r}, "
|
808 |
+
"include_oslevel={self.include_oslevel!r}, "
|
809 |
+
"root_dir={self.root_dir!r}, "
|
810 |
+
"_os_release_info={self._os_release_info!r}, "
|
811 |
+
"_lsb_release_info={self._lsb_release_info!r}, "
|
812 |
+
"_distro_release_info={self._distro_release_info!r}, "
|
813 |
+
"_uname_info={self._uname_info!r}, "
|
814 |
+
"_oslevel_info={self._oslevel_info!r})".format(self=self)
|
815 |
+
)
|
816 |
+
|
817 |
+
def linux_distribution(
|
818 |
+
self, full_distribution_name: bool = True
|
819 |
+
) -> Tuple[str, str, str]:
|
820 |
+
"""
|
821 |
+
Return information about the OS distribution that is compatible
|
822 |
+
with Python's :func:`platform.linux_distribution`, supporting a subset
|
823 |
+
of its parameters.
|
824 |
+
|
825 |
+
For details, see :func:`distro.linux_distribution`.
|
826 |
+
"""
|
827 |
+
return (
|
828 |
+
self.name() if full_distribution_name else self.id(),
|
829 |
+
self.version(),
|
830 |
+
self._os_release_info.get("release_codename") or self.codename(),
|
831 |
+
)
|
832 |
+
|
833 |
+
def id(self) -> str:
|
834 |
+
"""Return the distro ID of the OS distribution, as a string.
|
835 |
+
|
836 |
+
For details, see :func:`distro.id`.
|
837 |
+
"""
|
838 |
+
|
839 |
+
def normalize(distro_id: str, table: Dict[str, str]) -> str:
|
840 |
+
distro_id = distro_id.lower().replace(" ", "_")
|
841 |
+
return table.get(distro_id, distro_id)
|
842 |
+
|
843 |
+
distro_id = self.os_release_attr("id")
|
844 |
+
if distro_id:
|
845 |
+
return normalize(distro_id, NORMALIZED_OS_ID)
|
846 |
+
|
847 |
+
distro_id = self.lsb_release_attr("distributor_id")
|
848 |
+
if distro_id:
|
849 |
+
return normalize(distro_id, NORMALIZED_LSB_ID)
|
850 |
+
|
851 |
+
distro_id = self.distro_release_attr("id")
|
852 |
+
if distro_id:
|
853 |
+
return normalize(distro_id, NORMALIZED_DISTRO_ID)
|
854 |
+
|
855 |
+
distro_id = self.uname_attr("id")
|
856 |
+
if distro_id:
|
857 |
+
return normalize(distro_id, NORMALIZED_DISTRO_ID)
|
858 |
+
|
859 |
+
return ""
|
860 |
+
|
861 |
+
def name(self, pretty: bool = False) -> str:
|
862 |
+
"""
|
863 |
+
Return the name of the OS distribution, as a string.
|
864 |
+
|
865 |
+
For details, see :func:`distro.name`.
|
866 |
+
"""
|
867 |
+
name = (
|
868 |
+
self.os_release_attr("name")
|
869 |
+
or self.lsb_release_attr("distributor_id")
|
870 |
+
or self.distro_release_attr("name")
|
871 |
+
or self.uname_attr("name")
|
872 |
+
)
|
873 |
+
if pretty:
|
874 |
+
name = self.os_release_attr("pretty_name") or self.lsb_release_attr(
|
875 |
+
"description"
|
876 |
+
)
|
877 |
+
if not name:
|
878 |
+
name = self.distro_release_attr("name") or self.uname_attr("name")
|
879 |
+
version = self.version(pretty=True)
|
880 |
+
if version:
|
881 |
+
name = f"{name} {version}"
|
882 |
+
return name or ""
|
883 |
+
|
884 |
+
def version(self, pretty: bool = False, best: bool = False) -> str:
|
885 |
+
"""
|
886 |
+
Return the version of the OS distribution, as a string.
|
887 |
+
|
888 |
+
For details, see :func:`distro.version`.
|
889 |
+
"""
|
890 |
+
versions = [
|
891 |
+
self.os_release_attr("version_id"),
|
892 |
+
self.lsb_release_attr("release"),
|
893 |
+
self.distro_release_attr("version_id"),
|
894 |
+
self._parse_distro_release_content(self.os_release_attr("pretty_name")).get(
|
895 |
+
"version_id", ""
|
896 |
+
),
|
897 |
+
self._parse_distro_release_content(
|
898 |
+
self.lsb_release_attr("description")
|
899 |
+
).get("version_id", ""),
|
900 |
+
self.uname_attr("release"),
|
901 |
+
]
|
902 |
+
if self.uname_attr("id").startswith("aix"):
|
903 |
+
# On AIX platforms, prefer oslevel command output.
|
904 |
+
versions.insert(0, self.oslevel_info())
|
905 |
+
elif self.id() == "debian" or "debian" in self.like().split():
|
906 |
+
# On Debian-like, add debian_version file content to candidates list.
|
907 |
+
versions.append(self._debian_version)
|
908 |
+
version = ""
|
909 |
+
if best:
|
910 |
+
# This algorithm uses the last version in priority order that has
|
911 |
+
# the best precision. If the versions are not in conflict, that
|
912 |
+
# does not matter; otherwise, using the last one instead of the
|
913 |
+
# first one might be considered a surprise.
|
914 |
+
for v in versions:
|
915 |
+
if v.count(".") > version.count(".") or version == "":
|
916 |
+
version = v
|
917 |
+
else:
|
918 |
+
for v in versions:
|
919 |
+
if v != "":
|
920 |
+
version = v
|
921 |
+
break
|
922 |
+
if pretty and version and self.codename():
|
923 |
+
version = f"{version} ({self.codename()})"
|
924 |
+
return version
|
925 |
+
|
926 |
+
def version_parts(self, best: bool = False) -> Tuple[str, str, str]:
|
927 |
+
"""
|
928 |
+
Return the version of the OS distribution, as a tuple of version
|
929 |
+
numbers.
|
930 |
+
|
931 |
+
For details, see :func:`distro.version_parts`.
|
932 |
+
"""
|
933 |
+
version_str = self.version(best=best)
|
934 |
+
if version_str:
|
935 |
+
version_regex = re.compile(r"(\d+)\.?(\d+)?\.?(\d+)?")
|
936 |
+
matches = version_regex.match(version_str)
|
937 |
+
if matches:
|
938 |
+
major, minor, build_number = matches.groups()
|
939 |
+
return major, minor or "", build_number or ""
|
940 |
+
return "", "", ""
|
941 |
+
|
942 |
+
def major_version(self, best: bool = False) -> str:
|
943 |
+
"""
|
944 |
+
Return the major version number of the current distribution.
|
945 |
+
|
946 |
+
For details, see :func:`distro.major_version`.
|
947 |
+
"""
|
948 |
+
return self.version_parts(best)[0]
|
949 |
+
|
950 |
+
def minor_version(self, best: bool = False) -> str:
|
951 |
+
"""
|
952 |
+
Return the minor version number of the current distribution.
|
953 |
+
|
954 |
+
For details, see :func:`distro.minor_version`.
|
955 |
+
"""
|
956 |
+
return self.version_parts(best)[1]
|
957 |
+
|
958 |
+
def build_number(self, best: bool = False) -> str:
|
959 |
+
"""
|
960 |
+
Return the build number of the current distribution.
|
961 |
+
|
962 |
+
For details, see :func:`distro.build_number`.
|
963 |
+
"""
|
964 |
+
return self.version_parts(best)[2]
|
965 |
+
|
966 |
+
def like(self) -> str:
|
967 |
+
"""
|
968 |
+
Return the IDs of distributions that are like the OS distribution.
|
969 |
+
|
970 |
+
For details, see :func:`distro.like`.
|
971 |
+
"""
|
972 |
+
return self.os_release_attr("id_like") or ""
|
973 |
+
|
974 |
+
def codename(self) -> str:
|
975 |
+
"""
|
976 |
+
Return the codename of the OS distribution.
|
977 |
+
|
978 |
+
For details, see :func:`distro.codename`.
|
979 |
+
"""
|
980 |
+
try:
|
981 |
+
# Handle os_release specially since distros might purposefully set
|
982 |
+
# this to empty string to have no codename
|
983 |
+
return self._os_release_info["codename"]
|
984 |
+
except KeyError:
|
985 |
+
return (
|
986 |
+
self.lsb_release_attr("codename")
|
987 |
+
or self.distro_release_attr("codename")
|
988 |
+
or ""
|
989 |
+
)
|
990 |
+
|
991 |
+
def info(self, pretty: bool = False, best: bool = False) -> InfoDict:
|
992 |
+
"""
|
993 |
+
Return certain machine-readable information about the OS
|
994 |
+
distribution.
|
995 |
+
|
996 |
+
For details, see :func:`distro.info`.
|
997 |
+
"""
|
998 |
+
return InfoDict(
|
999 |
+
id=self.id(),
|
1000 |
+
version=self.version(pretty, best),
|
1001 |
+
version_parts=VersionDict(
|
1002 |
+
major=self.major_version(best),
|
1003 |
+
minor=self.minor_version(best),
|
1004 |
+
build_number=self.build_number(best),
|
1005 |
+
),
|
1006 |
+
like=self.like(),
|
1007 |
+
codename=self.codename(),
|
1008 |
+
)
|
1009 |
+
|
1010 |
+
def os_release_info(self) -> Dict[str, str]:
|
1011 |
+
"""
|
1012 |
+
Return a dictionary containing key-value pairs for the information
|
1013 |
+
items from the os-release file data source of the OS distribution.
|
1014 |
+
|
1015 |
+
For details, see :func:`distro.os_release_info`.
|
1016 |
+
"""
|
1017 |
+
return self._os_release_info
|
1018 |
+
|
1019 |
+
def lsb_release_info(self) -> Dict[str, str]:
|
1020 |
+
"""
|
1021 |
+
Return a dictionary containing key-value pairs for the information
|
1022 |
+
items from the lsb_release command data source of the OS
|
1023 |
+
distribution.
|
1024 |
+
|
1025 |
+
For details, see :func:`distro.lsb_release_info`.
|
1026 |
+
"""
|
1027 |
+
return self._lsb_release_info
|
1028 |
+
|
1029 |
+
def distro_release_info(self) -> Dict[str, str]:
|
1030 |
+
"""
|
1031 |
+
Return a dictionary containing key-value pairs for the information
|
1032 |
+
items from the distro release file data source of the OS
|
1033 |
+
distribution.
|
1034 |
+
|
1035 |
+
For details, see :func:`distro.distro_release_info`.
|
1036 |
+
"""
|
1037 |
+
return self._distro_release_info
|
1038 |
+
|
1039 |
+
def uname_info(self) -> Dict[str, str]:
|
1040 |
+
"""
|
1041 |
+
Return a dictionary containing key-value pairs for the information
|
1042 |
+
items from the uname command data source of the OS distribution.
|
1043 |
+
|
1044 |
+
For details, see :func:`distro.uname_info`.
|
1045 |
+
"""
|
1046 |
+
return self._uname_info
|
1047 |
+
|
1048 |
+
def oslevel_info(self) -> str:
|
1049 |
+
"""
|
1050 |
+
Return AIX' oslevel command output.
|
1051 |
+
"""
|
1052 |
+
return self._oslevel_info
|
1053 |
+
|
1054 |
+
def os_release_attr(self, attribute: str) -> str:
|
1055 |
+
"""
|
1056 |
+
Return a single named information item from the os-release file data
|
1057 |
+
source of the OS distribution.
|
1058 |
+
|
1059 |
+
For details, see :func:`distro.os_release_attr`.
|
1060 |
+
"""
|
1061 |
+
return self._os_release_info.get(attribute, "")
|
1062 |
+
|
1063 |
+
def lsb_release_attr(self, attribute: str) -> str:
|
1064 |
+
"""
|
1065 |
+
Return a single named information item from the lsb_release command
|
1066 |
+
output data source of the OS distribution.
|
1067 |
+
|
1068 |
+
For details, see :func:`distro.lsb_release_attr`.
|
1069 |
+
"""
|
1070 |
+
return self._lsb_release_info.get(attribute, "")
|
1071 |
+
|
1072 |
+
def distro_release_attr(self, attribute: str) -> str:
|
1073 |
+
"""
|
1074 |
+
Return a single named information item from the distro release file
|
1075 |
+
data source of the OS distribution.
|
1076 |
+
|
1077 |
+
For details, see :func:`distro.distro_release_attr`.
|
1078 |
+
"""
|
1079 |
+
return self._distro_release_info.get(attribute, "")
|
1080 |
+
|
1081 |
+
def uname_attr(self, attribute: str) -> str:
|
1082 |
+
"""
|
1083 |
+
Return a single named information item from the uname command
|
1084 |
+
output data source of the OS distribution.
|
1085 |
+
|
1086 |
+
For details, see :func:`distro.uname_attr`.
|
1087 |
+
"""
|
1088 |
+
return self._uname_info.get(attribute, "")
|
1089 |
+
|
1090 |
+
@cached_property
|
1091 |
+
def _os_release_info(self) -> Dict[str, str]:
|
1092 |
+
"""
|
1093 |
+
Get the information items from the specified os-release file.
|
1094 |
+
|
1095 |
+
Returns:
|
1096 |
+
A dictionary containing all information items.
|
1097 |
+
"""
|
1098 |
+
if os.path.isfile(self.os_release_file):
|
1099 |
+
with open(self.os_release_file, encoding="utf-8") as release_file:
|
1100 |
+
return self._parse_os_release_content(release_file)
|
1101 |
+
return {}
|
1102 |
+
|
1103 |
+
@staticmethod
|
1104 |
+
def _parse_os_release_content(lines: TextIO) -> Dict[str, str]:
|
1105 |
+
"""
|
1106 |
+
Parse the lines of an os-release file.
|
1107 |
+
|
1108 |
+
Parameters:
|
1109 |
+
|
1110 |
+
* lines: Iterable through the lines in the os-release file.
|
1111 |
+
Each line must be a unicode string or a UTF-8 encoded byte
|
1112 |
+
string.
|
1113 |
+
|
1114 |
+
Returns:
|
1115 |
+
A dictionary containing all information items.
|
1116 |
+
"""
|
1117 |
+
props = {}
|
1118 |
+
lexer = shlex.shlex(lines, posix=True)
|
1119 |
+
lexer.whitespace_split = True
|
1120 |
+
|
1121 |
+
tokens = list(lexer)
|
1122 |
+
for token in tokens:
|
1123 |
+
# At this point, all shell-like parsing has been done (i.e.
|
1124 |
+
# comments processed, quotes and backslash escape sequences
|
1125 |
+
# processed, multi-line values assembled, trailing newlines
|
1126 |
+
# stripped, etc.), so the tokens are now either:
|
1127 |
+
# * variable assignments: var=value
|
1128 |
+
# * commands or their arguments (not allowed in os-release)
|
1129 |
+
# Ignore any tokens that are not variable assignments
|
1130 |
+
if "=" in token:
|
1131 |
+
k, v = token.split("=", 1)
|
1132 |
+
props[k.lower()] = v
|
1133 |
+
|
1134 |
+
if "version" in props:
|
1135 |
+
# extract release codename (if any) from version attribute
|
1136 |
+
match = re.search(r"\((\D+)\)|,\s*(\D+)", props["version"])
|
1137 |
+
if match:
|
1138 |
+
release_codename = match.group(1) or match.group(2)
|
1139 |
+
props["codename"] = props["release_codename"] = release_codename
|
1140 |
+
|
1141 |
+
if "version_codename" in props:
|
1142 |
+
# os-release added a version_codename field. Use that in
|
1143 |
+
# preference to anything else Note that some distros purposefully
|
1144 |
+
# do not have code names. They should be setting
|
1145 |
+
# version_codename=""
|
1146 |
+
props["codename"] = props["version_codename"]
|
1147 |
+
elif "ubuntu_codename" in props:
|
1148 |
+
# Same as above but a non-standard field name used on older Ubuntus
|
1149 |
+
props["codename"] = props["ubuntu_codename"]
|
1150 |
+
|
1151 |
+
return props
|
1152 |
+
|
1153 |
+
@cached_property
|
1154 |
+
def _lsb_release_info(self) -> Dict[str, str]:
|
1155 |
+
"""
|
1156 |
+
Get the information items from the lsb_release command output.
|
1157 |
+
|
1158 |
+
Returns:
|
1159 |
+
A dictionary containing all information items.
|
1160 |
+
"""
|
1161 |
+
if not self.include_lsb:
|
1162 |
+
return {}
|
1163 |
+
try:
|
1164 |
+
cmd = ("lsb_release", "-a")
|
1165 |
+
stdout = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
|
1166 |
+
# Command not found or lsb_release returned error
|
1167 |
+
except (OSError, subprocess.CalledProcessError):
|
1168 |
+
return {}
|
1169 |
+
content = self._to_str(stdout).splitlines()
|
1170 |
+
return self._parse_lsb_release_content(content)
|
1171 |
+
|
1172 |
+
@staticmethod
|
1173 |
+
def _parse_lsb_release_content(lines: Iterable[str]) -> Dict[str, str]:
|
1174 |
+
"""
|
1175 |
+
Parse the output of the lsb_release command.
|
1176 |
+
|
1177 |
+
Parameters:
|
1178 |
+
|
1179 |
+
* lines: Iterable through the lines of the lsb_release output.
|
1180 |
+
Each line must be a unicode string or a UTF-8 encoded byte
|
1181 |
+
string.
|
1182 |
+
|
1183 |
+
Returns:
|
1184 |
+
A dictionary containing all information items.
|
1185 |
+
"""
|
1186 |
+
props = {}
|
1187 |
+
for line in lines:
|
1188 |
+
kv = line.strip("\n").split(":", 1)
|
1189 |
+
if len(kv) != 2:
|
1190 |
+
# Ignore lines without colon.
|
1191 |
+
continue
|
1192 |
+
k, v = kv
|
1193 |
+
props.update({k.replace(" ", "_").lower(): v.strip()})
|
1194 |
+
return props
|
1195 |
+
|
1196 |
+
@cached_property
|
1197 |
+
def _uname_info(self) -> Dict[str, str]:
|
1198 |
+
if not self.include_uname:
|
1199 |
+
return {}
|
1200 |
+
try:
|
1201 |
+
cmd = ("uname", "-rs")
|
1202 |
+
stdout = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
|
1203 |
+
except OSError:
|
1204 |
+
return {}
|
1205 |
+
content = self._to_str(stdout).splitlines()
|
1206 |
+
return self._parse_uname_content(content)
|
1207 |
+
|
1208 |
+
@cached_property
|
1209 |
+
def _oslevel_info(self) -> str:
|
1210 |
+
if not self.include_oslevel:
|
1211 |
+
return ""
|
1212 |
+
try:
|
1213 |
+
stdout = subprocess.check_output("oslevel", stderr=subprocess.DEVNULL)
|
1214 |
+
except (OSError, subprocess.CalledProcessError):
|
1215 |
+
return ""
|
1216 |
+
return self._to_str(stdout).strip()
|
1217 |
+
|
1218 |
+
@cached_property
|
1219 |
+
def _debian_version(self) -> str:
|
1220 |
+
try:
|
1221 |
+
with open(
|
1222 |
+
os.path.join(self.etc_dir, "debian_version"), encoding="ascii"
|
1223 |
+
) as fp:
|
1224 |
+
return fp.readline().rstrip()
|
1225 |
+
except FileNotFoundError:
|
1226 |
+
return ""
|
1227 |
+
|
1228 |
+
@staticmethod
|
1229 |
+
def _parse_uname_content(lines: Sequence[str]) -> Dict[str, str]:
|
1230 |
+
if not lines:
|
1231 |
+
return {}
|
1232 |
+
props = {}
|
1233 |
+
match = re.search(r"^([^\s]+)\s+([\d\.]+)", lines[0].strip())
|
1234 |
+
if match:
|
1235 |
+
name, version = match.groups()
|
1236 |
+
|
1237 |
+
# This is to prevent the Linux kernel version from
|
1238 |
+
# appearing as the 'best' version on otherwise
|
1239 |
+
# identifiable distributions.
|
1240 |
+
if name == "Linux":
|
1241 |
+
return {}
|
1242 |
+
props["id"] = name.lower()
|
1243 |
+
props["name"] = name
|
1244 |
+
props["release"] = version
|
1245 |
+
return props
|
1246 |
+
|
1247 |
+
@staticmethod
|
1248 |
+
def _to_str(bytestring: bytes) -> str:
|
1249 |
+
encoding = sys.getfilesystemencoding()
|
1250 |
+
return bytestring.decode(encoding)
|
1251 |
+
|
1252 |
+
@cached_property
|
1253 |
+
def _distro_release_info(self) -> Dict[str, str]:
|
1254 |
+
"""
|
1255 |
+
Get the information items from the specified distro release file.
|
1256 |
+
|
1257 |
+
Returns:
|
1258 |
+
A dictionary containing all information items.
|
1259 |
+
"""
|
1260 |
+
if self.distro_release_file:
|
1261 |
+
# If it was specified, we use it and parse what we can, even if
|
1262 |
+
# its file name or content does not match the expected pattern.
|
1263 |
+
distro_info = self._parse_distro_release_file(self.distro_release_file)
|
1264 |
+
basename = os.path.basename(self.distro_release_file)
|
1265 |
+
# The file name pattern for user-specified distro release files
|
1266 |
+
# is somewhat more tolerant (compared to when searching for the
|
1267 |
+
# file), because we want to use what was specified as best as
|
1268 |
+
# possible.
|
1269 |
+
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
|
1270 |
+
else:
|
1271 |
+
try:
|
1272 |
+
basenames = [
|
1273 |
+
basename
|
1274 |
+
for basename in os.listdir(self.etc_dir)
|
1275 |
+
if basename not in _DISTRO_RELEASE_IGNORE_BASENAMES
|
1276 |
+
and os.path.isfile(os.path.join(self.etc_dir, basename))
|
1277 |
+
]
|
1278 |
+
# We sort for repeatability in cases where there are multiple
|
1279 |
+
# distro specific files; e.g. CentOS, Oracle, Enterprise all
|
1280 |
+
# containing `redhat-release` on top of their own.
|
1281 |
+
basenames.sort()
|
1282 |
+
except OSError:
|
1283 |
+
# This may occur when /etc is not readable but we can't be
|
1284 |
+
# sure about the *-release files. Check common entries of
|
1285 |
+
# /etc for information. If they turn out to not be there the
|
1286 |
+
# error is handled in `_parse_distro_release_file()`.
|
1287 |
+
basenames = _DISTRO_RELEASE_BASENAMES
|
1288 |
+
for basename in basenames:
|
1289 |
+
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
|
1290 |
+
if match is None:
|
1291 |
+
continue
|
1292 |
+
filepath = os.path.join(self.etc_dir, basename)
|
1293 |
+
distro_info = self._parse_distro_release_file(filepath)
|
1294 |
+
# The name is always present if the pattern matches.
|
1295 |
+
if "name" not in distro_info:
|
1296 |
+
continue
|
1297 |
+
self.distro_release_file = filepath
|
1298 |
+
break
|
1299 |
+
else: # the loop didn't "break": no candidate.
|
1300 |
+
return {}
|
1301 |
+
|
1302 |
+
if match is not None:
|
1303 |
+
distro_info["id"] = match.group(1)
|
1304 |
+
|
1305 |
+
# CloudLinux < 7: manually enrich info with proper id.
|
1306 |
+
if "cloudlinux" in distro_info.get("name", "").lower():
|
1307 |
+
distro_info["id"] = "cloudlinux"
|
1308 |
+
|
1309 |
+
return distro_info
|
1310 |
+
|
1311 |
+
def _parse_distro_release_file(self, filepath: str) -> Dict[str, str]:
|
1312 |
+
"""
|
1313 |
+
Parse a distro release file.
|
1314 |
+
|
1315 |
+
Parameters:
|
1316 |
+
|
1317 |
+
* filepath: Path name of the distro release file.
|
1318 |
+
|
1319 |
+
Returns:
|
1320 |
+
A dictionary containing all information items.
|
1321 |
+
"""
|
1322 |
+
try:
|
1323 |
+
with open(filepath, encoding="utf-8") as fp:
|
1324 |
+
# Only parse the first line. For instance, on SLES there
|
1325 |
+
# are multiple lines. We don't want them...
|
1326 |
+
return self._parse_distro_release_content(fp.readline())
|
1327 |
+
except OSError:
|
1328 |
+
# Ignore not being able to read a specific, seemingly version
|
1329 |
+
# related file.
|
1330 |
+
# See https://github.com/python-distro/distro/issues/162
|
1331 |
+
return {}
|
1332 |
+
|
1333 |
+
@staticmethod
|
1334 |
+
def _parse_distro_release_content(line: str) -> Dict[str, str]:
|
1335 |
+
"""
|
1336 |
+
Parse a line from a distro release file.
|
1337 |
+
|
1338 |
+
Parameters:
|
1339 |
+
* line: Line from the distro release file. Must be a unicode string
|
1340 |
+
or a UTF-8 encoded byte string.
|
1341 |
+
|
1342 |
+
Returns:
|
1343 |
+
A dictionary containing all information items.
|
1344 |
+
"""
|
1345 |
+
matches = _DISTRO_RELEASE_CONTENT_REVERSED_PATTERN.match(line.strip()[::-1])
|
1346 |
+
distro_info = {}
|
1347 |
+
if matches:
|
1348 |
+
# regexp ensures non-None
|
1349 |
+
distro_info["name"] = matches.group(3)[::-1]
|
1350 |
+
if matches.group(2):
|
1351 |
+
distro_info["version_id"] = matches.group(2)[::-1]
|
1352 |
+
if matches.group(1):
|
1353 |
+
distro_info["codename"] = matches.group(1)[::-1]
|
1354 |
+
elif line:
|
1355 |
+
distro_info["name"] = line.strip()
|
1356 |
+
return distro_info
|
1357 |
+
|
1358 |
+
|
1359 |
+
_distro = LinuxDistribution()
|
1360 |
+
|
1361 |
+
|
1362 |
+
def main() -> None:
|
1363 |
+
logger = logging.getLogger(__name__)
|
1364 |
+
logger.setLevel(logging.DEBUG)
|
1365 |
+
logger.addHandler(logging.StreamHandler(sys.stdout))
|
1366 |
+
|
1367 |
+
parser = argparse.ArgumentParser(description="OS distro info tool")
|
1368 |
+
parser.add_argument(
|
1369 |
+
"--json", "-j", help="Output in machine readable format", action="store_true"
|
1370 |
+
)
|
1371 |
+
|
1372 |
+
parser.add_argument(
|
1373 |
+
"--root-dir",
|
1374 |
+
"-r",
|
1375 |
+
type=str,
|
1376 |
+
dest="root_dir",
|
1377 |
+
help="Path to the root filesystem directory (defaults to /)",
|
1378 |
+
)
|
1379 |
+
|
1380 |
+
args = parser.parse_args()
|
1381 |
+
|
1382 |
+
if args.root_dir:
|
1383 |
+
dist = LinuxDistribution(
|
1384 |
+
include_lsb=False,
|
1385 |
+
include_uname=False,
|
1386 |
+
include_oslevel=False,
|
1387 |
+
root_dir=args.root_dir,
|
1388 |
+
)
|
1389 |
+
else:
|
1390 |
+
dist = _distro
|
1391 |
+
|
1392 |
+
if args.json:
|
1393 |
+
logger.info(json.dumps(dist.info(), indent=4, sort_keys=True))
|
1394 |
+
else:
|
1395 |
+
logger.info("Name: %s", dist.name(pretty=True))
|
1396 |
+
distribution_version = dist.version(pretty=True)
|
1397 |
+
logger.info("Version: %s", distribution_version)
|
1398 |
+
distribution_codename = dist.codename()
|
1399 |
+
logger.info("Codename: %s", distribution_codename)
|
1400 |
+
|
1401 |
+
|
1402 |
+
if __name__ == "__main__":
|
1403 |
+
main()
|
graphrag-ollama/lib/python3.12/site-packages/distro/py.typed
ADDED
File without changes
|
graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/METADATA
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.3
|
2 |
+
Name: jiter
|
3 |
+
Version: 0.7.0
|
4 |
+
Classifier: Development Status :: 4 - Beta
|
5 |
+
Classifier: Programming Language :: Python
|
6 |
+
Classifier: Programming Language :: Python :: 3
|
7 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
8 |
+
Classifier: Programming Language :: Python :: 3.8
|
9 |
+
Classifier: Programming Language :: Python :: 3.9
|
10 |
+
Classifier: Programming Language :: Python :: 3.10
|
11 |
+
Classifier: Programming Language :: Python :: 3.11
|
12 |
+
Classifier: Programming Language :: Python :: 3.12
|
13 |
+
Classifier: Intended Audience :: Developers
|
14 |
+
Classifier: Intended Audience :: Information Technology
|
15 |
+
Classifier: Intended Audience :: System Administrators
|
16 |
+
Classifier: License :: OSI Approved :: MIT License
|
17 |
+
Classifier: Operating System :: Unix
|
18 |
+
Classifier: Operating System :: POSIX :: Linux
|
19 |
+
Classifier: Environment :: Console
|
20 |
+
Classifier: Environment :: MacOS X
|
21 |
+
Classifier: Topic :: File Formats :: JSON
|
22 |
+
Classifier: Framework :: Pydantic :: 2
|
23 |
+
Summary: Fast iterable JSON parser.
|
24 |
+
Keywords: JSON,parsing,deserialization,iter
|
25 |
+
Home-Page: https://github.com/pydantic/jiter/
|
26 |
+
Author: Samuel Colvin <samuel@pydantic.dev>
|
27 |
+
Author-email: Samuel Colvin <s@muelcolvin.com>
|
28 |
+
License: MIT
|
29 |
+
Requires-Python: >=3.8
|
30 |
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
31 |
+
Project-URL: Source Code, https://github.com/pydantic/jiter/
|
32 |
+
|
33 |
+
# jiter
|
34 |
+
|
35 |
+
[](https://github.com/pydantic/jiter/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
|
36 |
+
[](https://pypi.python.org/pypi/jiter)
|
37 |
+
[](https://github.com/pydantic/jiter)
|
38 |
+
[](https://github.com/pydantic/jiter/blob/main/LICENSE)
|
39 |
+
|
40 |
+
This is a standalone version of the JSON parser used in `pydantic-core`. The recommendation is to only use this package directly if you do not use `pydantic`.
|
41 |
+
|
42 |
+
The API is extremely minimal:
|
43 |
+
|
44 |
+
```python
|
45 |
+
def from_json(
|
46 |
+
json_data: bytes,
|
47 |
+
/,
|
48 |
+
*,
|
49 |
+
allow_inf_nan: bool = True,
|
50 |
+
cache_mode: Literal[True, False, "all", "keys", "none"] = "all",
|
51 |
+
partial_mode: Literal[True, False, "off", "on", "trailing-strings"] = False,
|
52 |
+
catch_duplicate_keys: bool = False,
|
53 |
+
float_mode: Literal["float", "decimal", "lossless-float"] = False,
|
54 |
+
) -> Any:
|
55 |
+
"""
|
56 |
+
Parse input bytes into a JSON object.
|
57 |
+
|
58 |
+
Arguments:
|
59 |
+
json_data: The JSON data to parse
|
60 |
+
allow_inf_nan: Whether to allow infinity (`Infinity` an `-Infinity`) and `NaN` values to float fields.
|
61 |
+
Defaults to True.
|
62 |
+
cache_mode: cache Python strings to improve performance at the cost of some memory usage
|
63 |
+
- True / 'all' - cache all strings
|
64 |
+
- 'keys' - cache only object keys
|
65 |
+
- False / 'none' - cache nothing
|
66 |
+
partial_mode: How to handle incomplete strings:
|
67 |
+
- False / 'off' - raise an exception if the input is incomplete
|
68 |
+
- True / 'on' - allow incomplete JSON but discard the last string if it is incomplete
|
69 |
+
- 'trailing-strings' - allow incomplete JSON, and include the last incomplete string in the output
|
70 |
+
catch_duplicate_keys: if True, raise an exception if objects contain the same key multiple times
|
71 |
+
float_mode: How to return floats: as a `float`, `Decimal` or `LosslessFloat`
|
72 |
+
|
73 |
+
Returns:
|
74 |
+
Python object built from the JSON input.
|
75 |
+
"""
|
76 |
+
|
77 |
+
def cache_clear() -> None:
|
78 |
+
"""
|
79 |
+
Reset the string cache.
|
80 |
+
"""
|
81 |
+
|
82 |
+
def cache_usage() -> int:
|
83 |
+
"""
|
84 |
+
get the size of the string cache.
|
85 |
+
|
86 |
+
Returns:
|
87 |
+
Size of the string cache in bytes.
|
88 |
+
"""
|
89 |
+
```
|
90 |
+
## Examples
|
91 |
+
|
92 |
+
The main function provided by Jiter is `from_json()`, which accepts a bytes object containing JSON and returns a Python dictionary, list or other value.
|
93 |
+
|
94 |
+
```python
|
95 |
+
import jiter
|
96 |
+
|
97 |
+
json_data = b'{"name": "John", "age": 30}'
|
98 |
+
parsed_data = jiter.from_json(json_data)
|
99 |
+
print(parsed_data) # Output: {'name': 'John', 'age': 30}
|
100 |
+
```
|
101 |
+
|
102 |
+
### Handling Partial JSON
|
103 |
+
|
104 |
+
Incomplete JSON objects can be parsed using the `partial_mode=` parameter.
|
105 |
+
|
106 |
+
```python
|
107 |
+
import jiter
|
108 |
+
|
109 |
+
partial_json = b'{"name": "John", "age": 30, "city": "New Yor'
|
110 |
+
|
111 |
+
# Raise error on incomplete JSON
|
112 |
+
try:
|
113 |
+
jiter.from_json(partial_json, partial_mode=False)
|
114 |
+
except ValueError as e:
|
115 |
+
print(f"Error: {e}")
|
116 |
+
|
117 |
+
# Parse incomplete JSON, discarding incomplete last field
|
118 |
+
result = jiter.from_json(partial_json, partial_mode=True)
|
119 |
+
print(result) # Output: {'name': 'John', 'age': 30}
|
120 |
+
|
121 |
+
# Parse incomplete JSON, including incomplete last field
|
122 |
+
result = jiter.from_json(partial_json, partial_mode='trailing-strings')
|
123 |
+
print(result) # Output: {'name': 'John', 'age': 30, 'city': 'New Yor'}
|
124 |
+
```
|
125 |
+
|
126 |
+
### Catching Duplicate Keys
|
127 |
+
|
128 |
+
The `catch_duplicate_keys=True` option can be used to raise a `ValueError` if an object contains duplicate keys.
|
129 |
+
|
130 |
+
```python
|
131 |
+
import jiter
|
132 |
+
|
133 |
+
json_with_dupes = b'{"foo": 1, "foo": 2}'
|
134 |
+
|
135 |
+
# Default behavior (last value wins)
|
136 |
+
result = jiter.from_json(json_with_dupes)
|
137 |
+
print(result) # Output: {'foo': 2}
|
138 |
+
|
139 |
+
# Catch duplicate keys
|
140 |
+
try:
|
141 |
+
jiter.from_json(json_with_dupes, catch_duplicate_keys=True)
|
142 |
+
except ValueError as e:
|
143 |
+
print(f"Error: {e}")
|
144 |
+
```
|
145 |
+
|
graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/RECORD
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jiter-0.7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
2 |
+
jiter-0.7.0.dist-info/METADATA,sha256=1aBEkg8HdQI-ACVnF5JIFOGbpNL3bxaqL6Y5WwtQVFQ,5177
|
3 |
+
jiter-0.7.0.dist-info/RECORD,,
|
4 |
+
jiter-0.7.0.dist-info/WHEEL,sha256=9nMhkhjT5-smROE-lOgRy50zrYHdk-fRmS6ah4MLvkg,129
|
5 |
+
jiter/__init__.py,sha256=Fp9HkOixiYYDSiC_80vmiJ_sCoCGT8OAh48yltm0lP0,103
|
6 |
+
jiter/__init__.pyi,sha256=AEs-Zbzf7c2r5vUTpTjxkLBuN7KnfFTURrWrZJAZnQY,2363
|
7 |
+
jiter/__pycache__/__init__.cpython-312.pyc,,
|
8 |
+
jiter/jiter.cpython-312-x86_64-linux-gnu.so,sha256=ObQLhWU_TGKQW5zi27w5nMPhQ7GqhKGyAWaSe_Z5O3g,794888
|
9 |
+
jiter/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
graphrag-ollama/lib/python3.12/site-packages/jiter-0.7.0.dist-info/WHEEL
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: maturin (1.7.4)
|
3 |
+
Root-Is-Purelib: false
|
4 |
+
Tag: cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64
|
graphrag-ollama/lib/python3.12/site-packages/jiter/__init__.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .jiter import *
|
2 |
+
|
3 |
+
__doc__ = jiter.__doc__
|
4 |
+
if hasattr(jiter, "__all__"):
|
5 |
+
__all__ = jiter.__all__
|
graphrag-ollama/lib/python3.12/site-packages/jiter/__init__.pyi
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import decimal
|
2 |
+
from typing import Any, Literal
|
3 |
+
|
4 |
+
def from_json(
|
5 |
+
json_data: bytes,
|
6 |
+
/,
|
7 |
+
*,
|
8 |
+
allow_inf_nan: bool = True,
|
9 |
+
cache_mode: Literal[True, False, "all", "keys", "none"] = "all",
|
10 |
+
partial_mode: Literal[True, False, "off", "on", "trailing-strings"] = False,
|
11 |
+
catch_duplicate_keys: bool = False,
|
12 |
+
float_mode: Literal["float", "decimal", "lossless-float"] = False,
|
13 |
+
) -> Any:
|
14 |
+
"""
|
15 |
+
Parse input bytes into a JSON object.
|
16 |
+
|
17 |
+
Arguments:
|
18 |
+
json_data: The JSON data to parse
|
19 |
+
allow_inf_nan: Whether to allow infinity (`Infinity` an `-Infinity`) and `NaN` values to float fields.
|
20 |
+
Defaults to True.
|
21 |
+
cache_mode: cache Python strings to improve performance at the cost of some memory usage
|
22 |
+
- True / 'all' - cache all strings
|
23 |
+
- 'keys' - cache only object keys
|
24 |
+
- False / 'none' - cache nothing
|
25 |
+
partial_mode: How to handle incomplete strings:
|
26 |
+
- False / 'off' - raise an exception if the input is incomplete
|
27 |
+
- True / 'on' - allow incomplete JSON but discard the last string if it is incomplete
|
28 |
+
- 'trailing-strings' - allow incomplete JSON, and include the last incomplete string in the output
|
29 |
+
catch_duplicate_keys: if True, raise an exception if objects contain the same key multiple times
|
30 |
+
float_mode: How to return floats: as a `float`, `Decimal` or `LosslessFloat`
|
31 |
+
|
32 |
+
Returns:
|
33 |
+
Python object built from the JSON input.
|
34 |
+
"""
|
35 |
+
|
36 |
+
def cache_clear() -> None:
|
37 |
+
"""
|
38 |
+
Reset the string cache.
|
39 |
+
"""
|
40 |
+
|
41 |
+
def cache_usage() -> int:
|
42 |
+
"""
|
43 |
+
get the size of the string cache.
|
44 |
+
|
45 |
+
Returns:
|
46 |
+
Size of the string cache in bytes.
|
47 |
+
"""
|
48 |
+
|
49 |
+
|
50 |
+
class LosslessFloat:
|
51 |
+
"""
|
52 |
+
Represents a float from JSON, by holding the underlying bytes representing a float from JSON.
|
53 |
+
"""
|
54 |
+
def __init__(self, json_float: bytes):
|
55 |
+
"""Construct a LosslessFloat object from a JSON bytes slice"""
|
56 |
+
|
57 |
+
def as_decimal(self) -> decimal.Decimal:
|
58 |
+
"""Construct a Python Decimal from the JSON bytes slice"""
|
59 |
+
|
60 |
+
def __float__(self) -> float:
|
61 |
+
"""Construct a Python float from the JSON bytes slice"""
|
62 |
+
|
63 |
+
def __bytes__(self) -> bytes:
|
64 |
+
"""Return the JSON bytes slice as bytes"""
|
65 |
+
|
66 |
+
def __str__(self):
|
67 |
+
"""Return the JSON bytes slice as a string"""
|
68 |
+
|
69 |
+
def __repr__(self):
|
70 |
+
...
|
graphrag-ollama/lib/python3.12/site-packages/jiter/__pycache__/__init__.cpython-312.pyc
ADDED
Binary file (353 Bytes). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/jiter/jiter.cpython-312-x86_64-linux-gnu.so
ADDED
Binary file (795 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/jiter/py.typed
ADDED
File without changes
|
graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/METADATA
ADDED
@@ -0,0 +1,758 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.3
|
2 |
+
Name: openai
|
3 |
+
Version: 1.54.0
|
4 |
+
Summary: The official Python library for the openai API
|
5 |
+
Project-URL: Homepage, https://github.com/openai/openai-python
|
6 |
+
Project-URL: Repository, https://github.com/openai/openai-python
|
7 |
+
Author-email: OpenAI <support@openai.com>
|
8 |
+
License-Expression: Apache-2.0
|
9 |
+
License-File: LICENSE
|
10 |
+
Classifier: Intended Audience :: Developers
|
11 |
+
Classifier: License :: OSI Approved :: Apache Software License
|
12 |
+
Classifier: Operating System :: MacOS
|
13 |
+
Classifier: Operating System :: Microsoft :: Windows
|
14 |
+
Classifier: Operating System :: OS Independent
|
15 |
+
Classifier: Operating System :: POSIX
|
16 |
+
Classifier: Operating System :: POSIX :: Linux
|
17 |
+
Classifier: Programming Language :: Python :: 3.8
|
18 |
+
Classifier: Programming Language :: Python :: 3.9
|
19 |
+
Classifier: Programming Language :: Python :: 3.10
|
20 |
+
Classifier: Programming Language :: Python :: 3.11
|
21 |
+
Classifier: Programming Language :: Python :: 3.12
|
22 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
23 |
+
Classifier: Typing :: Typed
|
24 |
+
Requires-Python: >=3.8
|
25 |
+
Requires-Dist: anyio<5,>=3.5.0
|
26 |
+
Requires-Dist: cached-property; python_version < '3.8'
|
27 |
+
Requires-Dist: distro<2,>=1.7.0
|
28 |
+
Requires-Dist: httpx<1,>=0.23.0
|
29 |
+
Requires-Dist: jiter<1,>=0.4.0
|
30 |
+
Requires-Dist: pydantic<3,>=1.9.0
|
31 |
+
Requires-Dist: sniffio
|
32 |
+
Requires-Dist: tqdm>4
|
33 |
+
Requires-Dist: typing-extensions<5,>=4.11
|
34 |
+
Provides-Extra: datalib
|
35 |
+
Requires-Dist: numpy>=1; extra == 'datalib'
|
36 |
+
Requires-Dist: pandas-stubs>=1.1.0.11; extra == 'datalib'
|
37 |
+
Requires-Dist: pandas>=1.2.3; extra == 'datalib'
|
38 |
+
Description-Content-Type: text/markdown
|
39 |
+
|
40 |
+
# OpenAI Python API library
|
41 |
+
|
42 |
+
[](https://pypi.org/project/openai/)
|
43 |
+
|
44 |
+
The OpenAI Python library provides convenient access to the OpenAI REST API from any Python 3.8+
|
45 |
+
application. The library includes type definitions for all request params and response fields,
|
46 |
+
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
47 |
+
|
48 |
+
It is generated from our [OpenAPI specification](https://github.com/openai/openai-openapi) with [Stainless](https://stainlessapi.com/).
|
49 |
+
|
50 |
+
## Documentation
|
51 |
+
|
52 |
+
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). The full API of this library can be found in [api.md](https://github.com/openai/openai-python/tree/main/api.md).
|
53 |
+
|
54 |
+
## Installation
|
55 |
+
|
56 |
+
> [!IMPORTANT]
|
57 |
+
> The SDK was rewritten in v1, which was released November 6th 2023. See the [v1 migration guide](https://github.com/openai/openai-python/discussions/742), which includes scripts to automatically update your code.
|
58 |
+
|
59 |
+
```sh
|
60 |
+
# install from PyPI
|
61 |
+
pip install openai
|
62 |
+
```
|
63 |
+
|
64 |
+
## Usage
|
65 |
+
|
66 |
+
The full API of this library can be found in [api.md](https://github.com/openai/openai-python/tree/main/api.md).
|
67 |
+
|
68 |
+
```python
|
69 |
+
import os
|
70 |
+
from openai import OpenAI
|
71 |
+
|
72 |
+
client = OpenAI(
|
73 |
+
# This is the default and can be omitted
|
74 |
+
api_key=os.environ.get("OPENAI_API_KEY"),
|
75 |
+
)
|
76 |
+
|
77 |
+
chat_completion = client.chat.completions.create(
|
78 |
+
messages=[
|
79 |
+
{
|
80 |
+
"role": "user",
|
81 |
+
"content": "Say this is a test",
|
82 |
+
}
|
83 |
+
],
|
84 |
+
model="gpt-3.5-turbo",
|
85 |
+
)
|
86 |
+
```
|
87 |
+
|
88 |
+
While you can provide an `api_key` keyword argument,
|
89 |
+
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
90 |
+
to add `OPENAI_API_KEY="My API Key"` to your `.env` file
|
91 |
+
so that your API Key is not stored in source control.
|
92 |
+
|
93 |
+
### Vision
|
94 |
+
|
95 |
+
With a hosted image:
|
96 |
+
|
97 |
+
```python
|
98 |
+
response = client.chat.completions.create(
|
99 |
+
model="gpt-4o-mini",
|
100 |
+
messages=[
|
101 |
+
{
|
102 |
+
"role": "user",
|
103 |
+
"content": [
|
104 |
+
{"type": "text", "text": prompt},
|
105 |
+
{
|
106 |
+
"type": "image_url",
|
107 |
+
"image_url": {"url": f"{img_url}"},
|
108 |
+
},
|
109 |
+
],
|
110 |
+
}
|
111 |
+
],
|
112 |
+
)
|
113 |
+
```
|
114 |
+
|
115 |
+
With the image as a base64 encoded string:
|
116 |
+
|
117 |
+
```python
|
118 |
+
response = client.chat.completions.create(
|
119 |
+
model="gpt-4o-mini",
|
120 |
+
messages=[
|
121 |
+
{
|
122 |
+
"role": "user",
|
123 |
+
"content": [
|
124 |
+
{"type": "text", "text": prompt},
|
125 |
+
{
|
126 |
+
"type": "image_url",
|
127 |
+
"image_url": {"url": f"data:{img_type};base64,{img_b64_str}"},
|
128 |
+
},
|
129 |
+
],
|
130 |
+
}
|
131 |
+
],
|
132 |
+
)
|
133 |
+
```
|
134 |
+
|
135 |
+
### Polling Helpers
|
136 |
+
|
137 |
+
When interacting with the API some actions such as starting a Run and adding files to vector stores are asynchronous and take time to complete. The SDK includes
|
138 |
+
helper functions which will poll the status until it reaches a terminal state and then return the resulting object.
|
139 |
+
If an API method results in an action that could benefit from polling there will be a corresponding version of the
|
140 |
+
method ending in '\_and_poll'.
|
141 |
+
|
142 |
+
For instance to create a Run and poll until it reaches a terminal state you can run:
|
143 |
+
|
144 |
+
```python
|
145 |
+
run = client.beta.threads.runs.create_and_poll(
|
146 |
+
thread_id=thread.id,
|
147 |
+
assistant_id=assistant.id,
|
148 |
+
)
|
149 |
+
```
|
150 |
+
|
151 |
+
More information on the lifecycle of a Run can be found in the [Run Lifecycle Documentation](https://platform.openai.com/docs/assistants/how-it-works/run-lifecycle)
|
152 |
+
|
153 |
+
### Bulk Upload Helpers
|
154 |
+
|
155 |
+
When creating and interacting with vector stores, you can use polling helpers to monitor the status of operations.
|
156 |
+
For convenience, we also provide a bulk upload helper to allow you to simultaneously upload several files at once.
|
157 |
+
|
158 |
+
```python
|
159 |
+
sample_files = [Path("sample-paper.pdf"), ...]
|
160 |
+
|
161 |
+
batch = await client.vector_stores.file_batches.upload_and_poll(
|
162 |
+
store.id,
|
163 |
+
files=sample_files,
|
164 |
+
)
|
165 |
+
```
|
166 |
+
|
167 |
+
### Streaming Helpers
|
168 |
+
|
169 |
+
The SDK also includes helpers to process streams and handle incoming events.
|
170 |
+
|
171 |
+
```python
|
172 |
+
with client.beta.threads.runs.stream(
|
173 |
+
thread_id=thread.id,
|
174 |
+
assistant_id=assistant.id,
|
175 |
+
instructions="Please address the user as Jane Doe. The user has a premium account.",
|
176 |
+
) as stream:
|
177 |
+
for event in stream:
|
178 |
+
# Print the text from text delta events
|
179 |
+
if event.type == "thread.message.delta" and event.data.delta.content:
|
180 |
+
print(event.data.delta.content[0].text)
|
181 |
+
```
|
182 |
+
|
183 |
+
More information on streaming helpers can be found in the dedicated documentation: [helpers.md](https://github.com/openai/openai-python/tree/main/helpers.md)
|
184 |
+
|
185 |
+
## Async usage
|
186 |
+
|
187 |
+
Simply import `AsyncOpenAI` instead of `OpenAI` and use `await` with each API call:
|
188 |
+
|
189 |
+
```python
|
190 |
+
import os
|
191 |
+
import asyncio
|
192 |
+
from openai import AsyncOpenAI
|
193 |
+
|
194 |
+
client = AsyncOpenAI(
|
195 |
+
# This is the default and can be omitted
|
196 |
+
api_key=os.environ.get("OPENAI_API_KEY"),
|
197 |
+
)
|
198 |
+
|
199 |
+
|
200 |
+
async def main() -> None:
|
201 |
+
chat_completion = await client.chat.completions.create(
|
202 |
+
messages=[
|
203 |
+
{
|
204 |
+
"role": "user",
|
205 |
+
"content": "Say this is a test",
|
206 |
+
}
|
207 |
+
],
|
208 |
+
model="gpt-3.5-turbo",
|
209 |
+
)
|
210 |
+
|
211 |
+
|
212 |
+
asyncio.run(main())
|
213 |
+
```
|
214 |
+
|
215 |
+
Functionality between the synchronous and asynchronous clients is otherwise identical.
|
216 |
+
|
217 |
+
## Streaming responses
|
218 |
+
|
219 |
+
We provide support for streaming responses using Server Side Events (SSE).
|
220 |
+
|
221 |
+
```python
|
222 |
+
from openai import OpenAI
|
223 |
+
|
224 |
+
client = OpenAI()
|
225 |
+
|
226 |
+
stream = client.chat.completions.create(
|
227 |
+
model="gpt-4",
|
228 |
+
messages=[{"role": "user", "content": "Say this is a test"}],
|
229 |
+
stream=True,
|
230 |
+
)
|
231 |
+
for chunk in stream:
|
232 |
+
print(chunk.choices[0].delta.content or "", end="")
|
233 |
+
```
|
234 |
+
|
235 |
+
The async client uses the exact same interface.
|
236 |
+
|
237 |
+
```python
|
238 |
+
from openai import AsyncOpenAI
|
239 |
+
|
240 |
+
client = AsyncOpenAI()
|
241 |
+
|
242 |
+
|
243 |
+
async def main():
|
244 |
+
stream = await client.chat.completions.create(
|
245 |
+
model="gpt-4",
|
246 |
+
messages=[{"role": "user", "content": "Say this is a test"}],
|
247 |
+
stream=True,
|
248 |
+
)
|
249 |
+
async for chunk in stream:
|
250 |
+
print(chunk.choices[0].delta.content or "", end="")
|
251 |
+
|
252 |
+
|
253 |
+
asyncio.run(main())
|
254 |
+
```
|
255 |
+
|
256 |
+
## Module-level client
|
257 |
+
|
258 |
+
> [!IMPORTANT]
|
259 |
+
> We highly recommend instantiating client instances instead of relying on the global client.
|
260 |
+
|
261 |
+
We also expose a global client instance that is accessible in a similar fashion to versions prior to v1.
|
262 |
+
|
263 |
+
```py
|
264 |
+
import openai
|
265 |
+
|
266 |
+
# optional; defaults to `os.environ['OPENAI_API_KEY']`
|
267 |
+
openai.api_key = '...'
|
268 |
+
|
269 |
+
# all client options can be configured just like the `OpenAI` instantiation counterpart
|
270 |
+
openai.base_url = "https://..."
|
271 |
+
openai.default_headers = {"x-foo": "true"}
|
272 |
+
|
273 |
+
completion = openai.chat.completions.create(
|
274 |
+
model="gpt-4",
|
275 |
+
messages=[
|
276 |
+
{
|
277 |
+
"role": "user",
|
278 |
+
"content": "How do I output all files in a directory using Python?",
|
279 |
+
},
|
280 |
+
],
|
281 |
+
)
|
282 |
+
print(completion.choices[0].message.content)
|
283 |
+
```
|
284 |
+
|
285 |
+
The API is the exact same as the standard client instance-based API.
|
286 |
+
|
287 |
+
This is intended to be used within REPLs or notebooks for faster iteration, **not** in application code.
|
288 |
+
|
289 |
+
We recommend that you always instantiate a client (e.g., with `client = OpenAI()`) in application code because:
|
290 |
+
|
291 |
+
- It can be difficult to reason about where client options are configured
|
292 |
+
- It's not possible to change certain client options without potentially causing race conditions
|
293 |
+
- It's harder to mock for testing purposes
|
294 |
+
- It's not possible to control cleanup of network connections
|
295 |
+
|
296 |
+
## Using types
|
297 |
+
|
298 |
+
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
|
299 |
+
|
300 |
+
- Serializing back into JSON, `model.to_json()`
|
301 |
+
- Converting to a dictionary, `model.to_dict()`
|
302 |
+
|
303 |
+
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
|
304 |
+
|
305 |
+
## Pagination
|
306 |
+
|
307 |
+
List methods in the OpenAI API are paginated.
|
308 |
+
|
309 |
+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
|
310 |
+
|
311 |
+
```python
|
312 |
+
from openai import OpenAI
|
313 |
+
|
314 |
+
client = OpenAI()
|
315 |
+
|
316 |
+
all_jobs = []
|
317 |
+
# Automatically fetches more pages as needed.
|
318 |
+
for job in client.fine_tuning.jobs.list(
|
319 |
+
limit=20,
|
320 |
+
):
|
321 |
+
# Do something with job here
|
322 |
+
all_jobs.append(job)
|
323 |
+
print(all_jobs)
|
324 |
+
```
|
325 |
+
|
326 |
+
Or, asynchronously:
|
327 |
+
|
328 |
+
```python
|
329 |
+
import asyncio
|
330 |
+
from openai import AsyncOpenAI
|
331 |
+
|
332 |
+
client = AsyncOpenAI()
|
333 |
+
|
334 |
+
|
335 |
+
async def main() -> None:
|
336 |
+
all_jobs = []
|
337 |
+
# Iterate through items across all pages, issuing requests as needed.
|
338 |
+
async for job in client.fine_tuning.jobs.list(
|
339 |
+
limit=20,
|
340 |
+
):
|
341 |
+
all_jobs.append(job)
|
342 |
+
print(all_jobs)
|
343 |
+
|
344 |
+
|
345 |
+
asyncio.run(main())
|
346 |
+
```
|
347 |
+
|
348 |
+
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
|
349 |
+
|
350 |
+
```python
|
351 |
+
first_page = await client.fine_tuning.jobs.list(
|
352 |
+
limit=20,
|
353 |
+
)
|
354 |
+
if first_page.has_next_page():
|
355 |
+
print(f"will fetch next page using these details: {first_page.next_page_info()}")
|
356 |
+
next_page = await first_page.get_next_page()
|
357 |
+
print(f"number of items we just fetched: {len(next_page.data)}")
|
358 |
+
|
359 |
+
# Remove `await` for non-async usage.
|
360 |
+
```
|
361 |
+
|
362 |
+
Or just work directly with the returned data:
|
363 |
+
|
364 |
+
```python
|
365 |
+
first_page = await client.fine_tuning.jobs.list(
|
366 |
+
limit=20,
|
367 |
+
)
|
368 |
+
|
369 |
+
print(f"next page cursor: {first_page.after}") # => "next page cursor: ..."
|
370 |
+
for job in first_page.data:
|
371 |
+
print(job.id)
|
372 |
+
|
373 |
+
# Remove `await` for non-async usage.
|
374 |
+
```
|
375 |
+
|
376 |
+
## Nested params
|
377 |
+
|
378 |
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
|
379 |
+
|
380 |
+
```python
|
381 |
+
from openai import OpenAI
|
382 |
+
|
383 |
+
client = OpenAI()
|
384 |
+
|
385 |
+
completion = client.chat.completions.create(
|
386 |
+
messages=[
|
387 |
+
{
|
388 |
+
"role": "user",
|
389 |
+
"content": "Can you generate an example json object describing a fruit?",
|
390 |
+
}
|
391 |
+
],
|
392 |
+
model="gpt-3.5-turbo-1106",
|
393 |
+
response_format={"type": "json_object"},
|
394 |
+
)
|
395 |
+
```
|
396 |
+
|
397 |
+
## File uploads
|
398 |
+
|
399 |
+
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
|
400 |
+
|
401 |
+
```python
|
402 |
+
from pathlib import Path
|
403 |
+
from openai import OpenAI
|
404 |
+
|
405 |
+
client = OpenAI()
|
406 |
+
|
407 |
+
client.files.create(
|
408 |
+
file=Path("input.jsonl"),
|
409 |
+
purpose="fine-tune",
|
410 |
+
)
|
411 |
+
```
|
412 |
+
|
413 |
+
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
|
414 |
+
|
415 |
+
## Handling errors
|
416 |
+
|
417 |
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `openai.APIConnectionError` is raised.
|
418 |
+
|
419 |
+
When the API returns a non-success status code (that is, 4xx or 5xx
|
420 |
+
response), a subclass of `openai.APIStatusError` is raised, containing `status_code` and `response` properties.
|
421 |
+
|
422 |
+
All errors inherit from `openai.APIError`.
|
423 |
+
|
424 |
+
```python
|
425 |
+
import openai
|
426 |
+
from openai import OpenAI
|
427 |
+
|
428 |
+
client = OpenAI()
|
429 |
+
|
430 |
+
try:
|
431 |
+
client.fine_tuning.jobs.create(
|
432 |
+
model="gpt-3.5-turbo",
|
433 |
+
training_file="file-abc123",
|
434 |
+
)
|
435 |
+
except openai.APIConnectionError as e:
|
436 |
+
print("The server could not be reached")
|
437 |
+
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
438 |
+
except openai.RateLimitError as e:
|
439 |
+
print("A 429 status code was received; we should back off a bit.")
|
440 |
+
except openai.APIStatusError as e:
|
441 |
+
print("Another non-200-range status code was received")
|
442 |
+
print(e.status_code)
|
443 |
+
print(e.response)
|
444 |
+
```
|
445 |
+
|
446 |
+
Error codes are as followed:
|
447 |
+
|
448 |
+
| Status Code | Error Type |
|
449 |
+
| ----------- | -------------------------- |
|
450 |
+
| 400 | `BadRequestError` |
|
451 |
+
| 401 | `AuthenticationError` |
|
452 |
+
| 403 | `PermissionDeniedError` |
|
453 |
+
| 404 | `NotFoundError` |
|
454 |
+
| 422 | `UnprocessableEntityError` |
|
455 |
+
| 429 | `RateLimitError` |
|
456 |
+
| >=500 | `InternalServerError` |
|
457 |
+
| N/A | `APIConnectionError` |
|
458 |
+
|
459 |
+
## Request IDs
|
460 |
+
|
461 |
+
> For more information on debugging requests, see [these docs](https://platform.openai.com/docs/api-reference/debugging-requests)
|
462 |
+
|
463 |
+
All object responses in the SDK provide a `_request_id` property which is added from the `x-request-id` response header so that you can quickly log failing requests and report them back to OpenAI.
|
464 |
+
|
465 |
+
```python
|
466 |
+
completion = await client.chat.completions.create(
|
467 |
+
messages=[{"role": "user", "content": "Say this is a test"}], model="gpt-4"
|
468 |
+
)
|
469 |
+
print(completion._request_id) # req_123
|
470 |
+
```
|
471 |
+
|
472 |
+
Note that unlike other properties that use an `_` prefix, the `_request_id` property
|
473 |
+
*is* public. Unless documented otherwise, *all* other `_` prefix properties,
|
474 |
+
methods and modules are *private*.
|
475 |
+
|
476 |
+
|
477 |
+
### Retries
|
478 |
+
|
479 |
+
Certain errors are automatically retried 2 times by default, with a short exponential backoff.
|
480 |
+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
|
481 |
+
429 Rate Limit, and >=500 Internal errors are all retried by default.
|
482 |
+
|
483 |
+
You can use the `max_retries` option to configure or disable retry settings:
|
484 |
+
|
485 |
+
```python
|
486 |
+
from openai import OpenAI
|
487 |
+
|
488 |
+
# Configure the default for all requests:
|
489 |
+
client = OpenAI(
|
490 |
+
# default is 2
|
491 |
+
max_retries=0,
|
492 |
+
)
|
493 |
+
|
494 |
+
# Or, configure per-request:
|
495 |
+
client.with_options(max_retries=5).chat.completions.create(
|
496 |
+
messages=[
|
497 |
+
{
|
498 |
+
"role": "user",
|
499 |
+
"content": "How can I get the name of the current day in Node.js?",
|
500 |
+
}
|
501 |
+
],
|
502 |
+
model="gpt-3.5-turbo",
|
503 |
+
)
|
504 |
+
```
|
505 |
+
|
506 |
+
### Timeouts
|
507 |
+
|
508 |
+
By default requests time out after 10 minutes. You can configure this with a `timeout` option,
|
509 |
+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
|
510 |
+
|
511 |
+
```python
|
512 |
+
from openai import OpenAI
|
513 |
+
|
514 |
+
# Configure the default for all requests:
|
515 |
+
client = OpenAI(
|
516 |
+
# 20 seconds (default is 10 minutes)
|
517 |
+
timeout=20.0,
|
518 |
+
)
|
519 |
+
|
520 |
+
# More granular control:
|
521 |
+
client = OpenAI(
|
522 |
+
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
|
523 |
+
)
|
524 |
+
|
525 |
+
# Override per-request:
|
526 |
+
client.with_options(timeout=5.0).chat.completions.create(
|
527 |
+
messages=[
|
528 |
+
{
|
529 |
+
"role": "user",
|
530 |
+
"content": "How can I list all files in a directory using Python?",
|
531 |
+
}
|
532 |
+
],
|
533 |
+
model="gpt-3.5-turbo",
|
534 |
+
)
|
535 |
+
```
|
536 |
+
|
537 |
+
On timeout, an `APITimeoutError` is thrown.
|
538 |
+
|
539 |
+
Note that requests that time out are [retried twice by default](https://github.com/openai/openai-python/tree/main/#retries).
|
540 |
+
|
541 |
+
## Advanced
|
542 |
+
|
543 |
+
### Logging
|
544 |
+
|
545 |
+
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
|
546 |
+
|
547 |
+
You can enable logging by setting the environment variable `OPENAI_LOG` to `debug`.
|
548 |
+
|
549 |
+
```shell
|
550 |
+
$ export OPENAI_LOG=debug
|
551 |
+
```
|
552 |
+
|
553 |
+
### How to tell whether `None` means `null` or missing
|
554 |
+
|
555 |
+
In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
|
556 |
+
|
557 |
+
```py
|
558 |
+
if response.my_field is None:
|
559 |
+
if 'my_field' not in response.model_fields_set:
|
560 |
+
print('Got json like {}, without a "my_field" key present at all.')
|
561 |
+
else:
|
562 |
+
print('Got json like {"my_field": null}.')
|
563 |
+
```
|
564 |
+
|
565 |
+
### Accessing raw response data (e.g. headers)
|
566 |
+
|
567 |
+
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
|
568 |
+
|
569 |
+
```py
|
570 |
+
from openai import OpenAI
|
571 |
+
|
572 |
+
client = OpenAI()
|
573 |
+
response = client.chat.completions.with_raw_response.create(
|
574 |
+
messages=[{
|
575 |
+
"role": "user",
|
576 |
+
"content": "Say this is a test",
|
577 |
+
}],
|
578 |
+
model="gpt-3.5-turbo",
|
579 |
+
)
|
580 |
+
print(response.headers.get('X-My-Header'))
|
581 |
+
|
582 |
+
completion = response.parse() # get the object that `chat.completions.create()` would have returned
|
583 |
+
print(completion)
|
584 |
+
```
|
585 |
+
|
586 |
+
These methods return an [`LegacyAPIResponse`](https://github.com/openai/openai-python/tree/main/src/openai/_legacy_response.py) object. This is a legacy class as we're changing it slightly in the next major version.
|
587 |
+
|
588 |
+
For the sync client this will mostly be the same with the exception
|
589 |
+
of `content` & `text` will be methods instead of properties. In the
|
590 |
+
async client, all methods will be async.
|
591 |
+
|
592 |
+
A migration script will be provided & the migration in general should
|
593 |
+
be smooth.
|
594 |
+
|
595 |
+
#### `.with_streaming_response`
|
596 |
+
|
597 |
+
The above interface eagerly reads the full response body when you make the request, which may not always be what you want.
|
598 |
+
|
599 |
+
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
600 |
+
|
601 |
+
As such, `.with_streaming_response` methods return a different [`APIResponse`](https://github.com/openai/openai-python/tree/main/src/openai/_response.py) object, and the async client returns an [`AsyncAPIResponse`](https://github.com/openai/openai-python/tree/main/src/openai/_response.py) object.
|
602 |
+
|
603 |
+
```python
|
604 |
+
with client.chat.completions.with_streaming_response.create(
|
605 |
+
messages=[
|
606 |
+
{
|
607 |
+
"role": "user",
|
608 |
+
"content": "Say this is a test",
|
609 |
+
}
|
610 |
+
],
|
611 |
+
model="gpt-3.5-turbo",
|
612 |
+
) as response:
|
613 |
+
print(response.headers.get("X-My-Header"))
|
614 |
+
|
615 |
+
for line in response.iter_lines():
|
616 |
+
print(line)
|
617 |
+
```
|
618 |
+
|
619 |
+
The context manager is required so that the response will reliably be closed.
|
620 |
+
|
621 |
+
### Making custom/undocumented requests
|
622 |
+
|
623 |
+
This library is typed for convenient access to the documented API.
|
624 |
+
|
625 |
+
If you need to access undocumented endpoints, params, or response properties, the library can still be used.
|
626 |
+
|
627 |
+
#### Undocumented endpoints
|
628 |
+
|
629 |
+
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
|
630 |
+
http verbs. Options on the client will be respected (such as retries) will be respected when making this
|
631 |
+
request.
|
632 |
+
|
633 |
+
```py
|
634 |
+
import httpx
|
635 |
+
|
636 |
+
response = client.post(
|
637 |
+
"/foo",
|
638 |
+
cast_to=httpx.Response,
|
639 |
+
body={"my_param": True},
|
640 |
+
)
|
641 |
+
|
642 |
+
print(response.headers.get("x-foo"))
|
643 |
+
```
|
644 |
+
|
645 |
+
#### Undocumented request params
|
646 |
+
|
647 |
+
If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
|
648 |
+
options.
|
649 |
+
|
650 |
+
#### Undocumented response properties
|
651 |
+
|
652 |
+
To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
|
653 |
+
can also get all the extra fields on the Pydantic model as a dict with
|
654 |
+
[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).
|
655 |
+
|
656 |
+
### Configuring the HTTP client
|
657 |
+
|
658 |
+
You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
|
659 |
+
|
660 |
+
- Support for proxies
|
661 |
+
- Custom transports
|
662 |
+
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
|
663 |
+
|
664 |
+
```python
|
665 |
+
from openai import OpenAI, DefaultHttpxClient
|
666 |
+
|
667 |
+
client = OpenAI(
|
668 |
+
# Or use the `OPENAI_BASE_URL` env var
|
669 |
+
base_url="http://my.test.server.example.com:8083/v1",
|
670 |
+
http_client=DefaultHttpxClient(
|
671 |
+
proxies="http://my.test.proxy.example.com",
|
672 |
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
673 |
+
),
|
674 |
+
)
|
675 |
+
```
|
676 |
+
|
677 |
+
You can also customize the client on a per-request basis by using `with_options()`:
|
678 |
+
|
679 |
+
```python
|
680 |
+
client.with_options(http_client=DefaultHttpxClient(...))
|
681 |
+
```
|
682 |
+
|
683 |
+
### Managing HTTP resources
|
684 |
+
|
685 |
+
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
|
686 |
+
|
687 |
+
## Microsoft Azure OpenAI
|
688 |
+
|
689 |
+
To use this library with [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/overview), use the `AzureOpenAI`
|
690 |
+
class instead of the `OpenAI` class.
|
691 |
+
|
692 |
+
> [!IMPORTANT]
|
693 |
+
> The Azure API shape differs from the core API shape which means that the static types for responses / params
|
694 |
+
> won't always be correct.
|
695 |
+
|
696 |
+
```py
|
697 |
+
from openai import AzureOpenAI
|
698 |
+
|
699 |
+
# gets the API Key from environment variable AZURE_OPENAI_API_KEY
|
700 |
+
client = AzureOpenAI(
|
701 |
+
# https://learn.microsoft.com/azure/ai-services/openai/reference#rest-api-versioning
|
702 |
+
api_version="2023-07-01-preview",
|
703 |
+
# https://learn.microsoft.com/azure/cognitive-services/openai/how-to/create-resource?pivots=web-portal#create-a-resource
|
704 |
+
azure_endpoint="https://example-endpoint.openai.azure.com",
|
705 |
+
)
|
706 |
+
|
707 |
+
completion = client.chat.completions.create(
|
708 |
+
model="deployment-name", # e.g. gpt-35-instant
|
709 |
+
messages=[
|
710 |
+
{
|
711 |
+
"role": "user",
|
712 |
+
"content": "How do I output all files in a directory using Python?",
|
713 |
+
},
|
714 |
+
],
|
715 |
+
)
|
716 |
+
print(completion.to_json())
|
717 |
+
```
|
718 |
+
|
719 |
+
In addition to the options provided in the base `OpenAI` client, the following options are provided:
|
720 |
+
|
721 |
+
- `azure_endpoint` (or the `AZURE_OPENAI_ENDPOINT` environment variable)
|
722 |
+
- `azure_deployment`
|
723 |
+
- `api_version` (or the `OPENAI_API_VERSION` environment variable)
|
724 |
+
- `azure_ad_token` (or the `AZURE_OPENAI_AD_TOKEN` environment variable)
|
725 |
+
- `azure_ad_token_provider`
|
726 |
+
|
727 |
+
An example of using the client with Microsoft Entra ID (formerly known as Azure Active Directory) can be found [here](https://github.com/openai/openai-python/blob/main/examples/azure_ad.py).
|
728 |
+
|
729 |
+
## Versioning
|
730 |
+
|
731 |
+
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
732 |
+
|
733 |
+
1. Changes that only affect static types, without breaking runtime behavior.
|
734 |
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
|
735 |
+
3. Changes that we do not expect to impact the vast majority of users in practice.
|
736 |
+
|
737 |
+
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
738 |
+
|
739 |
+
We are keen for your feedback; please open an [issue](https://www.github.com/openai/openai-python/issues) with questions, bugs, or suggestions.
|
740 |
+
|
741 |
+
### Determining the installed version
|
742 |
+
|
743 |
+
If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.
|
744 |
+
|
745 |
+
You can determine the version that is being used at runtime with:
|
746 |
+
|
747 |
+
```py
|
748 |
+
import openai
|
749 |
+
print(openai.__version__)
|
750 |
+
```
|
751 |
+
|
752 |
+
## Requirements
|
753 |
+
|
754 |
+
Python 3.8 or higher.
|
755 |
+
|
756 |
+
## Contributing
|
757 |
+
|
758 |
+
See [the contributing documentation](https://github.com/openai/openai-python/tree/main/./CONTRIBUTING.md).
|
graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/RECORD
ADDED
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
../../../bin/openai,sha256=aKjrfBVSWfp5HyhUt9lhiPg27n5Xah5meUzfFTwT6TI,254
|
2 |
+
openai-1.54.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
3 |
+
openai-1.54.0.dist-info/METADATA,sha256=xhe0VXYYOYyBf83oVS-iJi68Zv2QSL6Gwsn9xV73cgE,24157
|
4 |
+
openai-1.54.0.dist-info/RECORD,,
|
5 |
+
openai-1.54.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6 |
+
openai-1.54.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
7 |
+
openai-1.54.0.dist-info/entry_points.txt,sha256=kAYhQEmziJwsKs5raYAIOvJ2LWmbz5dulEXOzsY71ro,43
|
8 |
+
openai-1.54.0.dist-info/licenses/LICENSE,sha256=d0M6HDjQ76tf255XPlAGkIoECMe688MXcGEYsOFySfI,11336
|
9 |
+
openai/__init__.py,sha256=YhCuMuxZHoRn6BnOxawEFt8fRZPnhBWGongW3CP-F3k,10191
|
10 |
+
openai/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
|
11 |
+
openai/__pycache__/__init__.cpython-312.pyc,,
|
12 |
+
openai/__pycache__/__main__.cpython-312.pyc,,
|
13 |
+
openai/__pycache__/_base_client.cpython-312.pyc,,
|
14 |
+
openai/__pycache__/_client.cpython-312.pyc,,
|
15 |
+
openai/__pycache__/_compat.cpython-312.pyc,,
|
16 |
+
openai/__pycache__/_constants.cpython-312.pyc,,
|
17 |
+
openai/__pycache__/_exceptions.cpython-312.pyc,,
|
18 |
+
openai/__pycache__/_files.cpython-312.pyc,,
|
19 |
+
openai/__pycache__/_legacy_response.cpython-312.pyc,,
|
20 |
+
openai/__pycache__/_models.cpython-312.pyc,,
|
21 |
+
openai/__pycache__/_module_client.cpython-312.pyc,,
|
22 |
+
openai/__pycache__/_qs.cpython-312.pyc,,
|
23 |
+
openai/__pycache__/_resource.cpython-312.pyc,,
|
24 |
+
openai/__pycache__/_response.cpython-312.pyc,,
|
25 |
+
openai/__pycache__/_streaming.cpython-312.pyc,,
|
26 |
+
openai/__pycache__/_types.cpython-312.pyc,,
|
27 |
+
openai/__pycache__/_version.cpython-312.pyc,,
|
28 |
+
openai/__pycache__/pagination.cpython-312.pyc,,
|
29 |
+
openai/__pycache__/version.cpython-312.pyc,,
|
30 |
+
openai/_base_client.py,sha256=R_u8qufl5UW4gl1NGr1wnKO3uhWCMfV_IJqAoL_Q5xQ,68888
|
31 |
+
openai/_client.py,sha256=PXHky30KYjUMIH8WV7PjKcOAULO9-36AbN8y1DCFu70,22233
|
32 |
+
openai/_compat.py,sha256=onH4a0k--J-KQMFTYSGiMp1B0irj1sqdDp54KukWN6g,7009
|
33 |
+
openai/_constants.py,sha256=L1pfEhuz_wM2w2_U9P_9JZzTbrN4pbLo207l96rtKcQ,469
|
34 |
+
openai/_exceptions.py,sha256=2BEuXwqce9z7X6lWLLXRqg1vOay_q-OdLz9lcj6Pluw,4798
|
35 |
+
openai/_extras/__init__.py,sha256=LZbJLZ7aFHRcI7uiY4-wFQTdMp-BF6FER1QMhKVFkWk,107
|
36 |
+
openai/_extras/__pycache__/__init__.cpython-312.pyc,,
|
37 |
+
openai/_extras/__pycache__/_common.cpython-312.pyc,,
|
38 |
+
openai/_extras/__pycache__/numpy_proxy.cpython-312.pyc,,
|
39 |
+
openai/_extras/__pycache__/pandas_proxy.cpython-312.pyc,,
|
40 |
+
openai/_extras/_common.py,sha256=NWWtgbdJsO3hQGQxaXGfVk0LjeIE5AFZ8VS_795hhMc,364
|
41 |
+
openai/_extras/numpy_proxy.py,sha256=hwZXa_JBAPD5taRhor1tGxK26g5IaK52JclQDl-dky0,799
|
42 |
+
openai/_extras/pandas_proxy.py,sha256=NCEt1Dqwc_0H85YdsWPDE3lPDJtYnBT8G-gJE_BCeEc,637
|
43 |
+
openai/_files.py,sha256=WEf6hxJN1u3pVkdnPCpinhxCUnOV2olt4J6vLoJ_k48,3616
|
44 |
+
openai/_legacy_response.py,sha256=Htl5Hov1NjGA7b7OJDdIjr6dp34s1GaJVvnGO_G_uY8,15990
|
45 |
+
openai/_models.py,sha256=uDQJEgxRo3_8WA_U_S8LNxh4V5E6hKKMBU98mYL39gY,30224
|
46 |
+
openai/_module_client.py,sha256=gF_2bbdosIwUt29sQgrQRJOgNREvXF-IDxe4XKGhHjY,2523
|
47 |
+
openai/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
48 |
+
openai/_resource.py,sha256=IQihFzFLhGOiGSlT2dO1ESWSTg2XypgbtAldtGdTOqU,1100
|
49 |
+
openai/_response.py,sha256=VhqkEVjRsausFB2Unh4fJjbabFU7MRiWZMg23djYJmw,29331
|
50 |
+
openai/_streaming.py,sha256=t1UZrg53fVJB5Rs6k2sT9PBbvjp-IGrQzUq_5nlxKG4,13102
|
51 |
+
openai/_types.py,sha256=HHBaGSKoIBMJ56IS2MMQZQRbq-WBs2_zr4m8ks9oVCk,6266
|
52 |
+
openai/_utils/__init__.py,sha256=k266EatJr88V8Zseb7xUimTlCeno9SynRfLwadHP1b4,2016
|
53 |
+
openai/_utils/__pycache__/__init__.cpython-312.pyc,,
|
54 |
+
openai/_utils/__pycache__/_logs.cpython-312.pyc,,
|
55 |
+
openai/_utils/__pycache__/_proxy.cpython-312.pyc,,
|
56 |
+
openai/_utils/__pycache__/_reflection.cpython-312.pyc,,
|
57 |
+
openai/_utils/__pycache__/_streams.cpython-312.pyc,,
|
58 |
+
openai/_utils/__pycache__/_sync.cpython-312.pyc,,
|
59 |
+
openai/_utils/__pycache__/_transform.cpython-312.pyc,,
|
60 |
+
openai/_utils/__pycache__/_typing.cpython-312.pyc,,
|
61 |
+
openai/_utils/__pycache__/_utils.cpython-312.pyc,,
|
62 |
+
openai/_utils/_logs.py,sha256=sFA_NejuNObTGGbfsXC03I38mrT9HjsgAJx4d3GP0ok,774
|
63 |
+
openai/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,1902
|
64 |
+
openai/_utils/_reflection.py,sha256=aTXm-W0Kww4PJo5LPkUnQ92N-2UvrK1-D67cJVBlIgw,1426
|
65 |
+
openai/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
|
66 |
+
openai/_utils/_sync.py,sha256=9ex9pfOyd8xAF1LxpFx4IkqL8k0vk8srE2Ee-OTMQ0A,2840
|
67 |
+
openai/_utils/_transform.py,sha256=GcsgDf2GwWGI6a7DTKRKa7JPdzcv2EFK8IHFG_8Cw5E,13226
|
68 |
+
openai/_utils/_typing.py,sha256=tFbktdpdHCQliwzGsWysgn0P5H0JRdagkZdb_LegGkY,3838
|
69 |
+
openai/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
|
70 |
+
openai/_version.py,sha256=X5ajQJ5eFNVjq40dAikF8m4hMY-xEIZh6NyQtgCzkKM,159
|
71 |
+
openai/cli/__init__.py,sha256=soGgtqyomgddl92H0KJRqHqGuaXIaghq86qkzLuVp7U,31
|
72 |
+
openai/cli/__pycache__/__init__.cpython-312.pyc,,
|
73 |
+
openai/cli/__pycache__/_cli.cpython-312.pyc,,
|
74 |
+
openai/cli/__pycache__/_errors.cpython-312.pyc,,
|
75 |
+
openai/cli/__pycache__/_models.cpython-312.pyc,,
|
76 |
+
openai/cli/__pycache__/_progress.cpython-312.pyc,,
|
77 |
+
openai/cli/__pycache__/_utils.cpython-312.pyc,,
|
78 |
+
openai/cli/_api/__init__.py,sha256=cj92MZq-9_1PQM8A4TQVsqKn5mcTDAGxHllJ0UvJOPE,58
|
79 |
+
openai/cli/_api/__pycache__/__init__.cpython-312.pyc,,
|
80 |
+
openai/cli/_api/__pycache__/_main.cpython-312.pyc,,
|
81 |
+
openai/cli/_api/__pycache__/audio.cpython-312.pyc,,
|
82 |
+
openai/cli/_api/__pycache__/completions.cpython-312.pyc,,
|
83 |
+
openai/cli/_api/__pycache__/files.cpython-312.pyc,,
|
84 |
+
openai/cli/_api/__pycache__/image.cpython-312.pyc,,
|
85 |
+
openai/cli/_api/__pycache__/models.cpython-312.pyc,,
|
86 |
+
openai/cli/_api/_main.py,sha256=5yyfLURqCEaAN8B61gHaqVAaYgtyb9Xq0ncQ3P2BAh0,451
|
87 |
+
openai/cli/_api/audio.py,sha256=IPbABMwryQ0CQTF4gi6VS3hJi6qFjoyj6IDV2ZoPT6A,3787
|
88 |
+
openai/cli/_api/chat/__init__.py,sha256=MhFUQH9F6QCtbPMlbsU_DWTd7wc5DSCZ7Wy3FBGVij0,300
|
89 |
+
openai/cli/_api/chat/__pycache__/__init__.cpython-312.pyc,,
|
90 |
+
openai/cli/_api/chat/__pycache__/completions.cpython-312.pyc,,
|
91 |
+
openai/cli/_api/chat/completions.py,sha256=9Ztetyz7rm0gP5SOPWEcpzFJnJKuIEQit626vOq42bE,5363
|
92 |
+
openai/cli/_api/completions.py,sha256=ysOmnbXpFz3VB5N_5USPdObiYew62vEn6rMtNFwTJGQ,6412
|
93 |
+
openai/cli/_api/files.py,sha256=6nKXFnsC2QE0bGnVUAG7BTLSu6K1_MhPE0ZJACmzgRY,2345
|
94 |
+
openai/cli/_api/image.py,sha256=ovBExdn8oUK9ImOpsPafesfAlmcftLP2p7d37hcUtKU,5062
|
95 |
+
openai/cli/_api/models.py,sha256=pGmIGZToj3raGGpKvPSq_EVUR-dqg4Vi0PNfZH98D2E,1295
|
96 |
+
openai/cli/_cli.py,sha256=WxqTnhVVtfzX0z7hV5fcvd3hkihaUgwOWpXOwyCS4Fc,6743
|
97 |
+
openai/cli/_errors.py,sha256=nejlu1HnOyAIr2n7uqpFtWn8XclWj_9N8FwgfT3BPK8,471
|
98 |
+
openai/cli/_models.py,sha256=tgsldjG216KpwgAZ5pS0sV02FQvONDJU2ElA4kCCiIU,491
|
99 |
+
openai/cli/_progress.py,sha256=aMLssU9jh-LoqRYH3608jNos7r6vZKnHTRlHxFznzv4,1406
|
100 |
+
openai/cli/_tools/__init__.py,sha256=cj92MZq-9_1PQM8A4TQVsqKn5mcTDAGxHllJ0UvJOPE,58
|
101 |
+
openai/cli/_tools/__pycache__/__init__.cpython-312.pyc,,
|
102 |
+
openai/cli/_tools/__pycache__/_main.cpython-312.pyc,,
|
103 |
+
openai/cli/_tools/__pycache__/fine_tunes.cpython-312.pyc,,
|
104 |
+
openai/cli/_tools/__pycache__/migrate.cpython-312.pyc,,
|
105 |
+
openai/cli/_tools/_main.py,sha256=pakjEXHRHqYlTml-RxV7fNrRtRXzmZBinoPi1AJipFY,467
|
106 |
+
openai/cli/_tools/fine_tunes.py,sha256=RQgYMzifk6S7Y1I1K6huqco2QxmXa7gVUlHl6SrKTSU,1543
|
107 |
+
openai/cli/_tools/migrate.py,sha256=OM2VJiMzg5rglV56Y91kFe5L4UoZZmEhcPh6qSO9nsc,4506
|
108 |
+
openai/cli/_utils.py,sha256=oiTc9MnxQh_zxAZ1OIHPkoDpCll0NF9ZgkdFHz4T-Bs,848
|
109 |
+
openai/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
110 |
+
openai/lib/__init__.py,sha256=BMTfMnlbugMgDA1STDIAlx4bI4t4l_8bQmJxd0th0n8,126
|
111 |
+
openai/lib/__pycache__/__init__.cpython-312.pyc,,
|
112 |
+
openai/lib/__pycache__/_old_api.cpython-312.pyc,,
|
113 |
+
openai/lib/__pycache__/_pydantic.cpython-312.pyc,,
|
114 |
+
openai/lib/__pycache__/_tools.cpython-312.pyc,,
|
115 |
+
openai/lib/__pycache__/_validators.cpython-312.pyc,,
|
116 |
+
openai/lib/__pycache__/azure.cpython-312.pyc,,
|
117 |
+
openai/lib/_old_api.py,sha256=XZnXBrEKuTd70iJirj5mGW35fZoqruJobbBTq6bvg10,1947
|
118 |
+
openai/lib/_parsing/__init__.py,sha256=wS3BYvMGj9TqiPqOe3rO1sleaAJqHVuCaQuCE5rZIUw,539
|
119 |
+
openai/lib/_parsing/__pycache__/__init__.cpython-312.pyc,,
|
120 |
+
openai/lib/_parsing/__pycache__/_completions.cpython-312.pyc,,
|
121 |
+
openai/lib/_parsing/_completions.py,sha256=I1KpjdI9p8Me-nsLF2szjEYF_7x4k28WGH5GdZeKpzI,9138
|
122 |
+
openai/lib/_pydantic.py,sha256=ndHdDDSEGg8Jbhc7JvLQHiIrZwLR36bCcUAlzwLmOdk,5282
|
123 |
+
openai/lib/_tools.py,sha256=xrzM7jNgehZGsRQ9kSgn1q33z9cHrgf0b8UMo5wrTFw,1501
|
124 |
+
openai/lib/_validators.py,sha256=cXJXFuaAl7jeJcYHXXnFa4NHGtHs-_zt3Zs1VVCmQo4,35288
|
125 |
+
openai/lib/azure.py,sha256=jMYr2GNCABcqiLuWPTJL8XyPtC6rvwNNcGNcOKFbbIM,21608
|
126 |
+
openai/lib/streaming/__init__.py,sha256=kD3LpjsqU7caDQDhB-YjTUl9qqbb5sPnGGSI2yQYC70,379
|
127 |
+
openai/lib/streaming/__pycache__/__init__.cpython-312.pyc,,
|
128 |
+
openai/lib/streaming/__pycache__/_assistants.cpython-312.pyc,,
|
129 |
+
openai/lib/streaming/__pycache__/_deltas.cpython-312.pyc,,
|
130 |
+
openai/lib/streaming/_assistants.py,sha256=OyY18aVJsCnyBLvZfec3APuS2ATwXCIZD1SYWpMJiYA,40694
|
131 |
+
openai/lib/streaming/_deltas.py,sha256=I7B_AznXZwlBmE8Puau7ayTQUx6hMIEVE8FYTQm2fjs,2502
|
132 |
+
openai/lib/streaming/chat/__init__.py,sha256=d243EsKxxHQ_MpUxecmYdLy4ZRVY6BKhL6QNSfLdtRY,1245
|
133 |
+
openai/lib/streaming/chat/__pycache__/__init__.cpython-312.pyc,,
|
134 |
+
openai/lib/streaming/chat/__pycache__/_completions.cpython-312.pyc,,
|
135 |
+
openai/lib/streaming/chat/__pycache__/_events.cpython-312.pyc,,
|
136 |
+
openai/lib/streaming/chat/__pycache__/_types.cpython-312.pyc,,
|
137 |
+
openai/lib/streaming/chat/_completions.py,sha256=Fwea9Ld9Y99LrSSaudGfMfd8PnQUv8jxG8FP_tvhqR8,29088
|
138 |
+
openai/lib/streaming/chat/_events.py,sha256=lstVmM6YR2Cs9drikzrY9JCZn9Nbfym0aKIPtNpxL6w,2618
|
139 |
+
openai/lib/streaming/chat/_types.py,sha256=-SYVBNhGkOUoJ-8dotxpCRqPJpfyOQ8hwR2_HrsQCRI,739
|
140 |
+
openai/pagination.py,sha256=B9ejXEAR_hYGLHfqb9xEEsE0u5dCUMjvplOce5dpY7M,2760
|
141 |
+
openai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
142 |
+
openai/resources/__init__.py,sha256=eYonVyf6AAmk-b8JYSYmo5EEMv89ovxiAY5A83ti8J8,4533
|
143 |
+
openai/resources/__pycache__/__init__.cpython-312.pyc,,
|
144 |
+
openai/resources/__pycache__/batches.cpython-312.pyc,,
|
145 |
+
openai/resources/__pycache__/completions.cpython-312.pyc,,
|
146 |
+
openai/resources/__pycache__/embeddings.cpython-312.pyc,,
|
147 |
+
openai/resources/__pycache__/files.cpython-312.pyc,,
|
148 |
+
openai/resources/__pycache__/images.cpython-312.pyc,,
|
149 |
+
openai/resources/__pycache__/models.cpython-312.pyc,,
|
150 |
+
openai/resources/__pycache__/moderations.cpython-312.pyc,,
|
151 |
+
openai/resources/audio/__init__.py,sha256=YM7FHvPKVlj_v6EIgfpUQsb6q4hS2hVQ3gfkgic0sP0,1687
|
152 |
+
openai/resources/audio/__pycache__/__init__.cpython-312.pyc,,
|
153 |
+
openai/resources/audio/__pycache__/audio.cpython-312.pyc,,
|
154 |
+
openai/resources/audio/__pycache__/speech.cpython-312.pyc,,
|
155 |
+
openai/resources/audio/__pycache__/transcriptions.cpython-312.pyc,,
|
156 |
+
openai/resources/audio/__pycache__/translations.cpython-312.pyc,,
|
157 |
+
openai/resources/audio/audio.py,sha256=MMJHbfXmyYmQU7dF8XsD0YOIqdlG3gtxUqTihOuVx8o,5499
|
158 |
+
openai/resources/audio/speech.py,sha256=yPoi_Xozv0Yuikbf2dxhAyRdN2q_sWDQoHNCxUayC-E,8903
|
159 |
+
openai/resources/audio/transcriptions.py,sha256=4X71pe1lvelNRPSlHy2jAtIMyETYwWieLShBdr12MN0,18507
|
160 |
+
openai/resources/audio/translations.py,sha256=4Y-ognKnSi72qhwX8FCKB-5JhvaAS2Wnq2ivTFmpUoU,15711
|
161 |
+
openai/resources/batches.py,sha256=cYY2SHoxfp2Z2MKr51B2TPSENLn28n7cyZgEVoc5u4s,19578
|
162 |
+
openai/resources/beta/__init__.py,sha256=nXoV4P8WCrbEZuNMtptbIuy_LqlVafY9lJ2qfW35GFc,1636
|
163 |
+
openai/resources/beta/__pycache__/__init__.cpython-312.pyc,,
|
164 |
+
openai/resources/beta/__pycache__/assistants.cpython-312.pyc,,
|
165 |
+
openai/resources/beta/__pycache__/beta.cpython-312.pyc,,
|
166 |
+
openai/resources/beta/assistants.py,sha256=j1BE3q4aCGzridJ8wyhzn0FeI3Gvy56jRK57EA-SuXk,40533
|
167 |
+
openai/resources/beta/beta.py,sha256=dJWA8oRF_Kz592xdxcIs6zJwUfvKIaVboGI7eUyglt0,5720
|
168 |
+
openai/resources/beta/chat/__init__.py,sha256=d_fpyFMAG3iRAPIXANPfRG4HtEm6U_uMUYep7Skj2uY,263
|
169 |
+
openai/resources/beta/chat/__pycache__/__init__.cpython-312.pyc,,
|
170 |
+
openai/resources/beta/chat/__pycache__/chat.cpython-312.pyc,,
|
171 |
+
openai/resources/beta/chat/__pycache__/completions.cpython-312.pyc,,
|
172 |
+
openai/resources/beta/chat/chat.py,sha256=sNvU8Fi_o3dWkD_X4Mobafv9XWBP6Y2dJxng-NdFXUs,597
|
173 |
+
openai/resources/beta/chat/completions.py,sha256=iBnyY5dtdqk59sG8XyBdq8gJBjxDdr4wAIaFexQc3fU,27348
|
174 |
+
openai/resources/beta/threads/__init__.py,sha256=fQ_qdUVSfouVS5h47DlTb5mamChT4K-v-siPuuAB6do,1177
|
175 |
+
openai/resources/beta/threads/__pycache__/__init__.cpython-312.pyc,,
|
176 |
+
openai/resources/beta/threads/__pycache__/messages.cpython-312.pyc,,
|
177 |
+
openai/resources/beta/threads/__pycache__/threads.cpython-312.pyc,,
|
178 |
+
openai/resources/beta/threads/messages.py,sha256=LBjgJAK-0g_lkhIX2WG6qNT0RzSTknO0nRlqkVQw-B8,27372
|
179 |
+
openai/resources/beta/threads/runs/__init__.py,sha256=2FfDaqwmJJCd-IVpY_CrzWcFvw0KFyQ3cm5jnTfI-DQ,771
|
180 |
+
openai/resources/beta/threads/runs/__pycache__/__init__.cpython-312.pyc,,
|
181 |
+
openai/resources/beta/threads/runs/__pycache__/runs.cpython-312.pyc,,
|
182 |
+
openai/resources/beta/threads/runs/__pycache__/steps.cpython-312.pyc,,
|
183 |
+
openai/resources/beta/threads/runs/runs.py,sha256=sZvbnsQPpQSzVzW2s2EDlxMH11_gs0Qy_jNQM44HXGw,142423
|
184 |
+
openai/resources/beta/threads/runs/steps.py,sha256=VlGD9NXtNqOt3uwlnepCavW7v3uVlvvyi0X1h9WZ_-E,15817
|
185 |
+
openai/resources/beta/threads/threads.py,sha256=iD8DLzR5wwc65Ob2Qn1wAZcFIJZiSdGgsfJTVgmexdk,94272
|
186 |
+
openai/resources/beta/vector_stores/__init__.py,sha256=11Xn1vhgndWiI0defJHv31vmbtbDgh2GwZT3gX8GgHk,1296
|
187 |
+
openai/resources/beta/vector_stores/__pycache__/__init__.cpython-312.pyc,,
|
188 |
+
openai/resources/beta/vector_stores/__pycache__/file_batches.cpython-312.pyc,,
|
189 |
+
openai/resources/beta/vector_stores/__pycache__/files.cpython-312.pyc,,
|
190 |
+
openai/resources/beta/vector_stores/__pycache__/vector_stores.cpython-312.pyc,,
|
191 |
+
openai/resources/beta/vector_stores/file_batches.py,sha256=EomxymvX4oCIRXUAfKGShAYWqnv1vlAahcp_Wa7Kt7Y,31985
|
192 |
+
openai/resources/beta/vector_stores/files.py,sha256=LjN6Zazb4dGV-xeQ-XRKAVciXsFj7LXh90AKJgVQ-Cw,29724
|
193 |
+
openai/resources/beta/vector_stores/vector_stores.py,sha256=OnzaEjKov8npQQf9YSYljPOTNBzjfwmxfW_D7f7fLkQ,28916
|
194 |
+
openai/resources/chat/__init__.py,sha256=8Q9ODRo1wIpFa34VaNwuaWFmxqFxagDtUhIAkQNvxEU,849
|
195 |
+
openai/resources/chat/__pycache__/__init__.cpython-312.pyc,,
|
196 |
+
openai/resources/chat/__pycache__/chat.cpython-312.pyc,,
|
197 |
+
openai/resources/chat/__pycache__/completions.cpython-312.pyc,,
|
198 |
+
openai/resources/chat/chat.py,sha256=hvYn24it5ARq8BYloSWn5kqqSlBEcYvVdQTf3ujxuV0,3360
|
199 |
+
openai/resources/chat/completions.py,sha256=-epJKzJOoc-3UbVCqbH9n8ncQENaz171Sm_qn_5syHQ,97661
|
200 |
+
openai/resources/completions.py,sha256=5W3UuTH0V-vpTIkb8-r7gyS0Qp7tx3JZMWZkHBGIjPY,59460
|
201 |
+
openai/resources/embeddings.py,sha256=PfwI3PKKPkmLs7wHijO-1pOwW6Fjs5Rqzpy0ALLYgAs,11655
|
202 |
+
openai/resources/files.py,sha256=Cg1QSddegp8inC4F6-8uxS1qKR42xDZBP-8aQfXWC1c,30093
|
203 |
+
openai/resources/fine_tuning/__init__.py,sha256=s6uoq7gM4gwoywdOOZQkPeYiSbUl-OwpeuMhwJJk0lc,837
|
204 |
+
openai/resources/fine_tuning/__pycache__/__init__.cpython-312.pyc,,
|
205 |
+
openai/resources/fine_tuning/__pycache__/fine_tuning.cpython-312.pyc,,
|
206 |
+
openai/resources/fine_tuning/fine_tuning.py,sha256=XKi_SqRJS70REs2jPCvb9bMk-QdbpmBwD_71TAc5Re4,3428
|
207 |
+
openai/resources/fine_tuning/jobs/__init__.py,sha256=_smlrwijZOCcsDWqKnofLxQM2QLucZzXgboL9zJBPHw,849
|
208 |
+
openai/resources/fine_tuning/jobs/__pycache__/__init__.cpython-312.pyc,,
|
209 |
+
openai/resources/fine_tuning/jobs/__pycache__/checkpoints.cpython-312.pyc,,
|
210 |
+
openai/resources/fine_tuning/jobs/__pycache__/jobs.cpython-312.pyc,,
|
211 |
+
openai/resources/fine_tuning/jobs/checkpoints.py,sha256=LIJUhxb8hgxEgHdTFKdyb0Q-hnV4ccIprvFpQJI97ho,7474
|
212 |
+
openai/resources/fine_tuning/jobs/jobs.py,sha256=Io1sr9bPJjafQMqPMiVf-G1_ErSOFyAp4ftu1IcNT7s,28520
|
213 |
+
openai/resources/images.py,sha256=PS7PIe1X8tccsqLtd-4kx1OTzCow0S-C-L29bmVyV4c,25634
|
214 |
+
openai/resources/models.py,sha256=qJj0Cpy_Ok9ELag8VxqTefX8tw7RPgIZ8-a6qllxl8w,11240
|
215 |
+
openai/resources/moderations.py,sha256=H9tygVKuT1c25LW_XyrhpK9nlT72SsEYDiPolQBP7hs,7805
|
216 |
+
openai/resources/uploads/__init__.py,sha256=HmY3WQgvUI2bN3CjfWHWQOk7UUC6Ozna97_lHhrrRSA,810
|
217 |
+
openai/resources/uploads/__pycache__/__init__.cpython-312.pyc,,
|
218 |
+
openai/resources/uploads/__pycache__/parts.cpython-312.pyc,,
|
219 |
+
openai/resources/uploads/__pycache__/uploads.cpython-312.pyc,,
|
220 |
+
openai/resources/uploads/parts.py,sha256=NEMRVCqOOYJV2zTmBau9UtY2qXuB_yDJzzXTJ1XubUY,8150
|
221 |
+
openai/resources/uploads/uploads.py,sha256=ft7cVZuDxphjdCV6BcS6Zs2qE3zD1RB57udvaGUR9HY,24918
|
222 |
+
openai/types/__init__.py,sha256=Xz4NCtHjVohcN8ROdidYfPDLjhRwWf391lsbFFp1qNU,3078
|
223 |
+
openai/types/__pycache__/__init__.cpython-312.pyc,,
|
224 |
+
openai/types/__pycache__/audio_model.cpython-312.pyc,,
|
225 |
+
openai/types/__pycache__/audio_response_format.cpython-312.pyc,,
|
226 |
+
openai/types/__pycache__/batch.cpython-312.pyc,,
|
227 |
+
openai/types/__pycache__/batch_create_params.cpython-312.pyc,,
|
228 |
+
openai/types/__pycache__/batch_error.cpython-312.pyc,,
|
229 |
+
openai/types/__pycache__/batch_list_params.cpython-312.pyc,,
|
230 |
+
openai/types/__pycache__/batch_request_counts.cpython-312.pyc,,
|
231 |
+
openai/types/__pycache__/chat_model.cpython-312.pyc,,
|
232 |
+
openai/types/__pycache__/completion.cpython-312.pyc,,
|
233 |
+
openai/types/__pycache__/completion_choice.cpython-312.pyc,,
|
234 |
+
openai/types/__pycache__/completion_create_params.cpython-312.pyc,,
|
235 |
+
openai/types/__pycache__/completion_usage.cpython-312.pyc,,
|
236 |
+
openai/types/__pycache__/create_embedding_response.cpython-312.pyc,,
|
237 |
+
openai/types/__pycache__/embedding.cpython-312.pyc,,
|
238 |
+
openai/types/__pycache__/embedding_create_params.cpython-312.pyc,,
|
239 |
+
openai/types/__pycache__/embedding_model.cpython-312.pyc,,
|
240 |
+
openai/types/__pycache__/file_content.cpython-312.pyc,,
|
241 |
+
openai/types/__pycache__/file_create_params.cpython-312.pyc,,
|
242 |
+
openai/types/__pycache__/file_deleted.cpython-312.pyc,,
|
243 |
+
openai/types/__pycache__/file_list_params.cpython-312.pyc,,
|
244 |
+
openai/types/__pycache__/file_object.cpython-312.pyc,,
|
245 |
+
openai/types/__pycache__/file_purpose.cpython-312.pyc,,
|
246 |
+
openai/types/__pycache__/image.cpython-312.pyc,,
|
247 |
+
openai/types/__pycache__/image_create_variation_params.cpython-312.pyc,,
|
248 |
+
openai/types/__pycache__/image_edit_params.cpython-312.pyc,,
|
249 |
+
openai/types/__pycache__/image_generate_params.cpython-312.pyc,,
|
250 |
+
openai/types/__pycache__/image_model.cpython-312.pyc,,
|
251 |
+
openai/types/__pycache__/images_response.cpython-312.pyc,,
|
252 |
+
openai/types/__pycache__/model.cpython-312.pyc,,
|
253 |
+
openai/types/__pycache__/model_deleted.cpython-312.pyc,,
|
254 |
+
openai/types/__pycache__/moderation.cpython-312.pyc,,
|
255 |
+
openai/types/__pycache__/moderation_create_params.cpython-312.pyc,,
|
256 |
+
openai/types/__pycache__/moderation_create_response.cpython-312.pyc,,
|
257 |
+
openai/types/__pycache__/moderation_image_url_input_param.cpython-312.pyc,,
|
258 |
+
openai/types/__pycache__/moderation_model.cpython-312.pyc,,
|
259 |
+
openai/types/__pycache__/moderation_multi_modal_input_param.cpython-312.pyc,,
|
260 |
+
openai/types/__pycache__/moderation_text_input_param.cpython-312.pyc,,
|
261 |
+
openai/types/__pycache__/upload.cpython-312.pyc,,
|
262 |
+
openai/types/__pycache__/upload_complete_params.cpython-312.pyc,,
|
263 |
+
openai/types/__pycache__/upload_create_params.cpython-312.pyc,,
|
264 |
+
openai/types/audio/__init__.py,sha256=sR9_rMb-gO0stG4ozTq6XJs714C_BfjB3KCgFvyhXVA,1050
|
265 |
+
openai/types/audio/__pycache__/__init__.cpython-312.pyc,,
|
266 |
+
openai/types/audio/__pycache__/speech_create_params.cpython-312.pyc,,
|
267 |
+
openai/types/audio/__pycache__/speech_model.cpython-312.pyc,,
|
268 |
+
openai/types/audio/__pycache__/transcription.cpython-312.pyc,,
|
269 |
+
openai/types/audio/__pycache__/transcription_create_params.cpython-312.pyc,,
|
270 |
+
openai/types/audio/__pycache__/transcription_create_response.cpython-312.pyc,,
|
271 |
+
openai/types/audio/__pycache__/transcription_segment.cpython-312.pyc,,
|
272 |
+
openai/types/audio/__pycache__/transcription_verbose.cpython-312.pyc,,
|
273 |
+
openai/types/audio/__pycache__/transcription_word.cpython-312.pyc,,
|
274 |
+
openai/types/audio/__pycache__/translation.cpython-312.pyc,,
|
275 |
+
openai/types/audio/__pycache__/translation_create_params.cpython-312.pyc,,
|
276 |
+
openai/types/audio/__pycache__/translation_create_response.cpython-312.pyc,,
|
277 |
+
openai/types/audio/__pycache__/translation_verbose.cpython-312.pyc,,
|
278 |
+
openai/types/audio/speech_create_params.py,sha256=-iUZ3a-BGlg46IFsP_vcJBTRuK_pXruF0KJsbNn0mgU,1300
|
279 |
+
openai/types/audio/speech_model.py,sha256=RUimvc__LYAxwEEmfrf-lj18O3EWrU1OlWZXEXN2AKY,218
|
280 |
+
openai/types/audio/transcription.py,sha256=FP9QMwwwdqgvP3xY9P-40gBiFmMwFKxXM5yv5x8xPVk,230
|
281 |
+
openai/types/audio/transcription_create_params.py,sha256=OP8fXaYYsi5HWi0E7HR5HIRihglsuBqeJWglxkNxLts,2264
|
282 |
+
openai/types/audio/transcription_create_response.py,sha256=-PLGH8he9EdJtvBXV-ZrE31CLVnk4bc0VQ1ixRoN8Ck,378
|
283 |
+
openai/types/audio/transcription_segment.py,sha256=-pPAGolwIIXUBMic-H5U7aR0u_Aq-pipSA4xTtn_viA,1153
|
284 |
+
openai/types/audio/transcription_verbose.py,sha256=tlVK8JzyvkslQOvpAb19PmsfiRBqmbne0l-GqFmVIMU,758
|
285 |
+
openai/types/audio/transcription_word.py,sha256=sNDdtjoqIiba6qKsD_lI2Ffs1Lr7qP9HyS59AFh5cTc,368
|
286 |
+
openai/types/audio/translation.py,sha256=5l-Zk9Cg7AZti-TTn2-4ydsoZj2zdvDwyzzVjVp9W0g,194
|
287 |
+
openai/types/audio/translation_create_params.py,sha256=lFQEh5IRG5XT-Z3TV7FDSNbIRqAt6yA3EsSvSsb0wsU,1585
|
288 |
+
openai/types/audio/translation_create_response.py,sha256=x6H0yjTbZR3vd3d7LdABcn9nrMDNdeMjepcjW1oUfVc,362
|
289 |
+
openai/types/audio/translation_verbose.py,sha256=ic6h7_fAKlyrJuCgbd4Vtr0pk9OnynQK_uobD9lAGZo,613
|
290 |
+
openai/types/audio_model.py,sha256=pxBVwf1HGd6mW-_jd-TDVMRZtTvvCUn_rL8Pt1BXzuo,208
|
291 |
+
openai/types/audio_response_format.py,sha256=EEItnQdwXinG8bOe1We2039Z7lp2Z8wSXXvTlFlkXzM,259
|
292 |
+
openai/types/batch.py,sha256=Dq7btfgIT4b2yfh0knZTzAL4yFx_l95H5KLfDPO8iig,2788
|
293 |
+
openai/types/batch_create_params.py,sha256=Wq-uHe9FcAPTtN68jEG2xMZWwOC8Q7Dg4GdxV_y5qP0,1441
|
294 |
+
openai/types/batch_error.py,sha256=Xxl-gYm0jerpYyI-mKSSVxRMQRubkoLUiOP9U3v72EM,622
|
295 |
+
openai/types/batch_list_params.py,sha256=X1_sfRspuIMSDyXWVh0YnJ9vJLeOOH66TrvgEHueC84,705
|
296 |
+
openai/types/batch_request_counts.py,sha256=GHHrJKdJwJ3foBa1j9v5Vece_zzkdXXXgOcne8W1E30,409
|
297 |
+
openai/types/beta/__init__.py,sha256=CbOOxDPXvdK5RInCcEiBihJ2XgaUhdm3NMBBwx90OHc,3462
|
298 |
+
openai/types/beta/__pycache__/__init__.cpython-312.pyc,,
|
299 |
+
openai/types/beta/__pycache__/assistant.cpython-312.pyc,,
|
300 |
+
openai/types/beta/__pycache__/assistant_create_params.cpython-312.pyc,,
|
301 |
+
openai/types/beta/__pycache__/assistant_deleted.cpython-312.pyc,,
|
302 |
+
openai/types/beta/__pycache__/assistant_list_params.cpython-312.pyc,,
|
303 |
+
openai/types/beta/__pycache__/assistant_response_format_option.cpython-312.pyc,,
|
304 |
+
openai/types/beta/__pycache__/assistant_response_format_option_param.cpython-312.pyc,,
|
305 |
+
openai/types/beta/__pycache__/assistant_stream_event.cpython-312.pyc,,
|
306 |
+
openai/types/beta/__pycache__/assistant_tool.cpython-312.pyc,,
|
307 |
+
openai/types/beta/__pycache__/assistant_tool_choice.cpython-312.pyc,,
|
308 |
+
openai/types/beta/__pycache__/assistant_tool_choice_function.cpython-312.pyc,,
|
309 |
+
openai/types/beta/__pycache__/assistant_tool_choice_function_param.cpython-312.pyc,,
|
310 |
+
openai/types/beta/__pycache__/assistant_tool_choice_option.cpython-312.pyc,,
|
311 |
+
openai/types/beta/__pycache__/assistant_tool_choice_option_param.cpython-312.pyc,,
|
312 |
+
openai/types/beta/__pycache__/assistant_tool_choice_param.cpython-312.pyc,,
|
313 |
+
openai/types/beta/__pycache__/assistant_tool_param.cpython-312.pyc,,
|
314 |
+
openai/types/beta/__pycache__/assistant_update_params.cpython-312.pyc,,
|
315 |
+
openai/types/beta/__pycache__/auto_file_chunking_strategy_param.cpython-312.pyc,,
|
316 |
+
openai/types/beta/__pycache__/code_interpreter_tool.cpython-312.pyc,,
|
317 |
+
openai/types/beta/__pycache__/code_interpreter_tool_param.cpython-312.pyc,,
|
318 |
+
openai/types/beta/__pycache__/file_chunking_strategy.cpython-312.pyc,,
|
319 |
+
openai/types/beta/__pycache__/file_chunking_strategy_param.cpython-312.pyc,,
|
320 |
+
openai/types/beta/__pycache__/file_search_tool.cpython-312.pyc,,
|
321 |
+
openai/types/beta/__pycache__/file_search_tool_param.cpython-312.pyc,,
|
322 |
+
openai/types/beta/__pycache__/function_tool.cpython-312.pyc,,
|
323 |
+
openai/types/beta/__pycache__/function_tool_param.cpython-312.pyc,,
|
324 |
+
openai/types/beta/__pycache__/other_file_chunking_strategy_object.cpython-312.pyc,,
|
325 |
+
openai/types/beta/__pycache__/static_file_chunking_strategy.cpython-312.pyc,,
|
326 |
+
openai/types/beta/__pycache__/static_file_chunking_strategy_object.cpython-312.pyc,,
|
327 |
+
openai/types/beta/__pycache__/static_file_chunking_strategy_param.cpython-312.pyc,,
|
328 |
+
openai/types/beta/__pycache__/thread.cpython-312.pyc,,
|
329 |
+
openai/types/beta/__pycache__/thread_create_and_run_params.cpython-312.pyc,,
|
330 |
+
openai/types/beta/__pycache__/thread_create_params.cpython-312.pyc,,
|
331 |
+
openai/types/beta/__pycache__/thread_deleted.cpython-312.pyc,,
|
332 |
+
openai/types/beta/__pycache__/thread_update_params.cpython-312.pyc,,
|
333 |
+
openai/types/beta/__pycache__/vector_store.cpython-312.pyc,,
|
334 |
+
openai/types/beta/__pycache__/vector_store_create_params.cpython-312.pyc,,
|
335 |
+
openai/types/beta/__pycache__/vector_store_deleted.cpython-312.pyc,,
|
336 |
+
openai/types/beta/__pycache__/vector_store_list_params.cpython-312.pyc,,
|
337 |
+
openai/types/beta/__pycache__/vector_store_update_params.cpython-312.pyc,,
|
338 |
+
openai/types/beta/assistant.py,sha256=3w8FpWceagZoKuEQrGeitoosTrz-Z24IPiL-viWC4I4,4936
|
339 |
+
openai/types/beta/assistant_create_params.py,sha256=Y5LoiGU9ZTWQ87KaYyrqN1TsMFT4iYsBvMNeDgciRd4,5986
|
340 |
+
openai/types/beta/assistant_deleted.py,sha256=bTTUl5FPHTBI5nRm7d0sGuR9VCSBDZ-IbOn9G_IpmJQ,301
|
341 |
+
openai/types/beta/assistant_list_params.py,sha256=yW-lj6AUkG0IRZQKre0veEr9p4VMN-9YdELFMYs74Cw,1222
|
342 |
+
openai/types/beta/assistant_response_format_option.py,sha256=yNeoAWxM-_8Sjmwqu8exqyKRFhVZIKeTypetPY55VFA,561
|
343 |
+
openai/types/beta/assistant_response_format_option_param.py,sha256=dyPMhwRSLBZ0ltpxiD7KM-9X6BzWnbGeG-nT_3SenuQ,628
|
344 |
+
openai/types/beta/assistant_stream_event.py,sha256=vP4LDqYWzSKGcZ1JAfyNw7YqC__XsVPe0nqZ2qdn93E,6930
|
345 |
+
openai/types/beta/assistant_tool.py,sha256=_0FC7Db4Ctq_0yLaKJ93zNTB5HthuJWEAHx3fadDRlw,506
|
346 |
+
openai/types/beta/assistant_tool_choice.py,sha256=Hy4HIfPQCkWD8VruHHicuTkomNwljGHviQHk36prKhg,544
|
347 |
+
openai/types/beta/assistant_tool_choice_function.py,sha256=aYMlVrZdX2JxmehDlyGALRK2PIEkO7VFEfsvY3VH6T4,270
|
348 |
+
openai/types/beta/assistant_tool_choice_function_param.py,sha256=-O38277LhSaqOVhTp0haHP0ZnVTLpEBvcLJa5MRo7wE,355
|
349 |
+
openai/types/beta/assistant_tool_choice_option.py,sha256=jrXMd_IYIQ1pt8Lkc-KrPd4CR3lR8sFV4m7_lpG8A4Y,362
|
350 |
+
openai/types/beta/assistant_tool_choice_option_param.py,sha256=VcatO5Nej9e5eqfrwetG4uM1vFoewnBEcFz47IxAK2E,424
|
351 |
+
openai/types/beta/assistant_tool_choice_param.py,sha256=NOWx9SzZEwYaHeAyFZTQlG3pmogMNXzjPJDGQUlbv7Q,572
|
352 |
+
openai/types/beta/assistant_tool_param.py,sha256=6DcaU3nMjurur2VkVIYcCaRAY1QLQscXXjCd0ZHHGho,501
|
353 |
+
openai/types/beta/assistant_update_params.py,sha256=XsLdjYNx7dbPr1aqDu0_ZGuXjgU0JVuM0waJo1NskyI,4684
|
354 |
+
openai/types/beta/auto_file_chunking_strategy_param.py,sha256=hbBtARkJXSJE7_4RqC-ZR3NiztUp9S4WuG3s3W0GpqY,351
|
355 |
+
openai/types/beta/chat/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
|
356 |
+
openai/types/beta/chat/__pycache__/__init__.cpython-312.pyc,,
|
357 |
+
openai/types/beta/code_interpreter_tool.py,sha256=7mgQc9OtD_ZUnZeNhoobMFcmmvtZPFCNYGB-PEnNnfs,333
|
358 |
+
openai/types/beta/code_interpreter_tool_param.py,sha256=X6mwzFyZx1RCKEYbBCPs4kh_tZkxFxydPMK4yFNJkLs,389
|
359 |
+
openai/types/beta/file_chunking_strategy.py,sha256=6nRvYetBl_BHgN8biTyTut-tw8G13YttgxSKtJsJLeM,560
|
360 |
+
openai/types/beta/file_chunking_strategy_param.py,sha256=P0x4I2hB_ylbSxFFEmRqgwto3HQQsHIokX3U0is_a9s,498
|
361 |
+
openai/types/beta/file_search_tool.py,sha256=5aNU8RZj-UNdmuqqpjCXNaa1pI9GzSP5qCPtvVSJ1oQ,1769
|
362 |
+
openai/types/beta/file_search_tool_param.py,sha256=o6sWPrzRYY8wtNaVuF8h3D1sAQV3N0L3dbdiiaMisW0,1765
|
363 |
+
openai/types/beta/function_tool.py,sha256=oYGJfcfPpUohKw2ikgshDjOI1HXCK-5pAWyegYNezeU,397
|
364 |
+
openai/types/beta/function_tool_param.py,sha256=hCclpGO4Re-TxiGy_QxX75g1kcN6_ElubicO6SdJ_YI,471
|
365 |
+
openai/types/beta/other_file_chunking_strategy_object.py,sha256=hJz1OeSkvvcWJVftPfvz2pB5ujdawWEEa3v38E6tt7g,311
|
366 |
+
openai/types/beta/static_file_chunking_strategy.py,sha256=nHaLv70q1rencY2u8mqS7mW7X7enzHrc-zM9mg22dHw,597
|
367 |
+
openai/types/beta/static_file_chunking_strategy_object.py,sha256=aOPxudte299F0j3bzniXcKJ7j-w4ZfQpgFHTa3CFyZ8,425
|
368 |
+
openai/types/beta/static_file_chunking_strategy_param.py,sha256=kCMmgyOxO0XIF2wjCWjUXtyn9S6q_7mNmyUCauqrjsg,692
|
369 |
+
openai/types/beta/thread.py,sha256=9wxx6M26S7cilx5SKWjZnkHc7g222AIOhikd0WTJfwI,2014
|
370 |
+
openai/types/beta/thread_create_and_run_params.py,sha256=NHkj-IMm2WEqH82i9zxqgJqYkOVCBVXSpZcpl-SVznY,13175
|
371 |
+
openai/types/beta/thread_create_params.py,sha256=U0gNXfSltPqYF3GIGQ7dloolkz6nzuDimXF-V9wjzvo,4970
|
372 |
+
openai/types/beta/thread_deleted.py,sha256=MaYG_jZIjSiB9h_ZBiTtpMsRSwFKkCY83ziM5GO_oUk,292
|
373 |
+
openai/types/beta/thread_update_params.py,sha256=olIjwn1eD0H2AkjdDZC38lPdT5dp2ORSjavPA7pB_08,1751
|
374 |
+
openai/types/beta/threads/__init__.py,sha256=0WsJo0tXp08CgayozR7Tqc3b8sqzotWzvBun19CEIWc,3066
|
375 |
+
openai/types/beta/threads/__pycache__/__init__.cpython-312.pyc,,
|
376 |
+
openai/types/beta/threads/__pycache__/annotation.cpython-312.pyc,,
|
377 |
+
openai/types/beta/threads/__pycache__/annotation_delta.cpython-312.pyc,,
|
378 |
+
openai/types/beta/threads/__pycache__/file_citation_annotation.cpython-312.pyc,,
|
379 |
+
openai/types/beta/threads/__pycache__/file_citation_delta_annotation.cpython-312.pyc,,
|
380 |
+
openai/types/beta/threads/__pycache__/file_path_annotation.cpython-312.pyc,,
|
381 |
+
openai/types/beta/threads/__pycache__/file_path_delta_annotation.cpython-312.pyc,,
|
382 |
+
openai/types/beta/threads/__pycache__/image_file.cpython-312.pyc,,
|
383 |
+
openai/types/beta/threads/__pycache__/image_file_content_block.cpython-312.pyc,,
|
384 |
+
openai/types/beta/threads/__pycache__/image_file_content_block_param.cpython-312.pyc,,
|
385 |
+
openai/types/beta/threads/__pycache__/image_file_delta.cpython-312.pyc,,
|
386 |
+
openai/types/beta/threads/__pycache__/image_file_delta_block.cpython-312.pyc,,
|
387 |
+
openai/types/beta/threads/__pycache__/image_file_param.cpython-312.pyc,,
|
388 |
+
openai/types/beta/threads/__pycache__/image_url.cpython-312.pyc,,
|
389 |
+
openai/types/beta/threads/__pycache__/image_url_content_block.cpython-312.pyc,,
|
390 |
+
openai/types/beta/threads/__pycache__/image_url_content_block_param.cpython-312.pyc,,
|
391 |
+
openai/types/beta/threads/__pycache__/image_url_delta.cpython-312.pyc,,
|
392 |
+
openai/types/beta/threads/__pycache__/image_url_delta_block.cpython-312.pyc,,
|
393 |
+
openai/types/beta/threads/__pycache__/image_url_param.cpython-312.pyc,,
|
394 |
+
openai/types/beta/threads/__pycache__/message.cpython-312.pyc,,
|
395 |
+
openai/types/beta/threads/__pycache__/message_content.cpython-312.pyc,,
|
396 |
+
openai/types/beta/threads/__pycache__/message_content_delta.cpython-312.pyc,,
|
397 |
+
openai/types/beta/threads/__pycache__/message_content_part_param.cpython-312.pyc,,
|
398 |
+
openai/types/beta/threads/__pycache__/message_create_params.cpython-312.pyc,,
|
399 |
+
openai/types/beta/threads/__pycache__/message_deleted.cpython-312.pyc,,
|
400 |
+
openai/types/beta/threads/__pycache__/message_delta.cpython-312.pyc,,
|
401 |
+
openai/types/beta/threads/__pycache__/message_delta_event.cpython-312.pyc,,
|
402 |
+
openai/types/beta/threads/__pycache__/message_list_params.cpython-312.pyc,,
|
403 |
+
openai/types/beta/threads/__pycache__/message_update_params.cpython-312.pyc,,
|
404 |
+
openai/types/beta/threads/__pycache__/refusal_content_block.cpython-312.pyc,,
|
405 |
+
openai/types/beta/threads/__pycache__/refusal_delta_block.cpython-312.pyc,,
|
406 |
+
openai/types/beta/threads/__pycache__/required_action_function_tool_call.cpython-312.pyc,,
|
407 |
+
openai/types/beta/threads/__pycache__/run.cpython-312.pyc,,
|
408 |
+
openai/types/beta/threads/__pycache__/run_create_params.cpython-312.pyc,,
|
409 |
+
openai/types/beta/threads/__pycache__/run_list_params.cpython-312.pyc,,
|
410 |
+
openai/types/beta/threads/__pycache__/run_status.cpython-312.pyc,,
|
411 |
+
openai/types/beta/threads/__pycache__/run_submit_tool_outputs_params.cpython-312.pyc,,
|
412 |
+
openai/types/beta/threads/__pycache__/run_update_params.cpython-312.pyc,,
|
413 |
+
openai/types/beta/threads/__pycache__/text.cpython-312.pyc,,
|
414 |
+
openai/types/beta/threads/__pycache__/text_content_block.cpython-312.pyc,,
|
415 |
+
openai/types/beta/threads/__pycache__/text_content_block_param.cpython-312.pyc,,
|
416 |
+
openai/types/beta/threads/__pycache__/text_delta.cpython-312.pyc,,
|
417 |
+
openai/types/beta/threads/__pycache__/text_delta_block.cpython-312.pyc,,
|
418 |
+
openai/types/beta/threads/annotation.py,sha256=Ce3Y0mSodmYRkoqyhtyIdep6WfWew6KJJgtrENOnfek,462
|
419 |
+
openai/types/beta/threads/annotation_delta.py,sha256=iNsE-1Gn1yU0TlTHoxqKbOvPRUxWuXsF72qY_mMnWGY,510
|
420 |
+
openai/types/beta/threads/file_citation_annotation.py,sha256=0Rs1Sr-eCLQpLsu8-WwHG7kv5Ihud4kiHO1NL7xHO0s,595
|
421 |
+
openai/types/beta/threads/file_citation_delta_annotation.py,sha256=R87tcXkJ0RiH5UJo0Qknwk7X_c4qF1qvGsu2spOPx-I,873
|
422 |
+
openai/types/beta/threads/file_path_annotation.py,sha256=hNc4ebprJynqMG1yk0gLvgzTpjtVzgEbXriMZftkgew,552
|
423 |
+
openai/types/beta/threads/file_path_delta_annotation.py,sha256=RW9dgDF9Ggf357fPZ-vUu2ge3U-Hf11DVTr-ecklsBY,755
|
424 |
+
openai/types/beta/threads/image_file.py,sha256=QVXLiplb-CigZqdMZtXlmebXKt6tF74kI-3vHxe_qUE,707
|
425 |
+
openai/types/beta/threads/image_file_content_block.py,sha256=31I5trSERP2qLZpJ4ugZtIyta4DDoBhBvxkM4LovL3w,363
|
426 |
+
openai/types/beta/threads/image_file_content_block_param.py,sha256=3ryZ6AV-DLwWYVP2XSK11UHkvutTUollxn6z8BZ4rSA,445
|
427 |
+
openai/types/beta/threads/image_file_delta.py,sha256=nUJoSuP-3YyqqwBsmPJ0AqiQydz2FymVDCXQVkNYwOk,734
|
428 |
+
openai/types/beta/threads/image_file_delta_block.py,sha256=XJ2YVX_cq0OiNcGbNmXO0_dca1IvPockOvvoM7pDvbI,492
|
429 |
+
openai/types/beta/threads/image_file_param.py,sha256=BaKD31JPxQ5CjRfZ_0RcOG3lDTZeW_k85XCvwyctD54,717
|
430 |
+
openai/types/beta/threads/image_url.py,sha256=EzEK-CYoO0YyqFmejIPu7pMfTEgMmp5NFscsRd2pCos,592
|
431 |
+
openai/types/beta/threads/image_url_content_block.py,sha256=_sg3BWrtVGw-8XtAh15Rs4co6NCBB9Y3zCp_XOAz4U8,365
|
432 |
+
openai/types/beta/threads/image_url_content_block_param.py,sha256=RWzo5KkBiwvgJSviZl6JUlsfv3VQKIFr6cp9lhkLu8E,447
|
433 |
+
openai/types/beta/threads/image_url_delta.py,sha256=MXCp-OmuNT4njbWA9DWAbocP7pD3VpdcUy2wgeOjwm4,582
|
434 |
+
openai/types/beta/threads/image_url_delta_block.py,sha256=Jjdfub4g9ceNKF8GuuTIghOmYba2vEeX3320mg5PWIA,484
|
435 |
+
openai/types/beta/threads/image_url_param.py,sha256=VRLaxZf-wxnvAOcKGwyF_o6KEvwktBfE3B6KmYE5LZo,602
|
436 |
+
openai/types/beta/threads/message.py,sha256=aGWe0kiNv5sXUYheJ0o1KpTds4oTaeDmqot1PMStJCE,3295
|
437 |
+
openai/types/beta/threads/message_content.py,sha256=b8IC_EG28hcXk28z09EABfJwPkYZ7U-lTp_9ykdoxvU,630
|
438 |
+
openai/types/beta/threads/message_content_delta.py,sha256=o4Edlx9BtdH2Z4OMwGWWXex8wiijknNRihJ-wu8PDUQ,615
|
439 |
+
openai/types/beta/threads/message_content_part_param.py,sha256=RXrnoDP2-UMQHoR2jJvaT3JHrCeffLi6WzXzH05cDGI,550
|
440 |
+
openai/types/beta/threads/message_create_params.py,sha256=WYfc_-kc7lxcxdpwKCVT2Ei-5Jl_132uqOHMtXL92OE,1957
|
441 |
+
openai/types/beta/threads/message_deleted.py,sha256=DNnrSfGZ3kWEazmo4mVTdLhiKlIHxs-D8Ef5sNdHY1o,303
|
442 |
+
openai/types/beta/threads/message_delta.py,sha256=-kaRyvnIA8Yr2QV5jKRn15BU2Ni068a_WtWJ4PqlLfE,570
|
443 |
+
openai/types/beta/threads/message_delta_event.py,sha256=7SpE4Dd3Lrc_cm97SzBwZzGGhfLqiFViDeTRQz-5YmQ,579
|
444 |
+
openai/types/beta/threads/message_list_params.py,sha256=iuwzDccnViooUxHlq-WoE1FEJArNy5-zrYCoaNgVS8k,1296
|
445 |
+
openai/types/beta/threads/message_update_params.py,sha256=jTM_WDKDuPVJKlNKlT6J_UqQjgM2vrrD03ZhvHI5bSY,630
|
446 |
+
openai/types/beta/threads/refusal_content_block.py,sha256=qB9jrS2Wv9UQ7XXaIVKe62dTAU1WOnN3qenR_E43mhg,310
|
447 |
+
openai/types/beta/threads/refusal_delta_block.py,sha256=ZhgFC8KqA9LIwo_CQIX-w3VVg3Vj0h71xC1Hh1bwmnU,423
|
448 |
+
openai/types/beta/threads/required_action_function_tool_call.py,sha256=XsR4OBbxI-RWteLvhcLEDBan6eUUGvhLORFRKjPbsLg,888
|
449 |
+
openai/types/beta/threads/run.py,sha256=GR469hvbAlWTHL17MieCYxQfASyxaY1ZOe6Qbf0ORMI,8218
|
450 |
+
openai/types/beta/threads/run_create_params.py,sha256=KgltVibs_KnKsL3UaZyVJgb-6aUxct7CXUtqMdkTXTM,9670
|
451 |
+
openai/types/beta/threads/run_list_params.py,sha256=TgepSLrupUUtuQV2kbVcoGH1YA0FVUX9ESkszKuwyHY,1210
|
452 |
+
openai/types/beta/threads/run_status.py,sha256=OU1hzoyYXaRJ3lupX4YcZ-HZkTpctNE4tzAcp6X8Q9U,351
|
453 |
+
openai/types/beta/threads/run_submit_tool_outputs_params.py,sha256=cKiyD374BsZN_Oih5o5n5gOf_DYsxErVrbgxveNhmPI,1643
|
454 |
+
openai/types/beta/threads/run_update_params.py,sha256=EDYJO3YuH1IKjfR1xAaBtWFonNnyXJDYAnlaMnwyXo8,622
|
455 |
+
openai/types/beta/threads/runs/__init__.py,sha256=mg_roY9yL1bClJ8isizkQgHOAkN17iSdVr2m65iyBrs,1653
|
456 |
+
openai/types/beta/threads/runs/__pycache__/__init__.cpython-312.pyc,,
|
457 |
+
openai/types/beta/threads/runs/__pycache__/code_interpreter_logs.cpython-312.pyc,,
|
458 |
+
openai/types/beta/threads/runs/__pycache__/code_interpreter_output_image.cpython-312.pyc,,
|
459 |
+
openai/types/beta/threads/runs/__pycache__/code_interpreter_tool_call.cpython-312.pyc,,
|
460 |
+
openai/types/beta/threads/runs/__pycache__/code_interpreter_tool_call_delta.cpython-312.pyc,,
|
461 |
+
openai/types/beta/threads/runs/__pycache__/file_search_tool_call.cpython-312.pyc,,
|
462 |
+
openai/types/beta/threads/runs/__pycache__/file_search_tool_call_delta.cpython-312.pyc,,
|
463 |
+
openai/types/beta/threads/runs/__pycache__/function_tool_call.cpython-312.pyc,,
|
464 |
+
openai/types/beta/threads/runs/__pycache__/function_tool_call_delta.cpython-312.pyc,,
|
465 |
+
openai/types/beta/threads/runs/__pycache__/message_creation_step_details.cpython-312.pyc,,
|
466 |
+
openai/types/beta/threads/runs/__pycache__/run_step.cpython-312.pyc,,
|
467 |
+
openai/types/beta/threads/runs/__pycache__/run_step_delta.cpython-312.pyc,,
|
468 |
+
openai/types/beta/threads/runs/__pycache__/run_step_delta_event.cpython-312.pyc,,
|
469 |
+
openai/types/beta/threads/runs/__pycache__/run_step_delta_message_delta.cpython-312.pyc,,
|
470 |
+
openai/types/beta/threads/runs/__pycache__/run_step_include.cpython-312.pyc,,
|
471 |
+
openai/types/beta/threads/runs/__pycache__/step_list_params.cpython-312.pyc,,
|
472 |
+
openai/types/beta/threads/runs/__pycache__/step_retrieve_params.cpython-312.pyc,,
|
473 |
+
openai/types/beta/threads/runs/__pycache__/tool_call.cpython-312.pyc,,
|
474 |
+
openai/types/beta/threads/runs/__pycache__/tool_call_delta.cpython-312.pyc,,
|
475 |
+
openai/types/beta/threads/runs/__pycache__/tool_call_delta_object.cpython-312.pyc,,
|
476 |
+
openai/types/beta/threads/runs/__pycache__/tool_calls_step_details.cpython-312.pyc,,
|
477 |
+
openai/types/beta/threads/runs/code_interpreter_logs.py,sha256=7wXZpUE9I-oZJ0K3mFG0Nwmfm2bKGiSpWJyBeo7txwo,482
|
478 |
+
openai/types/beta/threads/runs/code_interpreter_output_image.py,sha256=8o99k0ZHMHpqH0taXkOkYR9WaDUpCN-G0Ifd5XsJpb8,613
|
479 |
+
openai/types/beta/threads/runs/code_interpreter_tool_call.py,sha256=ekiIuH1kVCN51hCzY3AYr5i3_a4vlgUiZHJ59pl17oY,1810
|
480 |
+
openai/types/beta/threads/runs/code_interpreter_tool_call_delta.py,sha256=Qr2cen-bKyXTW2NDEUHnmJRE0jY-nkLcnO4NzCbBPDo,1479
|
481 |
+
openai/types/beta/threads/runs/file_search_tool_call.py,sha256=XBgsM_USVr3ZrwTZx4L1-YG94Qv8c8GXI19ZHtDrZq8,1897
|
482 |
+
openai/types/beta/threads/runs/file_search_tool_call_delta.py,sha256=Gx8c7GSgGYuOvGadcAr3ZIspEFMZS3e2OY7vBo_MYnM,655
|
483 |
+
openai/types/beta/threads/runs/function_tool_call.py,sha256=aOq5yOtKOi6C5Q1FIQRxqtJJR1AcSW_K5PvRiKISNCI,920
|
484 |
+
openai/types/beta/threads/runs/function_tool_call_delta.py,sha256=VFRtCJkj4PHX97upM1cXpJAk9-JvJSgyngie06fBIjQ,1076
|
485 |
+
openai/types/beta/threads/runs/message_creation_step_details.py,sha256=tRFMNF2Rf4DekVliUKkoujItiOjjAE9EG9bbxJvpVPA,506
|
486 |
+
openai/types/beta/threads/runs/run_step.py,sha256=L_CiwlW9y7NEOTumv1RyoQrQ_oCaNowRmraUHiAgJEc,3469
|
487 |
+
openai/types/beta/threads/runs/run_step_delta.py,sha256=FNYDTddRrTO3PT_fgi7AsJ1PeMtyWsVzcxoihjbBzAw,663
|
488 |
+
openai/types/beta/threads/runs/run_step_delta_event.py,sha256=rkDyvHSXt-hc1LngB41f9vglkn6t03kS62bsn0iGaxU,585
|
489 |
+
openai/types/beta/threads/runs/run_step_delta_message_delta.py,sha256=UIo6oPH8STLjPHiWL-A4CtKfYe49uptvIAHWNnZ3Ums,564
|
490 |
+
openai/types/beta/threads/runs/run_step_include.py,sha256=u-9Cw1hruRiWr70f_hw4XG0w1cwOAYfRJYKva2dEacs,264
|
491 |
+
openai/types/beta/threads/runs/step_list_params.py,sha256=zorF5juogCzLMsZLjzMZTs_iIBcPj9WUur5HcrXuH8M,1752
|
492 |
+
openai/types/beta/threads/runs/step_retrieve_params.py,sha256=aJ7l8RDJLPyEmqjfO4XsTV54VZOOqyb_gKSUvqp33ZI,815
|
493 |
+
openai/types/beta/threads/runs/tool_call.py,sha256=1rwq4IbLgjQAQ-ORXYkNpmJyi9SREDnqA57nJbj_NiU,537
|
494 |
+
openai/types/beta/threads/runs/tool_call_delta.py,sha256=t5wF8ndW3z99lHF981FL-IN5xXBS9p7eonH9bxvKu_c,600
|
495 |
+
openai/types/beta/threads/runs/tool_call_delta_object.py,sha256=eK20VsIswEyT48XbkGu60HUrE7OD3fhpn1fbXrVauM4,615
|
496 |
+
openai/types/beta/threads/runs/tool_calls_step_details.py,sha256=bDa-yybVF3a8H6VqhDGmFZMkpn-0gtPQM2jWWsmUvYo,574
|
497 |
+
openai/types/beta/threads/text.py,sha256=9gjmDCqoptnxQ8Jhym87pECyd6m1lB3daCxKNzSFp4Y,319
|
498 |
+
openai/types/beta/threads/text_content_block.py,sha256=pdGlKYM1IF9PjTvxjxo1oDg1XeGCFdJdl0kJVpZ7jIs,319
|
499 |
+
openai/types/beta/threads/text_content_block_param.py,sha256=feQr0muF845tc1q3FJrzgYOhXeuKLU3x1x5DGFTN2Q0,407
|
500 |
+
openai/types/beta/threads/text_delta.py,sha256=2EFeQCkg_cc8nYEJ6BtYAA3_TqgMTbmEXoMvLjzaB34,389
|
501 |
+
openai/types/beta/threads/text_delta_block.py,sha256=pkHkVBgNsmHi9JURzs5ayPqxQXSkex3F0jH0MqJXik0,448
|
502 |
+
openai/types/beta/vector_store.py,sha256=R8M70uuGWVKt4t0ef__Py-MPw33Ljx4sh5ddihJMbIU,2354
|
503 |
+
openai/types/beta/vector_store_create_params.py,sha256=rvvYUSDBbc5L6PAiMGSFQD85ugyR9mLdvZMxjap0fnk,1600
|
504 |
+
openai/types/beta/vector_store_deleted.py,sha256=Yq0E1orRLShseLwZ1deiBdDEUgEw_tcYVxGYa5gbIrM,308
|
505 |
+
openai/types/beta/vector_store_list_params.py,sha256=KeSeQaEdqO2EiPEVtq1Nun-uRRdkfwW0P8aHeCmL5zA,1226
|
506 |
+
openai/types/beta/vector_store_update_params.py,sha256=6OEP1IvilrGoPhHQPXOMQA0TwmCubeo7rB_ik5GQSrY,1115
|
507 |
+
openai/types/beta/vector_stores/__init__.py,sha256=gXfm8V5Ad0iueaC_VoHDUQvSdwSfBzk2cQNwZldvY0s,671
|
508 |
+
openai/types/beta/vector_stores/__pycache__/__init__.cpython-312.pyc,,
|
509 |
+
openai/types/beta/vector_stores/__pycache__/file_batch_create_params.cpython-312.pyc,,
|
510 |
+
openai/types/beta/vector_stores/__pycache__/file_batch_list_files_params.cpython-312.pyc,,
|
511 |
+
openai/types/beta/vector_stores/__pycache__/file_create_params.cpython-312.pyc,,
|
512 |
+
openai/types/beta/vector_stores/__pycache__/file_list_params.cpython-312.pyc,,
|
513 |
+
openai/types/beta/vector_stores/__pycache__/vector_store_file.cpython-312.pyc,,
|
514 |
+
openai/types/beta/vector_stores/__pycache__/vector_store_file_batch.cpython-312.pyc,,
|
515 |
+
openai/types/beta/vector_stores/__pycache__/vector_store_file_deleted.cpython-312.pyc,,
|
516 |
+
openai/types/beta/vector_stores/file_batch_create_params.py,sha256=lV4t5kikvEhl431RZgGDyQdFKTl-zXI-Q7YnbM0Qmv8,798
|
517 |
+
openai/types/beta/vector_stores/file_batch_list_files_params.py,sha256=FPpQvCQI2skyLB8YCuwdCj7RbO9ba1UjaHAtvrWxAbs,1451
|
518 |
+
openai/types/beta/vector_stores/file_create_params.py,sha256=kwSqe-le2UaYrcXGPxlP41QhH2OGvLXBbntAGlmK288,748
|
519 |
+
openai/types/beta/vector_stores/file_list_params.py,sha256=AIzmNH1oFuy-qlpRhj9eXu9yyTA-2z_IppLYFclMtZw,1385
|
520 |
+
openai/types/beta/vector_stores/vector_store_file.py,sha256=X8aQg4jYlK7iQumxn7B-eammIKVjUbu4lapPeq9jDWo,1788
|
521 |
+
openai/types/beta/vector_stores/vector_store_file_batch.py,sha256=ubvj8z95EOdRGAp0rgI94g5uFQx0ob8hLgwOWHKda4E,1457
|
522 |
+
openai/types/beta/vector_stores/vector_store_file_deleted.py,sha256=37J7oL2WYCgOd7Rhg2jX6IavaZT63vgUf3u6LC6C3Hs,322
|
523 |
+
openai/types/chat/__init__.py,sha256=X9MsMceoVWoqNyoTB4pyTi9Kv97Kv2FX04fr9PupZ2s,3603
|
524 |
+
openai/types/chat/__pycache__/__init__.cpython-312.pyc,,
|
525 |
+
openai/types/chat/__pycache__/chat_completion.cpython-312.pyc,,
|
526 |
+
openai/types/chat/__pycache__/chat_completion_assistant_message_param.cpython-312.pyc,,
|
527 |
+
openai/types/chat/__pycache__/chat_completion_audio.cpython-312.pyc,,
|
528 |
+
openai/types/chat/__pycache__/chat_completion_audio_param.cpython-312.pyc,,
|
529 |
+
openai/types/chat/__pycache__/chat_completion_chunk.cpython-312.pyc,,
|
530 |
+
openai/types/chat/__pycache__/chat_completion_content_part_image_param.cpython-312.pyc,,
|
531 |
+
openai/types/chat/__pycache__/chat_completion_content_part_input_audio_param.cpython-312.pyc,,
|
532 |
+
openai/types/chat/__pycache__/chat_completion_content_part_param.cpython-312.pyc,,
|
533 |
+
openai/types/chat/__pycache__/chat_completion_content_part_refusal_param.cpython-312.pyc,,
|
534 |
+
openai/types/chat/__pycache__/chat_completion_content_part_text_param.cpython-312.pyc,,
|
535 |
+
openai/types/chat/__pycache__/chat_completion_function_call_option_param.cpython-312.pyc,,
|
536 |
+
openai/types/chat/__pycache__/chat_completion_function_message_param.cpython-312.pyc,,
|
537 |
+
openai/types/chat/__pycache__/chat_completion_message.cpython-312.pyc,,
|
538 |
+
openai/types/chat/__pycache__/chat_completion_message_param.cpython-312.pyc,,
|
539 |
+
openai/types/chat/__pycache__/chat_completion_message_tool_call.cpython-312.pyc,,
|
540 |
+
openai/types/chat/__pycache__/chat_completion_message_tool_call_param.cpython-312.pyc,,
|
541 |
+
openai/types/chat/__pycache__/chat_completion_modality.cpython-312.pyc,,
|
542 |
+
openai/types/chat/__pycache__/chat_completion_named_tool_choice_param.cpython-312.pyc,,
|
543 |
+
openai/types/chat/__pycache__/chat_completion_prediction_content_param.cpython-312.pyc,,
|
544 |
+
openai/types/chat/__pycache__/chat_completion_role.cpython-312.pyc,,
|
545 |
+
openai/types/chat/__pycache__/chat_completion_stream_options_param.cpython-312.pyc,,
|
546 |
+
openai/types/chat/__pycache__/chat_completion_system_message_param.cpython-312.pyc,,
|
547 |
+
openai/types/chat/__pycache__/chat_completion_token_logprob.cpython-312.pyc,,
|
548 |
+
openai/types/chat/__pycache__/chat_completion_tool_choice_option_param.cpython-312.pyc,,
|
549 |
+
openai/types/chat/__pycache__/chat_completion_tool_message_param.cpython-312.pyc,,
|
550 |
+
openai/types/chat/__pycache__/chat_completion_tool_param.cpython-312.pyc,,
|
551 |
+
openai/types/chat/__pycache__/chat_completion_user_message_param.cpython-312.pyc,,
|
552 |
+
openai/types/chat/__pycache__/completion_create_params.cpython-312.pyc,,
|
553 |
+
openai/types/chat/__pycache__/parsed_chat_completion.cpython-312.pyc,,
|
554 |
+
openai/types/chat/__pycache__/parsed_function_tool_call.cpython-312.pyc,,
|
555 |
+
openai/types/chat/chat_completion.py,sha256=MaTVOMwtbzqGyHgyP4DP41ESEDKhv_XOM8L_fx3uoQE,2689
|
556 |
+
openai/types/chat/chat_completion_assistant_message_param.py,sha256=E6ZrsjEN_JHOHO-wC7Uk90Fa7Qz7bfgx8jea0z6g30s,2421
|
557 |
+
openai/types/chat/chat_completion_audio.py,sha256=vzWeaAAAbomkvbFksXQu6qpw1RVJiuFytJZswO6h6vI,656
|
558 |
+
openai/types/chat/chat_completion_audio_param.py,sha256=5lnLQqSzazaAL3v1udxK5rLPDXLo9TG5pJTeAQ8JbZs,719
|
559 |
+
openai/types/chat/chat_completion_chunk.py,sha256=aQXFY4gq9YEIrr7YBM68D5XyWGT9kKo0JO8n-55IjEA,5032
|
560 |
+
openai/types/chat/chat_completion_content_part_image_param.py,sha256=Gqv98qyD8jB81THZp49c8v2tHrId_iQp4NzciT9SKI0,797
|
561 |
+
openai/types/chat/chat_completion_content_part_input_audio_param.py,sha256=r1EXNEtjJo5oJ9AnP3omaJzACE1gSfdmob5Q0HKsOm4,704
|
562 |
+
openai/types/chat/chat_completion_content_part_param.py,sha256=7lCk-fZB5iT5keHLWw9eM-Hd5jsnPh2IIHICIUpoEXk,686
|
563 |
+
openai/types/chat/chat_completion_content_part_refusal_param.py,sha256=TV1vu-IgrvKa5IBlPSIdBxUaW8g1zDhMOOBOEmhU2w0,467
|
564 |
+
openai/types/chat/chat_completion_content_part_text_param.py,sha256=4IpiXMKM9AuTyop5PRptPBbBhh9s93xy2vjg4Yw6NIw,429
|
565 |
+
openai/types/chat/chat_completion_function_call_option_param.py,sha256=M-IqWHyBLkvYBcwFxxp4ydCIxbPDaMlNl4bik9UoFd4,365
|
566 |
+
openai/types/chat/chat_completion_function_message_param.py,sha256=jIaZbBHHbt4v4xHCIyvYtYLst_X4jOznRjYNcTf0MF0,591
|
567 |
+
openai/types/chat/chat_completion_message.py,sha256=AH7JpjgKfphxBRJyI4PhwHCMREy_-D-a4_4u4NHjSfc,1674
|
568 |
+
openai/types/chat/chat_completion_message_param.py,sha256=RFer4ZYXxVed9F0ulkqi0xNy_eOhp63Y-0oN24dhVBI,889
|
569 |
+
openai/types/chat/chat_completion_message_tool_call.py,sha256=XlIe2vhSYvrt8o8Yol5AQqnacI1xHqpEIV26G4oNrZY,900
|
570 |
+
openai/types/chat/chat_completion_message_tool_call_param.py,sha256=XNhuUpGr5qwVTo0K8YavJwleHYSdwN_urK51eKlqC24,1009
|
571 |
+
openai/types/chat/chat_completion_modality.py,sha256=8Ga0kruwJc43WD2OIqNudn7KrVRTPDQaalVkh_8bp9I,236
|
572 |
+
openai/types/chat/chat_completion_named_tool_choice_param.py,sha256=JsxfSJYpOmF7zIreQ0JrXRSLp07OGCBSycRRcF6OZmg,569
|
573 |
+
openai/types/chat/chat_completion_prediction_content_param.py,sha256=Xw4K_4F379LsXENOpZvREDn55cCnbmZ69xa4fw9w3bg,868
|
574 |
+
openai/types/chat/chat_completion_role.py,sha256=Rdzg4deI1uZmqgkwnMrLHvbV2fPRqKcHLQrVmKVk9Dw,262
|
575 |
+
openai/types/chat/chat_completion_stream_options_param.py,sha256=7-R2mYh7dbtX9qDOL3UkeyVH6FNWC_4aTCLtHYObMbs,628
|
576 |
+
openai/types/chat/chat_completion_system_message_param.py,sha256=WYtzmsNP8ZI3Ie8cd-oU7RuNoaBF6-bBR3mOzST9hMw,815
|
577 |
+
openai/types/chat/chat_completion_token_logprob.py,sha256=6-ipUFfsXMf5L7FDFi127NaVkDtmEooVgGBF6Ts965A,1769
|
578 |
+
openai/types/chat/chat_completion_tool_choice_option_param.py,sha256=ef71WSM9HMQhIQUocRgVJUVW-bSRwK2_1NjFSB5TPiI,472
|
579 |
+
openai/types/chat/chat_completion_tool_message_param.py,sha256=5K7jfKpwTuKNi1PTFabq_LHH-7wun8CUsLDh90U8zQE,730
|
580 |
+
openai/types/chat/chat_completion_tool_param.py,sha256=J9r2TAWygkIBDInWEKx29gBE0wiCgc7HpXFyQhxSkAU,503
|
581 |
+
openai/types/chat/chat_completion_user_message_param.py,sha256=mik-MRkwb543C5FSJ52LtTkeA2E_HdLUgtoHEdO73XQ,792
|
582 |
+
openai/types/chat/completion_create_params.py,sha256=OIJT79o3_UZ4th127eZk5x2X0GmocEbf55MWTy_XD90,14015
|
583 |
+
openai/types/chat/parsed_chat_completion.py,sha256=KwcwCtj0yexl6gB7yuOnyETRW-uUvNRYbVzPMkwCe5Q,1437
|
584 |
+
openai/types/chat/parsed_function_tool_call.py,sha256=hJzcKOpzf1tnXC6RGbPhaeCawq8EFdnLK_MfRITkW1U,920
|
585 |
+
openai/types/chat_model.py,sha256=lTG3ugwVJrzUz9BItRlPuIeEKhnnH1Cxv2pTN62JgSo,1008
|
586 |
+
openai/types/completion.py,sha256=yuYVEVkJcMVUINNLglkxOJqCx097HKCYFeJun3Js73A,1172
|
587 |
+
openai/types/completion_choice.py,sha256=PUk77T3Cp34UJSXoMfSzTKGWDK0rQQwq84X_PSlOUJo,965
|
588 |
+
openai/types/completion_create_params.py,sha256=TWNRWlGAcvirzY3Piy6AeYKyNxG7ktmtwjS27Q4bTi8,7535
|
589 |
+
openai/types/completion_usage.py,sha256=uf5n0vzlCkGAU67BBn_h7yhjd_G4OHpQbJnvzz0eO2A,1735
|
590 |
+
openai/types/create_embedding_response.py,sha256=lTAu_Pym76kFljDnnDRoDB2GNQSzWmwwlqf5ff7FNPM,798
|
591 |
+
openai/types/embedding.py,sha256=2pV6RTSf5UV6E86Xeud5ZwmjQjMS93m_4LrQ0GN3fho,637
|
592 |
+
openai/types/embedding_create_params.py,sha256=C9Tm1C_m96QtjyNc8fiy6wzs9HkM2GUF8CSTSS6V7ks,1850
|
593 |
+
openai/types/embedding_model.py,sha256=0dDL87len4vZ4DR6eCp7JZJCJpgwWphRmJhMK3Se8f4,281
|
594 |
+
openai/types/file_content.py,sha256=qLlM4J8kgu1BfrtlmYftPsQVCJu4VqYeiS1T28u8EQ8,184
|
595 |
+
openai/types/file_create_params.py,sha256=N1I3rER1se27usx46fhkvdtn-blJ6Y9ECT7Wwzve37Q,913
|
596 |
+
openai/types/file_deleted.py,sha256=H_r9U7XthT5xHAo_4ay1EGGkc21eURt8MkkIBRYiQcw,277
|
597 |
+
openai/types/file_list_params.py,sha256=TmmqvM7droAJ49YlgpeFzrhPv5uVkSZDxqlG6hhumPo,960
|
598 |
+
openai/types/file_object.py,sha256=ESuRYCTLbDtHxyuhzybKTF_TztIcq_F7TzCTQ6JToE0,1309
|
599 |
+
openai/types/file_purpose.py,sha256=o1TzR-41XsNsQ0791GTGPe3DLkU9FEODucKdP6Q6sPc,243
|
600 |
+
openai/types/fine_tuning/__init__.py,sha256=SZvjq_22oY9E4zcnrvVd0ul9U4sk_IBeOd0MsNALu5s,806
|
601 |
+
openai/types/fine_tuning/__pycache__/__init__.cpython-312.pyc,,
|
602 |
+
openai/types/fine_tuning/__pycache__/fine_tuning_job.cpython-312.pyc,,
|
603 |
+
openai/types/fine_tuning/__pycache__/fine_tuning_job_event.cpython-312.pyc,,
|
604 |
+
openai/types/fine_tuning/__pycache__/fine_tuning_job_integration.cpython-312.pyc,,
|
605 |
+
openai/types/fine_tuning/__pycache__/fine_tuning_job_wandb_integration.cpython-312.pyc,,
|
606 |
+
openai/types/fine_tuning/__pycache__/fine_tuning_job_wandb_integration_object.cpython-312.pyc,,
|
607 |
+
openai/types/fine_tuning/__pycache__/job_create_params.cpython-312.pyc,,
|
608 |
+
openai/types/fine_tuning/__pycache__/job_list_events_params.cpython-312.pyc,,
|
609 |
+
openai/types/fine_tuning/__pycache__/job_list_params.cpython-312.pyc,,
|
610 |
+
openai/types/fine_tuning/fine_tuning_job.py,sha256=YOcsIJZPPAqOnQudOkS_Am-peQuHyyvcMWVDxFvJdEA,3861
|
611 |
+
openai/types/fine_tuning/fine_tuning_job_event.py,sha256=oCkO0yImLZnZQLeU4GH6YyUlDG25pzs41SCWWB-sd_o,374
|
612 |
+
openai/types/fine_tuning/fine_tuning_job_integration.py,sha256=c3Uy7RMVJ32Xlat-6s9eG-5vZLl4w66COXc0B3pWk4g,242
|
613 |
+
openai/types/fine_tuning/fine_tuning_job_wandb_integration.py,sha256=YnBeiz14UuhUSpnD0KBj5V143qLvJbDIMcUVWOCBLXY,1026
|
614 |
+
openai/types/fine_tuning/fine_tuning_job_wandb_integration_object.py,sha256=7vEc2uEV2c_DENBjhq0Qy5X8B-rzxsKvGECjnvF1Wdw,804
|
615 |
+
openai/types/fine_tuning/job_create_params.py,sha256=wC2amCPMILFqsgKXCvIl7Yq2ngJ5YFaQUfj_EgjVPaI,4693
|
616 |
+
openai/types/fine_tuning/job_list_events_params.py,sha256=4xOED4H2ky2mI9sIDytjmfJz5bNAdNWb70WIb_0bBWs,400
|
617 |
+
openai/types/fine_tuning/job_list_params.py,sha256=yjxaEnESVTRpJ9ItvjKq30KcD_xz_trqKMIxG2eAriE,396
|
618 |
+
openai/types/fine_tuning/jobs/__init__.py,sha256=nuWhOUsmsoVKTKMU35kknmr8sfpTF-kkIzyuOlRbJj0,295
|
619 |
+
openai/types/fine_tuning/jobs/__pycache__/__init__.cpython-312.pyc,,
|
620 |
+
openai/types/fine_tuning/jobs/__pycache__/checkpoint_list_params.cpython-312.pyc,,
|
621 |
+
openai/types/fine_tuning/jobs/__pycache__/fine_tuning_job_checkpoint.cpython-312.pyc,,
|
622 |
+
openai/types/fine_tuning/jobs/checkpoint_list_params.py,sha256=XoDLkkKCWmf5an5rnoVEpNK8mtQHq1fHw9EqmezfrXM,415
|
623 |
+
openai/types/fine_tuning/jobs/fine_tuning_job_checkpoint.py,sha256=Z_sUhebJY9nWSssZU7QoOJwe5sez76sCAuVeSO63XhY,1347
|
624 |
+
openai/types/image.py,sha256=9No-8GHesOUbjchemY1jqtMwh_s22oBmLVFlLn2KoQo,607
|
625 |
+
openai/types/image_create_variation_params.py,sha256=PvvPvHXvz0etrRrzVIyvRjvDvNbjGspPu85hOq2fLII,1477
|
626 |
+
openai/types/image_edit_params.py,sha256=cxpBybs5peY0DJMTWHgoIx3dWIXj0Y0YmvgxrjGmWjo,1837
|
627 |
+
openai/types/image_generate_params.py,sha256=bD2AEIetbt37YDp65vEFfGxkLndOFCwhzJol1I63wfA,2132
|
628 |
+
openai/types/image_model.py,sha256=W4YchkhJT2wZdlNDUpVkEKg8zdDDfp9S3oTf4D8Wr8g,219
|
629 |
+
openai/types/images_response.py,sha256=EJ4qxYZ8CPGh2SZdRsyw6I0FnUvlgwxwc4NgPovJrvk,274
|
630 |
+
openai/types/model.py,sha256=DMw8KwQx8B6S6sAI038D0xdzkmYdY5-r0oMhCUG4l6w,532
|
631 |
+
openai/types/model_deleted.py,sha256=tXZybg03DunoOSYvwhT7zKj7KTN42R0VEs_-3PRliMo,229
|
632 |
+
openai/types/moderation.py,sha256=6CZmxhZiafnT50gKa7BeybrTSoYfCAk7wvD5CQHvBP0,6789
|
633 |
+
openai/types/moderation_create_params.py,sha256=EaZ2cej25g5WbRB2kIY7JFCXQPKSQQ95iyoUAAelGr4,992
|
634 |
+
openai/types/moderation_create_response.py,sha256=e6SVfWX2_JX25Za0C6KojcnbMTtDB2A7cjUm6cFMKcs,484
|
635 |
+
openai/types/moderation_image_url_input_param.py,sha256=t1r9WD3c-CK2Al1lpB4-DjfzLFSwgETR0g8nsRdoL0Y,622
|
636 |
+
openai/types/moderation_model.py,sha256=BFeqSyel2My2WKC6MCa_mAIHJx4uXU3-p8UNudJANeM,319
|
637 |
+
openai/types/moderation_multi_modal_input_param.py,sha256=RFdiEPsakWIscutX896ir5_rnEA2TLX5xQkjO5QR2vs,483
|
638 |
+
openai/types/moderation_text_input_param.py,sha256=ardCbBcdaULf8bkFuzkSKukV9enrINSjNWvb7m0LjZg,406
|
639 |
+
openai/types/shared/__init__.py,sha256=34RJ2IUXj0f3B73a6rqeHILu8AH5-sC8npTbEx_bnk8,551
|
640 |
+
openai/types/shared/__pycache__/__init__.cpython-312.pyc,,
|
641 |
+
openai/types/shared/__pycache__/error_object.cpython-312.pyc,,
|
642 |
+
openai/types/shared/__pycache__/function_definition.cpython-312.pyc,,
|
643 |
+
openai/types/shared/__pycache__/function_parameters.cpython-312.pyc,,
|
644 |
+
openai/types/shared/__pycache__/response_format_json_object.cpython-312.pyc,,
|
645 |
+
openai/types/shared/__pycache__/response_format_json_schema.cpython-312.pyc,,
|
646 |
+
openai/types/shared/__pycache__/response_format_text.cpython-312.pyc,,
|
647 |
+
openai/types/shared/error_object.py,sha256=G7SGPZ9Qw3gewTKbi3fK69eM6L2Ur0C2D57N8iEapJA,305
|
648 |
+
openai/types/shared/function_definition.py,sha256=8a5uHoIKrkrwTgfwTyE9ly4PgsZ3iLA_yRUAjubTb7Y,1447
|
649 |
+
openai/types/shared/function_parameters.py,sha256=Dkc_pm98zCKyouQmYrl934cK8ZWX7heY_IIyunW8x7c,236
|
650 |
+
openai/types/shared/response_format_json_object.py,sha256=15KTCXJ0o1W4c5V1vAcOQAx-u0eoIfAjxrHLoN3NuE4,344
|
651 |
+
openai/types/shared/response_format_json_schema.py,sha256=rZS7diOPeqK48O_R6OYMJ6AtSGy_88PKTxzha6_56Fo,1399
|
652 |
+
openai/types/shared/response_format_text.py,sha256=GX0u_40OLmDdSyawDrUcUk4jcrz1qWsKmmAMP4AD7hc,318
|
653 |
+
openai/types/shared_params/__init__.py,sha256=GcNBmK_EPlGE-xPFmSQjlOq7SuNYd2nwDswX4ExHwoU,498
|
654 |
+
openai/types/shared_params/__pycache__/__init__.cpython-312.pyc,,
|
655 |
+
openai/types/shared_params/__pycache__/function_definition.cpython-312.pyc,,
|
656 |
+
openai/types/shared_params/__pycache__/function_parameters.cpython-312.pyc,,
|
657 |
+
openai/types/shared_params/__pycache__/response_format_json_object.cpython-312.pyc,,
|
658 |
+
openai/types/shared_params/__pycache__/response_format_json_schema.cpython-312.pyc,,
|
659 |
+
openai/types/shared_params/__pycache__/response_format_text.cpython-312.pyc,,
|
660 |
+
openai/types/shared_params/function_definition.py,sha256=ciMXqn1tFXnp1tg9weJW0uvtyvMLrnph3WXMg4IG1Vk,1482
|
661 |
+
openai/types/shared_params/function_parameters.py,sha256=UvxKz_3b9b5ECwWr8RFrIH511htbU2JZsp9Z9BMkF-o,272
|
662 |
+
openai/types/shared_params/response_format_json_object.py,sha256=QT4uJCK7RzN3HK17eGjEo36jLKOIBBNGjiX-zIa9iT4,390
|
663 |
+
openai/types/shared_params/response_format_json_schema.py,sha256=Uu2ioeSbI64bm-jJ61OY8Lr3PpofTR4d2LNBcaYxlec,1360
|
664 |
+
openai/types/shared_params/response_format_text.py,sha256=SjHeZAfgM1-HXAoKLrkiH-VZEnQ73XPTk_RgtJmEbU4,364
|
665 |
+
openai/types/upload.py,sha256=mEeQTGS0uqFkxbDpJzgBUvuDhGVPw9cQxhRJjPBVeLo,1186
|
666 |
+
openai/types/upload_complete_params.py,sha256=7On-iVAlA9p_nksLSFPBPR4QbB0xEtAW-skyh7S9gR0,504
|
667 |
+
openai/types/upload_create_params.py,sha256=ZiZr1yC6g2VqL7KEnw7lhE4kZvU-F3DfTAc2TPk-XBo,889
|
668 |
+
openai/types/uploads/__init__.py,sha256=fDsmd3L0nIWbFldbViOLvcQavsFA4SL3jsXDfAueAck,242
|
669 |
+
openai/types/uploads/__pycache__/__init__.cpython-312.pyc,,
|
670 |
+
openai/types/uploads/__pycache__/part_create_params.cpython-312.pyc,,
|
671 |
+
openai/types/uploads/__pycache__/upload_part.cpython-312.pyc,,
|
672 |
+
openai/types/uploads/part_create_params.py,sha256=pBByUzngaj70ov1knoSo_gpeBjaWP9D5EdiHwiG4G7U,362
|
673 |
+
openai/types/uploads/upload_part.py,sha256=U9953cr9lJJLWEfhTiwHphRzLKARq3gWAWqrjxbhTR4,590
|
674 |
+
openai/version.py,sha256=cjbXKO8Ut3aiv4YlQnugff7AdC48MpSndcx96q88Yb8,62
|
graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/REQUESTED
ADDED
File without changes
|
graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/WHEEL
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: hatchling 1.25.0
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-any
|
graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/entry_points.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[console_scripts]
|
2 |
+
openai = openai.cli:main
|
graphrag-ollama/lib/python3.12/site-packages/openai-1.54.0.dist-info/licenses/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Apache License
|
2 |
+
Version 2.0, January 2004
|
3 |
+
http://www.apache.org/licenses/
|
4 |
+
|
5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6 |
+
|
7 |
+
1. Definitions.
|
8 |
+
|
9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
11 |
+
|
12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13 |
+
the copyright owner that is granting the License.
|
14 |
+
|
15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
16 |
+
other entities that control, are controlled by, or are under common
|
17 |
+
control with that entity. For the purposes of this definition,
|
18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
19 |
+
direction or management of such entity, whether by contract or
|
20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22 |
+
|
23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24 |
+
exercising permissions granted by this License.
|
25 |
+
|
26 |
+
"Source" form shall mean the preferred form for making modifications,
|
27 |
+
including but not limited to software source code, documentation
|
28 |
+
source, and configuration files.
|
29 |
+
|
30 |
+
"Object" form shall mean any form resulting from mechanical
|
31 |
+
transformation or translation of a Source form, including but
|
32 |
+
not limited to compiled object code, generated documentation,
|
33 |
+
and conversions to other media types.
|
34 |
+
|
35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
36 |
+
Object form, made available under the License, as indicated by a
|
37 |
+
copyright notice that is included in or attached to the work
|
38 |
+
(an example is provided in the Appendix below).
|
39 |
+
|
40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41 |
+
form, that is based on (or derived from) the Work and for which the
|
42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
44 |
+
of this License, Derivative Works shall not include works that remain
|
45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46 |
+
the Work and Derivative Works thereof.
|
47 |
+
|
48 |
+
"Contribution" shall mean any work of authorship, including
|
49 |
+
the original version of the Work and any modifications or additions
|
50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
54 |
+
means any form of electronic, verbal, or written communication sent
|
55 |
+
to the Licensor or its representatives, including but not limited to
|
56 |
+
communication on electronic mailing lists, source code control systems,
|
57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
59 |
+
excluding communication that is conspicuously marked or otherwise
|
60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
61 |
+
|
62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
64 |
+
subsequently incorporated within the Work.
|
65 |
+
|
66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
71 |
+
Work and such Derivative Works in Source or Object form.
|
72 |
+
|
73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76 |
+
(except as stated in this section) patent license to make, have made,
|
77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78 |
+
where such license applies only to those patent claims licensable
|
79 |
+
by such Contributor that are necessarily infringed by their
|
80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
82 |
+
institute patent litigation against any entity (including a
|
83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84 |
+
or a Contribution incorporated within the Work constitutes direct
|
85 |
+
or contributory patent infringement, then any patent licenses
|
86 |
+
granted to You under this License for that Work shall terminate
|
87 |
+
as of the date such litigation is filed.
|
88 |
+
|
89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
90 |
+
Work or Derivative Works thereof in any medium, with or without
|
91 |
+
modifications, and in Source or Object form, provided that You
|
92 |
+
meet the following conditions:
|
93 |
+
|
94 |
+
(a) You must give any other recipients of the Work or
|
95 |
+
Derivative Works a copy of this License; and
|
96 |
+
|
97 |
+
(b) You must cause any modified files to carry prominent notices
|
98 |
+
stating that You changed the files; and
|
99 |
+
|
100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
101 |
+
that You distribute, all copyright, patent, trademark, and
|
102 |
+
attribution notices from the Source form of the Work,
|
103 |
+
excluding those notices that do not pertain to any part of
|
104 |
+
the Derivative Works; and
|
105 |
+
|
106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107 |
+
distribution, then any Derivative Works that You distribute must
|
108 |
+
include a readable copy of the attribution notices contained
|
109 |
+
within such NOTICE file, excluding those notices that do not
|
110 |
+
pertain to any part of the Derivative Works, in at least one
|
111 |
+
of the following places: within a NOTICE text file distributed
|
112 |
+
as part of the Derivative Works; within the Source form or
|
113 |
+
documentation, if provided along with the Derivative Works; or,
|
114 |
+
within a display generated by the Derivative Works, if and
|
115 |
+
wherever such third-party notices normally appear. The contents
|
116 |
+
of the NOTICE file are for informational purposes only and
|
117 |
+
do not modify the License. You may add Your own attribution
|
118 |
+
notices within Derivative Works that You distribute, alongside
|
119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
120 |
+
that such additional attribution notices cannot be construed
|
121 |
+
as modifying the License.
|
122 |
+
|
123 |
+
You may add Your own copyright statement to Your modifications and
|
124 |
+
may provide additional or different license terms and conditions
|
125 |
+
for use, reproduction, or distribution of Your modifications, or
|
126 |
+
for any such Derivative Works as a whole, provided Your use,
|
127 |
+
reproduction, and distribution of the Work otherwise complies with
|
128 |
+
the conditions stated in this License.
|
129 |
+
|
130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
132 |
+
by You to the Licensor shall be under the terms and conditions of
|
133 |
+
this License, without any additional terms or conditions.
|
134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135 |
+
the terms of any separate license agreement you may have executed
|
136 |
+
with Licensor regarding such Contributions.
|
137 |
+
|
138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
140 |
+
except as required for reasonable and customary use in describing the
|
141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
142 |
+
|
143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144 |
+
agreed to in writing, Licensor provides the Work (and each
|
145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147 |
+
implied, including, without limitation, any warranties or conditions
|
148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150 |
+
appropriateness of using or redistributing the Work and assume any
|
151 |
+
risks associated with Your exercise of permissions under this License.
|
152 |
+
|
153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
154 |
+
whether in tort (including negligence), contract, or otherwise,
|
155 |
+
unless required by applicable law (such as deliberate and grossly
|
156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157 |
+
liable to You for damages, including any direct, indirect, special,
|
158 |
+
incidental, or consequential damages of any character arising as a
|
159 |
+
result of this License or out of the use or inability to use the
|
160 |
+
Work (including but not limited to damages for loss of goodwill,
|
161 |
+
work stoppage, computer failure or malfunction, or any and all
|
162 |
+
other commercial damages or losses), even if such Contributor
|
163 |
+
has been advised of the possibility of such damages.
|
164 |
+
|
165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168 |
+
or other liability obligations and/or rights consistent with this
|
169 |
+
License. However, in accepting such obligations, You may act only
|
170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171 |
+
of any other Contributor, and only if You agree to indemnify,
|
172 |
+
defend, and hold each Contributor harmless for any liability
|
173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
174 |
+
of your accepting any such warranty or additional liability.
|
175 |
+
|
176 |
+
END OF TERMS AND CONDITIONS
|
177 |
+
|
178 |
+
APPENDIX: How to apply the Apache License to your work.
|
179 |
+
|
180 |
+
To apply the Apache License to your work, attach the following
|
181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182 |
+
replaced with your own identifying information. (Don't include
|
183 |
+
the brackets!) The text should be enclosed in the appropriate
|
184 |
+
comment syntax for the file format. We also recommend that a
|
185 |
+
file or class name and description of purpose be included on the
|
186 |
+
same "printed page" as the copyright notice for easier
|
187 |
+
identification within third-party archives.
|
188 |
+
|
189 |
+
Copyright 2024 OpenAI
|
190 |
+
|
191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192 |
+
you may not use this file except in compliance with the License.
|
193 |
+
You may obtain a copy of the License at
|
194 |
+
|
195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
196 |
+
|
197 |
+
Unless required by applicable law or agreed to in writing, software
|
198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200 |
+
See the License for the specific language governing permissions and
|
201 |
+
limitations under the License.
|
graphrag-ollama/lib/python3.12/site-packages/openai/__init__.py
ADDED
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
import os as _os
|
6 |
+
from typing_extensions import override
|
7 |
+
|
8 |
+
from . import types
|
9 |
+
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
|
10 |
+
from ._utils import file_from_path
|
11 |
+
from ._client import Client, OpenAI, Stream, Timeout, Transport, AsyncClient, AsyncOpenAI, AsyncStream, RequestOptions
|
12 |
+
from ._models import BaseModel
|
13 |
+
from ._version import __title__, __version__
|
14 |
+
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
|
15 |
+
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
|
16 |
+
from ._exceptions import (
|
17 |
+
APIError,
|
18 |
+
OpenAIError,
|
19 |
+
ConflictError,
|
20 |
+
NotFoundError,
|
21 |
+
APIStatusError,
|
22 |
+
RateLimitError,
|
23 |
+
APITimeoutError,
|
24 |
+
BadRequestError,
|
25 |
+
APIConnectionError,
|
26 |
+
AuthenticationError,
|
27 |
+
InternalServerError,
|
28 |
+
PermissionDeniedError,
|
29 |
+
LengthFinishReasonError,
|
30 |
+
UnprocessableEntityError,
|
31 |
+
APIResponseValidationError,
|
32 |
+
ContentFilterFinishReasonError,
|
33 |
+
)
|
34 |
+
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
|
35 |
+
from ._utils._logs import setup_logging as _setup_logging
|
36 |
+
|
37 |
+
__all__ = [
|
38 |
+
"types",
|
39 |
+
"__version__",
|
40 |
+
"__title__",
|
41 |
+
"NoneType",
|
42 |
+
"Transport",
|
43 |
+
"ProxiesTypes",
|
44 |
+
"NotGiven",
|
45 |
+
"NOT_GIVEN",
|
46 |
+
"OpenAIError",
|
47 |
+
"APIError",
|
48 |
+
"APIStatusError",
|
49 |
+
"APITimeoutError",
|
50 |
+
"APIConnectionError",
|
51 |
+
"APIResponseValidationError",
|
52 |
+
"BadRequestError",
|
53 |
+
"AuthenticationError",
|
54 |
+
"PermissionDeniedError",
|
55 |
+
"NotFoundError",
|
56 |
+
"ConflictError",
|
57 |
+
"UnprocessableEntityError",
|
58 |
+
"RateLimitError",
|
59 |
+
"InternalServerError",
|
60 |
+
"LengthFinishReasonError",
|
61 |
+
"ContentFilterFinishReasonError",
|
62 |
+
"Timeout",
|
63 |
+
"RequestOptions",
|
64 |
+
"Client",
|
65 |
+
"AsyncClient",
|
66 |
+
"Stream",
|
67 |
+
"AsyncStream",
|
68 |
+
"OpenAI",
|
69 |
+
"AsyncOpenAI",
|
70 |
+
"file_from_path",
|
71 |
+
"BaseModel",
|
72 |
+
"DEFAULT_TIMEOUT",
|
73 |
+
"DEFAULT_MAX_RETRIES",
|
74 |
+
"DEFAULT_CONNECTION_LIMITS",
|
75 |
+
"DefaultHttpxClient",
|
76 |
+
"DefaultAsyncHttpxClient",
|
77 |
+
]
|
78 |
+
|
79 |
+
from .lib import azure as _azure, pydantic_function_tool as pydantic_function_tool
|
80 |
+
from .version import VERSION as VERSION
|
81 |
+
from .lib.azure import AzureOpenAI as AzureOpenAI, AsyncAzureOpenAI as AsyncAzureOpenAI
|
82 |
+
from .lib._old_api import *
|
83 |
+
from .lib.streaming import (
|
84 |
+
AssistantEventHandler as AssistantEventHandler,
|
85 |
+
AsyncAssistantEventHandler as AsyncAssistantEventHandler,
|
86 |
+
)
|
87 |
+
|
88 |
+
_setup_logging()
|
89 |
+
|
90 |
+
# Update the __module__ attribute for exported symbols so that
|
91 |
+
# error messages point to this module instead of the module
|
92 |
+
# it was originally defined in, e.g.
|
93 |
+
# openai._exceptions.NotFoundError -> openai.NotFoundError
|
94 |
+
__locals = locals()
|
95 |
+
for __name in __all__:
|
96 |
+
if not __name.startswith("__"):
|
97 |
+
try:
|
98 |
+
__locals[__name].__module__ = "openai"
|
99 |
+
except (TypeError, AttributeError):
|
100 |
+
# Some of our exported symbols are builtins which we can't set attributes for.
|
101 |
+
pass
|
102 |
+
|
103 |
+
# ------ Module level client ------
|
104 |
+
import typing as _t
|
105 |
+
import typing_extensions as _te
|
106 |
+
|
107 |
+
import httpx as _httpx
|
108 |
+
|
109 |
+
from ._base_client import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES
|
110 |
+
|
111 |
+
api_key: str | None = None
|
112 |
+
|
113 |
+
organization: str | None = None
|
114 |
+
|
115 |
+
project: str | None = None
|
116 |
+
|
117 |
+
base_url: str | _httpx.URL | None = None
|
118 |
+
|
119 |
+
timeout: float | Timeout | None = DEFAULT_TIMEOUT
|
120 |
+
|
121 |
+
max_retries: int = DEFAULT_MAX_RETRIES
|
122 |
+
|
123 |
+
default_headers: _t.Mapping[str, str] | None = None
|
124 |
+
|
125 |
+
default_query: _t.Mapping[str, object] | None = None
|
126 |
+
|
127 |
+
http_client: _httpx.Client | None = None
|
128 |
+
|
129 |
+
_ApiType = _te.Literal["openai", "azure"]
|
130 |
+
|
131 |
+
api_type: _ApiType | None = _t.cast(_ApiType, _os.environ.get("OPENAI_API_TYPE"))
|
132 |
+
|
133 |
+
api_version: str | None = _os.environ.get("OPENAI_API_VERSION")
|
134 |
+
|
135 |
+
azure_endpoint: str | None = _os.environ.get("AZURE_OPENAI_ENDPOINT")
|
136 |
+
|
137 |
+
azure_ad_token: str | None = _os.environ.get("AZURE_OPENAI_AD_TOKEN")
|
138 |
+
|
139 |
+
azure_ad_token_provider: _azure.AzureADTokenProvider | None = None
|
140 |
+
|
141 |
+
|
142 |
+
class _ModuleClient(OpenAI):
|
143 |
+
# Note: we have to use type: ignores here as overriding class members
|
144 |
+
# with properties is technically unsafe but it is fine for our use case
|
145 |
+
|
146 |
+
@property # type: ignore
|
147 |
+
@override
|
148 |
+
def api_key(self) -> str | None:
|
149 |
+
return api_key
|
150 |
+
|
151 |
+
@api_key.setter # type: ignore
|
152 |
+
def api_key(self, value: str | None) -> None: # type: ignore
|
153 |
+
global api_key
|
154 |
+
|
155 |
+
api_key = value
|
156 |
+
|
157 |
+
@property # type: ignore
|
158 |
+
@override
|
159 |
+
def organization(self) -> str | None:
|
160 |
+
return organization
|
161 |
+
|
162 |
+
@organization.setter # type: ignore
|
163 |
+
def organization(self, value: str | None) -> None: # type: ignore
|
164 |
+
global organization
|
165 |
+
|
166 |
+
organization = value
|
167 |
+
|
168 |
+
@property # type: ignore
|
169 |
+
@override
|
170 |
+
def project(self) -> str | None:
|
171 |
+
return project
|
172 |
+
|
173 |
+
@project.setter # type: ignore
|
174 |
+
def project(self, value: str | None) -> None: # type: ignore
|
175 |
+
global project
|
176 |
+
|
177 |
+
project = value
|
178 |
+
|
179 |
+
@property
|
180 |
+
@override
|
181 |
+
def base_url(self) -> _httpx.URL:
|
182 |
+
if base_url is not None:
|
183 |
+
return _httpx.URL(base_url)
|
184 |
+
|
185 |
+
return super().base_url
|
186 |
+
|
187 |
+
@base_url.setter
|
188 |
+
def base_url(self, url: _httpx.URL | str) -> None:
|
189 |
+
super().base_url = url # type: ignore[misc]
|
190 |
+
|
191 |
+
@property # type: ignore
|
192 |
+
@override
|
193 |
+
def timeout(self) -> float | Timeout | None:
|
194 |
+
return timeout
|
195 |
+
|
196 |
+
@timeout.setter # type: ignore
|
197 |
+
def timeout(self, value: float | Timeout | None) -> None: # type: ignore
|
198 |
+
global timeout
|
199 |
+
|
200 |
+
timeout = value
|
201 |
+
|
202 |
+
@property # type: ignore
|
203 |
+
@override
|
204 |
+
def max_retries(self) -> int:
|
205 |
+
return max_retries
|
206 |
+
|
207 |
+
@max_retries.setter # type: ignore
|
208 |
+
def max_retries(self, value: int) -> None: # type: ignore
|
209 |
+
global max_retries
|
210 |
+
|
211 |
+
max_retries = value
|
212 |
+
|
213 |
+
@property # type: ignore
|
214 |
+
@override
|
215 |
+
def _custom_headers(self) -> _t.Mapping[str, str] | None:
|
216 |
+
return default_headers
|
217 |
+
|
218 |
+
@_custom_headers.setter # type: ignore
|
219 |
+
def _custom_headers(self, value: _t.Mapping[str, str] | None) -> None: # type: ignore
|
220 |
+
global default_headers
|
221 |
+
|
222 |
+
default_headers = value
|
223 |
+
|
224 |
+
@property # type: ignore
|
225 |
+
@override
|
226 |
+
def _custom_query(self) -> _t.Mapping[str, object] | None:
|
227 |
+
return default_query
|
228 |
+
|
229 |
+
@_custom_query.setter # type: ignore
|
230 |
+
def _custom_query(self, value: _t.Mapping[str, object] | None) -> None: # type: ignore
|
231 |
+
global default_query
|
232 |
+
|
233 |
+
default_query = value
|
234 |
+
|
235 |
+
@property # type: ignore
|
236 |
+
@override
|
237 |
+
def _client(self) -> _httpx.Client:
|
238 |
+
return http_client or super()._client
|
239 |
+
|
240 |
+
@_client.setter # type: ignore
|
241 |
+
def _client(self, value: _httpx.Client) -> None: # type: ignore
|
242 |
+
global http_client
|
243 |
+
|
244 |
+
http_client = value
|
245 |
+
|
246 |
+
|
247 |
+
class _AzureModuleClient(_ModuleClient, AzureOpenAI): # type: ignore
|
248 |
+
...
|
249 |
+
|
250 |
+
|
251 |
+
class _AmbiguousModuleClientUsageError(OpenAIError):
|
252 |
+
def __init__(self) -> None:
|
253 |
+
super().__init__(
|
254 |
+
"Ambiguous use of module client; please set `openai.api_type` or the `OPENAI_API_TYPE` environment variable to `openai` or `azure`"
|
255 |
+
)
|
256 |
+
|
257 |
+
|
258 |
+
def _has_openai_credentials() -> bool:
|
259 |
+
return _os.environ.get("OPENAI_API_KEY") is not None
|
260 |
+
|
261 |
+
|
262 |
+
def _has_azure_credentials() -> bool:
|
263 |
+
return azure_endpoint is not None or _os.environ.get("AZURE_OPENAI_API_KEY") is not None
|
264 |
+
|
265 |
+
|
266 |
+
def _has_azure_ad_credentials() -> bool:
|
267 |
+
return (
|
268 |
+
_os.environ.get("AZURE_OPENAI_AD_TOKEN") is not None
|
269 |
+
or azure_ad_token is not None
|
270 |
+
or azure_ad_token_provider is not None
|
271 |
+
)
|
272 |
+
|
273 |
+
|
274 |
+
_client: OpenAI | None = None
|
275 |
+
|
276 |
+
|
277 |
+
def _load_client() -> OpenAI: # type: ignore[reportUnusedFunction]
|
278 |
+
global _client
|
279 |
+
|
280 |
+
if _client is None:
|
281 |
+
global api_type, azure_endpoint, azure_ad_token, api_version
|
282 |
+
|
283 |
+
if azure_endpoint is None:
|
284 |
+
azure_endpoint = _os.environ.get("AZURE_OPENAI_ENDPOINT")
|
285 |
+
|
286 |
+
if azure_ad_token is None:
|
287 |
+
azure_ad_token = _os.environ.get("AZURE_OPENAI_AD_TOKEN")
|
288 |
+
|
289 |
+
if api_version is None:
|
290 |
+
api_version = _os.environ.get("OPENAI_API_VERSION")
|
291 |
+
|
292 |
+
if api_type is None:
|
293 |
+
has_openai = _has_openai_credentials()
|
294 |
+
has_azure = _has_azure_credentials()
|
295 |
+
has_azure_ad = _has_azure_ad_credentials()
|
296 |
+
|
297 |
+
if has_openai and (has_azure or has_azure_ad):
|
298 |
+
raise _AmbiguousModuleClientUsageError()
|
299 |
+
|
300 |
+
if (azure_ad_token is not None or azure_ad_token_provider is not None) and _os.environ.get(
|
301 |
+
"AZURE_OPENAI_API_KEY"
|
302 |
+
) is not None:
|
303 |
+
raise _AmbiguousModuleClientUsageError()
|
304 |
+
|
305 |
+
if has_azure or has_azure_ad:
|
306 |
+
api_type = "azure"
|
307 |
+
else:
|
308 |
+
api_type = "openai"
|
309 |
+
|
310 |
+
if api_type == "azure":
|
311 |
+
_client = _AzureModuleClient( # type: ignore
|
312 |
+
api_version=api_version,
|
313 |
+
azure_endpoint=azure_endpoint,
|
314 |
+
api_key=api_key,
|
315 |
+
azure_ad_token=azure_ad_token,
|
316 |
+
azure_ad_token_provider=azure_ad_token_provider,
|
317 |
+
organization=organization,
|
318 |
+
base_url=base_url,
|
319 |
+
timeout=timeout,
|
320 |
+
max_retries=max_retries,
|
321 |
+
default_headers=default_headers,
|
322 |
+
default_query=default_query,
|
323 |
+
http_client=http_client,
|
324 |
+
)
|
325 |
+
return _client
|
326 |
+
|
327 |
+
_client = _ModuleClient(
|
328 |
+
api_key=api_key,
|
329 |
+
organization=organization,
|
330 |
+
project=project,
|
331 |
+
base_url=base_url,
|
332 |
+
timeout=timeout,
|
333 |
+
max_retries=max_retries,
|
334 |
+
default_headers=default_headers,
|
335 |
+
default_query=default_query,
|
336 |
+
http_client=http_client,
|
337 |
+
)
|
338 |
+
return _client
|
339 |
+
|
340 |
+
return _client
|
341 |
+
|
342 |
+
|
343 |
+
def _reset_client() -> None: # type: ignore[reportUnusedFunction]
|
344 |
+
global _client
|
345 |
+
|
346 |
+
_client = None
|
347 |
+
|
348 |
+
|
349 |
+
from ._module_client import (
|
350 |
+
beta as beta,
|
351 |
+
chat as chat,
|
352 |
+
audio as audio,
|
353 |
+
files as files,
|
354 |
+
images as images,
|
355 |
+
models as models,
|
356 |
+
batches as batches,
|
357 |
+
embeddings as embeddings,
|
358 |
+
completions as completions,
|
359 |
+
fine_tuning as fine_tuning,
|
360 |
+
moderations as moderations,
|
361 |
+
)
|
graphrag-ollama/lib/python3.12/site-packages/openai/__main__.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
from .cli import main
|
2 |
+
|
3 |
+
main()
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/__init__.cpython-312.pyc
ADDED
Binary file (11.4 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/__main__.cpython-312.pyc
ADDED
Binary file (248 Bytes). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_base_client.cpython-312.pyc
ADDED
Binary file (73.2 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_client.cpython-312.pyc
ADDED
Binary file (23.8 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_compat.cpython-312.pyc
ADDED
Binary file (8.32 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_constants.cpython-312.pyc
ADDED
Binary file (728 Bytes). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_exceptions.cpython-312.pyc
ADDED
Binary file (7.26 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_files.cpython-312.pyc
ADDED
Binary file (6.14 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_legacy_response.cpython-312.pyc
ADDED
Binary file (22.7 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_models.cpython-312.pyc
ADDED
Binary file (30 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_module_client.cpython-312.pyc
ADDED
Binary file (6.51 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_qs.cpython-312.pyc
ADDED
Binary file (5.85 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_resource.cpython-312.pyc
ADDED
Binary file (2.16 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_response.cpython-312.pyc
ADDED
Binary file (37.2 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_streaming.cpython-312.pyc
ADDED
Binary file (17 kB). View file
|
|
graphrag-ollama/lib/python3.12/site-packages/openai/__pycache__/_types.cpython-312.pyc
ADDED
Binary file (7.17 kB). View file
|
|