MCPcopy Index your code
hub / github.com/PaddlePaddle/FastDeploy / RouterConfig

Class RouterConfig

fastdeploy/config.py:1557–1579  ·  view source on GitHub ↗

Configuration for router Attributes: router: the url of router, such as http://127.0.0.1:8000 api_server_host: the host ip of model server api_server_port: the http port of model server

Source from the content-addressed store, hash-verified

1555
1556
1557class RouterConfig:
1558 """
1559 Configuration for router
1560 Attributes:
1561 router: the url of router, such as http://127.0.0.1:8000
1562 api_server_host: the host ip of model server
1563 api_server_port: the http port of model server
1564 """
1565
1566 def __init__(self, args: dict):
1567 self.router = args["router"]
1568 if self.router is not None and not self.router.startswith(("http://", "https://")):
1569 self.router = f"http://{self.router}"
1570
1571 self.api_server_host = get_host_ip()
1572 self.api_server_port = args["port"]
1573 if args["metrics_port"] is not None:
1574 self.metrics_port = args["metrics_port"]
1575 else:
1576 self.metrics_port = self.api_server_port
1577
1578 def __str__(self):
1579 return json.dumps({key: value for key, value in self.__dict__.items()})
1580
1581
1582class CommitConfig:

Callers 1

create_engine_configMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected