# Converse with LLMs

`POST /v1.0-alpha2/conversation/{llmName}/converse`

This endpoint lets you converse with Large Language Models (LLMs) using the Alpha2 version  of the API, which provides enhanced tool calling support and alignment with OpenAI's interface. Dapr provides critical performance and security functionality with features like prompt caching,  PII data obfuscation, and tool calling capabilities.

## Request

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `llmName` | string | Yes | The name of the LLM component. Pattern: `^[a-zA-Z0-9_-]+$`. |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `metadata.api_key` | string | No | API key for authenticating with the LLM service. |
| `metadata.model` | string | No | Specific model identifier (e.g., gpt-4-turbo, claude-3-sonnet). |
| `metadata.version` | string | No | API version or service version. |
| `metadata.endpoint` | string | No | Custom endpoint URL for the service. |

### Request body

Required.

`application/json`

- `contextId` (string) — The ID of an existing chat (like in ChatGPT).
- `inputs` (object[]) — Required. Inputs for the conversation. Multiple inputs at one time are supported.
  - `messages` (object[]) — Required. Array of conversation messages.
    - `ofUser` (object)
      - `name` (string)
      - `content` (object[])
        - `text` (string)
    - `ofSystem` (object)
      - `name` (string)
      - `content` (object[])
        - `text` (string)
    - `ofDeveloper` (object)
      - `name` (string)
      - `content` (object[])
        - `text` (string)
    - `ofAssistant` (object)
      - `name` (string)
      - `content` (object[])
        - `text` (string)
      - `toolCalls` (object[])
    - `ofTool` (object)
      - `toolId` (string)
      - `name` (string)
      - `content` (object[])
        - `text` (string)
  - `scrubPii` (boolean) — Enable obfuscation of sensitive information present in the content field.
- `parameters` (object) — Parameters for all custom fields.
- `metadata` (object<string, string>) — Metadata passed to conversation components.
- `scrubPii` (boolean) — Enable obfuscation of sensitive information returning from the LLM.
- `temperature` (number (float)) — Control the temperature of the model. Used to optimize for consistency (0) or creativity (1).
- `tools` (object[]) — Tools available to be used by the LLM during the conversation.
  - `function` (object)
    - `name` (string) — Required. The name of the function to be called.
    - `description` (string) — A description of what the function does.
    - `parameters` (object) — JSON Schema object describing the function parameters.
- `toolChoice` — Controls which (if any) tool is called by the model. Values: auto, required, or specific tool name. Defaults to auto if tools are present.
  - One of:
    - **string**
    - **string** — Specific tool name

## Responses

### 202 — Accepted

`application/json`

- `outputs` (object[])
  - `choices` (object[])
    - `finishReason` (string) — One of: `stop`, `tool_calls`.
    - `message` (object)
      - `content` (string)
      - `toolCalls` (object[])
        - `id` (string)
        - `function` (object)
          - `name` (string)
          - `arguments` (string)

### 400 — Request was malformed

### 500 — Request formatted correctly, error in Dapr code or underlying component
