pass schema as dict

This commit is contained in:
Gokul Mohanarangan
2023-08-17 21:26:20 +05:30
parent 9332870e83
commit 2d686da15c
4 changed files with 8 additions and 11 deletions

View File

@@ -1,5 +1,3 @@
import json
import httpx
from reflector.llm.base import LLM
from reflector.settings import settings
@@ -28,7 +26,7 @@ class ModalLLM(LLM):
async def _generate(self, prompt: str, schema: dict | None, **kwargs):
json_payload = {"prompt": prompt}
if schema:
json_payload["schema"] = json.dumps(schema)
json_payload["schema"] = schema
async with httpx.AsyncClient() as client:
response = await retry(client.post)(
self.llm_url,