Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using tools to get a structured response, the returned array sometimes becomes a string. #35

Open
AsianLazyMan opened this issue Apr 9, 2024 · 0 comments

Comments

@AsianLazyMan
Copy link

AsianLazyMan commented Apr 9, 2024

Hi!
I found this error.
image
The topics should be an array, as defined in the tool.
const tools: Tool[] = [
{
name: 'print_note_schema',
description: 'Prints a article schema of the input document into well-structured JSON.',
input_schema: {
type: 'object',
properties: {
title: {
type: 'string',
description:
'Title of this article schema. Should be as concise and precise as possible.',
},
summary: {
type: 'string',
description:
'Summary of the input article.',
},
topics: {
type: 'array',
items: {
type: 'object',
properties: {
subtitle: {
type: 'string',
description:
'Subtitle of the topic Should be as concise and precise as possible.And ensure that the topic can match the corresponding content in the summary.',
},
topicSummary: {
type: 'string',
description:
'Summary of the topic. Should be as concise and precise as possible.And ensure that the topic can match the corresponding content in the summary of this schema.',
},
markIds: {
type: 'string',
description:
'What is stored here is the id of the mark related to the current topic. The marks come from the tag in the input.If there are multiple corresponding marks, be sure to use "," to separate them.',
},
additionalSuggestions: {
type: 'string',
description:
'Apart from the input I gave you, what do you think can be expanded on this topic? This content is not required, so the content of the suggestions you give me needs to be non-redundant and to the point.If there are multiple corresponding additionalSuggestions, be sure to use "," to separate them.',
},
},
required: ['subtitle', 'topicSummary', 'markIds', 'additionalSuggestions'],
},
description:
'Array of topics. Should be as specific as possible.And ensure that these topics can match the corresponding content in the summary.',
},
},
required: ['title', 'summary', 'topics'],
},
},
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant