Files
copilotkit__copilotkit/sdk-python/copilotkit/utils.py
2025-03-28 18:59:39 +01:00

8 lines
203 B
Python

def filter_by_schema_keys(obj, schema):
try:
return {
k: v for k, v in obj.items()
if k in schema or k == "messages"
}
except Exception:
return obj