> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Answer Question

- Component: `appmixer.tavily.core.AnswerQuestion`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.tavily 1.0.2](https://connectors.appmixer.com/connector/appmixer.tavily/1.0.2.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.tavily/1.0.2/component/appmixer.tavily.core.AnswerQuestion>

Ask a question and get a short answer generated by Tavily from live web results, together with the sources it was based on.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Question (`query`) | text | The question to answer. Maximum 400 characters. |
| Answer Depth (`answerDepth`) | select | **Basic** returns a short answer, **Advanced** a more detailed one. |
| Search Depth (`searchDepth`) | select | **Basic** costs 1 API credit per search, **Advanced** costs 2 but retrieves more relevant content. |
| Topic (`topic`) | select | The category of the search used to ground the answer. |
| Max Sources (`maxResults`) | number | How many web results the answer should be grounded in, between 1 and 20. |
| Include Domains (`includeDomains`) | text | Comma separated list of domains to restrict the search to. Maximum 300 domains. |
| Exclude Domains (`excludeDomains`) | text | Comma separated list of domains to exclude. Maximum 150 domains. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Query (`query`) | string | - |
| Answer (`answer`) | string | - |
| Sources (`sources`) | array | - |
| Response Time (`response_time`) | number | - |
| Request ID (`request_id`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.tavily.core.AnswerQuestion",
  "label": "Answer Question",
  "description": "Ask a question and get a short answer generated by Tavily from live web results, together with the sources it was based on.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:tavily"
  },
  "quota": {
    "manager": "appmixer:tavily",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 400
          },
          "answerDepth": {
            "type": "string"
          },
          "searchDepth": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "maxResults": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "includeDomains": {
            "type": "string"
          },
          "excludeDomains": {
            "type": "string"
          }
        },
        "required": [
          "query"
        ]
      },
      "inspector": {
        "inputs": {
          "query": {
            "type": "text",
            "index": 1,
            "label": "Question",
            "tooltip": "The question to answer. Maximum 400 characters."
          },
          "answerDepth": {
            "type": "select",
            "index": 2,
            "label": "Answer Depth",
            "defaultValue": "basic",
            "tooltip": "<b>Basic</b> returns a short answer, <b>Advanced</b> a more detailed one.",
            "options": [
              {
                "label": "Basic",
                "value": "basic"
              },
              {
                "label": "Advanced",
                "value": "advanced"
              }
            ]
          },
          "searchDepth": {
            "type": "select",
            "index": 3,
            "label": "Search Depth",
            "defaultValue": "basic",
            "tooltip": "<b>Basic</b> costs 1 API credit per search, <b>Advanced</b> costs 2 but retrieves more relevant content.",
            "options": [
              {
                "label": "Basic",
                "value": "basic"
              },
              {
                "label": "Advanced",
                "value": "advanced"
              }
            ]
          },
          "topic": {
            "type": "select",
            "index": 4,
            "label": "Topic",
            "defaultValue": "general",
            "tooltip": "The category of the search used to ground the answer.",
            "options": [
              {
                "label": "General",
                "value": "general"
              },
              {
                "label": "News",
                "value": "news"
              },
              {
                "label": "Finance",
                "value": "finance"
              }
            ]
          },
          "maxResults": {
            "type": "number",
            "index": 5,
            "label": "Max Sources",
            "defaultValue": 5,
            "tooltip": "How many web results the answer should be grounded in, between 1 and 20."
          },
          "includeDomains": {
            "type": "text",
            "index": 6,
            "label": "Include Domains",
            "tooltip": "Comma separated list of domains to restrict the search to. Maximum 300 domains."
          },
          "excludeDomains": {
            "type": "text",
            "index": 7,
            "label": "Exclude Domains",
            "tooltip": "Comma separated list of domains to exclude. Maximum 150 domains."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "title": "Query",
            "example": "Who is Leo Messi?"
          },
          "answer": {
            "type": "string",
            "title": "Answer",
            "example": "Lionel Messi is an Argentine professional footballer widely regarded as one of the greatest players of all time."
          },
          "sources": {
            "type": "array",
            "title": "Sources",
            "example": [
              {
                "title": "Lionel Messi | Biography, Trophies and Facts",
                "url": "https://www.britannica.com/biography/Lionel-Messi",
                "content": "Argentine footballer born in 1987 who played for Barcelona.",
                "score": 0.81
              }
            ],
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "title": "Title",
                  "example": "Lionel Messi | Biography, Trophies and Facts"
                },
                "url": {
                  "type": "string",
                  "title": "URL",
                  "example": "https://www.britannica.com/biography/Lionel-Messi"
                },
                "content": {
                  "type": "string",
                  "title": "Content",
                  "example": "Argentine footballer born in 1987 who played for Barcelona."
                },
                "score": {
                  "type": "number",
                  "title": "Relevance Score",
                  "example": 0.81
                }
              }
            }
          },
          "response_time": {
            "type": "number",
            "title": "Response Time",
            "example": 1.67
          },
          "request_id": {
            "type": "string",
            "title": "Request ID",
            "example": "123e4567-e89b-12d3-a456-426614174111"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
