Update model and prompt
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { get, omit } from "radash";
|
import { get, omit, draw } from "radash";
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const body = await readBody(event);
|
const body = await readBody(event);
|
||||||
@@ -16,22 +16,32 @@ export default defineEventHandler(async (event) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tone = draw([
|
||||||
|
"casual",
|
||||||
|
"casual",
|
||||||
|
"casual",
|
||||||
|
"casual",
|
||||||
|
"funny",
|
||||||
|
"epic",
|
||||||
|
"poetic",
|
||||||
|
"reflective",
|
||||||
|
"snarky",
|
||||||
|
]);
|
||||||
|
|
||||||
const strava = await useStrava(body.owner_id);
|
const strava = await useStrava(body.owner_id);
|
||||||
|
|
||||||
const [, activity] = await strava!<any>(`/activities/${body.object_id}`);
|
const [, activity] = await strava!<any>(`/activities/${body.object_id}`);
|
||||||
|
|
||||||
console.log(user?.preferences.data);
|
|
||||||
|
|
||||||
const [aiError, aiResponse] = await openai("/responses", {
|
const [aiError, aiResponse] = await openai("/responses", {
|
||||||
body: {
|
body: {
|
||||||
model: "gpt-4o-mini",
|
model: "gpt-4o",
|
||||||
input: [
|
input: [
|
||||||
{
|
{
|
||||||
role: "user",
|
role: "user",
|
||||||
content: `
|
content: `
|
||||||
Generate a title and a short description for my strava activity. Use my preferred language and unit system.
|
Generate a short title and description for my strava activity. Use my preferred language and unit system.
|
||||||
Use ${user?.preferences.data.tone} tone to generate content.
|
Don't exaggerate. Try keeping it calm as I am using Strava often and I don't want to have boring feed. Keep things short.
|
||||||
Add emojis unless tone is set to minimalist.
|
Use a little bit of ${tone} bits to make things less boring.
|
||||||
|
|
||||||
My user profile:
|
My user profile:
|
||||||
Sex: ${user?.sex}
|
Sex: ${user?.sex}
|
||||||
|
|||||||
Reference in New Issue
Block a user