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

Unknown parameter for CreateThreadAndRun method #773

Open
rasmusviben opened this issue Jun 19, 2024 · 2 comments
Open

Unknown parameter for CreateThreadAndRun method #773

rasmusviben opened this issue Jun 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rasmusviben
Copy link

Describe the bug
When calling the CreateThreadAndRun method, the response is 400 due to unknown parameter in the ThreadRequest: thread.messages[0].file_ids

To Reproduce
Run follow code given assistant is created:

run, err := ss.openAiClient.CreateThreadAndRun(context.Background(), openai.CreateThreadAndRunRequest{
		RunRequest: openai.RunRequest{
			Model:        openai.GPT4o,
			AssistantID:  assistant.ID,
			Instructions: "Very cool instructions - test",
		},
		Thread: openai.ThreadRequest{
			Messages: []openai.ThreadMessage{
				{
					Role:    openai.ThreadMessageRoleUser,
					Content: "Do something nice with the file",
					FileIDs: []string{file.ID},
					Metadata: map[string]interface{}{
						"tools": []openai.AssistantTool{{Type: "file_search"}},
					},
				},
			},
		},
	})

Expected behavior
Expected that the request was succesfull and not throwing 400 bad request for that parameter.

Screenshots/Logs

2024/06/19 20:19:55 CreateThreadAndRun error: error, status code: 400, message: Unknown parameter: 'thread.messages[0].file_ids'.

Environment (please complete the following information):

  • go-openai version: [e.g. v1.26.0]
  • Go version: [1.22.3 windows/amd64]
  • OS: Windows
@rasmusviben rasmusviben added the bug Something isn't working label Jun 19, 2024
@tforbus
Copy link

tforbus commented Jun 19, 2024

I think this PR is aiming to fix this issue.

@rasmusviben i'm seeing issues where the run states are never making it out of queued. Wondering if you'd seen this (maybe prior to v1.26.0)

@rasmusviben
Copy link
Author

I think this PR is aiming to fix this issue.

@rasmusviben i'm seeing issues where the run states are never making it out of queued. Wondering if you'd seen this (maybe prior to v1.26.0)

Alright - do you know the ETA for getting that PR into a new release? :)

I tried downgrading to 1.24 and 1.25, but then new exception is thrown:

Invalid type for 'thread.messages[0].metadata.tools': expected a string, but got an array instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants