yangdx
commited on
Commit
·
e1cb4a5
1
Parent(s):
a02a230
Move temperature parameter into kwargs for LLM calls
Browse files- Applied changes to both OpenAI and Azure OpenAI calls
lightrag/api/lightrag_server.py
CHANGED
@@ -200,6 +200,7 @@ def create_app(args):
|
|
200 |
kwargs["response_format"] = GPTKeywordExtractionFormat
|
201 |
if history_messages is None:
|
202 |
history_messages = []
|
|
|
203 |
return await openai_complete_if_cache(
|
204 |
args.llm_model,
|
205 |
prompt,
|
@@ -207,7 +208,6 @@ def create_app(args):
|
|
207 |
history_messages=history_messages,
|
208 |
base_url=args.llm_binding_host,
|
209 |
api_key=args.llm_binding_api_key,
|
210 |
-
temperature=args.temperature,
|
211 |
**kwargs,
|
212 |
)
|
213 |
|
@@ -223,6 +223,7 @@ def create_app(args):
|
|
223 |
kwargs["response_format"] = GPTKeywordExtractionFormat
|
224 |
if history_messages is None:
|
225 |
history_messages = []
|
|
|
226 |
return await azure_openai_complete_if_cache(
|
227 |
args.llm_model,
|
228 |
prompt,
|
@@ -231,7 +232,6 @@ def create_app(args):
|
|
231 |
base_url=args.llm_binding_host,
|
232 |
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
|
233 |
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview"),
|
234 |
-
temperature=args.temperature,
|
235 |
**kwargs,
|
236 |
)
|
237 |
|
|
|
200 |
kwargs["response_format"] = GPTKeywordExtractionFormat
|
201 |
if history_messages is None:
|
202 |
history_messages = []
|
203 |
+
kwargs["temperature"] = args.temperature
|
204 |
return await openai_complete_if_cache(
|
205 |
args.llm_model,
|
206 |
prompt,
|
|
|
208 |
history_messages=history_messages,
|
209 |
base_url=args.llm_binding_host,
|
210 |
api_key=args.llm_binding_api_key,
|
|
|
211 |
**kwargs,
|
212 |
)
|
213 |
|
|
|
223 |
kwargs["response_format"] = GPTKeywordExtractionFormat
|
224 |
if history_messages is None:
|
225 |
history_messages = []
|
226 |
+
kwargs["temperature"] = args.temperature
|
227 |
return await azure_openai_complete_if_cache(
|
228 |
args.llm_model,
|
229 |
prompt,
|
|
|
232 |
base_url=args.llm_binding_host,
|
233 |
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
|
234 |
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview"),
|
|
|
235 |
**kwargs,
|
236 |
)
|
237 |
|