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

# Artifacts in Chat

> Integrate rich, editable documents like reports and slides directly into your C1-powered assistants.

You can enhance your C1-powered assistants by giving them the ability to generate and edit long-form content, like reports and slides, directly within a conversation. This is achieved using a tool-calling workflow where your backend orchestrates the creation and modification of these documents, known as Artifacts.

### Workflow

The process relies on your assistant using tools to interact with the C1 Artifacts API. Your backend receives the tool call from the LLM, executes the logic by calling the C1 artifacts API, and then returns the result to the LLM to formulate a final response.

This creates a powerful loop where the assistant can work with documents on the user's behalf.

```mermaid theme={null}
sequenceDiagram
    participant User
    participant Assistant (Frontend)
    participant Your Backend
    participant LLM
    participant C1 Artifacts API

    User->>Assistant (Frontend): "Create a report for me"
    Assistant (Frontend)->>Your Backend: Sends prompt
    Your Backend->>LLM: "User wants a report"
    LLM->>Your Backend: Use `create_report` tool
    Your Backend->>C1 Artifacts API: Generate artifact
    C1 Artifacts API-->>Your Backend: Returns artifact content
    Your Backend->>LLM: Tool success, here is artifact_id & version
    LLM->>Your Backend: "I have generate the report"
    Your Backend-->>Assistant (Frontend): Assembled C1 Response (text + artifact)
```

The core of this pattern relies on two main tools you will define:

* **`create_artifact`**: A tool that calls the C1 Artifacts API to generate a new document.
* **`edit_artifact`**: A tool that calls the C1 Artifacts API with existing artifact content to make modifications.

### Guides in This Section

* **[Generating an Artifact in a Conversation](/guides/artifacts/artifacts-in-chat/generating)**
  A step-by-step tutorial on using a tool call to create a new Artifact and embed it in an assistant's response.

* **[Editing an Artifact in a Conversation](/guides/artifacts/artifacts-in-chat/editing)**
  Learn how to implement the edit loop for artifacts using a tool call.
