# llm\_chat

#### `llm_chat`: Basic Chat Interaction

Enables simple text-based conversations with the language model.

```python
def llm_chat(
    agent_name: str, 
    messages: List[Dict[str, Any]], 
    base_url: str = aios_kernel_url,
    llms: List[Dict[str, Any]] = None
) -> LLMResponse
```

**Parameters:**

* `agent_name`: Identifier for the agent making the request
* `messages`: List of message dictionaries (system, user, assistant)
* `base_url`: API endpoint URL (default: configured AIOS kernel URL)
* `llms`: Optional list of LLM configurations to use

**Returns:**

* `LLMResponse` object containing the model's text response

**Example:**

```python
# Basic chat interaction
response = llm_chat(
    "my_assistant",
    messages=[
        {"role": "system", "content": "You are a helpful AI assistant."},
        {"role": "user", "content": "What are the main features of Python?"}
    ]
)
print(response["response"]["response_message"])
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aios.foundation/aios-docs/aios-agent-sdk/llm-core-api/llm_chat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
