Skip to content

Can't send files - missing purpose #65

@not4fame

Description

@not4fame

Hi I am trying to send files for finetuning from my api service (not command line)
I tried:
return json.loads(requests.post( 'https://api.openai.com/v1/files', headers={'Authorization': 'Bearer '+ os.getenv("OPENAI_API_KEY")}, json={"purpose":"fine-tune"}, files={'file': "\n".join(data)} ).text)
and
return json.loads(requests.post( 'https://api.openai.com/v1/files', headers={'Authorization': 'Bearer '+ os.getenv("OPENAI_API_KEY")}, params={"purpose":"fine-tune"}, files={'file': "\n".join(data)} ).text)

but I got "'purpose' is a required property" error

and when I try:
return json.loads(requests.post( 'https://api.openai.com/v1/files', headers={'Authorization': 'Bearer '+ os.getenv("OPENAI_API_KEY")}, files={"purpose":"fine-tune", 'file': "\n".join(data)} ).text)

I got "'' is not one of ['fine-tune', 'answers', 'search', 'classifications'] - 'purpose'" error

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions