40 matches across 1 files for error path:libs/partners/openai/langchain_openai/chat_models/base.py
snippet_mode: auto · sorted by relevance
libs/partners/openai/langchain_openai/chat_models/base.py PYTHON 40 matches · showing 5 view file →
556
557
558class OpenAIAPIContextOverflowError(openai.APIError, ContextOverflowError):
559 """APIError raised when input exceeds OpenAI's context limit."""
560
· · ·
561
562def _handle_openai_bad_request(e: openai.BadRequestError) -> None:
563 if (
564 "context_length_exceeded" in str(e)
· · ·
565 or "Input tokens exceed the configured limit" in e.message
566 or "prompt is too long" in e.message
567 or "ContextWindowExceededError" in e.message
568 ):
569 raise OpenAIContextOverflowError(
· · ·
569 raise OpenAIContextOverflowError(
570 message=e.message, response=e.response, body=e.body
571 ) from e
· · ·
594
595
596def _handle_openai_api_error(e: openai.APIError) -> None:
597 error_message = str(e)
598 if "exceeds the context window" in error_message:
+ 35 more matches in this file
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.