chore: Enrich seeded data to give a pricing direction to the agents

This commit is contained in:
paulpaliychuk 2024-08-30 16:20:44 -04:00
parent f7642f6e6e
commit 25adac0b1b
3 changed files with 59 additions and 51 deletions

View File

@ -3,204 +3,204 @@
"team_name": "Boston Celtics",
"player_id": 1628369,
"player_name": "Jayson Tatum",
"last_transfer_price": 2250000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Boston Celtics",
"player_id": 201950,
"player_name": "Jrue Holiday",
"last_transfer_price": 3000000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1627759,
"player_name": "Jaylen Brown",
"last_transfer_price": 2250000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Boston Celtics",
"player_id": 204001,
"player_name": "Kristaps Porzingis",
"last_transfer_price": 2000000
"last_transfer_price": "$2,000,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1628401,
"player_name": "Derrick White",
"last_transfer_price": 2750000
"last_transfer_price": "$2,250,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1630202,
"player_name": "Payton Pritchard",
"last_transfer_price": 2500000
"last_transfer_price": "$2,000,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1629052,
"player_name": "Oshae Brissett",
"last_transfer_price": 2000000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1641809,
"player_name": "Drew Peterson",
"last_transfer_price": 2500000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1631120,
"player_name": "JD Davison",
"last_transfer_price": 3000000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1630214,
"player_name": "Xavier Tillman",
"last_transfer_price": 2250000
"last_transfer_price": "$2,250,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1641775,
"player_name": "Jordan Walsh",
"last_transfer_price": 2000000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1630573,
"player_name": "Sam Hauser",
"last_transfer_price": 2000000
"last_transfer_price": "$2,000,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1628436,
"player_name": "Luke Kornet",
"last_transfer_price": 2250000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Boston Celtics",
"player_id": 201143,
"player_name": "Al Horford",
"last_transfer_price": 2500000
"last_transfer_price": "$2,000,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1630531,
"player_name": "Jaden Springer",
"last_transfer_price": 2250000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1629004,
"player_name": "Svi Mykhailiuk",
"last_transfer_price": 2250000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Boston Celtics",
"player_id": 1629674,
"player_name": "Neemias Queta",
"last_transfer_price": 2500000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1642013,
"player_name": "Malik Williams",
"last_transfer_price": 2500000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1631241,
"player_name": "Javon Freeman-Liberty",
"last_transfer_price": 2500000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1641711,
"player_name": "Gradey Dick",
"last_transfer_price": 2750000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1629667,
"player_name": "Jalen McDaniels",
"last_transfer_price": 2000000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1630618,
"player_name": "DJ Carton",
"last_transfer_price": 2250000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1630567,
"player_name": "Scottie Barnes",
"last_transfer_price": 3000000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1630193,
"player_name": "Immanuel Quickley",
"last_transfer_price": 2750000
"last_transfer_price": "$2,250,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1629628,
"player_name": "RJ Barrett",
"last_transfer_price": 2000000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1628971,
"player_name": "Bruce Brown",
"last_transfer_price": 2000000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1629670,
"player_name": "Jordan Nwora",
"last_transfer_price": 2000000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1631338,
"player_name": "Mouhamadou Gueye",
"last_transfer_price": 2750000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 202066,
"player_name": "Garrett Temple",
"last_transfer_price": 2250000
"last_transfer_price": "$2,500,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1627751,
"player_name": "Jakob Poeltl",
"last_transfer_price": 2750000
"last_transfer_price": "$2,250,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1628449,
"player_name": "Chris Boucher",
"last_transfer_price": 2000000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1630534,
"player_name": "Ochai Agbaji",
"last_transfer_price": 2500000
"last_transfer_price": "$3,000,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 1629018,
"player_name": "Gary Trent Jr.",
"last_transfer_price": 2000000
"last_transfer_price": "$2,750,000"
},
{
"team_name": "Toronto Raptors",
"player_id": 203482,
"player_name": "Kelly Olynyk",
"last_transfer_price": 2000000
"last_transfer_price": "$2,000,000"
}
]

View File

@ -94,7 +94,7 @@ def fetch_current_roster():
'team_name': name,
'player_id': player_dict['PLAYER_ID'],
'player_name': player_dict['PLAYER'],
'last_transfer_price': random_number_from_list,
'last_transfer_price': f'${random_number_from_list:,}',
# 'player_number': player_dict['NUM'],
# 'player_position': player_dict['POSITION'],
# 'player_school': player_dict['SCHOOL'],
@ -128,19 +128,25 @@ async def main():
players_grouped_by_team[team_name] = []
players_grouped_by_team[team_name].append(player)
for _, players in players_grouped_by_team.items():
episodes: list[RawEpisode] = [
RawEpisode(
name=f'Player {player["player_id"]}',
content=str(player),
source_description='NBA current roster',
source=EpisodeType.json,
reference_time=datetime.now(),
)
for player in players
]
episodes: list[RawEpisode] = [
RawEpisode(
name=f'Player {player["player_id"]}',
content=str(
{
'team_name': player['team_name'],
'player_name': player['player_name'],
'last_transfer_price': player['last_transfer_price']
+ '<instruction>Make sure to extract the this as a node with the name of the price. Make sure to extract the edge with the name of TRANSFER_PRICE</instruction>',
}
),
source_description='NBA current roster',
source=EpisodeType.json,
reference_time=datetime.now(),
)
for player in current_roster_from_file
]
await client.add_episode_bulk(episodes)
await client.add_episode_bulk(episodes)
if __name__ == '__main__':

View File

@ -248,12 +248,14 @@ Current event: {event}
Your task is to decide on an action based on the event.
Use the available tools to gather information, but focus on making a decision quickly.
If you think a player transfer would benefit your team, propose one following the guidelines below. Make sure to get familiar with the entire transfer history of a given player
If you think a player transfer would benefit your team, propose one following the guidelines below.
Make sure to get familiar with the entire transfer history of a given player.
If the player has a transfer history, make sure to use the existing pricing history to make a perfect offer. Make sure that the offer is fair, not too expensive, but still compelling enough to make the transfer happen.
Ensure that you use the current budget info and the current state of your team (use an appropriate tool to get the current state of your team) to make the best decision.
Current budget: ${budget}
Valid teams for transfers: {valid_teams}
Do not propose transfers you cannot afford.
Do not propose transfers you cannot afford. (you cant go into debt!)
IMPORTANT: After gathering information, you MUST make a decision. Your options are:
1. Propose a transfer
Note: if you are proposing a transfer make sure to output JSON in the following format:
@ -263,7 +265,7 @@ IMPORTANT: After gathering information, you MUST make a decision. Your options a
"from_team": "team_name",
"player_name": "player_name",
"proposed_price": price,
"reason": "reason for the proposed transfer"
"reason": "reason for the proposed transfer. Make sure to include pricing considerations in the reason"
}}
}}
IMPORTANT: Only propose transfers to teams in the valid teams list. Make sure that the player_name is a valid player on the from_team. Ensure that the the from_team name is a valid team name.
@ -386,7 +388,7 @@ def create_simulator_agent():
Your role is to generate realistic events based on the current state of NBA teams and players.
Use the provided team and player information to create engaging and plausible scenarios.
Ensure that you use as much as possible from the teams_context to create the event.
Use the existing events to get a sense of the narrative unfolding.
Use the existing events to get a sense of the narrative unfolding. Additionally, if you see the players that dont have a lot of context, make sure to include them in the event to make for a more compelling story.
Current NBA landscape:
{teams_context}