caikit.runtime.dump_services
Attributes
Functions
|
Utility for rendering the all generated interfaces to proto files |
|
Dump out the openapi.json for the HTTP server |
Attempt to find a file descriptor by name and return None if not found |
|
Recursively add the given file descriptor and all of its dependencies to |
|
|
Convert a given Descriptor type to the corresponding Proto for |
|
Get a dict mapping package names to consolidated DescriptorProto objects |
|
Dump all protobuf interfaces consolidated by package |
Get all enabled grpc service packages |
|
|
Module Contents
- caikit.runtime.dump_services.error
- caikit.runtime.dump_services.dump_grpc_services(output_dir: str, write_modules_file: bool, consolidate: bool = False)[source]
Utility for rendering the all generated interfaces to proto files
- Args:
- output_dir (str): The directory where the generated services should be
placed
- write_modules_file (bool): Whether or not to write out the compatibility
file for supported modules
- consolidate (bool): Whether or not to consolidate the generated protos
by package
- caikit.runtime.dump_services.dump_http_services(output_dir: str)[source]
Dump out the openapi.json for the HTTP server
- caikit.runtime.dump_services._try_find_file_by_name(name: str, pool: google.protobuf.descriptor_pool.DescriptorPool) google.protobuf.descriptor.FileDescriptor | None[source]
Attempt to find a file descriptor by name and return None if not found
- caikit.runtime.dump_services._recursive_safe_add_to_pool(fd_proto: google.protobuf.descriptor_pb2.FileDescriptorProto, fd_protos_to_add: Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto], dpool: google.protobuf.descriptor_pool.DescriptorPool) google.protobuf.descriptor.FileDescriptor[source]
Recursively add the given file descriptor and all of its dependencies to the pool and handle double-add conflicts.
- caikit.runtime.dump_services._descriptor_to_proto(descriptor: google.protobuf.descriptor.Descriptor | google.protobuf.descriptor.EnumDescriptor | google.protobuf.descriptor.ServiceDescriptor) google.protobuf.descriptor_pb2.DescriptorProto | google.protobuf.descriptor_pb2.EnumDescriptorProto | google.protobuf.descriptor_pb2.ServiceDescriptorProto[source]
Convert a given Descriptor type to the corresponding Proto for comparison by content rather than instance id
- caikit.runtime.dump_services._get_proto_file_descriptors(object_descriptors: List[google.protobuf.descriptor.Descriptor | google.protobuf.descriptor.EnumDescriptor | google.protobuf.descriptor.ServiceDescriptor]) Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto][source]
Get a dict mapping package names to consolidated DescriptorProto objects holding all auto-generated messages and enums in the given package.
- caikit.runtime.dump_services._dump_consolidated_protos(fd_protos: Dict[str, google.protobuf.descriptor_pb2.FileDescriptorProto], interfaces_dir: str)[source]
Dump all protobuf interfaces consolidated by package
- caikit.runtime.dump_services._get_grpc_service_packages(write_modules_file: bool = False) List[caikit.runtime.service_factory.ServicePackage][source]
Get all enabled grpc service packages