frogml-core 0.0.113__py3-none-any.whl → 0.0.115__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. frogml_core/__init__.py +1 -1
  2. frogml_core/clients/administration/authentication/client.py +2 -2
  3. frogml_core/clients/batch_job_management/client.py +4 -4
  4. frogml_core/clients/build_orchestrator/build_model_request_getter.py +6 -6
  5. frogml_core/clients/build_orchestrator/client.py +12 -12
  6. frogml_core/clients/build_orchestrator/internal_client.py +10 -10
  7. frogml_core/frogml_client/build_api_helpers/build_api_steps.py +3 -3
  8. frogml_core/inner/build_logic/constants/upload_tag.py +7 -7
  9. frogml_core/inner/build_logic/interface/context_interface.py +1 -1
  10. frogml_core/inner/build_logic/phases/phase_010_fetch_model/fetch_strategy_manager/strategy/strategy.py +4 -4
  11. frogml_core/inner/build_logic/phases/phase_010_fetch_model/set_version_step.py +3 -3
  12. frogml_core/inner/build_logic/phases/phase_020_remote_register_frogml_build/start_remote_build_step.py +3 -3
  13. frogml_core/inner/build_logic/phases/phase_020_remote_register_frogml_build/upload_step.py +11 -9
  14. frogml_core/inner/build_logic/tools/ignore_files.py +3 -3
  15. frogml_core/inner/di_configuration/__init__.py +0 -6
  16. frogml_core/model/adapters/__init__.py +1 -1
  17. frogml_core/model/analytics_logging.py +1 -1
  18. frogml_core/model/tools/adapters/input.py +6 -6
  19. frogml_core/model/tools/adapters/output.py +8 -8
  20. frogml_core/model/tools/run_model_locally.py +2 -2
  21. frogml_core/model/utils/feature_utils.py +1 -1
  22. {frogml_core-0.0.113.dist-info → frogml_core-0.0.115.dist-info}/METADATA +1 -1
  23. {frogml_core-0.0.113.dist-info → frogml_core-0.0.115.dist-info}/RECORD +30 -137
  24. frogml_services_mock/mocks/analytics_api.py +6 -6
  25. frogml_services_mock/mocks/ecosystem_service_api.py +2 -2
  26. frogml_services_mock/mocks/frogml_mocks.py +0 -11
  27. frogml_services_mock/services_mock.py +4 -52
  28. frogml_storage/__init__.py +1 -1
  29. frogml_core/clients/prompt_manager/__init__.py +0 -0
  30. frogml_core/clients/prompt_manager/model_descriptor_mapper.py +0 -196
  31. frogml_core/clients/prompt_manager/prompt_manager_client.py +0 -190
  32. frogml_core/clients/prompt_manager/prompt_proto_mapper.py +0 -264
  33. frogml_core/clients/vector_store/__init__.py +0 -2
  34. frogml_core/clients/vector_store/management_client.py +0 -127
  35. frogml_core/clients/vector_store/serving_client.py +0 -157
  36. frogml_core/clients/workspace_manager/__init__.py +0 -1
  37. frogml_core/clients/workspace_manager/client.py +0 -224
  38. frogml_core/llmops/__init__.py +0 -0
  39. frogml_core/llmops/generation/__init__.py +0 -0
  40. frogml_core/llmops/generation/_steaming.py +0 -78
  41. frogml_core/llmops/generation/base.py +0 -5
  42. frogml_core/llmops/generation/chat/__init__.py +0 -0
  43. frogml_core/llmops/generation/chat/openai/LICENSE.txt +0 -201
  44. frogml_core/llmops/generation/chat/openai/types/__init__.py +0 -0
  45. frogml_core/llmops/generation/chat/openai/types/chat/__init__.py +0 -0
  46. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion.py +0 -88
  47. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_assistant_message_param.py +0 -65
  48. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_chunk.py +0 -153
  49. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_content_part_text_param.py +0 -28
  50. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_function_call_option_param.py +0 -25
  51. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_function_message_param.py +0 -33
  52. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message.py +0 -56
  53. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message_param.py +0 -34
  54. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message_tool_call.py +0 -46
  55. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message_tool_call_param.py +0 -44
  56. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_named_tool_choice_param.py +0 -32
  57. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_role.py +0 -20
  58. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_system_message_param.py +0 -35
  59. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_token_logprob.py +0 -71
  60. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_tool_choice_option_param.py +0 -28
  61. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_tool_message_param.py +0 -31
  62. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_tool_param.py +0 -29
  63. frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_user_message_param.py +0 -35
  64. frogml_core/llmops/generation/chat/openai/types/chat/completion_create_params.py +0 -279
  65. frogml_core/llmops/generation/chat/openai/types/completion_choice.py +0 -47
  66. frogml_core/llmops/generation/chat/openai/types/completion_create_params.py +0 -209
  67. frogml_core/llmops/generation/chat/openai/types/completion_usage.py +0 -30
  68. frogml_core/llmops/generation/chat/openai/types/model.py +0 -35
  69. frogml_core/llmops/generation/chat/openai/types/shared/__init__.py +0 -3
  70. frogml_core/llmops/generation/chat/openai/types/shared/error_object.py +0 -27
  71. frogml_core/llmops/generation/chat/openai/types/shared/function_definition.py +0 -49
  72. frogml_core/llmops/generation/chat/openai/types/shared/function_parameters.py +0 -20
  73. frogml_core/llmops/generation/chat/openai/types/shared_params/__init__.py +0 -2
  74. frogml_core/llmops/generation/chat/openai/types/shared_params/function_definition.py +0 -49
  75. frogml_core/llmops/generation/chat/openai/types/shared_params/function_parameters.py +0 -22
  76. frogml_core/llmops/generation/streaming.py +0 -26
  77. frogml_core/llmops/model/__init__.py +0 -0
  78. frogml_core/llmops/model/descriptor.py +0 -40
  79. frogml_core/llmops/prompt/__init__.py +0 -0
  80. frogml_core/llmops/prompt/base.py +0 -136
  81. frogml_core/llmops/prompt/chat/__init__.py +0 -0
  82. frogml_core/llmops/prompt/chat/message.py +0 -24
  83. frogml_core/llmops/prompt/chat/template.py +0 -113
  84. frogml_core/llmops/prompt/chat/value.py +0 -10
  85. frogml_core/llmops/prompt/manager.py +0 -138
  86. frogml_core/llmops/prompt/template.py +0 -24
  87. frogml_core/llmops/prompt/value.py +0 -14
  88. frogml_core/llmops/provider/__init__.py +0 -0
  89. frogml_core/llmops/provider/chat.py +0 -44
  90. frogml_core/llmops/provider/openai/__init__.py +0 -0
  91. frogml_core/llmops/provider/openai/client.py +0 -126
  92. frogml_core/llmops/provider/openai/provider.py +0 -93
  93. frogml_core/vector_store/__init__.py +0 -4
  94. frogml_core/vector_store/client.py +0 -151
  95. frogml_core/vector_store/collection.py +0 -429
  96. frogml_core/vector_store/filters.py +0 -359
  97. frogml_core/vector_store/inference_client.py +0 -105
  98. frogml_core/vector_store/rest_helpers.py +0 -81
  99. frogml_core/vector_store/utils/__init__.py +0 -0
  100. frogml_core/vector_store/utils/filter_utils.py +0 -23
  101. frogml_core/vector_store/utils/upsert_utils.py +0 -218
  102. frogml_proto/qwak/prompt/v1/prompt/prompt_manager_service_pb2.py +0 -77
  103. frogml_proto/qwak/prompt/v1/prompt/prompt_manager_service_pb2.pyi +0 -417
  104. frogml_proto/qwak/prompt/v1/prompt/prompt_manager_service_pb2_grpc.py +0 -441
  105. frogml_proto/qwak/prompt/v1/prompt/prompt_pb2.py +0 -69
  106. frogml_proto/qwak/prompt/v1/prompt/prompt_pb2.pyi +0 -415
  107. frogml_proto/qwak/prompt/v1/prompt/prompt_pb2_grpc.py +0 -4
  108. frogml_proto/qwak/vectors/v1/collection/collection_pb2.py +0 -46
  109. frogml_proto/qwak/vectors/v1/collection/collection_pb2.pyi +0 -287
  110. frogml_proto/qwak/vectors/v1/collection/collection_pb2_grpc.py +0 -4
  111. frogml_proto/qwak/vectors/v1/collection/collection_service_pb2.py +0 -60
  112. frogml_proto/qwak/vectors/v1/collection/collection_service_pb2.pyi +0 -258
  113. frogml_proto/qwak/vectors/v1/collection/collection_service_pb2_grpc.py +0 -304
  114. frogml_proto/qwak/vectors/v1/collection/event/collection_event_pb2.py +0 -28
  115. frogml_proto/qwak/vectors/v1/collection/event/collection_event_pb2.pyi +0 -41
  116. frogml_proto/qwak/vectors/v1/collection/event/collection_event_pb2_grpc.py +0 -4
  117. frogml_proto/qwak/vectors/v1/filters_pb2.py +0 -52
  118. frogml_proto/qwak/vectors/v1/filters_pb2.pyi +0 -297
  119. frogml_proto/qwak/vectors/v1/filters_pb2_grpc.py +0 -4
  120. frogml_proto/qwak/vectors/v1/vector_pb2.py +0 -38
  121. frogml_proto/qwak/vectors/v1/vector_pb2.pyi +0 -142
  122. frogml_proto/qwak/vectors/v1/vector_pb2_grpc.py +0 -4
  123. frogml_proto/qwak/vectors/v1/vector_service_pb2.py +0 -53
  124. frogml_proto/qwak/vectors/v1/vector_service_pb2.pyi +0 -243
  125. frogml_proto/qwak/vectors/v1/vector_service_pb2_grpc.py +0 -201
  126. frogml_proto/qwak/workspace/workspace_pb2.py +0 -50
  127. frogml_proto/qwak/workspace/workspace_pb2.pyi +0 -331
  128. frogml_proto/qwak/workspace/workspace_pb2_grpc.py +0 -4
  129. frogml_proto/qwak/workspace/workspace_service_pb2.py +0 -84
  130. frogml_proto/qwak/workspace/workspace_service_pb2.pyi +0 -393
  131. frogml_proto/qwak/workspace/workspace_service_pb2_grpc.py +0 -507
  132. frogml_services_mock/mocks/prompt_manager_service.py +0 -281
  133. frogml_services_mock/mocks/vector_serving_api.py +0 -159
  134. frogml_services_mock/mocks/vectors_management_api.py +0 -97
  135. frogml_services_mock/mocks/workspace_manager_service_mock.py +0 -202
  136. /frogml_core/model/adapters/output_adapters/{qwak_with_default_fallback.py → frogml_with_default_fallback.py} +0 -0
  137. {frogml_core-0.0.113.dist-info → frogml_core-0.0.115.dist-info}/WHEEL +0 -0
@@ -1,201 +0,0 @@
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.
@@ -1,88 +0,0 @@
1
- #
2
- # Copyright 2024 OpenAI
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
- from dataclasses import dataclass
17
- from typing import List, Optional
18
-
19
- from typing_extensions import Literal
20
-
21
- from frogml_core.llmops.generation.base import ModelResponse
22
-
23
- from ..completion_usage import CompletionUsage
24
- from .chat_completion_message import ChatCompletionMessage
25
- from .chat_completion_token_logprob import ChatCompletionTokenLogprob
26
-
27
- __all__ = ["ChatCompletion", "Choice", "ChoiceLogprobs"]
28
-
29
-
30
- @dataclass
31
- class ChoiceLogprobs:
32
- content: Optional[List[ChatCompletionTokenLogprob]] = None
33
- """A list of message content tokens with log probability information."""
34
-
35
-
36
- @dataclass
37
- class Choice:
38
- finish_reason: Literal[
39
- "stop", "length", "tool_calls", "content_filter", "function_call"
40
- ]
41
- """The reason the model stopped generating tokens.
42
-
43
- This will be `stop` if the model hit a natural stop point or a provided stop
44
- sequence, `length` if the maximum number of tokens specified in the request was
45
- reached, `content_filter` if content was omitted due to a flag from our content
46
- filters, `tool_calls` if the model called a tool, or `function_call`
47
- (deprecated) if the model called a function.
48
- """
49
-
50
- index: int
51
- """The index of the choice in the list of choices."""
52
-
53
- message: ChatCompletionMessage
54
- """A chat completion message generated by the model."""
55
-
56
- logprobs: Optional[ChoiceLogprobs] = None
57
- """Log probability information for the choice."""
58
-
59
-
60
- @dataclass
61
- class ChatCompletion(ModelResponse):
62
- id: str
63
- """A unique identifier for the chat completion."""
64
-
65
- choices: List[Choice]
66
- """A list of chat completion choices.
67
-
68
- Can be more than one if `n` is greater than 1.
69
- """
70
-
71
- created: int
72
- """The Unix timestamp (in seconds) of when the chat completion was created."""
73
-
74
- model: str
75
- """The model used for the chat completion."""
76
-
77
- object: Literal["chat.completion"]
78
- """The object type, which is always `chat.completion`."""
79
-
80
- system_fingerprint: Optional[str] = None
81
- """This fingerprint represents the backend configuration that the model runs with.
82
-
83
- Can be used in conjunction with the `seed` request parameter to understand when
84
- backend changes have been made that might impact determinism.
85
- """
86
-
87
- usage: Optional[CompletionUsage] = None
88
- """Usage statistics for the completion request."""
@@ -1,65 +0,0 @@
1
- #
2
- # Copyright 2024 OpenAI
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
- from __future__ import annotations
17
-
18
- from typing import Iterable, Optional
19
-
20
- from typing_extensions import Literal, Required, TypedDict
21
-
22
- from .chat_completion_message_tool_call_param import ChatCompletionMessageToolCallParam
23
-
24
- __all__ = ["ChatCompletionAssistantMessageParam", "FunctionCall"]
25
-
26
-
27
- class FunctionCall(TypedDict, total=False):
28
- arguments: Required[str]
29
- """
30
- The arguments to call the function with, as generated by the model in JSON
31
- format. Note that the model does not always generate valid JSON, and may
32
- hallucinate parameters not defined by your function schema. Validate the
33
- arguments in your code before calling your function.
34
- """
35
-
36
- name: Required[str]
37
- """The name of the function to call."""
38
-
39
-
40
- class ChatCompletionAssistantMessageParam(TypedDict, total=False):
41
- role: Required[Literal["assistant"]]
42
- """The role of the messages author, in this case `assistant`."""
43
-
44
- content: Optional[str]
45
- """The contents of the assistant message.
46
-
47
- Required unless `tool_calls` or `function_call` is specified.
48
- """
49
-
50
- function_call: FunctionCall
51
- """Deprecated and replaced by `tool_calls`.
52
-
53
- The name and arguments of a function that should be called, as generated by the
54
- model.
55
- """
56
-
57
- name: str
58
- """An optional name for the participant.
59
-
60
- Provides the model information to differentiate between participants of the same
61
- role.
62
- """
63
-
64
- tool_calls: Iterable[ChatCompletionMessageToolCallParam]
65
- """The tool calls generated by the model, such as function calls."""
@@ -1,153 +0,0 @@
1
- #
2
- # Copyright 2024 OpenAI
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
- from dataclasses import dataclass
17
- from typing import List, Optional
18
-
19
- from typing_extensions import Literal
20
-
21
- from frogml_core.llmops.generation.base import ModelResponse
22
-
23
- from .chat_completion_token_logprob import ChatCompletionTokenLogprob
24
-
25
- __all__ = [
26
- "ChatCompletionChunk",
27
- "Choice",
28
- "ChoiceDelta",
29
- "ChoiceDeltaFunctionCall",
30
- "ChoiceDeltaToolCall",
31
- "ChoiceDeltaToolCallFunction",
32
- "ChoiceLogprobs",
33
- ]
34
-
35
-
36
- @dataclass
37
- class ChoiceDeltaFunctionCall:
38
- arguments: Optional[str] = None
39
- """
40
- The arguments to call the function with, as generated by the model in JSON
41
- format. Note that the model does not always generate valid JSON, and may
42
- hallucinate parameters not defined by your function schema. Validate the
43
- arguments in your code before calling your function.
44
- """
45
-
46
- name: Optional[str] = None
47
- """The name of the function to call."""
48
-
49
-
50
- @dataclass
51
- class ChoiceDeltaToolCallFunction:
52
- arguments: Optional[str] = None
53
- """
54
- The arguments to call the function with, as generated by the model in JSON
55
- format. Note that the model does not always generate valid JSON, and may
56
- hallucinate parameters not defined by your function schema. Validate the
57
- arguments in your code before calling your function.
58
- """
59
-
60
- name: Optional[str] = None
61
- """The name of the function to call."""
62
-
63
-
64
- @dataclass
65
- class ChoiceDeltaToolCall:
66
- index: int
67
-
68
- id: Optional[str] = None
69
- """The ID of the tool call."""
70
-
71
- function: Optional[ChoiceDeltaToolCallFunction] = None
72
-
73
- type: Optional[Literal["function"]] = None
74
- """The type of the tool. Currently, only `function` is supported."""
75
-
76
-
77
- @dataclass
78
- class ChoiceDelta:
79
- content: Optional[str] = None
80
- """The contents of the chunk message."""
81
-
82
- function_call: Optional[ChoiceDeltaFunctionCall] = None
83
- """Deprecated and replaced by `tool_calls`.
84
-
85
- The name and arguments of a function that should be called, as generated by the
86
- model.
87
- """
88
-
89
- role: Optional[Literal["system", "user", "assistant", "tool"]] = None
90
- """The role of the author of this message."""
91
-
92
- tool_calls: Optional[List[ChoiceDeltaToolCall]] = None
93
-
94
-
95
- @dataclass
96
- class ChoiceLogprobs:
97
- content: Optional[List[ChatCompletionTokenLogprob]] = None
98
- """A list of message content tokens with log probability information."""
99
-
100
-
101
- @dataclass
102
- class Choice:
103
- delta: ChoiceDelta
104
- """A chat completion delta generated by streamed model responses."""
105
-
106
- index: int
107
- """The index of the choice in the list of choices."""
108
-
109
- finish_reason: Optional[
110
- Literal["stop", "length", "tool_calls", "content_filter", "function_call"]
111
- ] = None
112
- """The reason the model stopped generating tokens.
113
-
114
- This will be `stop` if the model hit a natural stop point or a provided stop
115
- sequence, `length` if the maximum number of tokens specified in the request was
116
- reached, `content_filter` if content was omitted due to a flag from our content
117
- filters, `tool_calls` if the model called a tool, or `function_call`
118
- (deprecated) if the model called a function.
119
- """
120
-
121
- logprobs: Optional[ChoiceLogprobs] = None
122
- """Log probability information for the choice."""
123
-
124
-
125
- @dataclass
126
- class ChatCompletionChunk(ModelResponse):
127
- id: str
128
- """A unique identifier for the chat completion. Each chunk has the same ID."""
129
-
130
- choices: List[Choice]
131
- """A list of chat completion choices.
132
-
133
- Can be more than one if `n` is greater than 1.
134
- """
135
-
136
- created: int
137
- """The Unix timestamp (in seconds) of when the chat completion was created.
138
-
139
- Each chunk has the same timestamp.
140
- """
141
-
142
- model: str
143
- """The model to generate the completion."""
144
-
145
- object: Literal["chat.completion.chunk"]
146
- """The object type, which is always `chat.completion.chunk`."""
147
-
148
- system_fingerprint: Optional[str] = None
149
- """
150
- This fingerprint represents the backend configuration that the model runs with.
151
- Can be used in conjunction with the `seed` request parameter to understand when
152
- backend changes have been made that might impact determinism.
153
- """
@@ -1,28 +0,0 @@
1
- #
2
- # Copyright 2024 OpenAI
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
- from __future__ import annotations
17
-
18
- from typing_extensions import Literal, Required, TypedDict
19
-
20
- __all__ = ["ChatCompletionContentPartTextParam"]
21
-
22
-
23
- class ChatCompletionContentPartTextParam(TypedDict, total=False):
24
- text: Required[str]
25
- """The text content."""
26
-
27
- type: Required[Literal["text"]]
28
- """The type of the content part."""
@@ -1,25 +0,0 @@
1
- #
2
- # Copyright 2024 OpenAI
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
- from __future__ import annotations
17
-
18
- from typing_extensions import Required, TypedDict
19
-
20
- __all__ = ["ChatCompletionFunctionCallOptionParam"]
21
-
22
-
23
- class ChatCompletionFunctionCallOptionParam(TypedDict, total=False):
24
- name: Required[str]
25
- """The name of the function to call."""
@@ -1,33 +0,0 @@
1
- #
2
- # Copyright 2024 OpenAI
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
- from __future__ import annotations
17
-
18
- from typing import Optional
19
-
20
- from typing_extensions import Literal, Required, TypedDict
21
-
22
- __all__ = ["ChatCompletionFunctionMessageParam"]
23
-
24
-
25
- class ChatCompletionFunctionMessageParam(TypedDict, total=False):
26
- content: Required[Optional[str]]
27
- """The contents of the function message."""
28
-
29
- name: Required[str]
30
- """The name of the function to call."""
31
-
32
- role: Required[Literal["function"]]
33
- """The role of the messages author, in this case `function`."""
@@ -1,56 +0,0 @@
1
- #
2
- # Copyright 2024 OpenAI
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
- from dataclasses import dataclass
17
- from typing import List, Optional
18
-
19
- from typing_extensions import Literal
20
-
21
- from .chat_completion_message_tool_call import ChatCompletionMessageToolCall
22
-
23
- __all__ = ["ChatCompletionMessage", "FunctionCall"]
24
-
25
-
26
- @dataclass
27
- class FunctionCall:
28
- arguments: str
29
- """
30
- The arguments to call the function with, as generated by the model in JSON
31
- format. Note that the model does not always generate valid JSON, and may
32
- hallucinate parameters not defined by your function schema. Validate the
33
- arguments in your code before calling your function.
34
- """
35
-
36
- name: str
37
- """The name of the function to call."""
38
-
39
-
40
- @dataclass
41
- class ChatCompletionMessage:
42
- role: Literal["assistant"]
43
- """The role of the author of this message."""
44
-
45
- content: Optional[str] = None
46
- """The contents of the message."""
47
-
48
- function_call: Optional[FunctionCall] = None
49
- """Deprecated and replaced by `tool_calls`.
50
-
51
- The name and arguments of a function that should be called, as generated by the
52
- model.
53
- """
54
-
55
- tool_calls: Optional[List[ChatCompletionMessageToolCall]] = None
56
- """The tool calls generated by the model, such as function calls."""