This repository has been archived by the owner on May 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatalog.proto
154 lines (126 loc) · 3.77 KB
/
datalog.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Copyright 2021 AI Redefined Inc. <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package cogmentAPI;
import "cogment/api/common.proto";
import "cogment/api/environment.proto";
import "google/protobuf/any.proto";
service DatalogSP {
// Expected headers:
// - trial-id
// - user-id
rpc RunTrialDatalog(stream RunTrialDatalogInput) returns (stream RunTrialDatalogOutput) {}
// Expected headers: None
rpc Version(VersionRequest) returns (VersionInfo) {}
}
// Received by datalog service on rpc call
message RunTrialDatalogInput {
oneof msg {
TrialParams trial_params = 1;
DatalogSample sample = 2;
}
}
// Sent by datalog service on rpc call
message RunTrialDatalogOutput {}
message SampleInfo {
uint64 tick_id = 1;
fixed64 timestamp = 2;
TrialState state = 3;
// Events that happened during this sample's tick. E.g. Terminate call, agent disconnect, etc
repeated string special_events = 4;
}
message DatalogSample {
SampleInfo info = 1; // Sample info
ObservationSet observations = 2; // Incoming observation from environment
repeated Action actions = 3; // Incoming actions from actors
repeated Reward rewards = 4; // Incoming rewards from environment and actors
repeated Message messages = 5; // Incoming messages from environment and actors
}
// ************************************************************************************************
// API 1.0 version of the log data.
// This is provided to facilitate the extraction/deserialization of older (1.0) log data.
// ************************************************************************************************
message TrialConfig_v1 {
bytes content = 1;
}
message ActorConfig_v1 {
bytes content = 1;
}
message EnvironmentConfig_v1 {
bytes content = 1;
}
message EnvironmentParams_v1 {
string endpoint = 1;
EnvironmentConfig_v1 config = 2;
string implementation = 3;
}
message ActorParams_v1 {
string name = 1;
string actor_class = 2;
string endpoint = 3;
string implementation = 4;
ActorConfig_v1 config = 5;
}
message TrialParams_v1 {
TrialConfig_v1 trial_config = 1;
EnvironmentParams_v1 environment = 2;
repeated ActorParams_v1 actors = 3;
uint32 max_steps = 4;
uint32 max_inactivity = 5;
}
message ObservationData_v1 {
bytes content = 1;
bool snapshot = 2;
}
message ObservationSet_v1 {
sint64 tick_id = 1;
fixed64 timestamp = 2;
repeated ObservationData_v1 observations = 3;
repeated int32 actors_map = 4;
}
message Action_v1 {
bytes content = 1;
sint64 tick_id = 2;
}
message RewardSource_v1 {
string sender_name = 1;
float value = 2;
float confidence = 3;
google.protobuf.Any user_data = 4;
}
message Reward_v1 {
string receiver_name = 1;
sint64 tick_id = 2;
float value = 3;
repeated RewardSource_v1 sources = 4;
}
message Message_v1 {
sint64 tick_id = 1;
string sender_name = 2;
string receiver_name = 3;
google.protobuf.Any payload = 4;
}
message DatalogSample_v1 {
string user_id = 1;
ObservationSet_v1 observations = 2;
repeated Action_v1 actions = 3;
repeated Reward_v1 rewards = 4;
repeated Message_v1 messages = 5;
TrialData_v1 trial_data = 6;
}
message TrialData_v1 {
uint64 tick_id = 1;
fixed64 timestamp = 2;
TrialState state = 3;
}