Skip to content

How do i show only the ai message #336

Closed Answered by davidmigloz
Leo-Bon asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @Leo-Bon ,

I guess you are talking about openai_dart client?

If so, there's a content field in the `ChatCompletionAssistantMessage

final res = await client.createChatCompletion(
request: const CreateChatCompletionRequest(
model: ChatCompletionModel.modelId('gpt-4'),
messages: [
ChatCompletionMessage.system(
content: 'You are a helpful assistant.',
),
ChatCompletionMessage.user(
content: ChatCompletionUserMessageContent.string('Hello!'),
),
],
temperature: 0,
),
);
print(res.choices.first.message.content);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Leo-Bon
Comment options

Answer selected by Leo-Bon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants