Skip to content

Document that, for the copilot models, the final prompt must end with a non-tool-result UserMessage #8063

Open
@tamuratak

Description

@tamuratak

When implementing a chat participant that uses tool calls with the copilot models, the last message sent to the copilot models after invoking a tool should not be the result of the tool call. A prompt like "Above is the result of calling one or more tools. The user cannot see the results, so you should explain them to the user if referencing them in your answer" is required after the tool call result. This behavior differs from that of the OpenAI Chat API.

Since this is only written as a comment in the chat-sample, it should also be included in the documentation.

See https://github.com/microsoft/vscode-extension-samples/blob/7e4846a7a78428c52e8fe7f7aae16aa444f8d8cb/chat-sample/src/toolsPrompt.tsx#L83-L87

		// Note- for the copilot models, the final prompt must end with a non-tool-result UserMessage
		return <>
			{this.props.toolCallRounds.map(round => this.renderOneToolCallRound(round))}
			<UserMessage>Above is the result of calling one or more tools. The user cannot see the results, so you should explain them to the user if referencing them in your answer.</UserMessage>
		</>;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

doc-bugout of date, inaccurate, confusing content

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions