{"openapi":"3.0.0","paths":{"/v1/ai/answer":{"post":{"description":"Generate an AI-powered answer based on the provided context. Returns the answer along with the knowledge-base sources used to produce it.","operationId":"AiCopilotCfaController_getAnswer","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAnswerCfaBodyDto"}}}},"responses":{"200":{"description":"Returns an AI generated answer and related sources for the given context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAnswerCfaResponseDto"}}}},"400":{"description":"Only one context item is allowed (We will allow multiple ones this in the future).\n\nInvalid parameters"},"403":{"description":"Forbidden"},"404":{"description":"No matching knowledge base entries for the given context."},"429":{"description":"Too many requests."}},"security":[{"authorization":[]}],"summary":"","tags":["ai-chat"]}},"/v1/ai/feedback/{traceId}":{"post":{"description":"Submit user feedback (positive or negative) for a previously generated AI answer, identified by its trace ID.","operationId":"AiCopilotCfaController_provideFeedback","parameters":[{"name":"traceId","required":true,"in":"path","description":"traceId of the conversation to provide feedback for","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiFeedbackCfaBodyDto"}}}},"responses":{"201":{"description":"Feedback was successfully registered."},"403":{"description":"Forbidden"},"404":{"description":"No matching conversation was found."},"500":{"description":"Conversation is missing a traceId."}},"security":[{"authorization":[]}],"summary":"","tags":["ai-chat"]}}},"info":{"title":"AI","description":"The remberg AI API description","version":"v1","contact":{}},"tags":[],"servers":[{"url":"https://api.remberg.de"}],"components":{"securitySchemes":{"authorization":{"type":"apiKey","in":"header","name":"authorization"}},"schemas":{"GetAnswerCfaContextBodyDto":{"type":"object","properties":{"instanceId":{"type":"string","description":"remberg id of the object that should be used to limit the context"},"type":{"type":"string","enum":["asset","file","assetType"],"description":"type of the object that should be used to limit the context"}},"required":["instanceId","type"]},"GetAnswerCfaBodyDto":{"type":"object","properties":{"question":{"type":"string","description":"Question that should be answered by the request"},"context":{"description":"Additional information to narrow the context that shall be used to answer the question (will use all available information if left empty)","type":"array","items":{"$ref":"#/components/schemas/GetAnswerCfaContextBodyDto"}}},"required":["question"]},"GetAnswerCfaFileSourceResponseDto":{"type":"object","properties":{"sourceType":{"type":"object","description":"type of the source (e.g. file or ticket)"},"text":{"type":"string","description":"text snippet of the source that was used to generate the answer"},"fileId":{"type":"string","description":"remberg id of the file where the information can be found in"},"fileName":{"type":"string","description":"name of the file where the information can be found in"},"page":{"type":"number","description":"page on which the information can be found"}},"required":["sourceType","text","fileId","fileName","page"]},"GetAnswerCfaTicketSourceResponseDto":{"type":"object","properties":{"sourceType":{"type":"object","description":"type of the source (e.g. file or ticket)"},"text":{"type":"string","description":"text snippet of the source that was used to generate the answer"},"ticketId":{"type":"string","description":"remberg id of the ticket where the information can be found in"},"title":{"type":"string","description":"title of the ticket where the information can be found in"}},"required":["sourceType","text","ticketId","title"]},"GetAnswerCfaResponseDto":{"type":"object","properties":{"traceId":{"type":"string","description":"traceId to keep track of the conversation. Can be e.g. used to submit feedback"},"question":{"type":"string","description":"question that was answered by the request"},"answer":{"type":"string","description":"generated answer to the given question"},"sources":{"items":{"oneOf":[{"$ref":"#/components/schemas/GetAnswerCfaFileSourceResponseDto"},{"$ref":"#/components/schemas/GetAnswerCfaTicketSourceResponseDto"}]},"description":"list of sources that have been used to generate the answer","type":"array"},"score":{"type":"number","description":"Indicator for confidence of the answer, value between 0 and 1"}},"required":["traceId","question","answer","sources","score"]},"AiFeedbackCfaBodyDto":{"type":"object","properties":{"score":{"type":"number","description":"Feedback score (0-10)"},"comment":{"type":"string","description":"Qualitative feedback to explain the score or give additional information to improve future responses"}},"required":["score"]}}}}