Move temperature parameter into kwargs for LLM calls
- Applied changes to both OpenAI and Azure OpenAI calls
This commit is contained in:
@@ -200,6 +200,7 @@ def create_app(args):
|
|||||||
kwargs["response_format"] = GPTKeywordExtractionFormat
|
kwargs["response_format"] = GPTKeywordExtractionFormat
|
||||||
if history_messages is None:
|
if history_messages is None:
|
||||||
history_messages = []
|
history_messages = []
|
||||||
|
kwargs["temperature"] = args.temperature
|
||||||
return await openai_complete_if_cache(
|
return await openai_complete_if_cache(
|
||||||
args.llm_model,
|
args.llm_model,
|
||||||
prompt,
|
prompt,
|
||||||
@@ -207,7 +208,6 @@ def create_app(args):
|
|||||||
history_messages=history_messages,
|
history_messages=history_messages,
|
||||||
base_url=args.llm_binding_host,
|
base_url=args.llm_binding_host,
|
||||||
api_key=args.llm_binding_api_key,
|
api_key=args.llm_binding_api_key,
|
||||||
temperature=args.temperature,
|
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -223,6 +223,7 @@ def create_app(args):
|
|||||||
kwargs["response_format"] = GPTKeywordExtractionFormat
|
kwargs["response_format"] = GPTKeywordExtractionFormat
|
||||||
if history_messages is None:
|
if history_messages is None:
|
||||||
history_messages = []
|
history_messages = []
|
||||||
|
kwargs["temperature"] = args.temperature
|
||||||
return await azure_openai_complete_if_cache(
|
return await azure_openai_complete_if_cache(
|
||||||
args.llm_model,
|
args.llm_model,
|
||||||
prompt,
|
prompt,
|
||||||
@@ -231,7 +232,6 @@ def create_app(args):
|
|||||||
base_url=args.llm_binding_host,
|
base_url=args.llm_binding_host,
|
||||||
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
|
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
|
||||||
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview"),
|
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview"),
|
||||||
temperature=args.temperature,
|
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user