Skip to content

Request: make it possible to specify the upper limit of history #1208

Closed

Description

@higutea

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

I specified the limit parameter, but the message history does not match the limit parameter value.
https://github.com/openai/openai-python/blob/main/src/openai/types/beta/threads/message_list_params.py#L29-L30

    limit: int
    """A limit on the number of objects to be returned.

it is forum feedback url.
https://community.openai.com/t/request-make-it-possible-to-specify-the-upper-limit-of-history/663420

To Reproduce

always

Code snippets

def _get_message(gpt_thread_id:str, secret:str):
    client = OpenAI(api_key=secret)
    return client.beta.threads.messages.list(
        thread_id=gpt_thread_id,
        extra_query = {"limit": 1},
        limit=1
    )


### OS

mac(docker debian)

### Python version

python3.9

### Library version

opneai v1.12.0

Activity

  1. added
    bug
    on Mar 4, 2024
  2. rattrayalex commented on Mar 5, 2024

    @rattrayalex
    Contributor

    Thanks for the suggestion!

    This sounds like a feature request for the underlying OpenAI API and not the Python library, so I'm going to go ahead and close this issue.

    Would you mind reposting at community.openai.com?

  3. higutea commented on Mar 6, 2024

    @higutea
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions