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

[@azure/openai-assistants] Cannot set files on individual thread/message #29473

Closed
2 of 6 tasks
howlowck opened this issue Apr 27, 2024 · 0 comments · Fixed by #29500
Closed
2 of 6 tasks

[@azure/openai-assistants] Cannot set files on individual thread/message #29473

howlowck opened this issue Apr 27, 2024 · 0 comments · Fixed by #29500
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@howlowck
Copy link
Contributor

  • Package Name: @azure/openai-assistants
  • Package Version: 1.0.0-beta.5
  • Operating system: WSL
  • nodejs
    • version: v20.10.0
  • browser
    • name/version: NA
  • typescript
    • version: 5.2.2
  • Is the bug related to documentation in

Describe the bug

I would like to set file_ids on the message level when creating a thread (when the assistant is already created).

OpenAI API allows us to set file_ids on the message level. In the python SDK, we are also allowed to set the file ids on the message level.

It looks like there is an unused type ThreadInitializationMessage in the source code already, that would allow for fileIds. However the AssistantThreadCreationOptions type has the messages hard-coded.

To Reproduce
Steps to reproduce the behavior:

  1. Create an assistant
  2. Upload files
  3. Try to add the following lines:
const threadRun = await assistantsClient.createThreadAndRun({
    assistantId: assistant.id,
    thread: {
      messages: [
        {
          role: "user",
          content: question,
          fileIds: fileIds,
        },
      ],
    },
  });

fileIds will give a type error.

Expected behavior
fileIds property should be allowed.

Screenshots
image
image

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 27, 2024
@github-actions github-actions bot removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Apr 29, 2024
glharper added a commit that referenced this issue Apr 29, 2024
Fix #29473 

### Packages impacted by this PR
@azure/openai-assistants

### Issues associated with this PR
#29473 

### Describe the problem that is addressed by this PR
Add fileIds to Thread messages

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants