Skip to content

Commit

Permalink
fix(backend): auto eval for new chat variants
Browse files Browse the repository at this point in the history
  • Loading branch information
ardaerzin committed Feb 5, 2025
1 parent 9aecdb5 commit 33eb933
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions agenta-backend/agenta_backend/services/llm_apps_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ async def make_payload(
# ---
payload = {}
inputs = {}
messages = []
# ---

for param in openapi_parameters:
Expand Down Expand Up @@ -184,10 +185,13 @@ async def make_payload(
if "ag_config" in parameters:
input_keys = helpers.find_key_occurrences(parameters, "input_keys") or []
inputs = {key: datapoint.get(key, None) for key in input_keys}

if inputs:
messages = json.loads(datapoint.get("messages", '[]'))
payload["messages"] = messages
payload["inputs"] = inputs

elif inputs:
# append inputs for old services only if "inputs" exist
payload["inputs"] = inputs

return payload


Expand Down Expand Up @@ -420,6 +424,7 @@ async def batch_invoke(
async def run_batch(start_idx: int):
tasks = []
print(f"Preparing {start_idx} batch...")

end_idx = min(start_idx + batch_size, len(testset_data))
for index in range(start_idx, end_idx):
task = asyncio.ensure_future(
Expand Down

0 comments on commit 33eb933

Please sign in to comment.