mycelium-ai 0.5.0__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.
- mycelium/__init__.py +0 -0
- mycelium/api/__init__.py +0 -0
- mycelium/api/app.py +1147 -0
- mycelium/api/client_app.py +170 -0
- mycelium/api/generated_sources/__init__.py +0 -0
- mycelium/api/generated_sources/server_schemas/__init__.py +97 -0
- mycelium/api/generated_sources/server_schemas/api/__init__.py +5 -0
- mycelium/api/generated_sources/server_schemas/api/default_api.py +2473 -0
- mycelium/api/generated_sources/server_schemas/api_client.py +766 -0
- mycelium/api/generated_sources/server_schemas/api_response.py +25 -0
- mycelium/api/generated_sources/server_schemas/configuration.py +434 -0
- mycelium/api/generated_sources/server_schemas/exceptions.py +166 -0
- mycelium/api/generated_sources/server_schemas/models/__init__.py +41 -0
- mycelium/api/generated_sources/server_schemas/models/api_section.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/chroma_section.py +69 -0
- mycelium/api/generated_sources/server_schemas/models/clap_section.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/compute_on_server200_response.py +79 -0
- mycelium/api/generated_sources/server_schemas/models/compute_on_server_request.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/compute_text_search_request.py +69 -0
- mycelium/api/generated_sources/server_schemas/models/config_request.py +81 -0
- mycelium/api/generated_sources/server_schemas/models/config_response.py +107 -0
- mycelium/api/generated_sources/server_schemas/models/create_playlist_request.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/get_similar_by_track200_response.py +143 -0
- mycelium/api/generated_sources/server_schemas/models/library_stats_response.py +77 -0
- mycelium/api/generated_sources/server_schemas/models/logging_section.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/media_server_section.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/playlist_response.py +73 -0
- mycelium/api/generated_sources/server_schemas/models/plex_section.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/processing_response.py +90 -0
- mycelium/api/generated_sources/server_schemas/models/save_config_response.py +73 -0
- mycelium/api/generated_sources/server_schemas/models/scan_library_response.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/search_result_response.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/server_section.py +67 -0
- mycelium/api/generated_sources/server_schemas/models/stop_processing_response.py +71 -0
- mycelium/api/generated_sources/server_schemas/models/task_status_response.py +87 -0
- mycelium/api/generated_sources/server_schemas/models/track_database_stats.py +75 -0
- mycelium/api/generated_sources/server_schemas/models/track_response.py +77 -0
- mycelium/api/generated_sources/server_schemas/models/tracks_list_response.py +81 -0
- mycelium/api/generated_sources/server_schemas/rest.py +329 -0
- mycelium/api/generated_sources/server_schemas/test/__init__.py +0 -0
- mycelium/api/generated_sources/server_schemas/test/test_api_section.py +57 -0
- mycelium/api/generated_sources/server_schemas/test/test_chroma_section.py +55 -0
- mycelium/api/generated_sources/server_schemas/test/test_clap_section.py +60 -0
- mycelium/api/generated_sources/server_schemas/test/test_compute_on_server200_response.py +52 -0
- mycelium/api/generated_sources/server_schemas/test/test_compute_on_server_request.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_compute_text_search_request.py +54 -0
- mycelium/api/generated_sources/server_schemas/test/test_config_request.py +66 -0
- mycelium/api/generated_sources/server_schemas/test/test_config_response.py +97 -0
- mycelium/api/generated_sources/server_schemas/test/test_create_playlist_request.py +60 -0
- mycelium/api/generated_sources/server_schemas/test/test_default_api.py +150 -0
- mycelium/api/generated_sources/server_schemas/test/test_get_similar_by_track200_response.py +61 -0
- mycelium/api/generated_sources/server_schemas/test/test_library_stats_response.py +63 -0
- mycelium/api/generated_sources/server_schemas/test/test_logging_section.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_media_server_section.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_playlist_response.py +58 -0
- mycelium/api/generated_sources/server_schemas/test/test_plex_section.py +56 -0
- mycelium/api/generated_sources/server_schemas/test/test_processing_response.py +61 -0
- mycelium/api/generated_sources/server_schemas/test/test_save_config_response.py +58 -0
- mycelium/api/generated_sources/server_schemas/test/test_scan_library_response.py +61 -0
- mycelium/api/generated_sources/server_schemas/test/test_search_result_response.py +69 -0
- mycelium/api/generated_sources/server_schemas/test/test_server_section.py +53 -0
- mycelium/api/generated_sources/server_schemas/test/test_stop_processing_response.py +55 -0
- mycelium/api/generated_sources/server_schemas/test/test_task_status_response.py +71 -0
- mycelium/api/generated_sources/server_schemas/test/test_track_database_stats.py +60 -0
- mycelium/api/generated_sources/server_schemas/test/test_track_response.py +63 -0
- mycelium/api/generated_sources/server_schemas/test/test_tracks_list_response.py +75 -0
- mycelium/api/generated_sources/worker_schemas/__init__.py +61 -0
- mycelium/api/generated_sources/worker_schemas/api/__init__.py +5 -0
- mycelium/api/generated_sources/worker_schemas/api/default_api.py +318 -0
- mycelium/api/generated_sources/worker_schemas/api_client.py +766 -0
- mycelium/api/generated_sources/worker_schemas/api_response.py +25 -0
- mycelium/api/generated_sources/worker_schemas/configuration.py +434 -0
- mycelium/api/generated_sources/worker_schemas/exceptions.py +166 -0
- mycelium/api/generated_sources/worker_schemas/models/__init__.py +23 -0
- mycelium/api/generated_sources/worker_schemas/models/save_config_response.py +73 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_clap_section.py +75 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_client_api_section.py +69 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_client_section.py +79 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_config_request.py +73 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_config_response.py +89 -0
- mycelium/api/generated_sources/worker_schemas/models/worker_logging_section.py +67 -0
- mycelium/api/generated_sources/worker_schemas/rest.py +329 -0
- mycelium/api/generated_sources/worker_schemas/test/__init__.py +0 -0
- mycelium/api/generated_sources/worker_schemas/test/test_default_api.py +45 -0
- mycelium/api/generated_sources/worker_schemas/test/test_save_config_response.py +58 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_clap_section.py +60 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_client_api_section.py +55 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_client_section.py +65 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_config_request.py +59 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_config_response.py +89 -0
- mycelium/api/generated_sources/worker_schemas/test/test_worker_logging_section.py +53 -0
- mycelium/api/worker_models.py +99 -0
- mycelium/application/__init__.py +11 -0
- mycelium/application/job_queue.py +323 -0
- mycelium/application/library_management_use_cases.py +292 -0
- mycelium/application/search_use_cases.py +96 -0
- mycelium/application/services.py +340 -0
- mycelium/client.py +554 -0
- mycelium/client_config.py +251 -0
- mycelium/client_frontend_dist/404.html +1 -0
- mycelium/client_frontend_dist/_next/static/a4iyRdfsvkjdyMAK9cE9Y/_buildManifest.js +1 -0
- mycelium/client_frontend_dist/_next/static/a4iyRdfsvkjdyMAK9cE9Y/_ssgManifest.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/4bd1b696-cf72ae8a39fa05aa.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/964-830f77d7ce1c2463.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/app/_not-found/page-d25eede5a9099bd3.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/app/layout-9b3d32f96dfe13b6.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/app/page-cc6bad295789134e.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/framework-7c95b8e5103c9e90.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/main-6b37be50736577a2.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/main-app-4153d115599d3126.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/pages/_app-0a0020ddd67f79cf.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/pages/_error-03529f2c21436739.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- mycelium/client_frontend_dist/_next/static/chunks/webpack-c81e624915b2ea70.js +1 -0
- mycelium/client_frontend_dist/_next/static/css/1eb7f0e2c78e0734.css +1 -0
- mycelium/client_frontend_dist/favicon.ico +0 -0
- mycelium/client_frontend_dist/file.svg +1 -0
- mycelium/client_frontend_dist/globe.svg +1 -0
- mycelium/client_frontend_dist/index.html +1 -0
- mycelium/client_frontend_dist/index.txt +20 -0
- mycelium/client_frontend_dist/next.svg +1 -0
- mycelium/client_frontend_dist/vercel.svg +1 -0
- mycelium/client_frontend_dist/window.svg +1 -0
- mycelium/config.py +346 -0
- mycelium/domain/__init__.py +13 -0
- mycelium/domain/models.py +71 -0
- mycelium/domain/repositories.py +98 -0
- mycelium/domain/worker.py +77 -0
- mycelium/frontend_dist/404.html +1 -0
- mycelium/frontend_dist/_next/static/chunks/4bd1b696-cf72ae8a39fa05aa.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/964-830f77d7ce1c2463.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/app/_not-found/page-d25eede5a9099bd3.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/app/layout-9b3d32f96dfe13b6.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/app/page-a761463485e0540b.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/framework-7c95b8e5103c9e90.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/main-6b37be50736577a2.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/main-app-4153d115599d3126.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/pages/_app-0a0020ddd67f79cf.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/pages/_error-03529f2c21436739.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- mycelium/frontend_dist/_next/static/chunks/webpack-c81e624915b2ea70.js +1 -0
- mycelium/frontend_dist/_next/static/css/1eb7f0e2c78e0734.css +1 -0
- mycelium/frontend_dist/_next/static/glVJ0yJSL0zWN7anTTG3_/_buildManifest.js +1 -0
- mycelium/frontend_dist/_next/static/glVJ0yJSL0zWN7anTTG3_/_ssgManifest.js +1 -0
- mycelium/frontend_dist/favicon.ico +0 -0
- mycelium/frontend_dist/file.svg +1 -0
- mycelium/frontend_dist/globe.svg +1 -0
- mycelium/frontend_dist/index.html +10 -0
- mycelium/frontend_dist/index.txt +20 -0
- mycelium/frontend_dist/next.svg +1 -0
- mycelium/frontend_dist/vercel.svg +1 -0
- mycelium/frontend_dist/window.svg +1 -0
- mycelium/infrastructure/__init__.py +17 -0
- mycelium/infrastructure/chroma_adapter.py +232 -0
- mycelium/infrastructure/clap_adapter.py +280 -0
- mycelium/infrastructure/plex_adapter.py +145 -0
- mycelium/infrastructure/track_database.py +467 -0
- mycelium/main.py +183 -0
- mycelium_ai-0.5.0.dist-info/METADATA +312 -0
- mycelium_ai-0.5.0.dist-info/RECORD +164 -0
- mycelium_ai-0.5.0.dist-info/WHEEL +5 -0
- mycelium_ai-0.5.0.dist-info/entry_points.txt +2 -0
- mycelium_ai-0.5.0.dist-info/licenses/LICENSE +21 -0
- mycelium_ai-0.5.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,143 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
from inspect import getfullargspec
|
17
|
+
import json
|
18
|
+
import pprint
|
19
|
+
import re # noqa: F401
|
20
|
+
|
21
|
+
from typing import Any, List, Optional
|
22
|
+
from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator, ConfigDict
|
23
|
+
from mycelium.api.generated_sources.server_schemas.models.processing_response import ProcessingResponse
|
24
|
+
from mycelium.api.generated_sources.server_schemas.models.search_result_response import SearchResultResponse
|
25
|
+
from typing import Union, Any, List, TYPE_CHECKING
|
26
|
+
from pydantic import StrictStr, Field
|
27
|
+
|
28
|
+
GETSIMILARBYTRACK200RESPONSE_ONE_OF_SCHEMAS = ["List[SearchResultResponse]", "ProcessingResponse"]
|
29
|
+
|
30
|
+
class GetSimilarByTrack200Response(BaseModel):
|
31
|
+
"""
|
32
|
+
GetSimilarByTrack200Response
|
33
|
+
"""
|
34
|
+
# data type: List[SearchResultResponse]
|
35
|
+
oneof_schema_1_validator: Optional[conlist(SearchResultResponse)] = None
|
36
|
+
# data type: ProcessingResponse
|
37
|
+
oneof_schema_2_validator: Optional[ProcessingResponse] = None
|
38
|
+
if TYPE_CHECKING:
|
39
|
+
actual_instance: Union[List[SearchResultResponse], ProcessingResponse]
|
40
|
+
else:
|
41
|
+
actual_instance: Any
|
42
|
+
one_of_schemas: List[str] = Field(GETSIMILARBYTRACK200RESPONSE_ONE_OF_SCHEMAS)
|
43
|
+
|
44
|
+
model_config = {"validate_assignment": True}
|
45
|
+
def __init__(self, *args, **kwargs) -> None:
|
46
|
+
if args:
|
47
|
+
if len(args) > 1:
|
48
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
49
|
+
if kwargs:
|
50
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
51
|
+
super().__init__(actual_instance=args[0])
|
52
|
+
else:
|
53
|
+
super().__init__(**kwargs)
|
54
|
+
|
55
|
+
@validator('actual_instance')
|
56
|
+
def actual_instance_must_validate_oneof(cls, v):
|
57
|
+
instance = GetSimilarByTrack200Response.construct()
|
58
|
+
error_messages = []
|
59
|
+
match = 0
|
60
|
+
# validate data type: List[SearchResultResponse]
|
61
|
+
try:
|
62
|
+
instance.oneof_schema_1_validator = v
|
63
|
+
match += 1
|
64
|
+
except (ValidationError, ValueError) as e:
|
65
|
+
error_messages.append(str(e))
|
66
|
+
# validate data type: ProcessingResponse
|
67
|
+
if not isinstance(v, ProcessingResponse):
|
68
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ProcessingResponse`")
|
69
|
+
else:
|
70
|
+
match += 1
|
71
|
+
if match > 1:
|
72
|
+
# more than 1 match
|
73
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in GetSimilarByTrack200Response with oneOf schemas: List[SearchResultResponse], ProcessingResponse. Details: " + ", ".join(error_messages))
|
74
|
+
elif match == 0:
|
75
|
+
# no match
|
76
|
+
raise ValueError("No match found when setting `actual_instance` in GetSimilarByTrack200Response with oneOf schemas: List[SearchResultResponse], ProcessingResponse. Details: " + ", ".join(error_messages))
|
77
|
+
else:
|
78
|
+
return v
|
79
|
+
|
80
|
+
@classmethod
|
81
|
+
def from_dict(cls, obj: dict) -> GetSimilarByTrack200Response:
|
82
|
+
return cls.from_json(json.dumps(obj))
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def from_json(cls, json_str: str) -> GetSimilarByTrack200Response:
|
86
|
+
"""Returns the object represented by the json string"""
|
87
|
+
instance = GetSimilarByTrack200Response.construct()
|
88
|
+
error_messages = []
|
89
|
+
match = 0
|
90
|
+
|
91
|
+
# deserialize data into List[SearchResultResponse]
|
92
|
+
try:
|
93
|
+
# validation
|
94
|
+
instance.oneof_schema_1_validator = json.loads(json_str)
|
95
|
+
# assign value to actual_instance
|
96
|
+
instance.actual_instance = instance.oneof_schema_1_validator
|
97
|
+
match += 1
|
98
|
+
except (ValidationError, ValueError) as e:
|
99
|
+
error_messages.append(str(e))
|
100
|
+
# deserialize data into ProcessingResponse
|
101
|
+
try:
|
102
|
+
instance.actual_instance = ProcessingResponse.from_json(json_str)
|
103
|
+
match += 1
|
104
|
+
except (ValidationError, ValueError) as e:
|
105
|
+
error_messages.append(str(e))
|
106
|
+
|
107
|
+
if match > 1:
|
108
|
+
# more than 1 match
|
109
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into GetSimilarByTrack200Response with oneOf schemas: List[SearchResultResponse], ProcessingResponse. Details: " + ", ".join(error_messages))
|
110
|
+
elif match == 0:
|
111
|
+
# no match
|
112
|
+
raise ValueError("No match found when deserializing the JSON string into GetSimilarByTrack200Response with oneOf schemas: List[SearchResultResponse], ProcessingResponse. Details: " + ", ".join(error_messages))
|
113
|
+
else:
|
114
|
+
return instance
|
115
|
+
|
116
|
+
def to_json(self) -> str:
|
117
|
+
"""Returns the JSON representation of the actual instance"""
|
118
|
+
if self.actual_instance is None:
|
119
|
+
return "null"
|
120
|
+
|
121
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
122
|
+
if callable(to_json):
|
123
|
+
return self.actual_instance.to_json()
|
124
|
+
else:
|
125
|
+
return json.dumps(self.actual_instance)
|
126
|
+
|
127
|
+
def to_dict(self) -> dict:
|
128
|
+
"""Returns the dict representation of the actual instance"""
|
129
|
+
if self.actual_instance is None:
|
130
|
+
return None
|
131
|
+
|
132
|
+
to_dict = getattr(self.actual_instance, "to_dict", None)
|
133
|
+
if callable(to_dict):
|
134
|
+
return self.actual_instance.to_dict()
|
135
|
+
else:
|
136
|
+
# primitive type
|
137
|
+
return self.actual_instance
|
138
|
+
|
139
|
+
def to_str(self) -> str:
|
140
|
+
"""Returns the string representation of the actual instance"""
|
141
|
+
return pprint.pformat(self.model_dump())
|
142
|
+
|
143
|
+
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
from typing import Optional
|
22
|
+
from pydantic import BaseModel, Field, StrictInt, StrictStr, ConfigDict
|
23
|
+
from mycelium.api.generated_sources.server_schemas.models.track_database_stats import TrackDatabaseStats
|
24
|
+
|
25
|
+
class LibraryStatsResponse(BaseModel):
|
26
|
+
"""
|
27
|
+
LibraryStatsResponse
|
28
|
+
"""
|
29
|
+
total_embeddings: StrictInt = Field(...)
|
30
|
+
collection_name: StrictStr = Field(...)
|
31
|
+
database_path: StrictStr = Field(...)
|
32
|
+
track_database_stats: Optional[TrackDatabaseStats] = None
|
33
|
+
__properties = ["total_embeddings", "collection_name", "database_path", "track_database_stats"]
|
34
|
+
|
35
|
+
model_config = {"populate_by_name": True, "validate_assignment": True}
|
36
|
+
def to_str(self) -> str:
|
37
|
+
"""Returns the string representation of the model using alias"""
|
38
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
39
|
+
|
40
|
+
def to_json(self) -> str:
|
41
|
+
"""Returns the JSON representation of the model using alias"""
|
42
|
+
return json.dumps(self.to_dict())
|
43
|
+
|
44
|
+
@classmethod
|
45
|
+
def from_json(cls, json_str: str) -> LibraryStatsResponse:
|
46
|
+
"""Create an instance of LibraryStatsResponse from a JSON string"""
|
47
|
+
return cls.from_dict(json.loads(json_str))
|
48
|
+
|
49
|
+
def to_dict(self):
|
50
|
+
"""Returns the dictionary representation of the model using alias"""
|
51
|
+
_dict = self.model_dump(by_alias=True,
|
52
|
+
exclude={
|
53
|
+
},
|
54
|
+
exclude_none=True)
|
55
|
+
# override the default output from pydantic by calling `to_dict()` of track_database_stats
|
56
|
+
if self.track_database_stats:
|
57
|
+
_dict['track_database_stats'] = self.track_database_stats.to_dict()
|
58
|
+
return _dict
|
59
|
+
|
60
|
+
@classmethod
|
61
|
+
def from_dict(cls, obj: dict) -> LibraryStatsResponse:
|
62
|
+
"""Create an instance of LibraryStatsResponse from a dict"""
|
63
|
+
if obj is None:
|
64
|
+
return None
|
65
|
+
|
66
|
+
if not isinstance(obj, dict):
|
67
|
+
return LibraryStatsResponse.model_validate(obj)
|
68
|
+
|
69
|
+
_obj = LibraryStatsResponse.model_validate({
|
70
|
+
"total_embeddings": obj.get("total_embeddings"),
|
71
|
+
"collection_name": obj.get("collection_name"),
|
72
|
+
"database_path": obj.get("database_path"),
|
73
|
+
"track_database_stats": TrackDatabaseStats.from_dict(obj.get("track_database_stats")) if obj.get("track_database_stats") is not None else None
|
74
|
+
})
|
75
|
+
return _obj
|
76
|
+
|
77
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
from pydantic import BaseModel, Field, StrictStr, ConfigDict
|
23
|
+
|
24
|
+
class LoggingSection(BaseModel):
|
25
|
+
"""
|
26
|
+
LoggingSection
|
27
|
+
"""
|
28
|
+
level: StrictStr = Field(...)
|
29
|
+
__properties = ["level"]
|
30
|
+
|
31
|
+
model_config = {"populate_by_name": True, "validate_assignment": True}
|
32
|
+
def to_str(self) -> str:
|
33
|
+
"""Returns the string representation of the model using alias"""
|
34
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
35
|
+
|
36
|
+
def to_json(self) -> str:
|
37
|
+
"""Returns the JSON representation of the model using alias"""
|
38
|
+
return json.dumps(self.to_dict())
|
39
|
+
|
40
|
+
@classmethod
|
41
|
+
def from_json(cls, json_str: str) -> LoggingSection:
|
42
|
+
"""Create an instance of LoggingSection from a JSON string"""
|
43
|
+
return cls.from_dict(json.loads(json_str))
|
44
|
+
|
45
|
+
def to_dict(self):
|
46
|
+
"""Returns the dictionary representation of the model using alias"""
|
47
|
+
_dict = self.model_dump(by_alias=True,
|
48
|
+
exclude={
|
49
|
+
},
|
50
|
+
exclude_none=True)
|
51
|
+
return _dict
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_dict(cls, obj: dict) -> LoggingSection:
|
55
|
+
"""Create an instance of LoggingSection from a dict"""
|
56
|
+
if obj is None:
|
57
|
+
return None
|
58
|
+
|
59
|
+
if not isinstance(obj, dict):
|
60
|
+
return LoggingSection.model_validate(obj)
|
61
|
+
|
62
|
+
_obj = LoggingSection.model_validate({
|
63
|
+
"level": obj.get("level")
|
64
|
+
})
|
65
|
+
return _obj
|
66
|
+
|
67
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
from pydantic import BaseModel, Field, StrictStr, ConfigDict
|
23
|
+
|
24
|
+
class MediaServerSection(BaseModel):
|
25
|
+
"""
|
26
|
+
MediaServerSection
|
27
|
+
"""
|
28
|
+
type: StrictStr = Field(...)
|
29
|
+
__properties = ["type"]
|
30
|
+
|
31
|
+
model_config = {"populate_by_name": True, "validate_assignment": True}
|
32
|
+
def to_str(self) -> str:
|
33
|
+
"""Returns the string representation of the model using alias"""
|
34
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
35
|
+
|
36
|
+
def to_json(self) -> str:
|
37
|
+
"""Returns the JSON representation of the model using alias"""
|
38
|
+
return json.dumps(self.to_dict())
|
39
|
+
|
40
|
+
@classmethod
|
41
|
+
def from_json(cls, json_str: str) -> MediaServerSection:
|
42
|
+
"""Create an instance of MediaServerSection from a JSON string"""
|
43
|
+
return cls.from_dict(json.loads(json_str))
|
44
|
+
|
45
|
+
def to_dict(self):
|
46
|
+
"""Returns the dictionary representation of the model using alias"""
|
47
|
+
_dict = self.model_dump(by_alias=True,
|
48
|
+
exclude={
|
49
|
+
},
|
50
|
+
exclude_none=True)
|
51
|
+
return _dict
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_dict(cls, obj: dict) -> MediaServerSection:
|
55
|
+
"""Create an instance of MediaServerSection from a dict"""
|
56
|
+
if obj is None:
|
57
|
+
return None
|
58
|
+
|
59
|
+
if not isinstance(obj, dict):
|
60
|
+
return MediaServerSection.model_validate(obj)
|
61
|
+
|
62
|
+
_obj = MediaServerSection.model_validate({
|
63
|
+
"type": obj.get("type")
|
64
|
+
})
|
65
|
+
return _obj
|
66
|
+
|
67
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
from typing import Optional
|
22
|
+
from pydantic import BaseModel, Field, StrictInt, StrictStr, ConfigDict
|
23
|
+
|
24
|
+
class PlaylistResponse(BaseModel):
|
25
|
+
"""
|
26
|
+
PlaylistResponse
|
27
|
+
"""
|
28
|
+
name: StrictStr = Field(...)
|
29
|
+
track_count: StrictInt = Field(...)
|
30
|
+
created_at: StrictStr = Field(...)
|
31
|
+
server_id: Optional[StrictStr] = None
|
32
|
+
__properties = ["name", "track_count", "created_at", "server_id"]
|
33
|
+
|
34
|
+
model_config = {"populate_by_name": True, "validate_assignment": True}
|
35
|
+
def to_str(self) -> str:
|
36
|
+
"""Returns the string representation of the model using alias"""
|
37
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
38
|
+
|
39
|
+
def to_json(self) -> str:
|
40
|
+
"""Returns the JSON representation of the model using alias"""
|
41
|
+
return json.dumps(self.to_dict())
|
42
|
+
|
43
|
+
@classmethod
|
44
|
+
def from_json(cls, json_str: str) -> PlaylistResponse:
|
45
|
+
"""Create an instance of PlaylistResponse from a JSON string"""
|
46
|
+
return cls.from_dict(json.loads(json_str))
|
47
|
+
|
48
|
+
def to_dict(self):
|
49
|
+
"""Returns the dictionary representation of the model using alias"""
|
50
|
+
_dict = self.model_dump(by_alias=True,
|
51
|
+
exclude={
|
52
|
+
},
|
53
|
+
exclude_none=True)
|
54
|
+
return _dict
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_dict(cls, obj: dict) -> PlaylistResponse:
|
58
|
+
"""Create an instance of PlaylistResponse from a dict"""
|
59
|
+
if obj is None:
|
60
|
+
return None
|
61
|
+
|
62
|
+
if not isinstance(obj, dict):
|
63
|
+
return PlaylistResponse.model_validate(obj)
|
64
|
+
|
65
|
+
_obj = PlaylistResponse.model_validate({
|
66
|
+
"name": obj.get("name"),
|
67
|
+
"track_count": obj.get("track_count"),
|
68
|
+
"created_at": obj.get("created_at"),
|
69
|
+
"server_id": obj.get("server_id")
|
70
|
+
})
|
71
|
+
return _obj
|
72
|
+
|
73
|
+
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
from typing import Optional
|
22
|
+
from pydantic import BaseModel, Field, StrictStr, ConfigDict
|
23
|
+
|
24
|
+
class PlexSection(BaseModel):
|
25
|
+
"""
|
26
|
+
PlexSection
|
27
|
+
"""
|
28
|
+
url: StrictStr = Field(...)
|
29
|
+
token: Optional[StrictStr] = None
|
30
|
+
music_library_name: StrictStr = Field(...)
|
31
|
+
__properties = ["url", "token", "music_library_name"]
|
32
|
+
|
33
|
+
model_config = {"populate_by_name": True, "validate_assignment": True}
|
34
|
+
def to_str(self) -> str:
|
35
|
+
"""Returns the string representation of the model using alias"""
|
36
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
37
|
+
|
38
|
+
def to_json(self) -> str:
|
39
|
+
"""Returns the JSON representation of the model using alias"""
|
40
|
+
return json.dumps(self.to_dict())
|
41
|
+
|
42
|
+
@classmethod
|
43
|
+
def from_json(cls, json_str: str) -> PlexSection:
|
44
|
+
"""Create an instance of PlexSection from a JSON string"""
|
45
|
+
return cls.from_dict(json.loads(json_str))
|
46
|
+
|
47
|
+
def to_dict(self):
|
48
|
+
"""Returns the dictionary representation of the model using alias"""
|
49
|
+
_dict = self.model_dump(by_alias=True,
|
50
|
+
exclude={
|
51
|
+
},
|
52
|
+
exclude_none=True)
|
53
|
+
return _dict
|
54
|
+
|
55
|
+
@classmethod
|
56
|
+
def from_dict(cls, obj: dict) -> PlexSection:
|
57
|
+
"""Create an instance of PlexSection from a dict"""
|
58
|
+
if obj is None:
|
59
|
+
return None
|
60
|
+
|
61
|
+
if not isinstance(obj, dict):
|
62
|
+
return PlexSection.model_validate(obj)
|
63
|
+
|
64
|
+
_obj = PlexSection.model_validate({
|
65
|
+
"url": obj.get("url"),
|
66
|
+
"token": obj.get("token"),
|
67
|
+
"music_library_name": obj.get("music_library_name")
|
68
|
+
})
|
69
|
+
return _obj
|
70
|
+
|
71
|
+
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
from typing import Optional
|
22
|
+
from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, validator, ConfigDict
|
23
|
+
|
24
|
+
class ProcessingResponse(BaseModel):
|
25
|
+
"""
|
26
|
+
ProcessingResponse
|
27
|
+
"""
|
28
|
+
status: StrictStr = Field(...)
|
29
|
+
message: Optional[StrictStr] = None
|
30
|
+
task_id: Optional[StrictStr] = None
|
31
|
+
track_id: Optional[StrictStr] = None
|
32
|
+
query: Optional[StrictStr] = None
|
33
|
+
filename: Optional[StrictStr] = None
|
34
|
+
active_workers: Optional[StrictInt] = None
|
35
|
+
tasks_created: Optional[StrictInt] = None
|
36
|
+
confirmation_required: Optional[StrictBool] = None
|
37
|
+
__properties = ["status", "message", "task_id", "track_id", "query", "filename", "active_workers", "tasks_created", "confirmation_required"]
|
38
|
+
|
39
|
+
@validator('status')
|
40
|
+
def status_validate_enum(cls, value):
|
41
|
+
"""Validates the enum"""
|
42
|
+
if value not in ('processing', 'confirmation_required', 'already_running', 'worker_processing_started', 'worker_error', 'no_workers', 'server_started',):
|
43
|
+
raise ValueError("must be one of enum values ('processing', 'confirmation_required', 'already_running', 'worker_processing_started', 'worker_error', 'no_workers', 'server_started')")
|
44
|
+
return value
|
45
|
+
|
46
|
+
model_config = {"populate_by_name": True, "validate_assignment": True}
|
47
|
+
def to_str(self) -> str:
|
48
|
+
"""Returns the string representation of the model using alias"""
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
+
|
51
|
+
def to_json(self) -> str:
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
53
|
+
return json.dumps(self.to_dict())
|
54
|
+
|
55
|
+
@classmethod
|
56
|
+
def from_json(cls, json_str: str) -> ProcessingResponse:
|
57
|
+
"""Create an instance of ProcessingResponse from a JSON string"""
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
59
|
+
|
60
|
+
def to_dict(self):
|
61
|
+
"""Returns the dictionary representation of the model using alias"""
|
62
|
+
_dict = self.model_dump(by_alias=True,
|
63
|
+
exclude={
|
64
|
+
},
|
65
|
+
exclude_none=True)
|
66
|
+
return _dict
|
67
|
+
|
68
|
+
@classmethod
|
69
|
+
def from_dict(cls, obj: dict) -> ProcessingResponse:
|
70
|
+
"""Create an instance of ProcessingResponse from a dict"""
|
71
|
+
if obj is None:
|
72
|
+
return None
|
73
|
+
|
74
|
+
if not isinstance(obj, dict):
|
75
|
+
return ProcessingResponse.model_validate(obj)
|
76
|
+
|
77
|
+
_obj = ProcessingResponse.model_validate({
|
78
|
+
"status": obj.get("status"),
|
79
|
+
"message": obj.get("message"),
|
80
|
+
"task_id": obj.get("task_id"),
|
81
|
+
"track_id": obj.get("track_id"),
|
82
|
+
"query": obj.get("query"),
|
83
|
+
"filename": obj.get("filename"),
|
84
|
+
"active_workers": obj.get("active_workers"),
|
85
|
+
"tasks_created": obj.get("tasks_created"),
|
86
|
+
"confirmation_required": obj.get("confirmation_required")
|
87
|
+
})
|
88
|
+
return _obj
|
89
|
+
|
90
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Mycelium API
|
5
|
+
|
6
|
+
Plex music collection and recommendation system using CLAP embeddings
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
|
21
|
+
from typing import Optional
|
22
|
+
from pydantic import BaseModel, Field, StrictBool, StrictStr, ConfigDict
|
23
|
+
|
24
|
+
class SaveConfigResponse(BaseModel):
|
25
|
+
"""
|
26
|
+
SaveConfigResponse
|
27
|
+
"""
|
28
|
+
message: StrictStr = Field(...)
|
29
|
+
status: StrictStr = Field(...)
|
30
|
+
reloaded: StrictBool = Field(...)
|
31
|
+
reload_error: Optional[StrictStr] = None
|
32
|
+
__properties = ["message", "status", "reloaded", "reload_error"]
|
33
|
+
|
34
|
+
model_config = {"populate_by_name": True, "validate_assignment": True}
|
35
|
+
def to_str(self) -> str:
|
36
|
+
"""Returns the string representation of the model using alias"""
|
37
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
38
|
+
|
39
|
+
def to_json(self) -> str:
|
40
|
+
"""Returns the JSON representation of the model using alias"""
|
41
|
+
return json.dumps(self.to_dict())
|
42
|
+
|
43
|
+
@classmethod
|
44
|
+
def from_json(cls, json_str: str) -> SaveConfigResponse:
|
45
|
+
"""Create an instance of SaveConfigResponse from a JSON string"""
|
46
|
+
return cls.from_dict(json.loads(json_str))
|
47
|
+
|
48
|
+
def to_dict(self):
|
49
|
+
"""Returns the dictionary representation of the model using alias"""
|
50
|
+
_dict = self.model_dump(by_alias=True,
|
51
|
+
exclude={
|
52
|
+
},
|
53
|
+
exclude_none=True)
|
54
|
+
return _dict
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_dict(cls, obj: dict) -> SaveConfigResponse:
|
58
|
+
"""Create an instance of SaveConfigResponse from a dict"""
|
59
|
+
if obj is None:
|
60
|
+
return None
|
61
|
+
|
62
|
+
if not isinstance(obj, dict):
|
63
|
+
return SaveConfigResponse.model_validate(obj)
|
64
|
+
|
65
|
+
_obj = SaveConfigResponse.model_validate({
|
66
|
+
"message": obj.get("message"),
|
67
|
+
"status": obj.get("status"),
|
68
|
+
"reloaded": obj.get("reloaded"),
|
69
|
+
"reload_error": obj.get("reload_error")
|
70
|
+
})
|
71
|
+
return _obj
|
72
|
+
|
73
|
+
|