269 lines
7.1 KiB
JSON
269 lines
7.1 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"title": "StockDocs",
|
|
"version": "1.0.0"
|
|
},
|
|
"paths": {
|
|
"/query": {
|
|
"post": {
|
|
"summary": "Query the vector database",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"question": { "type": "string" }
|
|
},
|
|
"required": ["question"]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Query results",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"results": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"document": { "type": "string" },
|
|
"score": { "type": "number" },
|
|
"metadata": { "type": "object" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/articles/query": {
|
|
"post": {
|
|
"summary": "Query articles based on a question with diversity filtering",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"question": { "type": "string" },
|
|
"max_results": { "type": "integer" }
|
|
},
|
|
"required": ["question"]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Query results with diverse articles",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"results": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"document": { "type": "string" },
|
|
"score": { "type": "number" },
|
|
"metadata": { "type": "object" }
|
|
}
|
|
}
|
|
},
|
|
"query": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/articles/latest/{field}": {
|
|
"get": {
|
|
"summary": "Get latest articles about a specific field with diversity",
|
|
"parameters": [
|
|
{
|
|
"name": "field",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Latest diverse articles for the field",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"results": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"document": { "type": "string" },
|
|
"score": { "type": "number" },
|
|
"metadata": { "type": "object" }
|
|
}
|
|
}
|
|
},
|
|
"field": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/company/{company_name}/facts": {
|
|
"get": {
|
|
"summary": "Get facts about a specific company",
|
|
"parameters": [
|
|
{
|
|
"name": "company_name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company facts",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company": { "type": "string" },
|
|
"facts": { "type": "object" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/company/{company_name}/products": {
|
|
"get": {
|
|
"summary": "Get products information for a company",
|
|
"parameters": [
|
|
{
|
|
"name": "company_name",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Company products",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company": { "type": "string" },
|
|
"products": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": { "type": "string" },
|
|
"release_date": { "type": "string" },
|
|
"specifications": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/company/facts/update": {
|
|
"post": {
|
|
"summary": "Update or add company facts",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"company_name": { "type": "string" },
|
|
"facts": { "type": "object" }
|
|
},
|
|
"required": ["company_name", "facts"]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Facts updated successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": { "type": "string" },
|
|
"company": { "type": "string" },
|
|
"facts": { "type": "object" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/health": {
|
|
"get": {
|
|
"summary": "Health check",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/info": {
|
|
"get": {
|
|
"summary": "Service info",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Info"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |