Skip to content

Conversation

@kompfner
Copy link
Contributor

…in favor of LLMContext, except for:

  • Usage in classes that are already deprecated
  • Usage related to realtime LLMs, which don't yet support LLMContext
  • Usage in (soon-to-be-deprecated) code paths related to OpenAILLMContext itself and associated machinery

…in favor of `LLMContext`, except for:

- Usage in classes that are already deprecated
- Usage related to realtime LLMs, which don't yet support `LLMContext`
- Usage in (soon-to-be-deprecated) code paths related to `OpenAILLMContext` itself and associated machinery
{"role": "user", "content": " How is the weather today in San Francisco, California?"},
]
context = OpenAILLMContext(messages, standard_tools())
# This is done by default inside the create_context_aggregator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using universal LLMContext let us get rid of this hack 👍

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 43.75000% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...t/processors/aggregators/llm_response_universal.py 58.33% 5 Missing ⚠️
...rc/pipecat/processors/aggregators/user_response.py 0.00% 4 Missing ⚠️
Files with missing lines Coverage Δ
...rc/pipecat/processors/aggregators/user_response.py 0.00% <0.00%> (ø)
...t/processors/aggregators/llm_response_universal.py 55.79% <58.33%> (+55.79%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

async def _test_llm_function_calling(llm: LLMService):
# Create an AsyncMock for the function
mock_fetch_weather = AsyncMock()
# Create a mock weather function
Copy link
Contributor Author

@kompfner kompfner Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the way we're mocking the function to avoid this unit test printing a deprecation warning.

The issue was that the AsyncMock()'s signature didn't match the single-FunctionCallParams-argument signature our code is expecting. Our code would then assume it was a deprecated old-style function.

Copy link
Contributor

@filipi87 filipi87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kompfner kompfner merged commit a14a53a into main Sep 30, 2025
6 checks passed
@kompfner kompfner deleted the pk/remove-openaillmcontext-usage branch September 30, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants