julep-ai / julep

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

[Bug]: IndexError in mmr logic #908

Open creatorrr opened 3 days ago

creatorrr commented 3 days ago

๐Ÿ“œ Description

\"<@beartype(agents_api.activities.execute_system.execute_system) at 0x7d41e8759ee0>\", line 52, in execute_system\n\n  File \"/app/agents_api/activities/execute_system.py\", line 88, in execute_system\n    return await handler(search_params=search_params, **arguments)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n  File \"/app/agents_api/routers/docs/search_docs.py\", line 162, in search_agent_docs\n    indices = maximal_marginal_relevance(\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n  File \"/app/agents_api/models/docs/mmr.py\", line 96, in maximal_marginal_relevance\n    similarity_to_selected = _cosine_similarity(embedding_list, selected)\n                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n  File \"/app/agents_api/models/docs/mmr.py\", line 37, in _cosine_similarity\n    if x.shape[1] != y.shape[1]:\n                     ~~~~~~~^^^\n",
              "applicationFailureInfo": {
                "type": "IndexError"
              }

๐Ÿ‘Ÿ Reproduction steps

No response

๐Ÿ‘€ Have you searched previous issues to see if this has been raised before?