Skip to content

Commit

Permalink
feat(Action): Add bloodlinealpha API Wrapper
Browse files Browse the repository at this point in the history
Adds BloodLineAlpha api wrapper for game-logs endpoint and removes the NHL Web API endpoint for GPT Actions. Used to improve accuracy for game-log responses and results.

Part of #2
  • Loading branch information
bloodlinealpha committed Jan 29, 2024
1 parent f415948 commit 7cdd9f6
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 40 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
Use the [configuration.json](configuration.json) to build your GPT.

# Actions
Add the [nhlAPI.json](nhlAPI.json) and [nhlStandingAPI.json](nhlStandingAPI.json) to the Actions section of your GPT
Add the [nhlAPI.json](nhlAPI.json), [nhlStandingAPI.json](nhlStandingAPI.json), [bloodlinealpha.json](bloodlinealpha.json) to the Actions section of your GPT

# Save
Save your GPT and it should be ready to go. Ask it questions about players, goalies and teams. It can retrieve current season data and past seasons back to 1917-1918. Review the OpenAPI json for more a mor ecomprehensive understanding of what it can do!

# Examples
Linkedin Post: https://www.linkedin.com/pulse/syntax-sunday-gpt-actions-kade-halabuza-vv7wf
Linkedin Post: https://www.linkedin.com/pulse/syntax-sunday-gpt-actions-kade-halabuza-vv7wf

Shared Chats:
- #1: https://chat.openai.com/share/ec150c92-a200-42b9-a56b-eb95435f925f
92 changes: 92 additions & 0 deletions bloodlinealpha.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"openapi": "3.0.0",
"info": {
"title": "BloodLineAlpha NHL GPT API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://bloodlinealpha.com",
"description": "GPT Action Builder API Production Server"
}
],
"paths": {
"/nhl-GPT/api/game-log": {
"get": {
"operationId": "get_NHL_Player_game_logs",
"summary": "Get game logs",
"description": "Retrieve game log data for a specific player, season, and game type.",
"parameters": [
{
"name": "playerId",
"in": "query",
"required": true,
"description": "The ID of the player.",
"schema": {
"type": "string"
}
},
{
"name": "seasonId",
"in": "query",
"required": true,
"description": "The ID of the season.",
"schema": {
"type": "string",
"default": "20232024"
}
},
{
"name": "gameTypeId",
"in": "query",
"required": true,
"description": "The ID of the game type. gameTypeId=2 is regular season, gameTypeId=3 is playoffs",
"schema": {
"type": "string",
"default": "2"
}
},
{
"name": "properties",
"in": "query",
"required": false,
"description": "Comma-separated list of properties to include in the response. Use when trying to find specific stat values. Returns all properties, if not used. Possible values are gameId, goal, assists, commonName, opponentCommonName, points, plusMinus, powerPlayGoals, powerPlayPoints, gameWinningGoals, otGoals, shots, shifts, shorthandedGoals, shorthandedPoints, pim, toi.",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"required": false,
"description": "Limit the number of game logs returned. Order of game logs is from most recent to least recent. Can be used with the isAggregate query parameter.",
"schema": {
"type": "integer",
"default": 82
}
},
{
"name": "isAggregate",
"in": "query",
"required": true,
"description": "Summarizes values from many game logs into a gamelog. If true, this will aggregate game log values for the following properties goals, assists, points, plusMinus, powerPlayGoals, powerPlayPoints, gameWinningGoals, otGoals, shots, shifts, shorthandedGoals, shorthandedPoints, pim, toi. If false, the game logs will be returned without aggregation.",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "isAscending",
"in": "query",
"required": true,
"description": "Changes the order of the game logs, default behaviour is descending. If true, the game logs will be returned from least recent to most recent. If false, the game logs will be returned from most recent to least recent.",
"schema": {
"type": "boolean",
"default": false
}
}
]
}
}
}
}
38 changes: 0 additions & 38 deletions nhlWebAPI.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,44 +54,6 @@
}
]
}
},
"/v1/player/{playerId}/game-log/{seasonId}/{gameTypeId}": {
"get": {
"operationId": "NHL_Player_game_logs",
"summary": "Gets NHL players detailed game logs for regular season and playoffs.",
"description": "Retrieves NHL players detailed game by game stats using their playerId which must first be found using the operationId: NHL_players. Use the gameLog property to find the game by game stats for a given season.",
"parameters": [
{
"name": "playerId",
"description": "This must be first obtained from the operationId: NHL_players and then used here.",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "seasonId",
"description": "Use the current seasonId. Ask for the current seasonId if unsure.",
"in": "path",
"required": true,
"schema": {
"type": "string",
"default": "20232024"
}
},
{
"name": "gameTypeId",
"description": "gameTypeId=2 is regular season, gameTypeId=3 is playoffs. Assume regular season if unsure or ask.",
"in": "path",
"required": true,
"schema": {
"type": "string",
"default": "2"
}
}
]
}
}
}
}

0 comments on commit 7cdd9f6

Please sign in to comment.