update as per jmorganca comments

Signed-off-by: Matt Williams <m@technovangelist.com>
This commit is contained in:
Matt Williams
2023-11-06 08:51:15 -08:00
parent a1c8974975
commit 3d8872bbbd
4 changed files with 3 additions and 107 deletions

View File

@@ -3,7 +3,7 @@ import { HuggingFaceTransformersEmbeddings } from 'langchain/embeddings/hf_trans
import { Chroma } from "langchain/vectorstores/chroma";
import { Document } from "langchain/document";
import { ChromaClient } from "chromadb";
const numberOfArtworks = 15;
const numberOfArtworks = 10;
// list of artists we are going to pull from the API
const artists = ["van Gogh", "Renoir", "Monet", "Picasso"]
@@ -36,7 +36,6 @@ const getArt = async (artists: string[]) => {
return artwork
}
const fetchArtistWorkIds = async (artist: string): Promise<number[]> => {
const artistURL = `https://api.artic.edu/api/v1/artworks/search?q=${artist}&limit=${numberOfArtworks}`;
const response = await fetch(artistURL);
@@ -99,7 +98,6 @@ const sanitize = (badstring: string): string => {
return goodstring;
}
const fetchArtwork = async (workids: number[]) => {
const docsarray = [];
const artworks: Artwork[] = [];
@@ -128,7 +126,4 @@ const fetchArtwork = async (workids: number[]) => {
return docsarray;
}
generateSource();