Agent should work
This commit is contained in:
42
ums/example/__main__.py
Normal file
42
ums/example/__main__.py
Normal file
@ -0,0 +1,42 @@
|
||||
# Agenten Plattform
|
||||
#
|
||||
# (c) 2024 Magnus Bender
|
||||
# Institute of Humanities-Centered Artificial Intelligence (CHAI)
|
||||
# Universitaet Hamburg
|
||||
# https://www.chai.uni-hamburg.de/~bender
|
||||
#
|
||||
# source code released under the terms of GNU Public License Version 3
|
||||
# https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
## Example: Sending messages to management via python
|
||||
|
||||
from ums.utils import AgentMessage, RiddleData, RiddleDataType, RiddleSolution, ManagementRequest
|
||||
|
||||
ex = AgentMessage(
|
||||
id="ex5",
|
||||
riddle={
|
||||
"context":"Example 1",
|
||||
"question":"Get the name of the person."
|
||||
},
|
||||
data=[
|
||||
RiddleData(
|
||||
type=RiddleDataType.TEXT,
|
||||
file_plain="./cv.txt"
|
||||
)
|
||||
]
|
||||
)
|
||||
ex.status.extract.required = False
|
||||
|
||||
ex.solution = RiddleSolution(
|
||||
solution="Otto",
|
||||
explanation="Written in line 6 after 'Name:'"
|
||||
)
|
||||
|
||||
mr = ManagementRequest("localhost")
|
||||
|
||||
print(mr.send_message(ex))
|
||||
print(mr.get_status(20))
|
||||
|
Reference in New Issue
Block a user