mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-18 17:51:02 +02:00
Add missing schema
This commit is contained in:
parent
f3b1b035de
commit
cbc8e148c1
1 changed files with 44 additions and 0 deletions
44
trustgraph-base/trustgraph/schema/config.py
Normal file
44
trustgraph-base/trustgraph/schema/config.py
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
|
||||||
|
from pulsar.schema import Record, Bytes, String, Boolean, Array, Map, Integer
|
||||||
|
|
||||||
|
from . topic import topic
|
||||||
|
from . types import Error, RowSchema
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
# Prompt services, abstract the prompt generation
|
||||||
|
|
||||||
|
class ConfigItem(Record):
|
||||||
|
key = String()
|
||||||
|
value = String()
|
||||||
|
|
||||||
|
class ConfigItems(Record):
|
||||||
|
items = Map(String())
|
||||||
|
|
||||||
|
class ConfigRequest(Record):
|
||||||
|
type = String()
|
||||||
|
key = String()
|
||||||
|
operation = String() # get, list, getall, delete, put, dump
|
||||||
|
|
||||||
|
class ConfigResponse(Record):
|
||||||
|
value = String()
|
||||||
|
directory = Array(String())
|
||||||
|
values = Map(String())
|
||||||
|
config = Map(Map(String()))
|
||||||
|
error = Error()
|
||||||
|
|
||||||
|
class ConfigPush(Record):
|
||||||
|
config = Map(ConfigItems())
|
||||||
|
|
||||||
|
config_request_queue = topic(
|
||||||
|
'prompt', kind='non-persistent', namespace='request'
|
||||||
|
)
|
||||||
|
config_response_queue = topic(
|
||||||
|
'prompt', kind='non-persistent', namespace='response'
|
||||||
|
)
|
||||||
|
config_push_queue = topic(
|
||||||
|
'prompt', kind='non-persistent', namespace='config'b
|
||||||
|
)
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue