Skip to content

Commit

Permalink
Remove CollectionsQuery import and adjust return type in product cate…
Browse files Browse the repository at this point in the history
…gorization service
  • Loading branch information
jamalsoueidan committed Jun 28, 2024
1 parent 9ae0afc commit cce3a94
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/functions/openai/services/product-categorize.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import OpenAI from "openai";
import { shopifyAdmin } from "~/library/shopify";
import { CollectionsQuery } from "~/types/admin.generated";

const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
Expand Down Expand Up @@ -61,8 +60,7 @@ If you think the product fits multiply collections, it's fine, include them all
},
});

return JSON.parse(response.choices[0].message.content as any)
.collections as CollectionsQuery["collections"]["nodes"];
return JSON.parse(response.choices[0].message.content as any);
} catch (error) {
console.error("Error:", error);
}
Expand Down

0 comments on commit cce3a94

Please sign in to comment.