diff --git a/docs/api/orchestrator_openapi_0_1_0.yaml b/docs/api/orchestrator_openapi_0_1_0.yaml index 6a62bc6b..6e369b64 100644 --- a/docs/api/orchestrator_openapi_0_1_0.yaml +++ b/docs/api/orchestrator_openapi_0_1_0.yaml @@ -67,8 +67,339 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /api/v1/text/task/detection/content: + post: + tags: + - Detection tasks + summary: Detection task on input content + operationId: >- + api_v1_detection_task_content_unary_handler + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DetectionContentRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DetectionContentResponse' + '404': + description: Resource Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /api/v1/text/task/detection/chat: + post: + tags: + - Detection tasks + summary: Detection task on input chat + operationId: >- + api_v1_detection_task_chat_unary_handler + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DetectionChatRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DetectionChatResponse' + '404': + description: Resource Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /api/v1/text/task/detection/context-docs: + post: + tags: + - Detection tasks + summary: Detection task on input content based on context documents + operationId: >- + api_v1_detection_task_context_docs_unary_handler + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DetectionContextDocsRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DetectionContextDocsResponse' + '404': + description: Resource Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /api/v1/text/task/generation-detection: + post: + tags: + - Text Generation with detectors + summary: Generation task performing detection on prompt and generated text + operationId: >- + api_v1_detection_task_generation_detection_unary_handler + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerationDetectionRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/GenerationDetectionResponse' + '404': + description: Resource Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + components: schemas: + DetectionContentRequest: + properties: + detectors: + type: object + title: Detectors + default: {} + example: + hap-v1-model-en: {} + content: + type: string + title: Content + required: ["detectors", "content"] + additionalProperties: false + type: object + title: Content Detection Request + DetectionContentResponse: + properties: + detections: + type: array + items: + $ref: '#/components/schemas/DetectionContentResponseObject' + additionalProperties: false + required: ["detections"] + type: object + title: Content Detection Response + DetectionContentResponseObject: + properties: + start: + type: integer + title: Start + end: + type: integer + title: End + text: + type: string + title: Text + detection_type: + type: string + title: Detection Type + detection: + type: string + title: Detection + score: + type: number + title: Score + + DetectionChatRequest: + properties: + detectors: + type: object + title: Detectors + default: {} + example: + chat-v1-model-en: {} + chat_history: + type: array + title: Chat History + default: {} + items: + $ref: '#/components/schemas/ChatHistoryObject' + example: + - content: "Hi, is this powered by siri or alexa?" + author: "user" + - content: "Better, it's watsonx" + author: "assistant" + - content: "You are a helpful assistant." + author: "system" + additionalProperties: false + required: ["detectors", "chat_history"] + type: object + title: Chat Detection Request + ChatHistoryObject: + properties: + content: + type: string + title: Content + default: "" + example: "Hi I am AI Agent" + author: + type: string + title: Author + default: "" + example: "assistant" + title: Chat History Object + required: ["content", "author"] + DetectionChatResponse: + properties: + detections: + type: array + items: + type: object + title: Detection Object + properties: + detection_type: + type: string + title: Detection Type + detection: + type: string + title: Detection + score: + type: number + title: Score + title: Detection Chat Response + required: ["detections"] + + DetectionContextDocsRequest: + properties: + detectors: + type: object + title: Detectors + default: {} + example: + context-v1-model-en: {} + content: + type: string + title: Content + default: "" + example: "What is the name of the solar powered car race held every two years?" + context_type: + type: string + title: Context Type + default: "" + example: "url" + context: + type: array + title: Context + default: [] + items: + type: string + example: + - "https://en.wikipedia.org/wiki/IBM" + - "https://research.ibm.com/" + required: ["detectors", "content", "context_type", "context"] + title: Detection Context Docs Request + DetectionContextDocsResponse: + properties: + detections: + type: array + items: + type: object + title: Detection Object + properties: + detection_type: + type: string + title: Detection Type + detection: + type: string + title: Detection + score: + type: number + title: Score + required: ["detections"] + title: Detection Context Docs Response + + GenerationDetectionRequest: + properties: + model_id: + type: string + title: Model Id + prompt: + type: string + title: Prompt + detectors: + type: object + title: Detectors + default: {} + example: + generation-detection-v1-model-en: {} + text_gen_parameters: + allOf: + - $ref: '#/components/schemas/GuardrailsTextGenerationParameters' + type: object + required: ["model_id", "prompt", "detectors"] + title: Generation-Detection Request + GenerationDetectionResponse: + properties: + generated_text: + type: string + title: Generated Text + detections: + type: array + items: + type: object + title: Detection Object + properties: + detection_type: + type: string + title: Detection Type + detection: + type: string + title: Detection + score: + type: number + title: Score + input_token_count: + type: string + title: Input token Count + title: Generation Detection Response + required: ["generated_text", "detections"] + ClassifiedGeneratedTextResult: properties: generated_text: @@ -114,7 +445,7 @@ components: additionalProperties: false required: ["input_token_count", "token_classification_results"] type: object - title: ClassifiedGeneratedTextResult + title: Classified Generated Text Result ClassifiedGeneratedTextStreamResult: properties: generated_text: @@ -167,7 +498,7 @@ components: additionalProperties: false required: ["input_token_count", "token_classification_results", "start_index"] type: object - title: ClassifiedGeneratedTextStreamResult + title: Classified Generated Text Stream Result Error: type: object properties: @@ -188,7 +519,7 @@ components: title: Decay Factor additionalProperties: false type: object - title: ExponentialDecayLengthPenalty + title: Exponential Decay Length Penalty FinishReason: type: string enum: @@ -200,7 +531,7 @@ components: - STOP_SEQUENCE - TOKEN_LIMIT - ERROR - title: FinishReason + title: Finish Reason GeneratedToken: properties: text: @@ -217,7 +548,7 @@ components: additionalProperties: false type: object required: ["text"] - title: GeneratedToken + title: Generated Token GuardrailsConfig: properties: input: @@ -234,7 +565,7 @@ components: default: models: {} type: object - title: GuardrailsConfig + title: Guardrails Config GuardrailsHttpRequest: properties: model_id: @@ -259,7 +590,7 @@ components: required: - model_id - inputs - title: GuardrailsHttpRequest + title: Guardrails Http Request GuardrailsTextGenerationParameters: properties: max_new_tokens: @@ -320,7 +651,7 @@ components: title: Token Ranks additionalProperties: false type: object - title: GuardrailsTextGenerationParameters + title: Guardrails Text Generation Parameters InputWarning: properties: id: @@ -331,10 +662,10 @@ components: title: Message additionalProperties: false type: object - title: InputWarning + title: Input Warning InputWarningReason: enum: [UNSUITABLE_INPUT] - title: InputWarningReason + title: Input Warning Reason TextGenTokenClassificationResults: # By default open-api spec consider all fields as optional properties: @@ -352,7 +683,7 @@ components: title: Output additionalProperties: false type: object - title: TextGenTokenClassificationResults + title: Text Gen Token Classification Results TokenClassificationResult: properties: start: @@ -380,4 +711,4 @@ components: additionalProperties: false required: ["start", "end", "word", "entity", "entity_group", "score"] type: object - title: TokenClassificationResult + title: Token Classification Result