Correct error in "Chat Call" docs

Created on 4 June 2025, 29 days ago

Problem/Motivation

There are a couple of errors in the code block in the "Example normalized Chat call" section of the "Chat Call" documentation

Steps to reproduce

See https://project.pages.drupalcode.org/ai/developers/call_chat/#example-no...

$provider->setChatSystemRole('You are a really rude assistant that will not great people.')

and

$response = $provider->chat($messages, 'gpt-4o', ['my-custom-call']);
/** @var \Drupal\ai\OperationType\Chat\ChatMessage $return_message */
$return_message->getNormalized();
echo $return_message->getText();

Proposed resolution

The first snippet above is missing a semi-colon (minor, but may as well fix while I'm here).

The third line of the second snippet above should be:

$return_message = $response->getNormalized();

Remaining tasks

Make the correction

๐Ÿ› Bug report
Status

Active

Version

1.1

Component

Documentation

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom jofitz Coventry

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024