frogml-core 0.0.112__py3-none-any.whl → 0.0.114__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.
- frogml_core/__init__.py +1 -1
- frogml_core/inner/di_configuration/__init__.py +0 -6
- {frogml_core-0.0.112.dist-info → frogml_core-0.0.114.dist-info}/METADATA +1 -1
- {frogml_core-0.0.112.dist-info → frogml_core-0.0.114.dist-info}/RECORD +8 -115
- frogml_services_mock/mocks/frogml_mocks.py +0 -11
- frogml_services_mock/services_mock.py +0 -48
- frogml_storage/__init__.py +1 -1
- frogml_core/clients/prompt_manager/__init__.py +0 -0
- frogml_core/clients/prompt_manager/model_descriptor_mapper.py +0 -196
- frogml_core/clients/prompt_manager/prompt_manager_client.py +0 -190
- frogml_core/clients/prompt_manager/prompt_proto_mapper.py +0 -264
- frogml_core/clients/vector_store/__init__.py +0 -2
- frogml_core/clients/vector_store/management_client.py +0 -127
- frogml_core/clients/vector_store/serving_client.py +0 -157
- frogml_core/clients/workspace_manager/__init__.py +0 -1
- frogml_core/clients/workspace_manager/client.py +0 -224
- frogml_core/llmops/__init__.py +0 -0
- frogml_core/llmops/generation/__init__.py +0 -0
- frogml_core/llmops/generation/_steaming.py +0 -78
- frogml_core/llmops/generation/base.py +0 -5
- frogml_core/llmops/generation/chat/__init__.py +0 -0
- frogml_core/llmops/generation/chat/openai/LICENSE.txt +0 -201
- frogml_core/llmops/generation/chat/openai/types/__init__.py +0 -0
- frogml_core/llmops/generation/chat/openai/types/chat/__init__.py +0 -0
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion.py +0 -88
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_assistant_message_param.py +0 -65
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_chunk.py +0 -153
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_content_part_text_param.py +0 -28
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_function_call_option_param.py +0 -25
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_function_message_param.py +0 -33
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message.py +0 -56
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message_param.py +0 -34
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message_tool_call.py +0 -46
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_message_tool_call_param.py +0 -44
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_named_tool_choice_param.py +0 -32
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_role.py +0 -20
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_system_message_param.py +0 -35
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_token_logprob.py +0 -71
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_tool_choice_option_param.py +0 -28
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_tool_message_param.py +0 -31
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_tool_param.py +0 -29
- frogml_core/llmops/generation/chat/openai/types/chat/chat_completion_user_message_param.py +0 -35
- frogml_core/llmops/generation/chat/openai/types/chat/completion_create_params.py +0 -279
- frogml_core/llmops/generation/chat/openai/types/completion_choice.py +0 -47
- frogml_core/llmops/generation/chat/openai/types/completion_create_params.py +0 -209
- frogml_core/llmops/generation/chat/openai/types/completion_usage.py +0 -30
- frogml_core/llmops/generation/chat/openai/types/model.py +0 -35
- frogml_core/llmops/generation/chat/openai/types/shared/__init__.py +0 -3
- frogml_core/llmops/generation/chat/openai/types/shared/error_object.py +0 -27
- frogml_core/llmops/generation/chat/openai/types/shared/function_definition.py +0 -49
- frogml_core/llmops/generation/chat/openai/types/shared/function_parameters.py +0 -20
- frogml_core/llmops/generation/chat/openai/types/shared_params/__init__.py +0 -2
- frogml_core/llmops/generation/chat/openai/types/shared_params/function_definition.py +0 -49
- frogml_core/llmops/generation/chat/openai/types/shared_params/function_parameters.py +0 -22
- frogml_core/llmops/generation/streaming.py +0 -26
- frogml_core/llmops/model/__init__.py +0 -0
- frogml_core/llmops/model/descriptor.py +0 -40
- frogml_core/llmops/prompt/__init__.py +0 -0
- frogml_core/llmops/prompt/base.py +0 -136
- frogml_core/llmops/prompt/chat/__init__.py +0 -0
- frogml_core/llmops/prompt/chat/message.py +0 -24
- frogml_core/llmops/prompt/chat/template.py +0 -113
- frogml_core/llmops/prompt/chat/value.py +0 -10
- frogml_core/llmops/prompt/manager.py +0 -138
- frogml_core/llmops/prompt/template.py +0 -24
- frogml_core/llmops/prompt/value.py +0 -14
- frogml_core/llmops/provider/__init__.py +0 -0
- frogml_core/llmops/provider/chat.py +0 -44
- frogml_core/llmops/provider/openai/__init__.py +0 -0
- frogml_core/llmops/provider/openai/client.py +0 -126
- frogml_core/llmops/provider/openai/provider.py +0 -93
- frogml_core/vector_store/__init__.py +0 -4
- frogml_core/vector_store/client.py +0 -151
- frogml_core/vector_store/collection.py +0 -429
- frogml_core/vector_store/filters.py +0 -359
- frogml_core/vector_store/inference_client.py +0 -105
- frogml_core/vector_store/rest_helpers.py +0 -81
- frogml_core/vector_store/utils/__init__.py +0 -0
- frogml_core/vector_store/utils/filter_utils.py +0 -23
- frogml_core/vector_store/utils/upsert_utils.py +0 -218
- frogml_proto/qwak/prompt/v1/prompt/prompt_manager_service_pb2.py +0 -77
- frogml_proto/qwak/prompt/v1/prompt/prompt_manager_service_pb2.pyi +0 -417
- frogml_proto/qwak/prompt/v1/prompt/prompt_manager_service_pb2_grpc.py +0 -441
- frogml_proto/qwak/prompt/v1/prompt/prompt_pb2.py +0 -69
- frogml_proto/qwak/prompt/v1/prompt/prompt_pb2.pyi +0 -415
- frogml_proto/qwak/prompt/v1/prompt/prompt_pb2_grpc.py +0 -4
- frogml_proto/qwak/vectors/v1/collection/collection_pb2.py +0 -46
- frogml_proto/qwak/vectors/v1/collection/collection_pb2.pyi +0 -287
- frogml_proto/qwak/vectors/v1/collection/collection_pb2_grpc.py +0 -4
- frogml_proto/qwak/vectors/v1/collection/collection_service_pb2.py +0 -60
- frogml_proto/qwak/vectors/v1/collection/collection_service_pb2.pyi +0 -258
- frogml_proto/qwak/vectors/v1/collection/collection_service_pb2_grpc.py +0 -304
- frogml_proto/qwak/vectors/v1/collection/event/collection_event_pb2.py +0 -28
- frogml_proto/qwak/vectors/v1/collection/event/collection_event_pb2.pyi +0 -41
- frogml_proto/qwak/vectors/v1/collection/event/collection_event_pb2_grpc.py +0 -4
- frogml_proto/qwak/vectors/v1/filters_pb2.py +0 -52
- frogml_proto/qwak/vectors/v1/filters_pb2.pyi +0 -297
- frogml_proto/qwak/vectors/v1/filters_pb2_grpc.py +0 -4
- frogml_proto/qwak/vectors/v1/vector_pb2.py +0 -38
- frogml_proto/qwak/vectors/v1/vector_pb2.pyi +0 -142
- frogml_proto/qwak/vectors/v1/vector_pb2_grpc.py +0 -4
- frogml_proto/qwak/vectors/v1/vector_service_pb2.py +0 -53
- frogml_proto/qwak/vectors/v1/vector_service_pb2.pyi +0 -243
- frogml_proto/qwak/vectors/v1/vector_service_pb2_grpc.py +0 -201
- frogml_proto/qwak/workspace/workspace_pb2.py +0 -50
- frogml_proto/qwak/workspace/workspace_pb2.pyi +0 -331
- frogml_proto/qwak/workspace/workspace_pb2_grpc.py +0 -4
- frogml_proto/qwak/workspace/workspace_service_pb2.py +0 -84
- frogml_proto/qwak/workspace/workspace_service_pb2.pyi +0 -393
- frogml_proto/qwak/workspace/workspace_service_pb2_grpc.py +0 -507
- frogml_services_mock/mocks/prompt_manager_service.py +0 -281
- frogml_services_mock/mocks/vector_serving_api.py +0 -159
- frogml_services_mock/mocks/vectors_management_api.py +0 -97
- frogml_services_mock/mocks/workspace_manager_service_mock.py +0 -202
- {frogml_core-0.0.112.dist-info → frogml_core-0.0.114.dist-info}/WHEEL +0 -0
@@ -1,202 +0,0 @@
|
|
1
|
-
import logging
|
2
|
-
import uuid
|
3
|
-
from dataclasses import dataclass
|
4
|
-
|
5
|
-
import grpc
|
6
|
-
|
7
|
-
from frogml_proto.qwak.user_application.common.v0.resources_pb2 import (
|
8
|
-
ClientPodComputeResources,
|
9
|
-
PodComputeResourceTemplateSpec,
|
10
|
-
)
|
11
|
-
from frogml_proto.qwak.workspace.workspace_pb2 import (
|
12
|
-
DefaultWorkspaceDetails,
|
13
|
-
Workspace,
|
14
|
-
WorkspaceImage,
|
15
|
-
)
|
16
|
-
from frogml_proto.qwak.workspace.workspace_service_pb2 import (
|
17
|
-
CountWorkspacesRequest,
|
18
|
-
CountWorkspacesResponse,
|
19
|
-
CreateWorkspaceResponse,
|
20
|
-
DeleteWorkspaceResponse,
|
21
|
-
GetDefaultWorkspaceValuesRequest,
|
22
|
-
GetDefaultWorkspaceValuesResponse,
|
23
|
-
GetWorkspaceByIdResponse,
|
24
|
-
ListWorkspaceImagesResponse,
|
25
|
-
ListWorkspacesResponse,
|
26
|
-
UpdateWorkspaceResponse,
|
27
|
-
)
|
28
|
-
from frogml_proto.qwak.workspace.workspace_service_pb2_grpc import (
|
29
|
-
WorkspaceManagementServiceServicer,
|
30
|
-
)
|
31
|
-
|
32
|
-
logger = logging.getLogger(__name__)
|
33
|
-
|
34
|
-
DEFAULT_CPU_IMAGE = "1"
|
35
|
-
DEFAULT_GPU_IMAGE = "3"
|
36
|
-
DEFAULT_CPU_INSTANCE = "small"
|
37
|
-
DEFAULT_GPU_INSTANCE = "g5_xlarge"
|
38
|
-
|
39
|
-
|
40
|
-
@dataclass
|
41
|
-
class WorkspaceData:
|
42
|
-
id: str
|
43
|
-
workspace_name: str
|
44
|
-
image_id: str
|
45
|
-
template_id: str
|
46
|
-
status: str
|
47
|
-
|
48
|
-
|
49
|
-
class WorkspaceManagerServiceMock(WorkspaceManagementServiceServicer):
|
50
|
-
def __init__(self):
|
51
|
-
super(WorkspaceManagerServiceMock, self).__init__()
|
52
|
-
self.workspaces = dict()
|
53
|
-
self.image_ids_to_names = {
|
54
|
-
"1": "cpu_3.7",
|
55
|
-
"2": "cpu_3.8",
|
56
|
-
"3": "gpu_3.7",
|
57
|
-
"4": "gpu_3.8",
|
58
|
-
}
|
59
|
-
|
60
|
-
def CreateWorkspace(self, request, context):
|
61
|
-
logger.info(f"Creating workspace {request}")
|
62
|
-
workspace_id = self._get_workspace_id()
|
63
|
-
self.workspaces[workspace_id] = WorkspaceData(
|
64
|
-
id=workspace_id,
|
65
|
-
workspace_name=request.workspace_spec.workspace_name,
|
66
|
-
image_id=request.workspace_spec.image_id,
|
67
|
-
template_id=request.workspace_spec.client_pod_compute_resources.template_spec.template_id,
|
68
|
-
status="CREATED",
|
69
|
-
)
|
70
|
-
return CreateWorkspaceResponse(workspace_id=workspace_id)
|
71
|
-
|
72
|
-
def UpdateWorkspace(self, request, context):
|
73
|
-
logger.info(f"Updating workspace {request}")
|
74
|
-
if request.workspace_id not in self.workspaces:
|
75
|
-
context.set_code(grpc.StatusCode.NOT_FOUND)
|
76
|
-
context.set_details("Received a non existing workspace id")
|
77
|
-
return UpdateWorkspaceResponse()
|
78
|
-
self.workspaces[request.workspace_id] = WorkspaceData(
|
79
|
-
id=request.workspace_id,
|
80
|
-
workspace_name=request.workspace_spec.workspace_name,
|
81
|
-
image_id=request.workspace_spec.image_id,
|
82
|
-
template_id=request.workspace_spec.client_pod_compute_resources.template_spec.template_id,
|
83
|
-
status="CREATED",
|
84
|
-
)
|
85
|
-
return UpdateWorkspaceResponse()
|
86
|
-
|
87
|
-
def DeleteWorkspace(self, request, context):
|
88
|
-
logger.info(f"delete workspace request: {request}")
|
89
|
-
if request.workspace_id not in self.workspaces:
|
90
|
-
context.set_code(grpc.StatusCode.NOT_FOUND)
|
91
|
-
context.set_details("Received a non existing workspace id")
|
92
|
-
return UpdateWorkspaceResponse()
|
93
|
-
del self.workspaces[request.workspace_id]
|
94
|
-
return DeleteWorkspaceResponse()
|
95
|
-
|
96
|
-
def GetWorkspaceById(self, request, context):
|
97
|
-
logger.info(f"get workspace by id request: {request}")
|
98
|
-
if request.workspace_id not in self.workspaces:
|
99
|
-
context.set_code(grpc.StatusCode.NOT_FOUND)
|
100
|
-
context.set_details("Received a non existing workspace id")
|
101
|
-
return UpdateWorkspaceResponse()
|
102
|
-
|
103
|
-
return GetWorkspaceByIdResponse(
|
104
|
-
workspace=Workspace(
|
105
|
-
workspace_id=request.workspace_id,
|
106
|
-
workspace_name=self.workspaces[request.workspace_id].workspace_name,
|
107
|
-
image_id=self.workspaces[request.workspace_id].image_id,
|
108
|
-
client_pod_compute_resources=ClientPodComputeResources(
|
109
|
-
template_spec=PodComputeResourceTemplateSpec(
|
110
|
-
template_id=self.workspaces[request.workspace_id].template_id
|
111
|
-
)
|
112
|
-
),
|
113
|
-
)
|
114
|
-
)
|
115
|
-
|
116
|
-
def ListWorkspaces(self, request, context):
|
117
|
-
logger.info(f"list workspaces: {request}")
|
118
|
-
return ListWorkspacesResponse(
|
119
|
-
workspaces=[
|
120
|
-
Workspace(
|
121
|
-
workspace_id=workspace_id,
|
122
|
-
workspace_name=workspace.workspace_name,
|
123
|
-
image_id=workspace.image_id,
|
124
|
-
client_pod_compute_resources=ClientPodComputeResources(
|
125
|
-
template_spec=PodComputeResourceTemplateSpec(
|
126
|
-
template_id=workspace.template_id
|
127
|
-
)
|
128
|
-
),
|
129
|
-
)
|
130
|
-
for workspace_id, workspace in self.workspaces.items()
|
131
|
-
]
|
132
|
-
)
|
133
|
-
|
134
|
-
def DeployWorkspace(self, request, context):
|
135
|
-
logger.info(f"Deploying workspace {request}")
|
136
|
-
if request.workspace_id not in self.workspaces:
|
137
|
-
context.set_code(grpc.StatusCode.NOT_FOUND)
|
138
|
-
context.set_details("Received a non existing workspace id")
|
139
|
-
return UpdateWorkspaceResponse()
|
140
|
-
|
141
|
-
current_workspace = self.workspaces[request.workspace_id]
|
142
|
-
self.workspaces[request.workspace_id] = WorkspaceData(
|
143
|
-
id=request.workspace_id,
|
144
|
-
workspace_name=current_workspace.workspace_name,
|
145
|
-
image_id=current_workspace.image_id,
|
146
|
-
template_id=current_workspace.template_id,
|
147
|
-
status="DEPLOYING",
|
148
|
-
)
|
149
|
-
return UpdateWorkspaceResponse()
|
150
|
-
|
151
|
-
def UndeployWorkspace(self, request, context):
|
152
|
-
logger.info(f"Undeploying workspace {request}")
|
153
|
-
if request.workspace_id not in self.workspaces:
|
154
|
-
context.set_code(grpc.StatusCode.NOT_FOUND)
|
155
|
-
context.set_details("Received a non existing workspace id")
|
156
|
-
return UpdateWorkspaceResponse()
|
157
|
-
|
158
|
-
current_workspace = self.workspaces[request.workspace_id]
|
159
|
-
self.workspaces[request.workspace_id] = WorkspaceData(
|
160
|
-
id=request.workspace_id,
|
161
|
-
workspace_name=current_workspace.workspace_name,
|
162
|
-
image_id=current_workspace.image_id,
|
163
|
-
template_id=current_workspace.template_id,
|
164
|
-
status="UNDEPLOYING",
|
165
|
-
)
|
166
|
-
return UpdateWorkspaceResponse()
|
167
|
-
|
168
|
-
def ListWorkspaceImages(self, request, context):
|
169
|
-
logger.info("List workspace images")
|
170
|
-
workspace_images = []
|
171
|
-
for k, v in self.image_ids_to_names.items():
|
172
|
-
workspace_images.append(WorkspaceImage(name=v, id=k))
|
173
|
-
return ListWorkspaceImagesResponse(workspace_images=workspace_images)
|
174
|
-
|
175
|
-
def CountWorkspaces(
|
176
|
-
self, request: CountWorkspacesRequest, context
|
177
|
-
) -> CountWorkspacesResponse:
|
178
|
-
return CountWorkspacesResponse(count=len(self.workspaces))
|
179
|
-
|
180
|
-
def GetDefaultWorkspaceValues(
|
181
|
-
self, request: GetDefaultWorkspaceValuesRequest, context
|
182
|
-
) -> GetDefaultWorkspaceValuesResponse:
|
183
|
-
return GetDefaultWorkspaceValuesResponse(
|
184
|
-
default_workspace_details=DefaultWorkspaceDetails(
|
185
|
-
cpu_image_id=DEFAULT_CPU_IMAGE,
|
186
|
-
gpu_image_id=DEFAULT_GPU_IMAGE,
|
187
|
-
cpu_compute_resources=ClientPodComputeResources(
|
188
|
-
template_spec=PodComputeResourceTemplateSpec(
|
189
|
-
template_id=DEFAULT_CPU_INSTANCE
|
190
|
-
)
|
191
|
-
),
|
192
|
-
gpu_compute_resources=ClientPodComputeResources(
|
193
|
-
template_spec=PodComputeResourceTemplateSpec(
|
194
|
-
template_id=DEFAULT_GPU_INSTANCE
|
195
|
-
)
|
196
|
-
),
|
197
|
-
)
|
198
|
-
)
|
199
|
-
|
200
|
-
@staticmethod
|
201
|
-
def _get_workspace_id():
|
202
|
-
return str(uuid.uuid4())
|
File without changes
|