Skip to content

Commit

Permalink
Fix griptape cloud ruleset drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
vachillo committed Oct 25, 2024
1 parent 587f807 commit 88ec885
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def load(self) -> tuple[list[Run], dict[str, Any]]:

runs = [
Run(
id=m["metadata"].pop("run_id"),
id=m["metadata"].pop("run_id", uuid.uuid4().hex),
meta=m["metadata"],
input=BaseArtifact.from_json(m["input"]),
output=BaseArtifact.from_json(m["output"]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def request(*args, **kwargs):
"message_id": f"{thread_id}_message",
"input": '{"type": "TextArtifact", "id": "1234", "value": "Hi There, Hello"}',
"output": '{"type": "TextArtifact", "id": "123", "value": "Hello! How can I assist you today?"}',
"metadata": {"run_id": "1234"},
"metadata": {"run_id": "1234"} if thread_id != "no_meta" else {},
}
]
}
Expand Down Expand Up @@ -118,3 +118,9 @@ def test_load(self, driver):
assert len(runs) == 1
assert runs[0].id == "1234"
assert metadata == {"foo": "bar"}

def test_load_no_message_meta(self, driver):
driver.thread_id = "no_meta"
runs, metadata = driver.load()
assert len(runs) == 1
assert metadata == {"foo": "bar"}

0 comments on commit 88ec885

Please sign in to comment.