# LLMThought

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought)

A thought in the LLM's thought stream.

## Signature

```python
LLMThought(
    self,
    parent_container: DeltaGenerator,
    labeler: LLMThoughtLabeler,
    expanded: bool,
    collapse_on_complete: bool,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `parent_container` | `DeltaGenerator` | Yes | The container we're writing into. |
| `labeler` | `LLMThoughtLabeler` | Yes | The labeler to use for this thought. |
| `expanded` | `bool` | Yes | Whether the thought should be expanded by default. |
| `collapse_on_complete` | `bool` | Yes | Whether the thought should be collapsed. |

## Constructors

```python
__init__(
    self,
    parent_container: DeltaGenerator,
    labeler: LLMThoughtLabeler,
    expanded: bool,
    collapse_on_complete: bool,
)
```

| Name | Type |
|------|------|
| `parent_container` | `DeltaGenerator` |
| `labeler` | `LLMThoughtLabeler` |
| `expanded` | `bool` |
| `collapse_on_complete` | `bool` |


## Properties

- `container`
- `last_tool`

## Methods

- [`on_llm_start()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_llm_start)
- [`on_llm_new_token()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_llm_new_token)
- [`on_llm_end()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_llm_end)
- [`on_llm_error()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_llm_error)
- [`on_tool_start()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_tool_start)
- [`on_tool_end()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_tool_end)
- [`on_tool_error()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_tool_error)
- [`on_agent_action()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/on_agent_action)
- [`complete()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/complete)
- [`clear()`](https://reference.langchain.com/python/langchain-community/callbacks/streamlit/streamlit_callback_handler/LLMThought/clear)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/callbacks/streamlit/streamlit_callback_handler.py#L112)