Find answers from the community

Home
Members
juanfe190
j
juanfe190
Offline, last seen 3 months ago
Joined September 25, 2024
Hey! Since llama-index 0.10.29, there seems to be a change in how the condition_fn works. We had this code:
Plain Text
# If there are players found, search for them in the vector store
# If there are teams found, search for them in the vector store
p.add_link("get_players", "player_vector", condition_fn=lambda x: len(x) > 0) 
p.add_link("get_teams", "teams_vector", condition_fn=lambda x: len(x) > 0)

# Generate a context object that contains the player and team data in a json format
# This is so that the context can be passed to the text_to_sql component with player and team ids etc
p.add_link("player_vector", "generate_prompt", dest_key="data")
p.add_link("teams_vector", "generate_prompt", dest_key="data")
p.add_link("input", "generate_prompt", dest_key="input")


Both player_vector and teams_vector are connecting to generate_prompt and it was optional to either of them to extract data, and it was working fine. But now, if any of those two condition_fn returns false, the pipeline does not continue to generate_prompt and stops there. Is that expected or was it a bug introduced in 0.10.29 ?
10 comments
L
j