-
Notifications
You must be signed in to change notification settings - Fork 52
Support for tool/function calling #131
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
Support for tool/function calling #131
Conversation
index.bs
Outdated
@@ -75,6 +75,16 @@ interface LanguageModelParams { | |||
readonly attribute float maxTemperature; | |||
}; | |||
|
|||
// A description of a funnction call that a language model can invoke. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// A description of a funnction call that a language model can invoke. | |
// A description of a tool call that a language model can invoke. |
index.bs
Outdated
// JSON schema for the input parameters. | ||
required object inputSchema; | ||
// The function to be invoked by user agent on behalf of language model. | ||
required Function execute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define this to return a promise for a string, as it will make the bindings slightly nicer.
Define a callback type like
callback LanguageModelToolFunction = Promise<DOMString> (any... arguments);
and then use LanguageModelToolFunction
instead of Function
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenic - thank you for the review. Updated the CL.
@FrankLi-MSFT thanks for the contribution! Please join the Community Group to turn the IPR check green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let me know when you've joined the Community Group, and we can merge.
@FrankLi-MSFT to make sure this lands smoothly, after joining the Community Group, check you've connected your GitHub nickname with your W3C account (via https://www.w3.org/account/ > Edit your account information > Connected accounts). If good, then hit revalidate in repo manager. That should trigger a new CI run that'll pass. 🤞 |
@domenic, I think it is done. Can you merge it. Thanks! |
This CL is from the proposal of #7 (comment). It places the declaration of
tools
intoLanguageModelCreateCoreOptions
dictionary so as to let the tools to be declared in the system prompt.Preview | Diff