Skip to content

Commit 071125a

Browse files
committed
attach request_id to be able to track each request
1 parent 7ef52a1 commit 071125a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

llms/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,9 @@ async def g_chat_completion(chat, context=None):
16511651
if context is None:
16521652
context = {"chat": chat, "tools": "all"}
16531653

1654+
if "request_id" not in context:
1655+
context["request_id"] = str(int(time.time() * 1000))
1656+
16541657
# get first provider that has the model
16551658
candidate_providers = [name for name, provider in g_handlers.items() if provider.provider_model(model)]
16561659
if len(candidate_providers) == 0:
@@ -2986,6 +2989,9 @@ def add_index_header(self, html: str):
29862989
def add_index_footer(self, html: str):
29872990
self.app.index_footers.append(html)
29882991

2992+
def get_home_path(self, name: str = "") -> str:
2993+
return home_llms_path(name)
2994+
29892995
def get_config(self) -> Optional[Dict[str, Any]]:
29902996
return g_config
29912997

0 commit comments

Comments
 (0)