Spaces:
Sleeping
Sleeping
matt HOFFNER
commited on
Commit
·
13e7011
1
Parent(s):
4638128
prompt engineer
Browse files- app/tools/odds.ts +3 -3
app/tools/odds.ts
CHANGED
@@ -6,7 +6,7 @@ function createOddsApi({ apiKey }: { apiKey: string }) {
|
|
6 |
input: z.string(),
|
7 |
});
|
8 |
const name = 'oddsApi';
|
9 |
-
const description = 'A realtime Sports Odds API. Useful for when you need to answer questions about sports odds, currently NBA and NFL. Input should be a
|
10 |
|
11 |
const execute = async ({ input }: z.infer<typeof paramsSchema>) => {
|
12 |
try {
|
@@ -18,9 +18,9 @@ function createOddsApi({ apiKey }: { apiKey: string }) {
|
|
18 |
let market;
|
19 |
|
20 |
// americanfootball_nfl_super_bowl_winner
|
21 |
-
if (input.includes('nba')) {
|
22 |
sportKey = 'basketball_nba';
|
23 |
-
} else if (input.includes('nfl')) {
|
24 |
sportKey = 'americanfootball_nfl';
|
25 |
} else {
|
26 |
sportKey = 'upcoming';
|
|
|
6 |
input: z.string(),
|
7 |
});
|
8 |
const name = 'oddsApi';
|
9 |
+
const description = 'A realtime Sports Odds API. Useful for when you need to answer questions about sports odds, currently NBA and NFL. Input should be a string including a sport (nba or nfl), optionally including type (h2h, spread or o/u). Outputs a JSON array of results.';
|
10 |
|
11 |
const execute = async ({ input }: z.infer<typeof paramsSchema>) => {
|
12 |
try {
|
|
|
18 |
let market;
|
19 |
|
20 |
// americanfootball_nfl_super_bowl_winner
|
21 |
+
if (input.toLowerCase().includes('nba')) {
|
22 |
sportKey = 'basketball_nba';
|
23 |
+
} else if (input.toLowerCase().includes('nfl')) {
|
24 |
sportKey = 'americanfootball_nfl';
|
25 |
} else {
|
26 |
sportKey = 'upcoming';
|