Serialize tool calls for Arch FC (#131)

* Serialize tool calls

* fix int tests
This commit is contained in:
Adil Hafeez 2024-10-07 00:03:25 -07:00 committed by GitHub
parent b43f687b85
commit 96686dc606
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 166 additions and 57 deletions

View file

@ -69,7 +69,8 @@ def process_state(arch_state, history: list[Message]):
if hist.role == 'user':
sha_history.append(hist.content)
sha256_hash = hashlib.sha256()
sha256_hash.update(json.dumps(sha_history).encode())
joined_key_str = ('#.#').join(sha_history)
sha256_hash.update(joined_key_str.encode())
sha_key = sha256_hash.hexdigest()
print(f"sha_key: {sha_key}")
if sha_key in state_map: