fix error and tested
This commit is contained in:
@@ -70,6 +70,11 @@ async def openai_complete_if_cache(
|
|||||||
if if_cache_return is not None:
|
if if_cache_return is not None:
|
||||||
return if_cache_return["return"]
|
return if_cache_return["return"]
|
||||||
|
|
||||||
|
if "response_format" in kwargs:
|
||||||
|
response = await openai_async_client.beta.chat.completions.parse(
|
||||||
|
model=model, messages=messages, **kwargs
|
||||||
|
)
|
||||||
|
else:
|
||||||
response = await openai_async_client.chat.completions.create(
|
response = await openai_async_client.chat.completions.create(
|
||||||
model=model, messages=messages, **kwargs
|
model=model, messages=messages, **kwargs
|
||||||
)
|
)
|
||||||
@@ -545,7 +550,7 @@ async def ollama_model_complete(
|
|||||||
prompt, system_prompt=None, history_messages=[], keyword_extraction=False, **kwargs
|
prompt, system_prompt=None, history_messages=[], keyword_extraction=False, **kwargs
|
||||||
) -> str:
|
) -> str:
|
||||||
if keyword_extraction:
|
if keyword_extraction:
|
||||||
kwargs["response_format"] = "json"
|
kwargs["format"] = "json"
|
||||||
model_name = kwargs["hashing_kv"].global_config["llm_model_name"]
|
model_name = kwargs["hashing_kv"].global_config["llm_model_name"]
|
||||||
return await ollama_model_if_cache(
|
return await ollama_model_if_cache(
|
||||||
model_name,
|
model_name,
|
||||||
|
Reference in New Issue
Block a user