Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for the newest PMAT #8

Merged
merged 4 commits into from
Sep 5, 2024
Merged

Refactor for the newest PMAT #8

merged 4 commits into from
Sep 5, 2024

Conversation

kongzii
Copy link
Collaborator

@kongzii kongzii commented Sep 5, 2024

No description provided.

@@ -35,28 +37,14 @@ def market_insights(market_id: HexAddress) -> MarketInsightsResponse:
status_code=404, detail=f"Market with id `{market_id}` not found."
)
try:
insights = tavily_insights(market.question_title)
tavily_response = tavily_search(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use tavily search from PMAT instead of re-implementing it in this repo

)
except ValueError as e:
logger.error(
f"Error deserializing MarketInsightsResponse from cache for {market_id=} and {item=}: {e}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could happen that Pydantic model and serialized results in database became out of sync. In that case, log error but pretend that it simply wasn't in the cache, to keep the API functional.

@kongzii kongzii merged commit aff9952 into main Sep 5, 2024
6 checks passed
@kongzii kongzii deleted the peter/updatepmat branch September 5, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants