orka.memory.schema_manager module

Schema management for OrKa memory entries. Provides Avro and Protobuf serialization with Schema Registry integration.

class orka.memory.schema_manager.SchemaFormat(value)[source]

Bases: Enum

AVRO = 'avro'
PROTOBUF = 'protobuf'
JSON = 'json'
class orka.memory.schema_manager.SchemaConfig(registry_url: str, format: orka.memory.schema_manager.SchemaFormat = <SchemaFormat.AVRO: 'avro'>, schemas_dir: str = 'orka/schemas', subject_name_strategy: str = 'TopicNameStrategy')[source]

Bases: object

registry_url: str
format: SchemaFormat = 'avro'
schemas_dir: str = 'orka/schemas'
subject_name_strategy: str = 'TopicNameStrategy'
class orka.memory.schema_manager.SchemaManager(config: SchemaConfig)[source]

Bases: object

Manages schema serialization/deserialization for OrKa memory entries.

get_serializer(topic: str, schema_name: str = 'memory_entry') Any[source]

Get serializer for a topic.

get_deserializer(topic: str, schema_name: str = 'memory_entry') Any[source]

Get deserializer for a topic.

register_schema(subject: str, schema_name: str) int[source]

Register a schema with the Schema Registry.

orka.memory.schema_manager.create_schema_manager(registry_url: str | None = None, format: SchemaFormat = SchemaFormat.AVRO) SchemaManager[source]

Create a schema manager with configuration from environment or parameters.

orka.memory.schema_manager.migrate_from_json()[source]

Example of how to migrate existing JSON-based Kafka messages to schema-based.