Skip to content

Commit

Permalink
use Run default
Browse files Browse the repository at this point in the history
  • Loading branch information
vachillo committed Oct 25, 2024
1 parent f059a17 commit 3c3ea7c
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,18 @@ def load(self) -> tuple[list[Run], dict[str, Any]]:
# retrieve the Thread to get the metadata
thread_response = self._call_api("get", f"/threads/{thread_id}").json()

runs = [
Run(
id=m["metadata"].pop("run_id", uuid.uuid4().hex),
runs = []
for m in messages_response.get("messages", []):
run_id = m["metadata"].pop("run_id", None)
run = Run(
meta=m["metadata"],
input=BaseArtifact.from_json(m["input"]),
output=BaseArtifact.from_json(m["output"]),
)
for m in messages_response.get("messages", [])
]
if run_id is not None:
run.id = run_id
runs.append(run)

return runs, thread_response.get("metadata", {})

def _get_url(self, path: str) -> str:
Expand Down

0 comments on commit 3c3ea7c

Please sign in to comment.