Skip to content

Commit

Permalink
Fix embed instruction in embed endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
HamadaSalhab committed Oct 22, 2024
1 parent 4290875 commit b68ab1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agents-api/agents_api/routers/docs/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ async def embed(
text_to_embed: list[str] = (
[text_to_embed] if isinstance(text_to_embed, str) else text_to_embed
)

vectors = await litellm.aembedding(inputs=[data.embed_instruction] + text_to_embed)
vectors = await litellm.aembedding(
inputs=[data.embed_instruction + text for text in text_to_embed]
)

return EmbedQueryResponse(vectors=vectors)

0 comments on commit b68ab1d

Please sign in to comment.