{"openapi":"3.1.0","info":{"title":"ThinkOwl Bot (Owl Not Enclosed) for ThinkOwl","description":"<CENTER><img src=\"/static/tbone-service.png\"></CENTER><BR>\n        This is the backend of the Conversation Bot.\n    ","contact":{"url":"http://www.thinkowl.com/"},"license":{"name":"ThinkOwl Usage License","url":"http://www.thinkowl.com/"},"version":"v1"},"paths":{"/metrics":{"get":{"summary":"Combined Metrics","description":"Expose combined metrics from the local instrumentator and the external server.","operationId":"combined_metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/train":{"get":{"summary":"Train","description":"Trains the bot with the given data that is downloaded from bot-service endpoints.\n\nArgs:\n    tenant (str, optional): Mandatory tenant ID\n    desk (str, optional): Mandatory desk ID\n\nReturns:\n    TrainingResponse: The response of the training process.","operationId":"train_v1_train_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/status_training":{"get":{"summary":"Get Status","description":"This endpoint is used to get the status of a training session.\n\nArgs:\n    reference (str, optional): the uuid of the chat session\n\nReturns:\n    Response: the logs of the chat session","operationId":"get_status_v1_status_training_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}},{"name":"add_logs","in":"query","required":false,"schema":{"type":"boolean","enum":["true","false"],"default":false,"title":"Add Logs"}},{"name":"force_done","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force Done"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/logs":{"get":{"summary":"Get Logs","description":"This endpoint is used to get the logs of a chat session.\n\nArgs:\n    reference (str, optional): the uuid of the chat session\n\nReturns:\n    Response: the logs of the chat session","operationId":"get_logs_v1_logs_get","parameters":[{"name":"reference","in":"query","required":true,"schema":{"type":"string","title":"Reference"}},{"name":"style","in":"query","required":false,"schema":{"type":"string","enum":["plain","prompt in focus","history: all stage_1","history: all stage_2_find_entities","history: all stage_3","history: all stage_4","history: all stage_5_question_extraction","history: all stage_5_answer_relevance","history: all stage_5_extract_intents","history: all stage_5_extract_entities","history: all stage_5_reply_generation","script","error","profiling","code","bare config","full","full prompt history","messages","json","raw"],"default":"plain","title":"Style"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat_start":{"post":{"summary":"Chat Start","description":"Starts a new chat session. This generates the opening prompt and a first message.","operationId":"chat_start_v1_chat_start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk_uuid","in":"query","required":true,"schema":{"type":"string","title":"Desk Uuid"}},{"name":"reference","in":"query","required":true,"schema":{"type":"string","title":"Reference"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSetup"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TBoneResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat":{"post":{"summary":"Chat","description":"Chat with a trained bot.\n\n#### Parameters:\n* body: The user message. The structure depends heavily on the data that is sent to the bot. See\n[Datastructures](https://thinkowl.atlassian.net/wiki/spaces/TR/pages/1941504001/Necessary+Data+to+train+the+Conversation+Bot)\n* reference: The reference to the chat session. This mustn't be empty.\n\n#### Returns:\n* text: The response text. Display this to the user if not empty and if metadata doesn't contain \"confirm\": true.\n* metadata: The metadata of the response. If the value \"confirm\" is false, the response is an answer to the user, otherwise it might be a statement that has to bevalidated by the frontend.             The validation response is either \"[computer_ok]\" or \"[computer_not_ok]\".\n* reference: The reference to the chat session\n* prompt_tokens: The number of prompt tokens used\n* completion_tokens: The number of completion tokens used\n* model: The model used for the response","operationId":"chat_v1_chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reference","in":"query","required":true,"schema":{"type":"string","title":"Reference"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMessage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TBoneResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/create_profile":{"get":{"summary":"Create Profile","description":"This endpoint is used to create a company profile.\n\nArgs:\n    company (str, optional): the company name\n    language (str, optional): the language that the profile is written in\n    tenant (str, optional): the tenant ID\n    desk (str, optional): the desk ID\n    keywords (str, optional): keywords like \"insurance, car, house\"\n\nReturns:\n    Response: a json response","operationId":"create_profile_v1_create_profile_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company","in":"query","required":true,"schema":{"type":"string","title":"Company"}},{"name":"language","in":"query","required":true,"schema":{"type":"string","title":"Language"}},{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}},{"name":"keywords","in":"query","required":false,"schema":{"type":"string","default":"","title":"Keywords"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/describe_intent":{"get":{"summary":"Describe Intent","description":"Generates a short description for a given intent in a specified language.\n\nArgs:\n    label (str): The label of the intent to describe.\n    language (str): The language in which the description should be written.\n    description (str, optional): An optional user-provided description of the intent. Defaults to an empty string.\n    apikey (str, optional): The API key for the language model service. Defaults to \"thinkowl-key\".\n\nReturns:\n    JSONResponse: A JSON response containing the generated description.","operationId":"describe_intent_v1_describe_intent_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}},{"name":"label","in":"query","required":true,"schema":{"type":"string","title":"Label"}},{"name":"language","in":"query","required":true,"schema":{"type":"string","title":"Language"}},{"name":"description","in":"query","required":false,"schema":{"type":"string","default":"","title":"Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/describe_entity":{"get":{"summary":"Describe Entity","description":"Generates a description for a given entity label and type in a specified language.\nArgs:\n    label (str): The label of the entity to describe.\n    entity_type (str): The type of the entity.\n    language (str): The language in which the description should be written.\n    description (str, optional): An optional user-provided description of the entity. Defaults to an empty string.\n    apikey (str, optional): The API key for authentication. Defaults to \"thinkowl-key\".\nReturns:\n    JSONResponse: A JSON response containing the generated description.","operationId":"describe_entity_v1_describe_entity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}},{"name":"label","in":"query","required":true,"schema":{"type":"string","title":"Label"}},{"name":"entity_type","in":"query","required":true,"schema":{"type":"string","title":"Entity Type"}},{"name":"language","in":"query","required":true,"schema":{"type":"string","title":"Language"}},{"name":"description","in":"query","required":false,"schema":{"type":"string","default":"","title":"Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/download_session":{"get":{"summary":"Download","description":"This endpoint is used to download the chat session as a json file.\n\nArgs:\n    reference (str, optional): the uuid of the chat session\n\nReturns:\n    JSonResponse: the chat session as a json file","operationId":"download_v1_download_session_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}},{"name":"reference","in":"query","required":true,"schema":{"type":"string","title":"Reference"}},{"name":"prefix","in":"query","required":false,"schema":{"type":"string","default":"full_","title":"Prefix"}},{"name":"infix","in":"query","required":false,"schema":{"type":"string","default":"","title":"Infix"}},{"name":"suffix","in":"query","required":false,"schema":{"type":"string","default":".tbs","title":"Suffix"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email_draft":{"get":{"summary":"Get the email reply draft of the current stage 5 pass","description":"Return the email reply draft that stage 5 generated for the current pass of this session.\n\nThe draft is read from `reply_body`, the same field the structured chat result reports, so the two\ncan never disagree. `reply_body` is reset at the start of every stage 5 pass, which means this\nendpoint never serves a draft that belongs to an earlier email of the thread.\n\nArgs:\n    desk (str): the desk the session belongs to\n    reference (str): the uuid of the chat session\n\nReturns:\n    EmailDraftResponse: the draft together with the session change timestamp, so a caller can tell\n    how old the draft is.\n\nRaises:\n    HTTPException: 401 without credentials, 404 when the session is unknown or expired, belongs to\n    another tenant or desk, or when the last pass produced no draft (bot response mode or the\n    `no_draft_intents` configuration suppressed it).","operationId":"get_email_draft_v1_email_draft_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","description":"UUID of the desk the session belongs to. Accepted dashed or undashed.","title":"Desk"},"description":"UUID of the desk the session belongs to. Accepted dashed or undashed."},{"name":"reference","in":"query","required":true,"schema":{"type":"string","description":"Reference ID of the chat session.","title":"Reference"},"description":"Reference ID of the chat session."}],"responses":{"200":{"description":"The generated email reply draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDraftResponse"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"example":{"detail":"Unauthorized"}}}},"404":{"description":"No draft available. Either the session is unknown or expired, it belongs to another tenant or desk, or the last pass produced no draft because the bot response mode or the `no_draft_intents` configuration suppressed it.","content":{"application/json":{"example":{"detail":"No email draft found for this session."}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/upload_session":{"post":{"summary":"Upload","description":"This endpoint is used to upload a chat session from a json file.\n\nArgs:\n    body (dict, optional): the chat session as a json file\n\nReturns:\n    Response: the response","operationId":"upload_v1_upload_session_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}},{"name":"reference","in":"query","required":true,"schema":{"type":"string","title":"Reference"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_v1_upload_session_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/insights":{"post":{"summary":"Get Insights","description":"This endpoint is used to get the logs from a previously stored chat session.","operationId":"get_insights_v1_insights_post","parameters":[{"name":"style","in":"query","required":false,"schema":{"type":"string","enum":["plain","prompt in focus","history: all stage_1","history: all stage_2_find_entities","history: all stage_3","history: all stage_4","history: all stage_5_question_extraction","history: all stage_5_answer_relevance","history: all stage_5_extract_intents","history: all stage_5_extract_entities","history: all stage_5_reply_generation","script","error","profiling","code","bare config","full","full prompt history","messages","json","raw"],"default":"plain","title":"Style"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_get_insights_v1_insights_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/references":{"get":{"summary":"Get References","description":"This endpoint is used to get all references of the chat sessions.\n\nReturns:\n    JSONResponse: the references of the chat sessions","operationId":"get_references_v1_references_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desk"}},{"name":"prompt","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/test_code":{"post":{"summary":"Test Code","description":"This endpoint is used to test the code that is available in the logs endpoint.\n\nArgs:\n    reference (str): the reference of the chat session\n    test_data (TBoneTestCode): the test data\n\nReturns:\n    PlainTextResponse: the response","operationId":"test_code_v1_test_code_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}},{"name":"async_execution","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Async Execution"}},{"name":"auto_conditions","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Auto Conditions"}},{"name":"max_words","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Max Words"}}],"requestBody":{"required":true,"content":{"text/plain":{"schema":{"type":"string","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/test_reports":{"get":{"summary":"Get Test Reports","description":"This endpoint is used to get the test reports of a chat session.","operationId":"get_test_reports_v1_test_reports_get","parameters":[{"name":"reference","in":"query","required":true,"schema":{"type":"string","title":"Reference"}},{"name":"style","in":"query","required":false,"schema":{"type":"string","enum":["issues","profile","screenplay","full","json"],"default":"issues","title":"Style"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/test_code_preparation":{"post":{"summary":"Test Code Preparation","description":"This endpoint is used to prepare the code for testing.\n\nArgs:\n    body (Annotated[str, Body, optional): The body of the request. Defaults to \"text/plain\")]=\"\".\n    examples (Annotated[bool, Query, optional): If true, the examples are dumped. Defaults to False.\n\nReturns:\n    Response: _description_","operationId":"test_code_preparation_v1_test_code_preparation_post","parameters":[{"name":"max_words","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Max Words"}},{"name":"examples","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Examples"}}],"requestBody":{"content":{"text/plain":{"schema":{"type":"string","default":"","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tools":{"get":{"summary":"Get Tools","description":"Returns all tool definitions grouped by usage phase.\nThis is used to display the tools in the UI. At the moment no constraints\nare applied to the tools so all tools are returned.\n\nArgs:\n    desk (str): The desk ID.\n\nReturns:\n    JSONResponse: A JSON object with \"intent_detection\" and \"intent_execution\" keys,\n    each containing a list of OwlNestToolDefinition objects.","operationId":"get_tools_v1_tools_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"desk","in":"query","required":true,"schema":{"type":"string","title":"Desk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_get_insights_v1_insights_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_get_insights_v1_insights_post"},"Body_upload_v1_upload_session_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_v1_upload_session_post"},"ChatSetup":{"properties":{"current_date_time_desk_timezone":{"type":"string","title":"Current Date Time Desk Timezone"},"main_bot_language":{"type":"string","title":"Main Bot Language"},"channel":{"type":"string","title":"Channel"},"end_message":{"type":"string","title":"End Message"},"user_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Message","default":""},"known_user_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Known User Details","default":{}},"greeting_text_for_query_via_current_channel":{"type":"string","title":"Greeting Text For Query Via Current Channel"},"user":{"type":"string","title":"User"},"formality":{"type":"string","title":"Formality"},"attempts":{"type":"integer","title":"Attempts"},"intent":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Intent","default":{}},"ask_for_availability":{"type":"boolean","title":"Ask For Availability","default":false},"allow_questions":{"type":"boolean","title":"Allow Questions","default":true},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"bot_response_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Response Mode"},"compound_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compound Uuid"}},"type":"object","required":["current_date_time_desk_timezone","main_bot_language","channel","end_message","greeting_text_for_query_via_current_channel","user","formality","attempts"],"title":"ChatSetup","description":"This is used in the setup (chat_start) call to provide the\nnecessary information for the chat session.\n\nknown_user_details: A dictionary with known user details as a flat dictionary.\nintent: A dictionary with the intent. There is at minimum a key \"uuid\" with the intent's UUID. If there are known entities, they are provided in a list \"entities\"."},"Command":{"properties":{"type":{"type":"string","title":"Type"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"row_id":{"type":"string","title":"Row Id","default":"0"},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"timerange":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timerange"},"daterange":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Daterange"},"weekdayrange":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weekdayrange"},"uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uuid"},"confirm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Confirm","default":true},"propose":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Propose","default":false},"appointment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appointment"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["type"],"title":"Command","description":"Command class represents a structured command with various optional attributes.\nAttributes:\n    type (str): The type of the command.\n    label (Optional[str]): An optional label for the command (used mainly for intent/entity declaration).\n    value (Optional[str]): An optional value associated with the command. (mostly used for entities)\n    message (Optional[str]): An optional message associated with the command. (mostly used for transfer and end commands)\n    uuid (Optional[str]): An optional unique identifier for the command. (mostly used for entities)\n    confirm (Optional[bool]): An optional flag indicating if the command requires confirmation. Defaults to True. (used for intent and entity confirmation)\n    propose (Optional[bool]): An optional flag indicating if the command is a proposal. Defaults to False. (used for appointment proposals)\n    appointment (Optional[str]): An optional appointment related to the command. (used for appointment commands, this holds the appointment date and time)\n    data (dict): A dictionary to hold additional data related to the command. (used for additional data)"},"CommandConfirmation":{"properties":{"type":{"type":"string","title":"Type"},"uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uuid"},"row_id":{"type":"string","title":"Row Id","default":"0"},"confirmed":{"type":"boolean","title":"Confirmed"},"availableslots":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Availableslots"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["type","confirmed"],"title":"CommandConfirmation","description":"The general confirmation structure for command confirmation. availableslots is optional as it is used only for\ncheck_availability command.\nSome commands may have a uuid but it is not a general requirement.\nReason will be used mostly for reasons if the command is not confirmed."},"EmailDraftResponse":{"properties":{"reference":{"type":"string","title":"Reference","description":"The reference of the chat session the draft belongs to.","examples":["chat-ref-123"]},"draft":{"type":"string","title":"Draft","description":"The generated reply body. A body fragment for an external email template, without salutation, closing or signature.","examples":["vielen Dank für Ihre Nachricht. Ihre Adresse haben wir aktualisiert."]},"generated_at":{"type":"integer","title":"Generated At","description":"Unix timestamp of the last session change, usable to judge how old the draft is.","examples":[1700000000]}},"type":"object","required":["reference","draft","generated_at"],"title":"EmailDraftResponse","description":"Returned by `GET /v1/email_draft`.\n\nAttributes:\n    reference (str): The reference of the chat session the draft belongs to.\n    draft (str): The generated reply body. This is a body fragment for an external email\n        template, so it carries no salutation, closing or signature.\n    generated_at (int): Unix timestamp of the last session change, so a caller can tell how old\n        the returned draft is."},"EntityOrKeyValue":{"properties":{"entity_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Uuid"},"entity_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Value"},"row_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Row Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uuid"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"dynamic":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dynamic","default":false},"enable_summary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Summary","default":true},"required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Required","default":false},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options","default":[]},"questions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Questions","default":[]},"examples":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Examples","default":[]}},"type":"object","title":"EntityOrKeyValue","description":"EntityKeyValue is a data structure that holds one entity key and value for the set_entity_value command.\nIt might contain a uuid, a label, a type, a value, a description and a list of options for an entity in an inject_entity command. (in this case entity_uuid and _value are ignored)\n\nThe Key/Value pair is used by the set_entity_value user command.\nThe Entity representation is used by the inject_entity user command. As both are user commands I wanted\nto have a very similar data structure for both and prevent two different user_command structures."},"FlowState":{"type":"string","enum":["NEW_CANDIDATE","INCREMENTAL_CONTINUATION","CONTINUATION_TIMEOUT","BARGE_IN"],"title":"FlowState","description":"Voice flow states a user message can carry: new candidate, continuation, timeout, or barge-in."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Metadata":{"properties":{"type":{"type":"string","title":"Type"},"commands":{"anyOf":[{"items":{"$ref":"#/components/schemas/Command"},"type":"array"},{"type":"null"}],"title":"Commands"},"uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uuid"}},"type":"object","required":["type"],"title":"Metadata","description":"Metadata class represents the metadata structure with a type and a list of commands.\nAttributes:\n    type (str): The type of the metadata.\n    commands (list[Command]): A list of Command objects associated with the metadata.\nMethods:\n    merge_commands(other: 'Metadata') -> 'Metadata':"},"TBoneResponse":{"properties":{"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/Metadata"},{"type":"null"}]},"reference":{"type":"string","title":"Reference","default":""},"billing":{"additionalProperties":true,"type":"object","title":"Billing","default":{}},"profiling":{"additionalProperties":true,"type":"object","title":"Profiling","default":{}},"tbone_result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tbone Result"}},"type":"object","title":"TBoneResponse","description":"Returned by the webservice, this is the response from the assistant/llm.\n\nAttributes:\n    text (str): The response text from the assistant.\n    metadata (Optional[Metadata]): Additional metadata related to the response.\n    reference (str): A reference string associated with the session.\n    billing (dict): Billing information for the llm.\n    profiling (dict): Profiling information (llm response time etc.)."},"TrainingResponse":{"properties":{"uuid":{"type":"string","title":"Uuid"},"tenant":{"type":"string","title":"Tenant"},"desk":{"type":"string","title":"Desk"},"logs":{"items":{"type":"string"},"type":"array","title":"Logs","default":["Starting job..."]},"fail_reason":{"type":"string","title":"Fail Reason","default":""},"question_count":{"type":"integer","title":"Question Count","default":0},"question_overall":{"type":"integer","title":"Question Overall","default":0},"article_count":{"type":"integer","title":"Article Count","default":0},"article_overall":{"type":"integer","title":"Article Overall","default":0},"took_in_ms":{"type":"integer","title":"Took In Ms","default":0},"done":{"type":"boolean","title":"Done","default":false},"started":{"type":"string","title":"Started","default":"2026-09-28 18:05:29"},"timestamp":{"type":"string","title":"Timestamp","default":"2026-09-28 18:05:29"}},"type":"object","required":["uuid","tenant","desk"],"title":"TrainingResponse","description":"This class represents the response of a training call."},"UserCommand":{"properties":{"command":{"type":"string","title":"Command"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"intent_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent Uuid"},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"entities":{"anyOf":[{"items":{"$ref":"#/components/schemas/EntityOrKeyValue"},"type":"array"},{"type":"null"}],"title":"Entities","default":[]}},"type":"object","required":["command"],"title":"UserCommand","description":"UserCommand is a general data structure that holds the command and metadata for actions that are triggered by the bot-service."},"UserMessage":{"properties":{"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"commands":{"anyOf":[{"items":{"$ref":"#/components/schemas/UserCommand"},"type":"array"},{"type":"null"}],"title":"Commands"},"command_confirmation":{"anyOf":[{"items":{"$ref":"#/components/schemas/CommandConfirmation"},"type":"array"},{"type":"null"}],"title":"Command Confirmation"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"no_reaction_from_customer":{"type":"boolean","title":"No Reaction From Customer","default":false},"interrupted":{"type":"boolean","title":"Interrupted","default":false},"flow_state":{"anyOf":[{"$ref":"#/components/schemas/FlowState"},{"type":"null"}]},"heard_assistant_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Heard Assistant Ratio"},"heard_assistant_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Heard Assistant Text"}},"type":"object","title":"UserMessage","description":"UserMessage is a data structure representing a message from a user, which may include the message text, a list of commands, command confirmations, and a reason.\nAttributes:\n    message (Optional[str]): The text of the user's message.\n    commands (Optional[list[UserCommand]]): A list of commands included in the user's message.\n    command_confirmation (Optional[list[CommandConfirmation]]): A list of command confirmations related to the user's message.\n    reason (Optional[str]): The reason or context for the user's message."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}