openai / openai/openai-python

context_management=[{"type": "type"}] in tests, not 'compaction'

Open Beginner friendly
#2,868 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
31.6k
Forks
5.7k
Avg merge
1d 6h
Merged PRs (30d)
96

Description

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

src/openai/types/responses/response_create_params.py gives us the supported string:

"""The context management entry type. Currently only 'compaction' is supported."""

It is sufficent to say that tests/api_resources/test_responses.py would fail without the right value for that key, or that the API actually able to run that test is not validating the one enum that would make something happen.

To Reproduce
  1. look at the code
  2. be astonished.
Code snippets
response = client.responses.create(
            background=True,
            context_management=[
                {
                    "type": "type",  # wot?
                    "compact_threshold": 1000,
                }
            ],
OS

AnyOS

Python version

Python 3.12

Library version

v2.20.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting src/openai/types/responses/response_create_params.py and the context_management example in tests/api_resources/test_responses.py. Compare the declared supported entry type with the value used by the test, then run that test file. Done means the test uses the supported context-management value and passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.