Files
Memoh/docs/docs.go
T
2026-01-23 18:53:20 +08:00

1446 lines
48 KiB
Go

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/auth/login": {
"post": {
"description": "Validate user credentials and issue a JWT",
"tags": [
"auth"
],
"summary": "Login",
"parameters": [
{
"description": "Login request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.LoginResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/apply_patch": {
"post": {
"description": "Apply a unified diff patch to a file under the user data mount",
"tags": [
"fs"
],
"summary": "Apply unified diff patch",
"parameters": [
{
"description": "Patch payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ApplyPatchRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/commit": {
"post": {
"description": "Create a new version snapshot for the user container",
"tags": [
"fs"
],
"summary": "Commit a filesystem snapshot",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.CommitResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/diff": {
"get": {
"description": "Produce a unified diff between a version snapshot and current data",
"tags": [
"fs"
],
"summary": "Diff against a version snapshot",
"parameters": [
{
"type": "string",
"description": "Path under data mount",
"name": "path",
"in": "query"
},
{
"type": "integer",
"description": "Version number",
"name": "version",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.DiffResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/list": {
"get": {
"description": "List files under the user data mount",
"tags": [
"fs"
],
"summary": "List directory contents",
"parameters": [
{
"type": "string",
"description": "Path under data mount",
"name": "path",
"in": "query"
},
{
"type": "boolean",
"description": "Recursive listing",
"name": "recursive",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.ListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/read": {
"get": {
"description": "Read a file under the user data mount",
"tags": [
"fs"
],
"summary": "Read file content",
"parameters": [
{
"type": "string",
"description": "Path under data mount",
"name": "path",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.ReadResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/write_atomic": {
"put": {
"description": "Atomically replace a file under the user data mount",
"tags": [
"fs"
],
"summary": "Write file atomically",
"parameters": [
{
"description": "Write payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.WriteAtomicRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/add": {
"post": {
"description": "Add memory for a user via memory",
"tags": [
"memory"
],
"summary": "Add memory",
"parameters": [
{
"description": "Add request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.AddRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/memories": {
"get": {
"description": "List memories for a user via memory",
"tags": [
"memory"
],
"summary": "List memories",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "Agent ID",
"name": "agent_id",
"in": "query"
},
{
"type": "string",
"description": "Run ID",
"name": "run_id",
"in": "query"
},
{
"type": "integer",
"description": "Limit",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete all memories for a user via memory",
"tags": [
"memory"
],
"summary": "Delete memories",
"parameters": [
{
"description": "Delete all request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.DeleteAllRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.DeleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/memories/{memoryId}": {
"get": {
"description": "Get a memory by ID via memory",
"tags": [
"memory"
],
"summary": "Get memory",
"parameters": [
{
"type": "string",
"description": "Memory ID",
"name": "memoryId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.MemoryItem"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a memory by ID via memory",
"tags": [
"memory"
],
"summary": "Delete memory",
"parameters": [
{
"type": "string",
"description": "Memory ID",
"name": "memoryId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.DeleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/search": {
"post": {
"description": "Search memories for a user via memory",
"tags": [
"memory"
],
"summary": "Search memories",
"parameters": [
{
"description": "Search request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.SearchRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/update": {
"post": {
"description": "Update a memory by ID via memory",
"tags": [
"memory"
],
"summary": "Update memory",
"parameters": [
{
"description": "Update request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.MemoryItem"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/models": {
"get": {
"description": "Get a list of all configured models, optionally filtered by type or client type",
"tags": [
"models"
],
"summary": "List all models",
"parameters": [
{
"type": "string",
"description": "Model type (chat, embedding)",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "Client type (openai, anthropic, google)",
"name": "client_type",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.GetResponse"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a new model configuration",
"tags": [
"models"
],
"summary": "Create a new model",
"parameters": [
{
"description": "Model configuration",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.AddRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/models.AddResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/models/count": {
"get": {
"description": "Get the total count of models, optionally filtered by type",
"tags": [
"models"
],
"summary": "Get model count",
"parameters": [
{
"type": "string",
"description": "Model type (chat, embedding)",
"name": "type",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.CountResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/models/model/{modelId}": {
"get": {
"description": "Get a model configuration by its model_id field (e.g., gpt-4)",
"tags": [
"models"
],
"summary": "Get model by model ID",
"parameters": [
{
"type": "string",
"description": "Model ID (e.g., gpt-4)",
"name": "modelId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a model configuration by its model_id field (e.g., gpt-4)",
"tags": [
"models"
],
"summary": "Update model by model ID",
"parameters": [
{
"type": "string",
"description": "Model ID (e.g., gpt-4)",
"name": "modelId",
"in": "path",
"required": true
},
{
"description": "Updated model configuration",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a model configuration by its model_id field (e.g., gpt-4)",
"tags": [
"models"
],
"summary": "Delete model by model ID",
"parameters": [
{
"type": "string",
"description": "Model ID (e.g., gpt-4)",
"name": "modelId",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/models/{id}": {
"get": {
"description": "Get a model configuration by its internal UUID",
"tags": [
"models"
],
"summary": "Get model by internal ID",
"parameters": [
{
"type": "string",
"description": "Model internal ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a model configuration by its internal UUID",
"tags": [
"models"
],
"summary": "Update model by internal ID",
"parameters": [
{
"type": "string",
"description": "Model internal ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated model configuration",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a model configuration by its internal UUID",
"tags": [
"models"
],
"summary": "Delete model by internal ID",
"parameters": [
{
"type": "string",
"description": "Model internal ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
}
},
"definitions": {
"handlers.ApplyPatchRequest": {
"type": "object",
"properties": {
"patch": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"handlers.CommitResponse": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"snapshot_id": {
"type": "string"
},
"version": {
"type": "integer"
}
}
},
"handlers.DiffResponse": {
"type": "object",
"properties": {
"diff": {
"type": "string"
},
"path": {
"type": "string"
},
"version": {
"type": "integer"
}
}
},
"handlers.ErrorResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"handlers.FileEntry": {
"type": "object",
"properties": {
"is_dir": {
"type": "boolean"
},
"mod_time": {
"type": "string"
},
"mode": {
"type": "integer"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"handlers.ListResponse": {
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.FileEntry"
}
},
"path": {
"type": "string"
}
}
},
"handlers.LoginRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handlers.LoginResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"token_type": {
"type": "string"
},
"user_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handlers.ReadResponse": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"encoding": {
"type": "string"
},
"mod_time": {
"type": "string"
},
"mode": {
"type": "integer"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"handlers.WriteAtomicRequest": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"encoding": {
"type": "string"
},
"mode": {
"type": "integer"
},
"mtime": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"memory.AddRequest": {
"type": "object",
"properties": {
"agent_id": {
"type": "string"
},
"filters": {
"type": "object",
"additionalProperties": true
},
"infer": {
"type": "boolean"
},
"message": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.Message"
}
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"run_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"memory.DeleteAllRequest": {
"type": "object",
"properties": {
"agent_id": {
"type": "string"
},
"run_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"memory.DeleteResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"memory.MemoryItem": {
"type": "object",
"properties": {
"agentId": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"hash": {
"type": "string"
},
"id": {
"type": "string"
},
"memory": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"runId": {
"type": "string"
},
"score": {
"type": "number"
},
"updatedAt": {
"type": "string"
},
"userId": {
"type": "string"
}
}
},
"memory.Message": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"role": {
"type": "string"
}
}
},
"memory.SearchRequest": {
"type": "object",
"properties": {
"agent_id": {
"type": "string"
},
"filters": {
"type": "object",
"additionalProperties": true
},
"limit": {
"type": "integer"
},
"query": {
"type": "string"
},
"run_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"memory.SearchResponse": {
"type": "object",
"properties": {
"relations": {
"type": "array",
"items": {}
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.MemoryItem"
}
}
}
},
"memory.UpdateRequest": {
"type": "object",
"properties": {
"memory": {
"type": "string"
},
"memory_id": {
"type": "string"
}
}
},
"models.AddRequest": {
"type": "object",
"properties": {
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"client_type": {
"$ref": "#/definitions/models.ClientType"
},
"dimensions": {
"type": "integer"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"models.AddResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"model_id": {
"type": "string"
}
}
},
"models.ClientType": {
"type": "string",
"enum": [
"openai",
"anthropic",
"google"
],
"x-enum-varnames": [
"ClientTypeOpenAI",
"ClientTypeAnthropic",
"ClientTypeGoogle"
]
},
"models.CountResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer"
}
}
},
"models.GetResponse": {
"type": "object",
"properties": {
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"client_type": {
"$ref": "#/definitions/models.ClientType"
},
"dimensions": {
"type": "integer"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"models.UpdateRequest": {
"type": "object",
"properties": {
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"client_type": {
"$ref": "#/definitions/models.ClientType"
},
"dimensions": {
"type": "integer"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}