commit
c9899c5d65
|
|
@ -23,4 +23,6 @@ COPY agents/ agents/
|
|||
COPY pyserver/ pyserver/
|
||||
COPY server.py .
|
||||
|
||||
ENV CONTAINERIZED=1
|
||||
|
||||
CMD ["python", "server.py"]
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
from flask import Flask, jsonify, request
|
||||
from agents import Agent
|
||||
from typing import Any
|
||||
|
|
@ -24,6 +26,7 @@ class PyServer:
|
|||
:param import_name: Flask application import name
|
||||
:type import_name: str
|
||||
"""
|
||||
self.containerized : bool = bool(int(os.environ.get("CONTAINERIZED", "0")))
|
||||
self.agent = agent
|
||||
self.app = Flask(import_name)
|
||||
|
||||
|
|
@ -49,6 +52,7 @@ class PyServer:
|
|||
|
||||
d = { **self.agent.profile, **d }
|
||||
|
||||
d["me.noordstar.peanuts.containerized"] = self.containerized
|
||||
d["games"] = {}
|
||||
for game, (profile, _) in self.agent.registered_games.items():
|
||||
d["games"][game] = profile
|
||||
|
|
|
|||
Loading…
Reference in New Issue