From dded8b8ca9954a16295ca01e968276b21986a12f Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Wed, 5 Mar 2025 17:19:50 +0100 Subject: [PATCH] remove Ai Service --- bizmatch-server/src/ai/ai.service.ts | 51 ++++++++++--------- .../src/app/pages/home/home.component.html | 6 +-- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/bizmatch-server/src/ai/ai.service.ts b/bizmatch-server/src/ai/ai.service.ts index 6225232..722aa5e 100644 --- a/bizmatch-server/src/ai/ai.service.ts +++ b/bizmatch-server/src/ai/ai.service.ts @@ -101,23 +101,10 @@ export class AiService { const prompt = `The Search Query of the User is: "${query}"`; let response = null; try { - // response = await this.openai.chat.completions.create({ - // model: 'gpt-4o-mini', - // //model: 'gpt-3.5-turbo', - // max_tokens: 300, - // messages: [ - // { - // role: 'system', - // content: `Please create unformatted JSON Object from a user input. - // The type is: ${JSON.stringify(businessListingCriteriaStructure)}., - // If location details available please fill city, county and state as State Code`, - // }, - // ], - // temperature: 0.5, - // response_format: { type: 'json_object' }, - // }); - - response = await this.groq.chat.completions.create({ + response = await this.openai.chat.completions.create({ + model: 'gpt-4o-mini', + //model: 'gpt-3.5-turbo', + max_tokens: 300, messages: [ { role: 'system', @@ -130,17 +117,33 @@ export class AiService { { role: 'user', content: prompt, - }, + }, ], - model: 'llama-3.3-70b-versatile', - //model: 'llama-3.1-8b-instant', - // model: 'mixtral-8x7b-32768', - //model: 'gemma2-9b-it', - temperature: 0.2, - max_tokens: 300, + temperature: 0.5, response_format: { type: 'json_object' }, }); + // response = await this.groq.chat.completions.create({ + // messages: [ + // { + // role: 'system', + // content: `Please create unformatted JSON Object from a user input. + // The criteriaType must be only either 'businessListings' or 'commercialPropertyListings' or 'brokerListings' !!!! + // The format of the object (depending on your choice of criteriaType) must be either ${BusinessListingCriteriaStructure}, ${CommercialPropertyListingCriteriaStructure} or ${UserListingCriteriaStructure} !!!! + // If location details available please fill city and state as State Code and only county if explicitly mentioned. + // If you decide for searchType==='exact', please do not set the attribute radius`, + // }, + // { + // role: 'user', + // content: prompt, + // }, + // ], + // model: 'llama-3.3-70b-versatile', + // temperature: 0.2, + // max_tokens: 300, + // response_format: { type: 'json_object' }, + // }); + const generatedCriteria = JSON.parse(response.choices[0]?.message?.content); return generatedCriteria; diff --git a/bizmatch/src/app/pages/home/home.component.html b/bizmatch/src/app/pages/home/home.component.html index 7be7b32..7f2b78f 100644 --- a/bizmatch/src/app/pages/home/home.component.html +++ b/bizmatch/src/app/pages/home/home.component.html @@ -40,7 +40,7 @@

Find businesses for sale.

Unlocking Exclusive Opportunities - Empowering Entrepreneurial Dreams

-
+
@if(!aiSearch){
    @@ -193,7 +193,7 @@
} -
+