refactor(api): update for CE protobuf refactoring and Python 3.13 support #290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because
CatalogtoKnowledgeBaseand restructuring the artifact service APIsThis commit
Refactors ArtifactClient (
instill/clients/artifact.py):catalogmethods toknowledge_basemethodsartifact_pb2→file_pb2,knowledge_base_pb2)list_knowledge_base_runs(),get_chunk()process_catalog_files(),question_answering(),get_file_catalog()search_chunks()with new parameters:chunk_type,file_media_type,file_ids,tagsUpdates MgmtClient (
instill/clients/mgmt.py):get_remaining_credit(),list_credit_consumption_chart_records()get_authenticated_subscription(),get_organization_subscription()Fixes file processing utility (
instill/utils/process_file.py):artifact_pb2tofile_pb2for File message"FILE_TYPE_TEXT") to protobuf enum constants (file_interface.File.TYPE_TEXT)nametofilenamein File constructionget_file_type()Updates tests (
instill/tests/test_utils.py):file_interfaceimport for protobuf enumsresult.nametoresult.filenameTYPE_CSV)Upgrades dependencies for Python 3.13 support (
pyproject.toml):>=3.9,<3.13→>=3.9,<3.14grpcio:^1.59.0→^1.68.0(Python 3.13 support)grpcio-tools:1.62.0→^1.68.0(Python 3.13 build support)protobuf:4.25.8→^5.28.0(required by grpcio 1.68+)types-protobuf:^4.24.0.1→^5.28.0numpy:^1.21.0→>=1.26,<1.28(Python 3.13 support while avoiding scipy/cupy conflicts)pillow:^10.1.0→^11.0.0pyinstaller:6.0.0→^6.16.0google-api-core:^2.11.1→{version = "^2.22.0", extras = ["grpc"]}ray:2.47.0→{version = "^2.47.0", extras = ["default"]}MacFSEvents = {version = "*", platform = "darwin", python = "<3.13"}sniffer = {version = "*", python = "<3.13"}opentelemetry-proto = "^1.29.0"opentelemetry-exporter-otlp = "^1.29.0"opentelemetry-exporter-otlp-proto-common = "^1.29.0"opentelemetry-exporter-otlp-proto-grpc = "^1.29.0"opentelemetry-exporter-otlp-proto-http = "^1.29.0"Resolves all dependency conflicts:
Testing
Breaking Changes
ArtifactClientchanged from*_catalog*to*_knowledge_base*process_catalog_files(),question_answering(),get_file_catalog()MgmtClient:get_remaining_credit(),list_credit_consumption_chart_records(),get_authenticated_subscription(),get_organization_subscription()process_file()utility now returns protobuf enum values instead of strings for file types