{"openapi":"3.0.3","info":{"version":"0.0.3","title":"AIFabric"},"servers":[{"url":"https://aifabric.fabricksolutionsspain.es/dev/portal/"}],"security":[{"bearerAuth":[]}],"paths":{"/connectors":{"get":{"summary":"Get a list of connectors","tags":["Connectors"],"parameters":[{"name":"paginationKey","in":"query","schema":{"type":"string"}},{"name":"pageSize","in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorList"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/sessions":{"post":{"summary":"Create a session","tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionPost"}}}},"responses":{"201":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}},"get":{"summary":"Get a list of sessions","tags":["Sessions"],"parameters":[{"name":"paginationKey","in":"query","schema":{"type":"string"}},{"name":"pageSize","in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionList"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/sessions/{sessionId}":{"get":{"summary":"Get a session","tags":["Sessions"],"parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/sessions/{sessionId}/prompt":{"post":{"summary":"Add prompt to a session","tags":["Sessions"],"parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionPost"}}}},"responses":{"201":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SessionPost":{"type":"object","properties":{"prompt":{"type":"string"}}},"SessionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"sessionStartDate":{"type":"string","format":"date-time"},"prompts":{"type":"array","items":{"type":"object","properties":{"prompt":{"type":"string"},"sqls":{"type":"array","items":{"$ref":"#/components/schemas/SQL"}},"apis":{"type":"array","items":{"$ref":"#/components/schemas/API"}},"rags":{"type":"array","items":{"$ref":"#/components/schemas/RAG"}},"references":{"type":"array","items":{"$ref":"#/components/schemas/Reference"}},"promptResponse":{"type":"string","description":"answer_composer response with the final result of multiple connectors responses merged"},"promptDate":{"type":"string","format":"date-time"}}}}}},"ConnectorList":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Pagination"},"connectors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["SQL","API","RAG"]}}}}}},"SQL":{"type":"object","properties":{"connectorId":{"type":"string","format":"uuid"},"name":{"type":"string"},"sqlStatement":{"type":"string"},"sqlExplanation":{"type":"string"},"sqlPreview":{"type":"string","description":"TBD format to populate FE tables"},"sqlFileUrl":{"type":"string","description":"S3 Presigned URL to download file"}}},"API":{"type":"object","properties":{"connectorId":{"type":"string","format":"uuid"},"name":{"type":"string"},"apiRequest":{"type":"string"},"apiResponse":{"type":"string"}}},"RAG":{"type":"object","properties":{"connectorId":{"type":"string","format":"uuid"},"name":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string"},"page":{"type":"string"},"article":{"type":"string"}}}}}},"Reference":{"type":"object","properties":{"connectorId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["SQL","API","RAG"]},"value":{"type":"string","description":"TBD format and structure by type"},"name":{"type":"string"}}},"SessionList":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Pagination"},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/SessionResponse"}}}},"Pagination":{"type":"object","properties":{"prev":{"type":"string"},"next":{"type":"string"},"first":{"type":"string"}}}}}}