feat(rnd): Simplify AI block

This commit is contained in:
Zamil Majdy
2024-07-10 17:02:19 +07:00
parent eb097eefab
commit c24cfc3718

View File

@@ -52,7 +52,7 @@ class LlmCallBlock(Block):
response = openai.chat.completions.create(
model=model,
messages=prompt, # type: ignore
response_format={"type": "json_object"}
response_format={"type": "json_object"} if json else {},
)
return response.choices[0].message.content or ""