Closed
Description
Service
OpenAI
Describe the bug
Thank you for adding samples with the Response API (dcf3838).
I added a few changelist, I believe the documentation is incorrect in a few places.
In particular, I do not think it is currently possible to assign a Tool as described:
new ResponseCreationOptions()
{
Tools = { ResponseTool.CreateWebSearchTool() },
});
Since tools is only provided in the code with a getter, and no setter:
ResponseCreationOptions
:
public IList<ResponseTool> Tools { get; }
Most likely, the setter should be added.
Steps to reproduce
Try to compile the README.md sample, in particular:
new ResponseCreationOptions()
{
Tools = { ResponseTool.CreateWebSearchTool() },
});
Expect the code to compile;
Observe that the following error is generated:
Property or indexer 'ResponseCreationOptions.Tools' cannot be assigned to -- it is read only
Code snippets
OS
Windows
.NET version
.Net 9.0
Library version
2.2.0-beta.4