-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use latest PMAT (mostly caching stuff) (#18)
- Loading branch information
Showing
11 changed files
with
1,320 additions
and
1,523 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from prediction_market_agent_tooling.gtypes import HexAddress | ||
from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC | ||
from prediction_market_agent_tooling.tools.tavily.tavily_models import ( | ||
TavilyResponse, | ||
TavilyResult, | ||
) | ||
from pydantic import BaseModel | ||
|
||
|
||
class MarketInsightResult(BaseModel): | ||
url: str | ||
title: str | ||
|
||
@staticmethod | ||
def from_tavily_result(tavily_result: TavilyResult) -> "MarketInsightResult": | ||
return MarketInsightResult(url=tavily_result.url, title=tavily_result.title) | ||
|
||
|
||
class MarketInsightsResponse(BaseModel): | ||
market_id: HexAddress | ||
created_at: DatetimeUTC | ||
summary: str | None | ||
results: list[MarketInsightResult] | ||
|
||
@staticmethod | ||
def from_tavily_response( | ||
market_id: HexAddress, | ||
created_at: DatetimeUTC, | ||
summary: str | None, | ||
tavily_response: TavilyResponse, | ||
) -> "MarketInsightsResponse": | ||
return MarketInsightsResponse( | ||
market_id=market_id, | ||
created_at=created_at, | ||
summary=summary, | ||
results=[ | ||
MarketInsightResult.from_tavily_result(result) | ||
for result in tavily_response.results | ||
], | ||
) |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from prediction_market_agent_tooling.markets.omen.omen_subgraph_handler import ( | ||
HexAddress, | ||
) | ||
from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC | ||
from pydantic import BaseModel | ||
|
||
|
||
class MarketInvalidResponse(BaseModel): | ||
market_id: HexAddress | ||
created_at: DatetimeUTC | ||
invalid: bool |
Oops, something went wrong.