identity:
  name: perplexity
  author: Dify
  label:
    en_US: Perplexity Search
description:
  human:
    en_US: Search information using Perplexity AI's language models.
  llm: This tool is used to search information using Perplexity AI's language models.
parameters:
  - name: query
    type: string
    required: true
    label:
      en_US: Query
      zh_Hans: 查询
    human_description:
      en_US: The text query to be processed by the AI model.
      zh_Hans: 要由 AI 模型处理的文本查询。
    form: llm
  - name: model
    type: select
    required: false
    label:
      en_US: Model Name
      zh_Hans: 模型名称
    human_description:
      en_US: The Perplexity AI model to use for generating the response.
      zh_Hans: 用于生成响应的 Perplexity AI 模型。
    form: form
    default: "llama-3.1-sonar-small-128k-online"
    options:
      - value: llama-3.1-sonar-small-128k-online
        label:
          en_US: llama-3.1-sonar-small-128k-online
          zh_Hans: llama-3.1-sonar-small-128k-online
      - value: llama-3.1-sonar-large-128k-online
        label:
          en_US: llama-3.1-sonar-large-128k-online
          zh_Hans: llama-3.1-sonar-large-128k-online
      - value: llama-3.1-sonar-huge-128k-online
        label:
          en_US: llama-3.1-sonar-huge-128k-online
          zh_Hans: llama-3.1-sonar-huge-128k-online
  - name: max_tokens
    type: number
    required: false
    label:
      en_US: Max Tokens
      zh_Hans: 最大令牌数
      pt_BR: Máximo de Tokens
    human_description:
      en_US: The maximum number of tokens to generate in the response.
      zh_Hans: 在响应中生成的最大令牌数。
      pt_BR: O número máximo de tokens a serem gerados na resposta.
    form: form
    default: 4096
    min: 1
    max: 4096
  - name: temperature
    type: number
    required: false
    label:
      en_US: Temperature
      zh_Hans: 温度
      pt_BR: Temperatura
    human_description:
      en_US: Controls randomness in the output. Lower values make the output more focused and deterministic.
      zh_Hans: 控制输出的随机性。较低的值使输出更加集中和确定。
    form: form
    default: 0.7
    min: 0
    max: 1
  - name: top_k
    type: number
    required: false
    label:
      en_US: Top K
      zh_Hans: 取样数量
    human_description:
      en_US: The number of top results to consider for response generation.
      zh_Hans: 用于生成响应的顶部结果数量。
    form: form
    default: 5
    min: 1
    max: 100
  - name: top_p
    type: number
    required: false
    label:
      en_US: Top P
      zh_Hans: Top P
    human_description:
      en_US: Controls diversity via nucleus sampling.
      zh_Hans: 通过核心采样控制多样性。
    form: form
    default: 1
    min: 0.1
    max: 1
    step: 0.1
  - name: presence_penalty
    type: number
    required: false
    label:
      en_US: Presence Penalty
      zh_Hans: 存在惩罚
    human_description:
      en_US: Positive values penalize new tokens based on whether they appear in the text so far.
      zh_Hans: 正值会根据新词元是否已经出现在文本中来对其进行惩罚。
    form: form
    default: 0
    min: -1.0
    max: 1.0
    step: 0.1
  - name: frequency_penalty
    type: number
    required: false
    label:
      en_US: Frequency Penalty
      zh_Hans: 频率惩罚
    human_description:
      en_US: Positive values penalize new tokens based on their existing frequency in the text so far.
      zh_Hans: 正值会根据新词元在文本中已经出现的频率来对其进行惩罚。
    form: form
    default: 1
    min: 0.1
    max: 1.0
    step: 0.1
  - name: return_citations
    type: boolean
    required: false
    label:
      en_US: Return Citations
      zh_Hans: 返回引用
    human_description:
      en_US: Whether to return citations in the response.
      zh_Hans: 是否在响应中返回引用。
    form: form
    default: true
  - name: search_domain_filter
    type: string
    required: false
    label:
      en_US: Search Domain Filter
      zh_Hans: 搜索域过滤器
    human_description:
      en_US: Domain to filter the search results.
      zh_Hans: 用于过滤搜索结果的域名。
    form: form
    default: ""
  - name: search_recency_filter
    type: select
    required: false
    label:
      en_US: Search Recency Filter
      zh_Hans: 搜索时间过滤器
    human_description:
      en_US: Filter for search results based on recency.
      zh_Hans: 基于时间筛选搜索结果。
    form: form
    default: "month"
    options:
      - value: day
        label:
          en_US: Day
          zh_Hans: 天
      - value: week
        label:
          en_US: Week
          zh_Hans: 周
      - value: month
        label:
          en_US: Month
          zh_Hans: 月
      - value: year
        label:
          en_US: Year
          zh_Hans: 年
