Skip to content

Commit

Permalink
Allow customizing server port
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas committed Jul 19, 2023
1 parent 84b166c commit 2a64901
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions agent/python/agent_protocol/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from .dependencies import *
from .models import Step, Task, TaskRequestBody

config = Config()
config.bind = ["localhost:8000"] # As an example configuration setting


from .server import app
from .models import (
Expand Down Expand Up @@ -156,5 +153,7 @@ def handle_task(handler: Callable[[TaskInput | None], Awaitable[StepHandler]]):
return Agent

@staticmethod
def start():
def start(port: int = 8000):
config = Config()
config.bind = [f"localhost:{port}"] # As an example configuration setting
trio.run(serve, app, config)

0 comments on commit 2a64901

Please sign in to comment.