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

# ChatService

<Warning>
  We are sunsetting our SDKs and will no longer add new features, security patches, bug fixes, or technical support for them. To access the latest capabilities and ongoing improvements, we encourage you to migrate to our [RESTful API](/api-rest/introduction).

  SDK support will officially end on **December 31, 2026**. On this date, the underlying endpoints used by the SDKs and related documentation will be decommissioned.

  To avoid any disruption to your services, please ensure your migration is complete by that date.

  For migration assistance, please contact us at [support@bigdata.com](mailto:support@bigdata.com).
</Warning>

It provides methods to interact with [Chat](./chat) objects, and is accesible from a `Bigdata` instance

## Methods

### `new(name, formatter=None)`

Create a new chat.

**Parameters:**

<ParamField query="name" type="string" required>
  Chat's name.
</ParamField>

<ParamField query="formatter" type="InlineAttributionFormatter | None">
  Format of the response inline attributions: [InlineAttributionFormatter](./inlineAttributionFormatter)
</ParamField>

**Return type:**

[Chat](./chat)

### `list(formatter=None)`

Return a list with all chats

**Parameters:**

<ParamField query="formatter" type="InlineAttributionFormatter | None">
  Format of the response inline attributions: [InlineAttributionFormatter](./inlineAttributionFormatter)
</ParamField>

**Return type:**

list\[[Chat](./chat)]

### `get(id_, formatter=None)`

Return a chat by its identifier.

**Parameters:**

<ParamField query="id_" type="string" required>
  Unique chat identifier.
</ParamField>

<ParamField query="formatter" type="InlineAttributionFormatter | None">
  Format of the response inline attributions: [InlineAttributionFormatter](./inlineAttributionFormatter).
</ParamField>

**Return type:**

[Chat](./chat)

### `delete(id_)`

Delete a chat by its identifier

**Parameters:**

<ParamField query="id_" type="string" required>
  Unique chat identifier
</ParamField>

<RequestExample>
  ```python Example theme={null}
  # Import classes from the bigdata-client Python SDK        
  from bigdata_client import Bigdata
  from bigdata_client.models.chat import MarkdownLinkFormatter
  from bigdata_client.models.chat import ChatScope

  # Log in to Bigdata
  bigdata = Bigdata("YOUR_USERNAME", "YOUR_PASSWORD")

  # Create a new chat with a format for the inline attribution in reponses
  formatter = MarkdownLinkFormatter()
  chat = bigdata.chat.new("Pfizer company analysis", formatter)

  # First question
  response = chat.ask("Evaluate the experience and reputation of the management team of Pfizer in 2024", streaming=True, scope=ChatScope.NEWS)

  print(f"\nQuestion:\n - {response.question}")
  print(f"\nAnswer:")
  for streamingChatInteraction in response:
    print(streamingChatInteraction, end="")

  # Follow up question
  response = chat.ask("Has it hired any senior AI expert?", streaming=True, scope=ChatScope.NEWS)

  print(f"\nQuestion:\n - {response.question}")
  print(f"\nAnswer:")
  for streamingChatInteraction in response:
    print(streamingChatInteraction, end="")

  # Delete chat
  bigdata.chat.delete(chat.id)
  ```
</RequestExample>
