Chicha
Chicha
HHono
Created by theGagne on 5/11/2024 in #help
Difficulty using OpenAPI registry parameters with createRoute
this is an example
3 replies
HHono
Created by theGagne on 5/11/2024 in #help
Difficulty using OpenAPI registry parameters with createRoute
app.openapi( createRoute({ method: "get", path: "/openai/models", responses: { 200: { description: "Respond a message" } }, }), async (c) => { const openai = c.get("OpenAIClient"); const list = await openai.models.list(); return c.json(list); } ); app.openapi( createRoute({ method: "post", path: "/openai/content-generator/aboutUs", requestBody: { content: { "application/json": { schema: { type: "object", properties: { company: { type: "string" }, companySpec: { type: "string" }, }, required: ["company", "companySpec"], }, }, }, }, responses: { 200: { description: "Respond a message" }, }, }), async (c) => { const { company, companySpec } = await c.req.json(); websiteContent.company = company; const openai = c.get("OpenAIClient"); const aboutUs = await openai.chat.completions.create({ model: "gpt-4-0125-preview", messages: [ { role: "system", content: generate me a brief description of ${company} company to put on the website in about us section. the company specialties are ${companySpec}, }, ], }); websiteContent.aboutUs = aboutUs.choices[0].message.content; return c.json(aboutUs.choices[0].message.content); } );
3 replies
HHono
Created by Chicha on 4/22/2024 in #help
connect my hono application endpoints with swagger ui
No description
14 replies
HHono
Created by Chicha on 4/19/2024 in #help
use Context to get vars from wrangler.toml
ok thanks
11 replies
HHono
Created by Chicha on 4/22/2024 in #help
connect my hono application endpoints with swagger ui
No description
14 replies
HHono
Created by Chicha on 4/22/2024 in #help
connect my hono application endpoints with swagger ui
@Hurby thx for the documentation but i am not finding anything can help me up
14 replies
HHono
Created by Chicha on 4/19/2024 in #help
use Context to get vars from wrangler.toml
No description
11 replies
HHono
Created by Chicha on 4/19/2024 in #help
use Context to get vars from wrangler.toml
@Nico this is how i fix it
11 replies