File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from fastapi import FastAPI , Query
22from fastapi .responses import PlainTextResponse
33import uvicorn
4- from prompt import Prompt
4+
55from config import Config , parse_args
66from openai_client import LLMClient
77from db import DB
88
99
1010proxy_server = FastAPI ()
1111args = parse_args ()
12- if args .config_file :
13- config = Config .from_toml ("config.toml" )
12+ if args .config :
13+ config = Config .from_toml (args .config )
14+ else :
15+ config = Config .from_args (args )
1416client = LLMClient .from_config (config )
1517db = DB .from_file (config .database_config .db_file )
1618
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ def request_completion(self):
5151 str: The content of the response message from the language model.
5252 Exception: An exception if an error occurs during the API call.
5353 """
54+
5455 try :
5556 completion = self .client .chat .completions .create (
5657 model = self .config .openai_config .model_name ,
You can’t perform that action at this time.
0 commit comments