julep-ai / julep

A new DSL and server for AI agents and multi-step tasks
https://julep.ai
Apache License 2.0
2.66k stars 911 forks source link

[Bug]: `metadata_filter` Not Supported in SDKs #807

Closed HamadaSalhab closed 2 weeks ago

HamadaSalhab commented 3 weeks ago

📜 Description

Reproduce:

client.users.list(metadata_filter={'filter_key': 'filter_value'})

Error:

TypeError: UsersResource.list() got an unexpected keyword argument 'metadata_filter'

👟 Reproduction steps

No response

👀 Have you spent some time to check if this bug has been raised before?

whiterabbit1983 commented 2 weeks ago

@HamadaSalhab this should be fixed now, could you plz confirm?

HamadaSalhab commented 2 weeks ago

@whiterabbit1983 The error is gone (it's accepting a metadata_filter parameter). However, it's not working correctly. Running the following code is giving an empty list.

client.users.create(name="new_user", metadata={"ppid": "123"})
client.users.list(metadata_filter={"ppid": "123"})

I can confirm it's not an issue from the endpoint itself. Doing the same thing in Tasks with a system tool gives the desired result.

creatorrr commented 2 weeks ago

client.agents.list(metadata_filter={...}) also works correctly image

creatorrr commented 2 weeks ago

Figured out the problem... Because we are parsing the query parameters, there's no way for the parser to know that ?metadata_filter.a=123 means a == 123 (int) or a == "123" (string). It just converted it to int.

image

creatorrr commented 2 weeks ago

This isn't straightforward to fix so closing this for now