> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/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](../functions/startconversation).
</Warning>

> `const` **startSession**: (`opts`) => [`Conversation`](../interfaces/conversation) = `startConversation`

Démarrez une nouvelle conversation et définissez-la comme conversation actuelle.
Les appels ultérieurs à `startTurn` l'utiliseront automatiquement.

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

Défini dans : [src/genai/api.ts:33](https://github.com/wandb/weave/blob/8c5f077eb11c42b84000726ff20504abc728d3fb/sdks/node/src/genai/api.ts#L33)

<div id="parameters">
  ## Paramètres
</div>

<div id="opts">
  ### opts ?
</div>

[`ConversationInit`](../interfaces/conversationinit) = `{}`

<div id="returns">
  ## Renvoie
</div>

[`Conversation`](../interfaces/conversation)

<div id="examples">
  ## Exemples
</div>

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

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