Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

openai reasoning initial types

Ishaan Jaff4b1b87eb674d
diff --git a/litellm/responses/main.py b/litellm/responses/main.py
new file mode 100644
index 00000000000..2d66f8e616b
--- /dev/null
+++ b/litellm/responses/main.py
@@ -0,0 +1,45 @@
+from typing import Any, Dict, Iterable, List, Literal, Optional, Union
+
+import httpx
+
+from litellm.types.llms.openai import (
+ Reasoning,
+ ResponseIncludable,
+ ResponseInputParam,
+ ResponseTextConfigParam,
+ ToolChoice,
+ ToolParam,
+)
+
+
+async def aresponses():
+ pass
+
+
+def responses(
+ input: Union[str, ResponseInputParam],
+ model: str,
+ include: Optional[List[ResponseIncludable]] = None,
+ instructions: Optional[str] = None,
+ max_output_tokens: Optional[int] = None,
+ metadata: Optional[Dict[str, Any]] = None,
+ parallel_tool_calls: Optional[bool] = None,
+ previous_response_id: Optional[str] = None,
+ reasoning: Optional[Reasoning] = None,
+ store: Optional[bool] = None,
+ stream: Optional[bool] = None,
+ temperature: Optional[float] = None,
+ text: Optional[ResponseTextConfigParam] = None,
+ tool_choice: Optional[ToolChoice] = None,
+ tools: Optional[Iterable[ToolParam]] = None,
+ top_p: Optional[float] = None,
+ truncation: Optional[Literal["auto", "disabled"]] = None,
+ user: Optional[str] = None,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Optional[Dict[str, Any]] = None,
+ extra_query: Optional[Dict[str, Any]] = None,
+ extra_body: Optional[Dict[str, Any]] = None,
+ timeout: Optional[Union[float, httpx.Timeout]] = None,
+):
+ pass
diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.py
index ee017744354..0923a3b7167 100644
--- a/litellm/types/llms/openai.py
+++ b/litellm/types/llms/openai.py
@@ -31,6 +31,14 @@ from openai.types.chat.chat_completion_prediction_content_param import (
)
from openai.types.embedding import Embedding as OpenAIEmbedding
from openai.types.fine_tuning.fine_tuning_job import FineTuningJob
+from openai.types.responses.response_create_params import (
+ Reasoning,
+ ResponseIncludable,
+ ResponseInputParam,
+ ResponseTextConfigParam,
+ ToolChoice,
+ ToolParam,
+)
from pydantic import BaseModel, Field
from typing_extensions import Dict, Required, TypedDict, override
diff --git a/tests/llm_responses_api_testing/test_openai_responses_api.py b/tests/llm_responses_api_testing/test_openai_responses_api.py
new file mode 100644
index 00000000000..74b60d35370
--- /dev/null
+++ b/tests/llm_responses_api_testing/test_openai_responses_api.py
@@ -0,0 +1,12 @@
+import os
+import sys
+
+sys.path.insert(0, os.path.abspath("../.."))
+
+
+def test_basic_openai_responses_api():
+ response = litellm.responses(
+ model="gpt-4o", input="Tell me a three sentence bedtime story about a unicorn."
+ )
+
+ validate_responses_api_response()