Skip to content

Commit

Permalink
fix(server): stringify aiDescription before database update
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 25, 2024
1 parent 6ed6159 commit 7406e89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ app.get("/api/properties/:id", async (c: Context) => {
propertyData.ai_generated_description = aiDescription;

await client.queryObject({
args: [propertyData.id, aiDescription],
args: [propertyData.id, JSON.stringify(aiDescription)],
text: `UPDATE Property SET ai_generated_description = $2 WHERE id = $1`,
});
}
Expand Down
2 changes: 1 addition & 1 deletion services/openai-assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const openaiAssistant = async (question: string) => {
2. Only use standard markdown syntax
3. Ensure all quotes are properly escaped
4. Only include location details from listing_address, listing_region_name, listing_city_name, and listing_area_name if provided
5. The response must be a valid JSON array that can be parsed don't wrap your response tripple backticks json
5. The response must be a valid JSON array in string format that can be parsed
`,
model: "gpt-4o",
});
Expand Down

0 comments on commit 7406e89

Please sign in to comment.