matt HOFFNER
commited on
Commit
·
2a6e164
1
Parent(s):
5f213cb
naming typo
Browse files- app/tools/odds.ts +5 -5
- pages/api/functions/vector-store.ts +1 -1
app/tools/odds.ts
CHANGED
|
@@ -14,7 +14,7 @@ function createOddsApi({ apiKey }: { apiKey: string }) {
|
|
| 14 |
const dateFormat = 'iso';
|
| 15 |
const regions = 'us';
|
| 16 |
let sportKey;
|
| 17 |
-
let
|
| 18 |
|
| 19 |
// americanfootball_nfl_super_bowl_winner
|
| 20 |
if (input.toLowerCase().includes('nba')) {
|
|
@@ -26,13 +26,13 @@ function createOddsApi({ apiKey }: { apiKey: string }) {
|
|
| 26 |
}
|
| 27 |
|
| 28 |
if (input.includes('money line')) {
|
| 29 |
-
|
| 30 |
} else if (input.includes('o/u')) {
|
| 31 |
-
|
| 32 |
} else {
|
| 33 |
-
|
| 34 |
}
|
| 35 |
-
const activeSports = await fetch(`https://api.the-odds-api.com/v4/sports/${sportKey}/odds?apiKey=${apiKey}&oddsFormat=${oddsFormat}&dateFormat=${dateFormat}&
|
| 36 |
const oddsResponse = await activeSports.json();
|
| 37 |
return JSON.stringify(oddsResponse);
|
| 38 |
} catch (error) {
|
|
|
|
| 14 |
const dateFormat = 'iso';
|
| 15 |
const regions = 'us';
|
| 16 |
let sportKey;
|
| 17 |
+
let markets;
|
| 18 |
|
| 19 |
// americanfootball_nfl_super_bowl_winner
|
| 20 |
if (input.toLowerCase().includes('nba')) {
|
|
|
|
| 26 |
}
|
| 27 |
|
| 28 |
if (input.includes('money line')) {
|
| 29 |
+
markets = 'spread';
|
| 30 |
} else if (input.includes('o/u')) {
|
| 31 |
+
markets = 'totals';
|
| 32 |
} else {
|
| 33 |
+
markets = 'spreads';
|
| 34 |
}
|
| 35 |
+
const activeSports = await fetch(`https://api.the-odds-api.com/v4/sports/${sportKey}/odds?apiKey=${apiKey}&oddsFormat=${oddsFormat}&dateFormat=${dateFormat}&markets=${markets}®ions=${regions}`);
|
| 36 |
const oddsResponse = await activeSports.json();
|
| 37 |
return JSON.stringify(oddsResponse);
|
| 38 |
} catch (error) {
|
pages/api/functions/vector-store.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { MemoryVectorStore } from 'langchain/vectorstores/memory';
|
|
| 3 |
import { HuggingFaceTransformersEmbeddings } from "langchain/embeddings/hf_transformers";
|
| 4 |
|
| 5 |
const DEFAULT_CHUNK_SIZE = 1000;
|
| 6 |
-
const VECTOR_STORE_SIZE =
|
| 7 |
const textSplitter = new RecursiveCharacterTextSplitter({ chunkSize: DEFAULT_CHUNK_SIZE });
|
| 8 |
|
| 9 |
const model = new HuggingFaceTransformersEmbeddings({
|
|
|
|
| 3 |
import { HuggingFaceTransformersEmbeddings } from "langchain/embeddings/hf_transformers";
|
| 4 |
|
| 5 |
const DEFAULT_CHUNK_SIZE = 1000;
|
| 6 |
+
const VECTOR_STORE_SIZE = 10;
|
| 7 |
const textSplitter = new RecursiveCharacterTextSplitter({ chunkSize: DEFAULT_CHUNK_SIZE });
|
| 8 |
|
| 9 |
const model = new HuggingFaceTransformersEmbeddings({
|