Commit b9d1f783 authored by Wade's avatar Wade

swagger post chat

parent 102348d1
openapi: 3.0.4
info:
title: Sample API
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
version: 0.1.9
servers:
- url: http://api.example.com/v1
description: Optional server description, e.g. Main (production) server
- url: http://staging-api.example.com
description: Optional server description, e.g. Internal staging server for testing
title: Genkit Chat API
description: API for interacting with a chat endpoint powered by Genkit.
version: 0.1.0
paths:
/users:
get:
summary: Returns a list of users.
description: Optional extended description in CommonMark or HTML.
/chat:
post:
summary: Send a chat message
description: Sends a chat message to the Genkit AI workflow and returns a response.
tags:
- Chat
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
content:
type: string
description: The chat message content
example: "What is the capital of UK?"
model:
type: string
description: The model to use for the chat response
example: "gpt-3.5-turbo"
apiKey:
type: string
description: The API key for authentication
example: "sk-1234567890abcdef"
username:
type: string
description: The username of the requester
example: "john_doe"
user_id:
type: string
description: The unique identifier for the user
example: "user_12345"
required:
- content
responses:
"200": # status code
description: A JSON array of user names
'200':
description: Successful response with the chat answer
content:
application/json:
schema:
type: array
items:
type: string
type: object
properties:
response:
type: string
description: The response from the chat workflow
example: "The capital of the UK is London."
'400':
description: Invalid input
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
example: "Invalid request body"
components:
schemas: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment