> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# निर्णय लें

> समर्थित निर्णय मॉडल से ऐप्लिकेशन की स्थिति पर प्रकारयुक्त प्रश्नों का मूल्यांकन करें।

जब ऐप्लिकेशन को ऐसे संरचित उत्तर चाहिए जिन्हें कोड सीधे इस्तेमाल कर सके, तो `POST /v1/decisions` इस्तेमाल करें। समर्थित मॉडल में TypeSafe Jev 1.13 (`typesafe/jev-1.13.0`), Together Tev1 4B Experimental (`together/tev1-4b-experimental`) और Respan Span-01 (`respan/span-01:free` तथा `respan/span-01`) शामिल हैं।

अनुरोध में ये शामिल हैं:

* `state`: मूल्यांकन की जानकारी वाली स्ट्रिंग, ऑब्जेक्ट या ऐरे।
* `questions`: नाम वाले प्रश्नों का मैप। हर प्रश्न में `type` को `noul`, `choice` या `score` रखा जाता है और `instructions` शामिल होता है; समर्थित प्रकार चुने गए मॉडल पर निर्भर हैं।
* `model`: Phaseo मॉडल आईडी। Jev 1.13 के लिए `typesafe/jev-1.13.0` या नवीनतम Jev रिलीज़ के लिए `typesafe/jev-latest` इस्तेमाल करें।

Liquid D1 (`liquid-ai/d1:free`, `liquid-ai/d1` के रूप में भी उपलब्ध) और Perplexity Decider 27B (`perplexity/decider-27b`) तीनों प्रश्न प्रकारों का समर्थन करते हैं। D1 प्रयोगात्मक शुरुआती पहुँच के दौरान मुफ़्त है। Decider की कीमत चित्र टोकन सहित प्रति दस लाख इनपुट टोकन 0.04 अमेरिकी डॉलर है; आउटपुट टोकन मुफ़्त हैं। Decider के लिए Phaseo में Perplexity प्रदाता क्रेडेंशियल जोड़ें। चित्र वाली स्थिति PNG, JPEG या WebP के base64 डेटा URL इस्तेमाल करती है; दूरस्थ चित्र URL समर्थित नहीं हैं। हर चयन प्रश्न में अधिकतम 255 विकल्प और हर स्कोर प्रश्न में अधिकतम 10 स्तर हो सकते हैं। दोनों में से किसी मॉडल को कॉल करने से पहले उसकी उपलब्धता जाँचें।

Respan Span-01 के लिए `state` बातचीत का ऐसा भाग होना चाहिए जिसमें पिछले संदेशों का `input` ऐरे और सहायक का `output` संदेश हो। Span-01 केवल `noul` प्रश्नों का समर्थन करता है। `noul` उत्तर व्यवहार मौजूद होने की संभावना है; `probabilities` में अनुपस्थित और न देखे जा सकने की संभावनाएँ भी हैं।

```json theme={null}
{
  "model": "respan/span-01:free",
  "state": {
    "input": [{ "role": "user", "content": "Please connect me to a person." }],
    "output": { "role": "assistant", "content": "I will connect you to support." }
  },
  "questions": {
    "escalation": {
      "type": "noul",
      "instructions": "Does the assistant offer a human handoff?"
    }
  }
}
```

`respan/span-01:free` दैनिक सीमा वाला मुफ़्त Lite मॉडल है; Phaseo इसे Respan की API मॉडल आईडी `span-01-free` से मैप करता है। `respan/span-01`, Respan की API मॉडल आईडी `span-01-pro` से मैप होता है और Respan प्रति दस लाख इनपुट टोकन 0.02 अमेरिकी डॉलर लेता है; आउटपुट टोकन मुफ़्त हैं। Span-01 शुरुआती पहुँच में है, इसलिए Respan को आपके संगठन के लिए पहुँच सक्षम करनी होगी। इन मॉडल को कॉल करने से पहले अपनी Respan API कुंजी Phaseo में Respan प्रदाता क्रेडेंशियल के रूप में जोड़ें।

उत्तर `questions` वाली ही कुंजियाँ इस्तेमाल करते हैं। `choice` उत्तर में चुना हुआ विकल्प, संभावनाएँ और विश्वास स्तर होते हैं; `noul` उत्तर में 0–1 की संभावना होती है; और `score` उत्तर में संभावना-भारित स्कोर, संकेत विवरण, संभावनाएँ और विश्वास स्तर होते हैं।

Respan उदाहरण के लिए प्रतिक्रिया इस प्रकार होती है:

```json theme={null}
{
  "answers": {
    "escalation": {
      "type": "noul",
      "noul": 0.73,
      "probabilities": {
        "true": 0.73,
        "false": 0.25,
        "not_observable": 0.02
      }
    }
  }
}
```

Jev एक अनुरोध में तीनों प्रश्न प्रकारों को मिलाने का समर्थन करता है; Span-01 केवल `noul` प्रश्नों का समर्थन करता है। कॉपी-पेस्ट करने योग्य cURL, JavaScript, TypeScript SDK और Python SDK उदाहरणों के लिए [त्वरित शुरुआत](../../quickstart) देखें। Jev 1.13 की कीमत प्रति दस लाख इनपुट टोकन 0.042 अमेरिकी डॉलर है; आउटपुट टोकन मुफ़्त हैं।

प्रदाता के प्रश्नों के अर्थ के लिए TypeSafe का [API संदर्भ](https://docs.typesafe.ai/api) देखें।

### Clef के साथ चित्र निर्णय

`cloudflare/clef` और `cloudflare/clef-flash`, Cloudflare Workers AI के ज़रिए तीनों प्रश्न प्रकार और एम्बेड किए गए चित्रों का समर्थन करते हैं। दोनों की कॉन्टेक्स्ट विंडो 65,536 टोकन है। इनपुट की कीमत प्रति दस लाख टोकन Clef के लिए 0.24 USD और Clef Flash के लिए 0.09 USD है।

```json theme={null}
{
  "model": "cloudflare/clef-flash",
  "state": "Inspect the attached product photo.",
  "images": [{ "content_type": "image/png", "base64": "<base64 image bytes>" }],
  "questions": {
    "damaged": { "type": "noul", "instructions": "Is the product visibly damaged?" }
  }
}
```

आप `images` में `data:image/png;base64,...` स्ट्रिंग भी दे सकते हैं। Clef अधिकतम चार PNG, JPEG या WebP चित्र स्वीकार करता है। हर चित्र अधिकतम 4 MiB और 16 मेगापिक्सल का हो सकता है; डिकोड किए गए चित्र डेटा की कुल सीमा 8 MiB और अनुरोध बॉडी की सीमा 13 MiB है। रिमोट URL समर्थित नहीं हैं। Cloudflare चित्रों के प्रारूप और आयाम जाँचता है। जिन मॉडलों में चित्र समर्थन नहीं है, वे चित्र अनुरोध अस्वीकार करते हैं।

Clef अधिकतम 64 प्रश्न स्वीकार करता है। ID में अधिकतम 100 अक्षर, अंक, अंडरस्कोर, डॉट या हाइफ़न हो सकते हैं। विकल्प वाले प्रश्नों में 2–255 विकल्प और स्कोर वाले प्रश्नों में 2–10 स्तर आवश्यक हैं। Cloudflare के [Clef दस्तावेज़](https://developers.cloudflare.com/workers-ai/models/clef/) देखें।


## OpenAPI

````yaml hi/openapi/v1/openapi.localized.yaml POST /decisions
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    OpenAI-संगत एंडपॉइंट के माध्यम से विभिन्न AI मॉडल तक पहुँचने के लिए एक गेटवे
    API।
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: वैश्विक रूटिंग
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /decisions:
    post:
      tags:
        - Gateway
      summary: संरचित निर्णय लें
      description: >-
        TypeSafe Jev जैसे निर्णय मॉडल से संरचित स्थिति पर Noul, Choice और Score
        प्रकार के प्रश्नों का मूल्यांकन करता है।
      operationId: makeDecision
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionsRequest'
      responses:
        '200':
          description: संरचित निर्णय प्रतिक्रिया
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionsResponse'
components:
  schemas:
    DecisionsRequest:
      type: object
      required:
        - model
        - state
        - questions
      properties:
        model:
          type: string
          description: मानक Phaseo मॉडल आईडी या प्रदाता मॉडल उपनाम।
          default: typesafe/jev-1.13.0
        state:
          description: मॉडल द्वारा मूल्यांकित संरचित स्थिति।
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        questions:
          type: object
          minProperties: 1
          maxProperties: 128
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/DecisionNoulQuestion'
              - $ref: '#/components/schemas/DecisionChoiceQuestion'
              - $ref: '#/components/schemas/DecisionScoreQuestion'
        images:
          type: array
          maxItems: 4
          description: >-
            विज़न समर्थित निर्णय मॉडलों के लिए एम्बेड किए गए चित्र। Clef PNG,
            JPEG या WebP स्वीकार करता है; रिमोट URL समर्थित नहीं हैं। हर चित्र
            की सीमा 4 MiB और 16 मेगापिक्सल, कुल डिकोड डेटा की सीमा 8 MiB और हर
            अनुरोध बॉडी की सीमा 13 MiB है।
          items:
            oneOf:
              - type: string
                pattern: >-
                  ^[Dd][Aa][Tt][Aa]:image/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$
              - $ref: '#/components/schemas/DecisionImage'
        meta:
          type: boolean
          default: false
        echo_upstream_request:
          type: boolean
        debug:
          $ref: '#/components/schemas/DebugOptions'
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
        routing:
          $ref: '#/components/schemas/ProviderRoutingOptions'
        metadata:
          type: object
          additionalProperties: true
    DecisionsResponse:
      type: object
      properties:
        model:
          type: string
        answers:
          type: object
          additionalProperties: true
        usage:
          $ref: '#/components/schemas/DecisionsUsage'
        request_id:
          type: string
          nullable: true
        meta:
          type: object
          additionalProperties: true
    DecisionNoulQuestion:
      type: object
      required:
        - type
        - instructions
      properties:
        type:
          type: string
          enum:
            - noul
        instructions:
          $ref: '#/components/schemas/DecisionInstructions'
        criteria:
          type: object
          properties:
            'true':
              type: string
            'false':
              type: string
          additionalProperties: true
    DecisionChoiceQuestion:
      type: object
      required:
        - type
        - instructions
        - criteria
      properties:
        type:
          type: string
          enum:
            - choice
        instructions:
          $ref: '#/components/schemas/DecisionInstructions'
        criteria:
          type: object
          minProperties: 1
          additionalProperties:
            type: string
            nullable: true
    DecisionScoreQuestion:
      type: object
      required:
        - type
        - instructions
        - criteria
      properties:
        type:
          type: string
          enum:
            - score
        instructions:
          $ref: '#/components/schemas/DecisionInstructions'
        criteria:
          type: array
          minItems: 2
          items:
            type: string
    DecisionImage:
      type: object
      required:
        - content_type
        - base64
      properties:
        content_type:
          type: string
          enum:
            - image/png
            - image/jpeg
            - image/webp
        base64:
          type: string
          pattern: ^[A-Za-z0-9+/]+={0,2}$
    DebugOptions:
      type: object
      description: गेटवे डिबग नियंत्रण। ये फ़्लैग कभी भी प्रदाता को फ़ॉरवर्ड नहीं किए जाते।
      properties:
        enabled:
          type: boolean
        return_upstream_request:
          type: boolean
        return_upstream_response:
          type: boolean
        trace:
          type: boolean
        trace_level:
          type: string
          enum:
            - summary
            - full
    ProviderRoutingOptions:
      type: object
      description: गेटवे चयन के लिए प्रदाता रूटिंग प्राथमिकताएँ।
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: रूटिंग में alpha प्रदाताओं को शामिल करें (डिफ़ॉल्ट रूप से बंद)।
        allow_fallbacks:
          type: boolean
          nullable: true
          description: विफलता के बाद किसी अन्य योग्य प्रदाता पर fallback की अनुमति दें।
        require_parameters:
          type: boolean
          nullable: true
          description: >-
            रूटिंग से पहले अनुरोधित पैरामीटरों के लिए प्रदाता का समर्थन आवश्यक
            करें।
        required_execution_region:
          type: string
          nullable: true
          description: रूटिंग को अनुरोधित execution region वाले प्रदाताओं तक सीमित करें।
        required_data_region:
          type: string
          nullable: true
          description: रूटिंग को अनुरोधित data region वाले प्रदाताओं तक सीमित करें।
        require_zero_data_retention:
          type: boolean
          nullable: true
          description: >-
            रूटिंग को उन प्रदाताओं तक सीमित करें जो शून्य डेटा प्रतिधारण का
            समर्थन करते हैं।
        data_collection:
          type: string
          nullable: true
          enum:
            - allow
            - deny
        zdr:
          type: boolean
          nullable: true
        enforce_distillable_text:
          type: boolean
          nullable: true
        quantizations:
          type: array
          nullable: true
          items:
            type: string
        sort:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            इस अनुरोध के लिए प्रदाताओं को क्रम दें, जैसे कीमत, विलंबता या
            थ्रूपुट के आधार पर।
        max_price:
          type: object
          properties:
            prompt:
              oneOf:
                - type: number
                - type: string
            completion:
              oneOf:
                - type: number
                - type: string
            image:
              oneOf:
                - type: number
                - type: string
            audio:
              oneOf:
                - type: number
                - type: string
            request:
              oneOf:
                - type: number
                - type: string
        preferred_min_throughput:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
        preferred_max_latency:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
    DecisionsUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          minimum: 0
        output_tokens:
          type: integer
          minimum: 0
        total_tokens:
          type: integer
          minimum: 0
    DecisionInstructions:
      oneOf:
        - type: string
        - type: object
          additionalProperties: true
        - type: array
          items: {}
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer टोकन से प्रमाणीकरण

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.