Fix variable type imported from environment variable

This commit is contained in:
hibobmaster 2023-12-12 16:31:02 +08:00
parent 768b8d1047
commit c67a25c575
Signed by: bobmaster
SSH key fingerprint: SHA256:5ZYgd8fg+PcNZNy4SzcSKu5JtqZyBF8kUhY7/k2viDk

View file

@ -65,17 +65,17 @@ async def main():
openai_api_key=os.environ.get("OPENAI_API_KEY"), openai_api_key=os.environ.get("OPENAI_API_KEY"),
gpt_api_endpoint=os.environ.get("GPT_API_ENDPOINT"), gpt_api_endpoint=os.environ.get("GPT_API_ENDPOINT"),
gpt_model=os.environ.get("GPT_MODEL"), gpt_model=os.environ.get("GPT_MODEL"),
max_tokens=os.environ.get("MAX_TOKENS"), max_tokens=int(os.environ.get("MAX_TOKENS", 4000)),
top_p=os.environ.get("TOP_P"), top_p=float(os.environ.get("TOP_P", 1.0)),
presence_penalty=os.environ.get("PRESENCE_PENALTY"), presence_penalty=float(os.environ.get("PRESENCE_PENALTY", 0.0)),
frequency_penalty=os.environ.get("FREQUENCY_PENALTY"), frequency_penalty=float(os.environ.get("FREQUENCY_PENALTY", 0.0)),
reply_count=os.environ.get("REPLY_COUNT"), reply_count=int(os.environ.get("REPLY_COUNT", 1)),
system_prompt=os.environ.get("SYSTEM_PROMPT"), system_prompt=os.environ.get("SYSTEM_PROMPT"),
temperature=os.environ.get("TEMPERATURE"), temperature=float(os.environ.get("TEMPERATURE", 0.8)),
lc_admin=os.environ.get("LC_ADMIN"), lc_admin=os.environ.get("LC_ADMIN"),
image_generation_endpoint=os.environ.get("IMAGE_GENERATION_ENDPOINT"), image_generation_endpoint=os.environ.get("IMAGE_GENERATION_ENDPOINT"),
image_generation_backend=os.environ.get("IMAGE_GENERATION_BACKEND"), image_generation_backend=os.environ.get("IMAGE_GENERATION_BACKEND"),
timeout=os.environ.get("TIMEOUT"), timeout=float(os.environ.get("TIMEOUT", 120.0)),
) )
if ( if (
os.environ.get("IMPORT_KEYS_PATH") os.environ.get("IMPORT_KEYS_PATH")