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

# startSession

> Référence du SDK TypeScript

> [!WARNING]
>
> **Obsolète.** Utilisez plutôt [startConversation](https://docs.coreweave.com/fr/products/wandb/weave/reference/typescript-sdk/functions/startconversation.md).

> `const` **startSession**: (`opts`) => [`Conversation`](https://docs.coreweave.com/fr/products/wandb/weave/reference/typescript-sdk/interfaces/conversation) = `startConversation`

[GitHub source](https://github.com/wandb/weave/blob/7c9efdc9fe05ffcaf2430dd652ef9bc5b3ffdfaa/sdks/node/src/genai/api.ts#L33)

Démarre une nouvelle Conversation et la définit comme conversation courante.
Les appels suivants à `startTurn` l’utiliseront automatiquement.

Passez `attributes` pour propager des attributs personnalisés (hors semconv) à chaque
span émis par la conversation.

## Paramètres

**opts** `ConversationInit = \{\}`

Voir [`ConversationInit`](https://docs.coreweave.com/fr/products/wandb/weave/reference/typescript-sdk/interfaces/conversationinit).

## Renvoie

[`Conversation`](https://docs.coreweave.com/fr/products/wandb/weave/reference/typescript-sdk/interfaces/conversation)

## Exemples

```ts twoslash theme={"system"}
// @noErrors
weave.startConversation({agentName: 'research-bot'});
```

```ts twoslash theme={"system"}
// @noErrors
weave.startConversation({
  agentName: 'research-bot',
  conversationId: '019efa53-8a65-711c-b4c1-7c1cb72c0bb7',
  attributes: {'myagent.version': '1.23'},
});
```
