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

# Camel.messages.conversion.alpaca

<a id="camel.messages.conversion.alpaca" />

<a id="camel.messages.conversion.alpaca.AlpacaItem" />

## AlpacaItem

```python theme={"system"}
class AlpacaItem(BaseModel):
```

Represents an instruction-response item in the Alpaca format.

Appropripate for both cases where input field is empty, or populated.
Provides parsing from string format using the class method from\_string().

**Parameters:**

* **instruction** (str): The instruction/question/prompt
* **input** (str): Input context or examples (put empty string if none)
* **output** (str): The response/answer to the instruction

<a id="camel.messages.conversion.alpaca.AlpacaItem.no_section_markers" />

### no\_section\_markers

```python theme={"system"}
def no_section_markers(cls, value: str):
```

Ensures fields don't contain section markers like '###
Response:'

<a id="camel.messages.conversion.alpaca.AlpacaItem.from_string" />

### from\_string

```python theme={"system"}
def from_string(cls, text: str):
```

Creates an AlpacaItem from a formatted string.

**Parameters:**

* **text**: String in either of these formats: With input: ### Instruction: \{instruction} ### Input: \{input} ### Response: \{response} Without input: ### Instruction: \{instruction} ### Response: \{response}

**Returns:**

AlpacaItem: Parsed instance

<a id="camel.messages.conversion.alpaca.AlpacaItem.to_string" />

### to\_string

```python theme={"system"}
def to_string(self):
```

**Returns:**

str: Formatted string representation with sections markers
