-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
11 deletions.
There are no files selected for viewing
7 changes: 1 addition & 6 deletions
7
workers/fund_public_goods/lib/strategy/utils/fetch_matching_projects.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
from fund_public_goods.db.entities import Projects | ||
from fund_public_goods.db.tables.projects import get_projects_by_ids | ||
from fund_public_goods.lib.strategy.models.answer import Answer | ||
from fund_public_goods.lib.strategy.utils.get_top_matching_projects import get_top_matching_projects | ||
|
||
|
||
def fetch_matching_projects(prompt: str) -> list[tuple[Projects, list[Answer]]]: | ||
matching_projects = get_top_matching_projects(prompt)[:10] | ||
matched_ids = [p.id for p in matching_projects] | ||
|
||
matching_projects_with_answers = get_projects_by_ids(matched_ids) | ||
|
||
return matching_projects_with_answers | ||
return matching_projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters