[1Chat] Add support for structured tool call results#229562
[1Chat] Add support for structured tool call results#229562joemcelroy merged 13 commits intoelastic:mainfrom
Conversation
184c6cd to
4c240ea
Compare
55c7ed5 to
4f7480d
Compare
x-pack/platform/packages/shared/onechat/onechat-genai-utils/tools/nl_search.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/packages/shared/onechat/onechat-genai-utils/langchain/messages.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/packages/shared/onechat/onechat-common/chat/conversation.ts
Outdated
Show resolved
Hide resolved
|
still need to go through the code changes but found a couple of points whilst testing this: suggestion: errors should have a "error" structured type rather than using the "other" question: noticed the index_mapping_response was using the "other" type but seems to have another type below. Is this intentional? |
I was toying with the idea of providing a subtype to "other" to distinguish between different "other" artifacts. It's probably a bad idea for now so will remove it. |
...tform/plugins/shared/onechat/server/services/tools/builtin/definitions/get_document_by_id.ts
Outdated
Show resolved
Hide resolved
...k/platform/plugins/shared/onechat/server/services/tools/builtin/definitions/generate_esql.ts
Show resolved
Hide resolved
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
History
|
Closes elastic/search-team#10552 This PR implements structured tool results (outlined in [Content Artifacts RFC](https://docs.google.com/document/d/10ZlcUZhrnxpWc6NDgv1YIXIUxc6AtNVhTpto_yQl9PU/edit?tab=t.jlbbbsa981p6)). This will form the foundation for citations, visualizations, and query (re-)execution. Breaking Change: Modified tool handler contract from `{ result: T }` to `{ results: ToolResult[] }` 4 tool result types are defined: - `ResourceResult` - `TabularDataResult` - `QueryResult` - `OtherResult` --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Closes elastic/search-team#10552 This PR implements structured tool results (outlined in [Content Artifacts RFC](https://docs.google.com/document/d/10ZlcUZhrnxpWc6NDgv1YIXIUxc6AtNVhTpto_yQl9PU/edit?tab=t.jlbbbsa981p6)). This will form the foundation for citations, visualizations, and query (re-)execution. Breaking Change: Modified tool handler contract from `{ result: T }` to `{ results: ToolResult[] }` 4 tool result types are defined: - `ResourceResult` - `TabularDataResult` - `QueryResult` - `OtherResult` --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Closes elastic/search-team#10552 This PR implements structured tool results (outlined in [Content Artifacts RFC](https://docs.google.com/document/d/10ZlcUZhrnxpWc6NDgv1YIXIUxc6AtNVhTpto_yQl9PU/edit?tab=t.jlbbbsa981p6)). This will form the foundation for citations, visualizations, and query (re-)execution. Breaking Change: Modified tool handler contract from `{ result: T }` to `{ results: ToolResult[] }` 4 tool result types are defined: - `ResourceResult` - `TabularDataResult` - `QueryResult` - `OtherResult` --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…astic#232258) Regression introduced in elastic#229562 Tool result messages must be of type `MessageContentComplex` or `DataContentBlock`. This PR converts the result to match the type `PlainTextContentBlock`.
Closes https://github.com/elastic/search-team/issues/10552
This PR implements structured tool results (outlined in Content Artifacts RFC). This will form the foundation for citations, visualizations, and query (re-)execution.
Breaking Change: Modified tool handler contract from
{ result: T }to{ results: ToolResult[] }4 tool result types are defined:
ResourceResultTabularDataResultQueryResultOtherResultClosing https://github.com/elastic/search-team/issues/10553