remove Ai Service
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user