mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13d706e274 |
+63
-4
@@ -1,12 +1,12 @@
|
|||||||
lockVersion: 2.0.0
|
lockVersion: 2.0.0
|
||||||
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
|
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
|
||||||
management:
|
management:
|
||||||
docChecksum: 74d4d2140677e899c1489f39198ea464
|
docChecksum: fff8b3c28663df858db3a222b1f62d40
|
||||||
docVersion: 1.0.0
|
docVersion: 1.0.0
|
||||||
speakeasyVersion: 1.666.0
|
speakeasyVersion: 1.666.0
|
||||||
generationVersion: 2.768.0
|
generationVersion: 2.768.0
|
||||||
releaseVersion: 0.8.0
|
releaseVersion: 0.9.0
|
||||||
configChecksum: fd866e0d9d3fef2d1d0ef2a52689a406
|
configChecksum: e6f61aeb6e1587fb2f6f67ef3b5217c5
|
||||||
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
|
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||||
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
|
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||||
published: true
|
published: true
|
||||||
@@ -74,6 +74,7 @@ generatedFiles:
|
|||||||
- docs/components/chatgenerationparams.md
|
- docs/components/chatgenerationparams.md
|
||||||
- docs/components/chatgenerationparamsby.md
|
- docs/components/chatgenerationparamsby.md
|
||||||
- docs/components/chatgenerationparamsidautorouter.md
|
- docs/components/chatgenerationparamsidautorouter.md
|
||||||
|
- docs/components/chatgenerationparamsidcontextcompression.md
|
||||||
- docs/components/chatgenerationparamsidfileparser.md
|
- docs/components/chatgenerationparamsidfileparser.md
|
||||||
- docs/components/chatgenerationparamsidmoderation.md
|
- docs/components/chatgenerationparamsidmoderation.md
|
||||||
- docs/components/chatgenerationparamsidresponsehealing.md
|
- docs/components/chatgenerationparamsidresponsehealing.md
|
||||||
@@ -85,6 +86,7 @@ generatedFiles:
|
|||||||
- docs/components/chatgenerationparamsorder.md
|
- docs/components/chatgenerationparamsorder.md
|
||||||
- docs/components/chatgenerationparamspartition.md
|
- docs/components/chatgenerationparamspartition.md
|
||||||
- docs/components/chatgenerationparamspluginautorouter.md
|
- docs/components/chatgenerationparamspluginautorouter.md
|
||||||
|
- docs/components/chatgenerationparamsplugincontextcompression.md
|
||||||
- docs/components/chatgenerationparamspluginfileparser.md
|
- docs/components/chatgenerationparamspluginfileparser.md
|
||||||
- docs/components/chatgenerationparamspluginmoderation.md
|
- docs/components/chatgenerationparamspluginmoderation.md
|
||||||
- docs/components/chatgenerationparamspluginresponsehealing.md
|
- docs/components/chatgenerationparamspluginresponsehealing.md
|
||||||
@@ -143,14 +145,19 @@ generatedFiles:
|
|||||||
- docs/components/completiontokensdetails.md
|
- docs/components/completiontokensdetails.md
|
||||||
- docs/components/compoundfilter.md
|
- docs/components/compoundfilter.md
|
||||||
- docs/components/compoundfiltertype.md
|
- docs/components/compoundfiltertype.md
|
||||||
|
- docs/components/conflictresponseerrordata.md
|
||||||
- docs/components/connectorid.md
|
- docs/components/connectorid.md
|
||||||
- docs/components/container.md
|
- docs/components/container.md
|
||||||
- docs/components/containerauto.md
|
- docs/components/containerauto.md
|
||||||
- docs/components/containertype.md
|
- docs/components/containertype.md
|
||||||
|
- docs/components/contextcompressionengine.md
|
||||||
- docs/components/costdetails.md
|
- docs/components/costdetails.md
|
||||||
- docs/components/createchargerequest.md
|
- docs/components/createchargerequest.md
|
||||||
- docs/components/data.md
|
- docs/components/data.md
|
||||||
- docs/components/datacollection.md
|
- docs/components/datacollection.md
|
||||||
|
- docs/components/datetimeservertool.md
|
||||||
|
- docs/components/datetimeservertoolparameters.md
|
||||||
|
- docs/components/datetimeservertooltype.md
|
||||||
- docs/components/debugoptions.md
|
- docs/components/debugoptions.md
|
||||||
- docs/components/defaultparameters.md
|
- docs/components/defaultparameters.md
|
||||||
- docs/components/developermessage.md
|
- docs/components/developermessage.md
|
||||||
@@ -350,6 +357,7 @@ generatedFiles:
|
|||||||
- docs/components/openresponsesreasoningtype.md
|
- docs/components/openresponsesreasoningtype.md
|
||||||
- docs/components/openresponsesrequest.md
|
- docs/components/openresponsesrequest.md
|
||||||
- docs/components/openresponsesrequestidautorouter.md
|
- docs/components/openresponsesrequestidautorouter.md
|
||||||
|
- docs/components/openresponsesrequestidcontextcompression.md
|
||||||
- docs/components/openresponsesrequestidfileparser.md
|
- docs/components/openresponsesrequestidfileparser.md
|
||||||
- docs/components/openresponsesrequestidmoderation.md
|
- docs/components/openresponsesrequestidmoderation.md
|
||||||
- docs/components/openresponsesrequestidresponsehealing.md
|
- docs/components/openresponsesrequestidresponsehealing.md
|
||||||
@@ -360,6 +368,7 @@ generatedFiles:
|
|||||||
- docs/components/openresponsesrequestonly.md
|
- docs/components/openresponsesrequestonly.md
|
||||||
- docs/components/openresponsesrequestorder.md
|
- docs/components/openresponsesrequestorder.md
|
||||||
- docs/components/openresponsesrequestpluginautorouter.md
|
- docs/components/openresponsesrequestpluginautorouter.md
|
||||||
|
- docs/components/openresponsesrequestplugincontextcompression.md
|
||||||
- docs/components/openresponsesrequestpluginfileparser.md
|
- docs/components/openresponsesrequestpluginfileparser.md
|
||||||
- docs/components/openresponsesrequestpluginmoderation.md
|
- docs/components/openresponsesrequestpluginmoderation.md
|
||||||
- docs/components/openresponsesrequestpluginresponsehealing.md
|
- docs/components/openresponsesrequestpluginresponsehealing.md
|
||||||
@@ -397,13 +406,25 @@ generatedFiles:
|
|||||||
- docs/components/openresponsesstreameventtoplogprob2.md
|
- docs/components/openresponsesstreameventtoplogprob2.md
|
||||||
- docs/components/openresponsesusage.md
|
- docs/components/openresponsesusage.md
|
||||||
- docs/components/openresponseswebsearch20250826tool.md
|
- docs/components/openresponseswebsearch20250826tool.md
|
||||||
|
- docs/components/openresponseswebsearch20250826toolengine.md
|
||||||
- docs/components/openresponseswebsearch20250826toolfilters.md
|
- docs/components/openresponseswebsearch20250826toolfilters.md
|
||||||
- docs/components/openresponseswebsearch20250826tooltype.md
|
- docs/components/openresponseswebsearch20250826tooltype.md
|
||||||
|
- docs/components/openresponseswebsearchcallcompleted.md
|
||||||
|
- docs/components/openresponseswebsearchcallcompletedtype.md
|
||||||
|
- docs/components/openresponseswebsearchcallinprogress.md
|
||||||
|
- docs/components/openresponseswebsearchcallinprogresstype.md
|
||||||
|
- docs/components/openresponseswebsearchcallsearching.md
|
||||||
|
- docs/components/openresponseswebsearchcallsearchingtype.md
|
||||||
- docs/components/openresponseswebsearchpreview20250311tool.md
|
- docs/components/openresponseswebsearchpreview20250311tool.md
|
||||||
|
- docs/components/openresponseswebsearchpreview20250311toolengine.md
|
||||||
|
- docs/components/openresponseswebsearchpreview20250311toolfilters.md
|
||||||
- docs/components/openresponseswebsearchpreview20250311tooltype.md
|
- docs/components/openresponseswebsearchpreview20250311tooltype.md
|
||||||
- docs/components/openresponseswebsearchpreviewtool.md
|
- docs/components/openresponseswebsearchpreviewtool.md
|
||||||
|
- docs/components/openresponseswebsearchpreviewtoolengine.md
|
||||||
|
- docs/components/openresponseswebsearchpreviewtoolfilters.md
|
||||||
- docs/components/openresponseswebsearchpreviewtooltype.md
|
- docs/components/openresponseswebsearchpreviewtooltype.md
|
||||||
- docs/components/openresponseswebsearchtool.md
|
- docs/components/openresponseswebsearchtool.md
|
||||||
|
- docs/components/openresponseswebsearchtoolengine.md
|
||||||
- docs/components/openresponseswebsearchtoolfilters.md
|
- docs/components/openresponseswebsearchtoolfilters.md
|
||||||
- docs/components/openresponseswebsearchtooltype.md
|
- docs/components/openresponseswebsearchtooltype.md
|
||||||
- docs/components/outputformat.md
|
- docs/components/outputformat.md
|
||||||
@@ -550,7 +571,12 @@ generatedFiles:
|
|||||||
- docs/components/responsesoutputmessagetype.md
|
- docs/components/responsesoutputmessagetype.md
|
||||||
- docs/components/responsesoutputmodality.md
|
- docs/components/responsesoutputmodality.md
|
||||||
- docs/components/responsessearchcontextsize.md
|
- docs/components/responsessearchcontextsize.md
|
||||||
|
- docs/components/responsesservertooloutput.md
|
||||||
|
- docs/components/responsesservertooloutputstatus.md
|
||||||
- docs/components/responseswebsearchcalloutput.md
|
- docs/components/responseswebsearchcalloutput.md
|
||||||
|
- docs/components/responseswebsearchservertool.md
|
||||||
|
- docs/components/responseswebsearchservertoolparameters.md
|
||||||
|
- docs/components/responseswebsearchservertooltype.md
|
||||||
- docs/components/responseswebsearchuserlocation.md
|
- docs/components/responseswebsearchuserlocation.md
|
||||||
- docs/components/responseswebsearchuserlocationtype.md
|
- docs/components/responseswebsearchuserlocationtype.md
|
||||||
- docs/components/responsetextconfig.md
|
- docs/components/responsetextconfig.md
|
||||||
@@ -573,6 +599,7 @@ generatedFiles:
|
|||||||
- docs/components/toolchoiceoptionrequired.md
|
- docs/components/toolchoiceoptionrequired.md
|
||||||
- docs/components/tooldefinitionjson.md
|
- docs/components/tooldefinitionjson.md
|
||||||
- docs/components/tooldefinitionjsonfunction.md
|
- docs/components/tooldefinitionjsonfunction.md
|
||||||
|
- docs/components/tooldefinitionjsonfunctionfunction.md
|
||||||
- docs/components/tooldefinitionjsontype.md
|
- docs/components/tooldefinitionjsontype.md
|
||||||
- docs/components/toolresponsemessage.md
|
- docs/components/toolresponsemessage.md
|
||||||
- docs/components/toolresponsemessagecontent.md
|
- docs/components/toolresponsemessagecontent.md
|
||||||
@@ -620,9 +647,28 @@ generatedFiles:
|
|||||||
- docs/components/websearchengine.md
|
- docs/components/websearchengine.md
|
||||||
- docs/components/websearchpreviewtooluserlocation.md
|
- docs/components/websearchpreviewtooluserlocation.md
|
||||||
- docs/components/websearchpreviewtooluserlocationtype.md
|
- docs/components/websearchpreviewtooluserlocationtype.md
|
||||||
|
- docs/components/websearchservertool.md
|
||||||
|
- docs/components/websearchservertoolengine.md
|
||||||
|
- docs/components/websearchservertoolparameters.md
|
||||||
|
- docs/components/websearchservertoolparameterstype.md
|
||||||
|
- docs/components/websearchservertoolsearchcontextsize.md
|
||||||
|
- docs/components/websearchservertooltypeopenrouterwebsearch.md
|
||||||
|
- docs/components/websearchservertooluserlocation.md
|
||||||
|
- docs/components/websearchshorthand.md
|
||||||
|
- docs/components/websearchshorthandengine.md
|
||||||
|
- docs/components/websearchshorthandparameters.md
|
||||||
|
- docs/components/websearchshorthandparametersengine.md
|
||||||
|
- docs/components/websearchshorthandparameterssearchcontextsize.md
|
||||||
|
- docs/components/websearchshorthandparameterstype.md
|
||||||
|
- docs/components/websearchshorthandparametersuserlocation.md
|
||||||
|
- docs/components/websearchshorthandsearchcontextsize.md
|
||||||
|
- docs/components/websearchshorthandtype.md
|
||||||
|
- docs/components/websearchshorthandtypeapproximate.md
|
||||||
|
- docs/components/websearchshorthanduserlocation.md
|
||||||
- docs/components/websearchstatus.md
|
- docs/components/websearchstatus.md
|
||||||
- docs/errors/badgatewayresponseerror.md
|
- docs/errors/badgatewayresponseerror.md
|
||||||
- docs/errors/badrequestresponseerror.md
|
- docs/errors/badrequestresponseerror.md
|
||||||
|
- docs/errors/conflictresponseerror.md
|
||||||
- docs/errors/edgenetworktimeoutresponseerror.md
|
- docs/errors/edgenetworktimeoutresponseerror.md
|
||||||
- docs/errors/forbiddenresponseerror.md
|
- docs/errors/forbiddenresponseerror.md
|
||||||
- docs/errors/internalserverresponseerror.md
|
- docs/errors/internalserverresponseerror.md
|
||||||
@@ -861,8 +907,11 @@ generatedFiles:
|
|||||||
- src/openrouter/components/chatstreamingresponsechunk.py
|
- src/openrouter/components/chatstreamingresponsechunk.py
|
||||||
- src/openrouter/components/chatstreamoptions.py
|
- src/openrouter/components/chatstreamoptions.py
|
||||||
- src/openrouter/components/compoundfilter.py
|
- src/openrouter/components/compoundfilter.py
|
||||||
|
- src/openrouter/components/conflictresponseerrordata.py
|
||||||
|
- src/openrouter/components/contextcompressionengine.py
|
||||||
- src/openrouter/components/createchargerequest.py
|
- src/openrouter/components/createchargerequest.py
|
||||||
- src/openrouter/components/datacollection.py
|
- src/openrouter/components/datacollection.py
|
||||||
|
- src/openrouter/components/datetimeservertool.py
|
||||||
- src/openrouter/components/debugoptions.py
|
- src/openrouter/components/debugoptions.py
|
||||||
- src/openrouter/components/defaultparameters.py
|
- src/openrouter/components/defaultparameters.py
|
||||||
- src/openrouter/components/developermessage.py
|
- src/openrouter/components/developermessage.py
|
||||||
@@ -929,6 +978,9 @@ generatedFiles:
|
|||||||
- src/openrouter/components/openresponsesstreamevent.py
|
- src/openrouter/components/openresponsesstreamevent.py
|
||||||
- src/openrouter/components/openresponsesusage.py
|
- src/openrouter/components/openresponsesusage.py
|
||||||
- src/openrouter/components/openresponseswebsearch20250826tool.py
|
- src/openrouter/components/openresponseswebsearch20250826tool.py
|
||||||
|
- src/openrouter/components/openresponseswebsearchcallcompleted.py
|
||||||
|
- src/openrouter/components/openresponseswebsearchcallinprogress.py
|
||||||
|
- src/openrouter/components/openresponseswebsearchcallsearching.py
|
||||||
- src/openrouter/components/openresponseswebsearchpreview20250311tool.py
|
- src/openrouter/components/openresponseswebsearchpreview20250311tool.py
|
||||||
- src/openrouter/components/openresponseswebsearchpreviewtool.py
|
- src/openrouter/components/openresponseswebsearchpreviewtool.py
|
||||||
- src/openrouter/components/openresponseswebsearchtool.py
|
- src/openrouter/components/openresponseswebsearchtool.py
|
||||||
@@ -985,7 +1037,9 @@ generatedFiles:
|
|||||||
- src/openrouter/components/responsesoutputmessage.py
|
- src/openrouter/components/responsesoutputmessage.py
|
||||||
- src/openrouter/components/responsesoutputmodality.py
|
- src/openrouter/components/responsesoutputmodality.py
|
||||||
- src/openrouter/components/responsessearchcontextsize.py
|
- src/openrouter/components/responsessearchcontextsize.py
|
||||||
|
- src/openrouter/components/responsesservertooloutput.py
|
||||||
- src/openrouter/components/responseswebsearchcalloutput.py
|
- src/openrouter/components/responseswebsearchcalloutput.py
|
||||||
|
- src/openrouter/components/responseswebsearchservertool.py
|
||||||
- src/openrouter/components/responseswebsearchuserlocation.py
|
- src/openrouter/components/responseswebsearchuserlocation.py
|
||||||
- src/openrouter/components/responsetextconfig.py
|
- src/openrouter/components/responsetextconfig.py
|
||||||
- src/openrouter/components/security.py
|
- src/openrouter/components/security.py
|
||||||
@@ -1004,6 +1058,8 @@ generatedFiles:
|
|||||||
- src/openrouter/components/videoinput.py
|
- src/openrouter/components/videoinput.py
|
||||||
- src/openrouter/components/websearchengine.py
|
- src/openrouter/components/websearchengine.py
|
||||||
- src/openrouter/components/websearchpreviewtooluserlocation.py
|
- src/openrouter/components/websearchpreviewtooluserlocation.py
|
||||||
|
- src/openrouter/components/websearchservertool.py
|
||||||
|
- src/openrouter/components/websearchshorthand.py
|
||||||
- src/openrouter/components/websearchstatus.py
|
- src/openrouter/components/websearchstatus.py
|
||||||
- src/openrouter/credits.py
|
- src/openrouter/credits.py
|
||||||
- src/openrouter/embeddings.py
|
- src/openrouter/embeddings.py
|
||||||
@@ -1011,6 +1067,7 @@ generatedFiles:
|
|||||||
- src/openrouter/errors/__init__.py
|
- src/openrouter/errors/__init__.py
|
||||||
- src/openrouter/errors/badgatewayresponse_error.py
|
- src/openrouter/errors/badgatewayresponse_error.py
|
||||||
- src/openrouter/errors/badrequestresponse_error.py
|
- src/openrouter/errors/badrequestresponse_error.py
|
||||||
|
- src/openrouter/errors/conflictresponse_error.py
|
||||||
- src/openrouter/errors/edgenetworktimeoutresponse_error.py
|
- src/openrouter/errors/edgenetworktimeoutresponse_error.py
|
||||||
- src/openrouter/errors/forbiddenresponse_error.py
|
- src/openrouter/errors/forbiddenresponse_error.py
|
||||||
- src/openrouter/errors/internalserverresponse_error.py
|
- src/openrouter/errors/internalserverresponse_error.py
|
||||||
@@ -1102,7 +1159,7 @@ examples:
|
|||||||
application/json: {"store": false, "service_tier": "auto", "stream": false}
|
application/json: {"store": false, "service_tier": "auto", "stream": false}
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 7468.94, "frequency_penalty": 3967.09, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true}
|
application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"type": "message", "status": "completed"}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 7468.94, "frequency_penalty": 3967.09, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true}
|
||||||
"400":
|
"400":
|
||||||
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
|
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
|
||||||
"401":
|
"401":
|
||||||
@@ -1420,6 +1477,8 @@ examples:
|
|||||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||||
"500":
|
"500":
|
||||||
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
|
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
|
||||||
|
"409":
|
||||||
|
application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}}
|
||||||
sendChatCompletionRequest:
|
sendChatCompletionRequest:
|
||||||
speakeasy-default-send-chat-completion-request:
|
speakeasy-default-send-chat-completion-request:
|
||||||
requestBody:
|
requestBody:
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ generation:
|
|||||||
skipResponseBodyAssertions: false
|
skipResponseBodyAssertions: false
|
||||||
preApplyUnionDiscriminators: true
|
preApplyUnionDiscriminators: true
|
||||||
python:
|
python:
|
||||||
version: 0.8.0
|
version: 0.9.0
|
||||||
additionalDependencies:
|
additionalDependencies:
|
||||||
dev: {}
|
dev: {}
|
||||||
main: {}
|
main: {}
|
||||||
|
|||||||
+698
-7
@@ -589,6 +589,31 @@ components:
|
|||||||
id: imagegen-abc123
|
id: imagegen-abc123
|
||||||
result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
|
result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
|
||||||
status: completed
|
status: completed
|
||||||
|
ResponsesServerToolOutput:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
pattern: '^openrouter:'
|
||||||
|
description: Server tool type (e.g. openrouter:datetime, openrouter:web_search)
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- completed
|
||||||
|
- in_progress
|
||||||
|
- incomplete
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- status
|
||||||
|
additionalProperties:
|
||||||
|
nullable: true
|
||||||
|
description: A generic OpenRouter server tool output item
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
id: ws_tmp_abc123
|
||||||
|
status: completed
|
||||||
ResponsesOutputItem:
|
ResponsesOutputItem:
|
||||||
anyOf:
|
anyOf:
|
||||||
- $ref: '#/components/schemas/ResponsesOutputMessage'
|
- $ref: '#/components/schemas/ResponsesOutputMessage'
|
||||||
@@ -597,6 +622,7 @@ components:
|
|||||||
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
||||||
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
||||||
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
||||||
|
- $ref: '#/components/schemas/ResponsesServerToolOutput'
|
||||||
description: An output item from the response
|
description: An output item from the response
|
||||||
example:
|
example:
|
||||||
id: msg-abc123
|
id: msg-abc123
|
||||||
@@ -1062,6 +1088,39 @@ components:
|
|||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
|
||||||
|
filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
|
||||||
|
engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
filters:
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
properties:
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search preview tool configuration
|
description: Web search preview tool configuration
|
||||||
@@ -1078,6 +1137,39 @@ components:
|
|||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
|
||||||
|
filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
|
||||||
|
engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
filters:
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
properties:
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search preview tool configuration (2025-03-11 version)
|
description: Web search preview tool configuration (2025-03-11 version)
|
||||||
@@ -1126,15 +1218,40 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
search_context_size:
|
search_context_size:
|
||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
|
||||||
|
filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
|
||||||
|
engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search tool configuration
|
description: Web search tool configuration
|
||||||
example:
|
example:
|
||||||
type: web_search
|
type: web_search
|
||||||
|
engine: auto
|
||||||
filters:
|
filters:
|
||||||
allowed_domains:
|
allowed_domains:
|
||||||
- example.com
|
- example.com
|
||||||
@@ -1154,15 +1271,40 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
search_context_size:
|
search_context_size:
|
||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
|
||||||
|
filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
|
||||||
|
engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search tool configuration (2025-08-26 version)
|
description: Web search tool configuration (2025-08-26 version)
|
||||||
example:
|
example:
|
||||||
type: web_search_2025_08_26
|
type: web_search_2025_08_26
|
||||||
|
engine: auto
|
||||||
filters:
|
filters:
|
||||||
allowed_domains:
|
allowed_domains:
|
||||||
- example.com
|
- example.com
|
||||||
@@ -2973,6 +3115,93 @@ components:
|
|||||||
output_index: 0
|
output_index: 0
|
||||||
sequence_number: 4
|
sequence_number: 4
|
||||||
item_id: call-123
|
item_id: call-123
|
||||||
|
OpenAIResponsesWebSearchCallInProgress:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- response.web_search_call.in_progress
|
||||||
|
item_id:
|
||||||
|
type: string
|
||||||
|
output_index:
|
||||||
|
type: number
|
||||||
|
sequence_number:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- item_id
|
||||||
|
- output_index
|
||||||
|
- sequence_number
|
||||||
|
OpenResponsesWebSearchCallInProgress:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Web search call in progress
|
||||||
|
example:
|
||||||
|
type: response.web_search_call.in_progress
|
||||||
|
output_index: 0
|
||||||
|
sequence_number: 1
|
||||||
|
item_id: ws-123
|
||||||
|
OpenAIResponsesWebSearchCallSearching:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- response.web_search_call.searching
|
||||||
|
item_id:
|
||||||
|
type: string
|
||||||
|
output_index:
|
||||||
|
type: number
|
||||||
|
sequence_number:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- item_id
|
||||||
|
- output_index
|
||||||
|
- sequence_number
|
||||||
|
OpenResponsesWebSearchCallSearching:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Web search call is searching
|
||||||
|
example:
|
||||||
|
type: response.web_search_call.searching
|
||||||
|
output_index: 0
|
||||||
|
sequence_number: 2
|
||||||
|
item_id: ws-123
|
||||||
|
OpenAIResponsesSearchCompleted:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- response.web_search_call.completed
|
||||||
|
item_id:
|
||||||
|
type: string
|
||||||
|
output_index:
|
||||||
|
type: number
|
||||||
|
sequence_number:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- item_id
|
||||||
|
- output_index
|
||||||
|
- sequence_number
|
||||||
|
OpenResponsesWebSearchCallCompleted:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/OpenAIResponsesSearchCompleted'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Web search call completed
|
||||||
|
example:
|
||||||
|
type: response.web_search_call.completed
|
||||||
|
output_index: 0
|
||||||
|
sequence_number: 3
|
||||||
|
item_id: ws-123
|
||||||
OpenResponsesStreamEvent:
|
OpenResponsesStreamEvent:
|
||||||
oneOf:
|
oneOf:
|
||||||
- allOf:
|
- allOf:
|
||||||
@@ -3360,6 +3589,9 @@ components:
|
|||||||
- $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating'
|
- $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating'
|
||||||
- $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage'
|
- $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage'
|
||||||
- $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted'
|
- $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted'
|
||||||
|
- $ref: '#/components/schemas/OpenResponsesWebSearchCallInProgress'
|
||||||
|
- $ref: '#/components/schemas/OpenResponsesWebSearchCallSearching'
|
||||||
|
- $ref: '#/components/schemas/OpenResponsesWebSearchCallCompleted'
|
||||||
description: Union of all possible event types emitted during response streaming
|
description: Union of all possible event types emitted during response streaming
|
||||||
example:
|
example:
|
||||||
type: response.created
|
type: response.created
|
||||||
@@ -4100,10 +4332,41 @@ components:
|
|||||||
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
||||||
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
||||||
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
||||||
|
- $ref: '#/components/schemas/ResponsesServerToolOutput'
|
||||||
description: Input for a response request - can be a string or array of items
|
description: Input for a response request - can be a string or array of items
|
||||||
example:
|
example:
|
||||||
- role: user
|
- role: user
|
||||||
content: What is the weather today?
|
content: What is the weather today?
|
||||||
|
ResponsesWebSearchServerTool:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: Maximum number of search results to return per search call. Defaults to 5.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is
|
||||||
|
reached, the tool will stop returning new results.
|
||||||
|
example: 20
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: searches the web for current information'
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
max_results: 5
|
||||||
OpenResponsesResponseText:
|
OpenResponsesResponseText:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/components/schemas/ResponseTextConfig'
|
- $ref: '#/components/schemas/ResponseTextConfig'
|
||||||
@@ -4379,6 +4642,11 @@ components:
|
|||||||
engine:
|
engine:
|
||||||
$ref: '#/components/schemas/PDFParserEngine'
|
$ref: '#/components/schemas/PDFParserEngine'
|
||||||
description: Options for PDF parsing.
|
description: Options for PDF parsing.
|
||||||
|
ContextCompressionEngine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- middle-out
|
||||||
|
description: The compression engine to use. Defaults to "middle-out".
|
||||||
OpenResponsesRequest:
|
OpenResponsesRequest:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -4392,7 +4660,7 @@ components:
|
|||||||
tools:
|
tools:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
oneOf:
|
anyOf:
|
||||||
- allOf:
|
- allOf:
|
||||||
- $ref: '#/components/schemas/OpenResponsesFunctionTool'
|
- $ref: '#/components/schemas/OpenResponsesFunctionTool'
|
||||||
- type: object
|
- type: object
|
||||||
@@ -4428,6 +4696,8 @@ components:
|
|||||||
- $ref: '#/components/schemas/OpenResponsesFunctionShellTool'
|
- $ref: '#/components/schemas/OpenResponsesFunctionShellTool'
|
||||||
- $ref: '#/components/schemas/OpenResponsesApplyPatchTool'
|
- $ref: '#/components/schemas/OpenResponsesApplyPatchTool'
|
||||||
- $ref: '#/components/schemas/OpenResponsesCustomTool'
|
- $ref: '#/components/schemas/OpenResponsesCustomTool'
|
||||||
|
- $ref: '#/components/schemas/DatetimeServerTool'
|
||||||
|
- $ref: '#/components/schemas/ResponsesWebSearchServerTool'
|
||||||
tool_choice:
|
tool_choice:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesToolChoice'
|
$ref: '#/components/schemas/OpenAIResponsesToolChoice'
|
||||||
parallel_tool_calls:
|
parallel_tool_calls:
|
||||||
@@ -4740,6 +5010,19 @@ components:
|
|||||||
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- context-compression
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
|
||||||
|
engine:
|
||||||
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
||||||
|
required:
|
||||||
|
- id
|
||||||
description: Plugins you want to enable for this request, including their settings.
|
description: Plugins you want to enable for this request, including their settings.
|
||||||
route:
|
route:
|
||||||
type: string
|
type: string
|
||||||
@@ -9720,6 +10003,89 @@ components:
|
|||||||
- role
|
- role
|
||||||
- content
|
- content
|
||||||
description: Anthropic message with OpenRouter extensions
|
description: Anthropic message with OpenRouter extensions
|
||||||
|
AnthropicWebSearchServerTool:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and
|
||||||
|
domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the
|
||||||
|
Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is
|
||||||
|
reached, the tool will stop returning new results. Useful for controlling cost and context size in
|
||||||
|
agentic loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the
|
||||||
|
Exa engine; ignored with native provider search.
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native
|
||||||
|
provider search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
|
||||||
|
provider search.
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: searches the web for current information'
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
max_results: 5
|
||||||
AnthropicOutputConfig:
|
AnthropicOutputConfig:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -9940,7 +10306,7 @@ components:
|
|||||||
tools:
|
tools:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
oneOf:
|
anyOf:
|
||||||
- type: object
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
@@ -10099,6 +10465,8 @@ components:
|
|||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
- name
|
- name
|
||||||
|
- $ref: '#/components/schemas/DatetimeServerTool'
|
||||||
|
- $ref: '#/components/schemas/AnthropicWebSearchServerTool'
|
||||||
tool_choice:
|
tool_choice:
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: object
|
- type: object
|
||||||
@@ -10541,6 +10909,19 @@ components:
|
|||||||
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- context-compression
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
|
||||||
|
engine:
|
||||||
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
||||||
|
required:
|
||||||
|
- id
|
||||||
description: Plugins you want to enable for this request, including their settings.
|
description: Plugins you want to enable for this request, including their settings.
|
||||||
route:
|
route:
|
||||||
type: string
|
type: string
|
||||||
@@ -11835,8 +12216,262 @@ components:
|
|||||||
- $ref: '#/components/schemas/NamedToolChoice'
|
- $ref: '#/components/schemas/NamedToolChoice'
|
||||||
description: Tool choice configuration
|
description: Tool choice configuration
|
||||||
example: auto
|
example: auto
|
||||||
ToolDefinitionJson:
|
DatetimeServerTool:
|
||||||
type: object
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:datetime
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC.
|
||||||
|
example: America/New_York
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: returns the current date and time'
|
||||||
|
example:
|
||||||
|
type: openrouter:datetime
|
||||||
|
parameters:
|
||||||
|
timezone: America/New_York
|
||||||
|
WebSearchServerTool:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and
|
||||||
|
domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the
|
||||||
|
Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is
|
||||||
|
reached, the tool will stop returning new results. Useful for controlling cost and context size in
|
||||||
|
agentic loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the
|
||||||
|
Exa engine; ignored with native provider search.
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native
|
||||||
|
provider search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
|
||||||
|
provider search.
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: searches the web for current information'
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
engine: auto
|
||||||
|
max_results: 5
|
||||||
|
WebSearchShorthand:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- web_search
|
||||||
|
- web_search_preview
|
||||||
|
- web_search_preview_2025_03_11
|
||||||
|
- web_search_2025_08_26
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
|
||||||
|
filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
|
||||||
|
engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is
|
||||||
|
reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic
|
||||||
|
loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa
|
||||||
|
engine; ignored with native provider search.
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider
|
||||||
|
search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
|
||||||
|
provider search.
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
|
||||||
|
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and
|
||||||
|
domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the
|
||||||
|
Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is
|
||||||
|
reached, the tool will stop returning new results. Useful for controlling cost and context size in
|
||||||
|
agentic loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the
|
||||||
|
Exa engine; ignored with native provider search.
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native
|
||||||
|
provider search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
|
||||||
|
provider search.
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
|
||||||
|
ToolDefinitionJson:
|
||||||
|
anyOf:
|
||||||
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
@@ -11891,7 +12526,10 @@ components:
|
|||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
- function
|
- function
|
||||||
description: Tool definition for function calling
|
- $ref: '#/components/schemas/DatetimeServerTool'
|
||||||
|
- $ref: '#/components/schemas/WebSearchServerTool'
|
||||||
|
- $ref: '#/components/schemas/WebSearchShorthand'
|
||||||
|
description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
||||||
example:
|
example:
|
||||||
type: function
|
type: function
|
||||||
function:
|
function:
|
||||||
@@ -12137,6 +12775,19 @@ components:
|
|||||||
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- context-compression
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
|
||||||
|
engine:
|
||||||
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
||||||
|
required:
|
||||||
|
- id
|
||||||
description: Plugins you want to enable for this request, including their settings.
|
description: Plugins you want to enable for this request, including their settings.
|
||||||
route:
|
route:
|
||||||
type: string
|
type: string
|
||||||
@@ -13310,6 +13961,40 @@ components:
|
|||||||
p75: 38.5
|
p75: 38.5
|
||||||
p90: 28.3
|
p90: 28.3
|
||||||
p99: 15.1
|
p99: 15.1
|
||||||
|
ConflictResponseErrorData:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: integer
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
additionalProperties:
|
||||||
|
nullable: true
|
||||||
|
required:
|
||||||
|
- code
|
||||||
|
- message
|
||||||
|
description: Error data for ConflictResponse
|
||||||
|
example:
|
||||||
|
code: 409
|
||||||
|
message: Resource conflict. Please try again later.
|
||||||
|
ConflictResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
error:
|
||||||
|
$ref: '#/components/schemas/ConflictResponseErrorData'
|
||||||
|
user_id:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
required:
|
||||||
|
- error
|
||||||
|
description: Conflict - Resource conflict or concurrent modification
|
||||||
|
example:
|
||||||
|
error:
|
||||||
|
code: 409
|
||||||
|
message: Resource conflict. Please try again later.
|
||||||
parameters: {}
|
parameters: {}
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
apiKey:
|
apiKey:
|
||||||
@@ -14679,7 +15364,7 @@ paths:
|
|||||||
description: >-
|
description: >-
|
||||||
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
|
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
|
||||||
embeddings) or "all" to include all models. Defaults to "text".
|
embeddings) or "all" to include all models. Defaults to "text".
|
||||||
name: output_modality
|
name: output_modalities
|
||||||
in: query
|
in: query
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
@@ -14689,7 +15374,7 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ModelsCountResponse'
|
$ref: '#/components/schemas/ModelsCountResponse'
|
||||||
'400':
|
'400':
|
||||||
description: Bad Request - Invalid output_modality value
|
description: Bad Request - Invalid output_modalities value
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -14744,7 +15429,7 @@ paths:
|
|||||||
description: >-
|
description: >-
|
||||||
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
|
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
|
||||||
embeddings) or "all" to include all models. Defaults to "text".
|
embeddings) or "all" to include all models. Defaults to "text".
|
||||||
name: output_modality
|
name: output_modalities
|
||||||
in: query
|
in: query
|
||||||
- schema:
|
- schema:
|
||||||
type: string
|
type: string
|
||||||
@@ -17846,6 +18531,12 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/UnauthorizedResponse'
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
||||||
|
'409':
|
||||||
|
description: Conflict - App upsert conflict during auth code creation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ConflictResponse'
|
||||||
'500':
|
'500':
|
||||||
description: Internal Server Error - Unexpected server error
|
description: Internal Server Error - Unexpected server error
|
||||||
content:
|
content:
|
||||||
|
|||||||
+667
-7
@@ -591,6 +591,32 @@ components:
|
|||||||
id: imagegen-abc123
|
id: imagegen-abc123
|
||||||
result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
|
result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
|
||||||
status: completed
|
status: completed
|
||||||
|
ResponsesServerToolOutput:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
pattern: '^openrouter:'
|
||||||
|
description: Server tool type (e.g. openrouter:datetime, openrouter:web_search)
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- completed
|
||||||
|
- in_progress
|
||||||
|
- incomplete
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- status
|
||||||
|
additionalProperties:
|
||||||
|
nullable: true
|
||||||
|
description: A generic OpenRouter server tool output item
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
id: ws_tmp_abc123
|
||||||
|
status: completed
|
||||||
ResponsesOutputItem:
|
ResponsesOutputItem:
|
||||||
anyOf:
|
anyOf:
|
||||||
- $ref: '#/components/schemas/ResponsesOutputMessage'
|
- $ref: '#/components/schemas/ResponsesOutputMessage'
|
||||||
@@ -599,6 +625,7 @@ components:
|
|||||||
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
||||||
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
||||||
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
||||||
|
- $ref: '#/components/schemas/ResponsesServerToolOutput'
|
||||||
description: An output item from the response
|
description: An output item from the response
|
||||||
example:
|
example:
|
||||||
id: msg-abc123
|
id: msg-abc123
|
||||||
@@ -1070,6 +1097,37 @@ components:
|
|||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
filters:
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
properties:
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search preview tool configuration
|
description: Web search preview tool configuration
|
||||||
@@ -1086,6 +1144,37 @@ components:
|
|||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
filters:
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
properties:
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search preview tool configuration (2025-03-11 version)
|
description: Web search preview tool configuration (2025-03-11 version)
|
||||||
@@ -1134,15 +1223,38 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
search_context_size:
|
search_context_size:
|
||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search tool configuration
|
description: Web search tool configuration
|
||||||
example:
|
example:
|
||||||
type: web_search
|
type: web_search
|
||||||
|
engine: auto
|
||||||
filters:
|
filters:
|
||||||
allowed_domains:
|
allowed_domains:
|
||||||
- example.com
|
- example.com
|
||||||
@@ -1162,15 +1274,38 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
search_context_size:
|
search_context_size:
|
||||||
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
$ref: '#/components/schemas/ResponsesSearchContextSize'
|
||||||
user_location:
|
user_location:
|
||||||
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
$ref: '#/components/schemas/ResponsesWebSearchUserLocation'
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
description: Web search tool configuration (2025-08-26 version)
|
description: Web search tool configuration (2025-08-26 version)
|
||||||
example:
|
example:
|
||||||
type: web_search_2025_08_26
|
type: web_search_2025_08_26
|
||||||
|
engine: auto
|
||||||
filters:
|
filters:
|
||||||
allowed_domains:
|
allowed_domains:
|
||||||
- example.com
|
- example.com
|
||||||
@@ -3001,6 +3136,93 @@ components:
|
|||||||
output_index: 0
|
output_index: 0
|
||||||
sequence_number: 4
|
sequence_number: 4
|
||||||
item_id: call-123
|
item_id: call-123
|
||||||
|
OpenAIResponsesWebSearchCallInProgress:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- response.web_search_call.in_progress
|
||||||
|
item_id:
|
||||||
|
type: string
|
||||||
|
output_index:
|
||||||
|
type: number
|
||||||
|
sequence_number:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- item_id
|
||||||
|
- output_index
|
||||||
|
- sequence_number
|
||||||
|
OpenResponsesWebSearchCallInProgress:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Web search call in progress
|
||||||
|
example:
|
||||||
|
type: response.web_search_call.in_progress
|
||||||
|
output_index: 0
|
||||||
|
sequence_number: 1
|
||||||
|
item_id: ws-123
|
||||||
|
OpenAIResponsesWebSearchCallSearching:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- response.web_search_call.searching
|
||||||
|
item_id:
|
||||||
|
type: string
|
||||||
|
output_index:
|
||||||
|
type: number
|
||||||
|
sequence_number:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- item_id
|
||||||
|
- output_index
|
||||||
|
- sequence_number
|
||||||
|
OpenResponsesWebSearchCallSearching:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Web search call is searching
|
||||||
|
example:
|
||||||
|
type: response.web_search_call.searching
|
||||||
|
output_index: 0
|
||||||
|
sequence_number: 2
|
||||||
|
item_id: ws-123
|
||||||
|
OpenAIResponsesSearchCompleted:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- response.web_search_call.completed
|
||||||
|
item_id:
|
||||||
|
type: string
|
||||||
|
output_index:
|
||||||
|
type: number
|
||||||
|
sequence_number:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- item_id
|
||||||
|
- output_index
|
||||||
|
- sequence_number
|
||||||
|
OpenResponsesWebSearchCallCompleted:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/OpenAIResponsesSearchCompleted'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Web search call completed
|
||||||
|
example:
|
||||||
|
type: response.web_search_call.completed
|
||||||
|
output_index: 0
|
||||||
|
sequence_number: 3
|
||||||
|
item_id: ws-123
|
||||||
OpenResponsesStreamEvent:
|
OpenResponsesStreamEvent:
|
||||||
oneOf:
|
oneOf:
|
||||||
- allOf:
|
- allOf:
|
||||||
@@ -3388,6 +3610,9 @@ components:
|
|||||||
- $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating'
|
- $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating'
|
||||||
- $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage'
|
- $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage'
|
||||||
- $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted'
|
- $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted'
|
||||||
|
- $ref: '#/components/schemas/OpenResponsesWebSearchCallInProgress'
|
||||||
|
- $ref: '#/components/schemas/OpenResponsesWebSearchCallSearching'
|
||||||
|
- $ref: '#/components/schemas/OpenResponsesWebSearchCallCompleted'
|
||||||
description: Union of all possible event types emitted during response streaming
|
description: Union of all possible event types emitted during response streaming
|
||||||
example:
|
example:
|
||||||
type: response.created
|
type: response.created
|
||||||
@@ -4127,10 +4352,40 @@ components:
|
|||||||
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
|
||||||
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
|
||||||
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
- $ref: '#/components/schemas/ResponsesImageGenerationCall'
|
||||||
|
- $ref: '#/components/schemas/ResponsesServerToolOutput'
|
||||||
description: Input for a response request - can be a string or array of items
|
description: Input for a response request - can be a string or array of items
|
||||||
example:
|
example:
|
||||||
- role: user
|
- role: user
|
||||||
content: What is the weather today?
|
content: What is the weather today?
|
||||||
|
ResponsesWebSearchServerTool:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: Maximum number of search results to return per search call. Defaults to 5.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results.
|
||||||
|
example: 20
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: searches the web for current information'
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
max_results: 5
|
||||||
OpenResponsesResponseText:
|
OpenResponsesResponseText:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/components/schemas/ResponseTextConfig'
|
- $ref: '#/components/schemas/ResponseTextConfig'
|
||||||
@@ -4408,6 +4663,11 @@ components:
|
|||||||
engine:
|
engine:
|
||||||
$ref: '#/components/schemas/PDFParserEngine'
|
$ref: '#/components/schemas/PDFParserEngine'
|
||||||
description: Options for PDF parsing.
|
description: Options for PDF parsing.
|
||||||
|
ContextCompressionEngine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- middle-out
|
||||||
|
description: The compression engine to use. Defaults to "middle-out".
|
||||||
OpenResponsesRequest:
|
OpenResponsesRequest:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -4421,7 +4681,7 @@ components:
|
|||||||
tools:
|
tools:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
oneOf:
|
anyOf:
|
||||||
- allOf:
|
- allOf:
|
||||||
- $ref: '#/components/schemas/OpenResponsesFunctionTool'
|
- $ref: '#/components/schemas/OpenResponsesFunctionTool'
|
||||||
- type: object
|
- type: object
|
||||||
@@ -4458,6 +4718,8 @@ components:
|
|||||||
- $ref: '#/components/schemas/OpenResponsesFunctionShellTool'
|
- $ref: '#/components/schemas/OpenResponsesFunctionShellTool'
|
||||||
- $ref: '#/components/schemas/OpenResponsesApplyPatchTool'
|
- $ref: '#/components/schemas/OpenResponsesApplyPatchTool'
|
||||||
- $ref: '#/components/schemas/OpenResponsesCustomTool'
|
- $ref: '#/components/schemas/OpenResponsesCustomTool'
|
||||||
|
- $ref: '#/components/schemas/DatetimeServerTool'
|
||||||
|
- $ref: '#/components/schemas/ResponsesWebSearchServerTool'
|
||||||
tool_choice:
|
tool_choice:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesToolChoice'
|
$ref: '#/components/schemas/OpenAIResponsesToolChoice'
|
||||||
parallel_tool_calls:
|
parallel_tool_calls:
|
||||||
@@ -4755,6 +5017,19 @@ components:
|
|||||||
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- context-compression
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
|
||||||
|
engine:
|
||||||
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
||||||
|
required:
|
||||||
|
- id
|
||||||
description: Plugins you want to enable for this request, including their settings.
|
description: Plugins you want to enable for this request, including their settings.
|
||||||
route:
|
route:
|
||||||
type: string
|
type: string
|
||||||
@@ -9784,6 +10059,83 @@ components:
|
|||||||
- role
|
- role
|
||||||
- content
|
- content
|
||||||
description: Anthropic message with OpenRouter extensions
|
description: Anthropic message with OpenRouter extensions
|
||||||
|
AnthropicWebSearchServerTool:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: searches the web for current information'
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
max_results: 5
|
||||||
AnthropicOutputConfig:
|
AnthropicOutputConfig:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -10004,7 +10356,7 @@ components:
|
|||||||
tools:
|
tools:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
oneOf:
|
anyOf:
|
||||||
- type: object
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
@@ -10167,6 +10519,8 @@ components:
|
|||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
- name
|
- name
|
||||||
|
- $ref: '#/components/schemas/DatetimeServerTool'
|
||||||
|
- $ref: '#/components/schemas/AnthropicWebSearchServerTool'
|
||||||
tool_choice:
|
tool_choice:
|
||||||
oneOf:
|
oneOf:
|
||||||
- type: object
|
- type: object
|
||||||
@@ -10597,6 +10951,19 @@ components:
|
|||||||
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- context-compression
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
|
||||||
|
engine:
|
||||||
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
||||||
|
required:
|
||||||
|
- id
|
||||||
description: Plugins you want to enable for this request, including their settings.
|
description: Plugins you want to enable for this request, including their settings.
|
||||||
route:
|
route:
|
||||||
type: string
|
type: string
|
||||||
@@ -11890,8 +12257,245 @@ components:
|
|||||||
- $ref: '#/components/schemas/NamedToolChoice'
|
- $ref: '#/components/schemas/NamedToolChoice'
|
||||||
description: Tool choice configuration
|
description: Tool choice configuration
|
||||||
example: auto
|
example: auto
|
||||||
ToolDefinitionJson:
|
DatetimeServerTool:
|
||||||
type: object
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:datetime
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC.
|
||||||
|
example: America/New_York
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: returns the current date and time'
|
||||||
|
example:
|
||||||
|
type: openrouter:datetime
|
||||||
|
parameters:
|
||||||
|
timezone: America/New_York
|
||||||
|
WebSearchServerTool:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: 'OpenRouter built-in server tool: searches the web for current information'
|
||||||
|
example:
|
||||||
|
type: openrouter:web_search
|
||||||
|
parameters:
|
||||||
|
engine: auto
|
||||||
|
max_results: 5
|
||||||
|
WebSearchShorthand:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- web_search
|
||||||
|
- web_search_preview
|
||||||
|
- web_search_preview_2025_03_11
|
||||||
|
- web_search_2025_08_26
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
parameters:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
engine:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- auto
|
||||||
|
- native
|
||||||
|
- exa
|
||||||
|
description: >-
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
example: auto
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
max_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
maximum: 25
|
||||||
|
description: >-
|
||||||
|
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
example: 5
|
||||||
|
max_total_results:
|
||||||
|
type: number
|
||||||
|
minimum: 1
|
||||||
|
description: >-
|
||||||
|
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
|
||||||
|
example: 20
|
||||||
|
search_context_size:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- low
|
||||||
|
- medium
|
||||||
|
- high
|
||||||
|
description: >-
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
x-speakeasy-unknown-values: allow
|
||||||
|
user_location:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- approximate
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
timezone:
|
||||||
|
type: string
|
||||||
|
description: Approximate user location for location-biased results.
|
||||||
|
allowed_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
excluded_domains:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: >-
|
||||||
|
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
|
||||||
|
ToolDefinitionJson:
|
||||||
|
anyOf:
|
||||||
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
@@ -11946,7 +12550,10 @@ components:
|
|||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
- function
|
- function
|
||||||
description: Tool definition for function calling
|
- $ref: '#/components/schemas/DatetimeServerTool'
|
||||||
|
- $ref: '#/components/schemas/WebSearchServerTool'
|
||||||
|
- $ref: '#/components/schemas/WebSearchShorthand'
|
||||||
|
description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
||||||
example:
|
example:
|
||||||
type: function
|
type: function
|
||||||
function:
|
function:
|
||||||
@@ -12178,6 +12785,19 @@ components:
|
|||||||
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- context-compression
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
|
||||||
|
engine:
|
||||||
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
||||||
|
required:
|
||||||
|
- id
|
||||||
description: Plugins you want to enable for this request, including their settings.
|
description: Plugins you want to enable for this request, including their settings.
|
||||||
route:
|
route:
|
||||||
type: string
|
type: string
|
||||||
@@ -13343,6 +13963,40 @@ components:
|
|||||||
p75: 38.5
|
p75: 38.5
|
||||||
p90: 28.3
|
p90: 28.3
|
||||||
p99: 15.1
|
p99: 15.1
|
||||||
|
ConflictResponseErrorData:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: integer
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
nullable: true
|
||||||
|
additionalProperties:
|
||||||
|
nullable: true
|
||||||
|
required:
|
||||||
|
- code
|
||||||
|
- message
|
||||||
|
description: Error data for ConflictResponse
|
||||||
|
example:
|
||||||
|
code: 409
|
||||||
|
message: Resource conflict. Please try again later.
|
||||||
|
ConflictResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
error:
|
||||||
|
$ref: '#/components/schemas/ConflictResponseErrorData'
|
||||||
|
user_id:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
required:
|
||||||
|
- error
|
||||||
|
description: Conflict - Resource conflict or concurrent modification
|
||||||
|
example:
|
||||||
|
error:
|
||||||
|
code: 409
|
||||||
|
message: Resource conflict. Please try again later.
|
||||||
parameters: {AppIdentifier: {name: HTTP-Referer, in: header, schema: {type: string}, description: "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"}, AppDisplayName: {name: X-OpenRouter-Title, in: header, schema: {type: string}, description: "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"}, AppCategories: {name: X-OpenRouter-Categories, in: header, schema: {type: string}, description: "Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.\n"}}
|
parameters: {AppIdentifier: {name: HTTP-Referer, in: header, schema: {type: string}, description: "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"}, AppDisplayName: {name: X-OpenRouter-Title, in: header, schema: {type: string}, description: "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"}, AppCategories: {name: X-OpenRouter-Categories, in: header, schema: {type: string}, description: "Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.\n"}}
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
apiKey:
|
apiKey:
|
||||||
@@ -14745,7 +15399,7 @@ paths:
|
|||||||
required: false
|
required: false
|
||||||
description: >-
|
description: >-
|
||||||
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".
|
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".
|
||||||
name: output_modality
|
name: output_modalities
|
||||||
in: query
|
in: query
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
@@ -14755,7 +15409,7 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ModelsCountResponse'
|
$ref: '#/components/schemas/ModelsCountResponse'
|
||||||
'400':
|
'400':
|
||||||
description: Bad Request - Invalid output_modality value
|
description: Bad Request - Invalid output_modalities value
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
@@ -14813,7 +15467,7 @@ paths:
|
|||||||
required: false
|
required: false
|
||||||
description: >-
|
description: >-
|
||||||
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".
|
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".
|
||||||
name: output_modality
|
name: output_modalities
|
||||||
in: query
|
in: query
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
@@ -17961,6 +18615,12 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/UnauthorizedResponse'
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
||||||
|
'409':
|
||||||
|
description: Conflict - App upsert conflict during auth code creation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ConflictResponse'
|
||||||
'500':
|
'500':
|
||||||
description: Internal Server Error - Unexpected server error
|
description: Internal Server Error - Unexpected server error
|
||||||
content:
|
content:
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ sources:
|
|||||||
- latest
|
- latest
|
||||||
OpenRouter API:
|
OpenRouter API:
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:2fa3ed22056b6be20af56e6548a094381d1d32359ecdfec536c73556fc9717aa
|
sourceRevisionDigest: sha256:33bc86b7a9b24082a410a8b5cbdd05ee359c9be2c88a2947893942d6bca20dca
|
||||||
sourceBlobDigest: sha256:f445d8b8c9319ec5f7ab85c2b6194692070cc259047254a08a6b1c127cef09dd
|
sourceBlobDigest: sha256:63c840be5dfe448c1d3f6ec9c15e1d92d117b35cccd134b1e736e1fb563d013d
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- main
|
- main
|
||||||
@@ -18,10 +18,10 @@ targets:
|
|||||||
open-router:
|
open-router:
|
||||||
source: OpenRouter API
|
source: OpenRouter API
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:2fa3ed22056b6be20af56e6548a094381d1d32359ecdfec536c73556fc9717aa
|
sourceRevisionDigest: sha256:33bc86b7a9b24082a410a8b5cbdd05ee359c9be2c88a2947893942d6bca20dca
|
||||||
sourceBlobDigest: sha256:f445d8b8c9319ec5f7ab85c2b6194692070cc259047254a08a6b1c127cef09dd
|
sourceBlobDigest: sha256:63c840be5dfe448c1d3f6ec9c15e1d92d117b35cccd134b1e736e1fb563d013d
|
||||||
codeSamplesNamespace: open-router-python-code-samples
|
codeSamplesNamespace: open-router-python-code-samples
|
||||||
codeSamplesRevisionDigest: sha256:8c9d4cec31e4cfe341de1c43b2f557a838837aad7923f86a2eb62ae3c95d09a9
|
codeSamplesRevisionDigest: sha256:b23dcc24419d8d006315e89e7a2fe131e28d72f19edb4fa920c97658e9e78073
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: 1.666.0
|
speakeasyVersion: 1.666.0
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatGenerationParamsIDContextCompression
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------- | --------------------- |
|
||||||
|
| `CONTEXT_COMPRESSION` | context-compression |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatGenerationParamsPluginContextCompression
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `id` | [components.ChatGenerationParamsIDContextCompression](../components/chatgenerationparamsidcontextcompression.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the context-compression plugin for this request. Defaults to true. |
|
||||||
|
| `engine` | [Optional[components.ContextCompressionEngine]](../components/contextcompressionengine.md) | :heavy_minus_sign: | The compression engine to use. Defaults to "middle-out". |
|
||||||
@@ -33,3 +33,9 @@ value: components.ChatGenerationParamsPluginFileParser = /* values here */
|
|||||||
value: components.ChatGenerationParamsPluginResponseHealing = /* values here */
|
value: components.ChatGenerationParamsPluginResponseHealing = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsPluginContextCompression`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsPluginContextCompression = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# ConflictResponseErrorData
|
||||||
|
|
||||||
|
Error data for ConflictResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
|
||||||
|
| `code` | *int* | :heavy_check_mark: | N/A |
|
||||||
|
| `message` | *str* | :heavy_check_mark: | N/A |
|
||||||
|
| `metadata` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ContextCompressionEngine
|
||||||
|
|
||||||
|
The compression engine to use. Defaults to "middle-out".
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------ | ------------ |
|
||||||
|
| `MIDDLE_OUT` | middle-out |
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# DatetimeServerTool
|
||||||
|
|
||||||
|
OpenRouter built-in server tool: returns the current date and time
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.DatetimeServerToolType](../components/datetimeservertooltype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `parameters` | [Optional[components.DatetimeServerToolParameters]](../components/datetimeservertoolparameters.md) | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# DatetimeServerToolParameters
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
|
||||||
|
| `timezone` | *Optional[str]* | :heavy_minus_sign: | IANA timezone name (e.g. "America/New_York"). Defaults to UTC. | America/New_York |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# DatetimeServerToolType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------- | --------------------- |
|
||||||
|
| `OPENROUTER_DATETIME` | openrouter:datetime |
|
||||||
@@ -69,3 +69,9 @@ value: components.ResponsesOutputItemFileSearchCall = /* values here */
|
|||||||
value: components.ResponsesImageGenerationCall = /* values here */
|
value: components.ResponsesImageGenerationCall = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.ResponsesServerToolOutput`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ResponsesServerToolOutput = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# OpenResponsesRequestIDContextCompression
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| --------------------- | --------------------- |
|
||||||
|
| `CONTEXT_COMPRESSION` | context-compression |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# OpenResponsesRequestPluginContextCompression
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `id` | [components.OpenResponsesRequestIDContextCompression](../components/openresponsesrequestidcontextcompression.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the context-compression plugin for this request. Defaults to true. |
|
||||||
|
| `engine` | [Optional[components.ContextCompressionEngine]](../components/contextcompressionengine.md) | :heavy_minus_sign: | The compression engine to use. Defaults to "middle-out". |
|
||||||
@@ -33,3 +33,9 @@ value: components.OpenResponsesRequestPluginFileParser = /* values here */
|
|||||||
value: components.OpenResponsesRequestPluginResponseHealing = /* values here */
|
value: components.OpenResponsesRequestPluginResponseHealing = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.OpenResponsesRequestPluginContextCompression`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.OpenResponsesRequestPluginContextCompression = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -87,3 +87,15 @@ value: components.OpenResponsesApplyPatchTool = /* values here */
|
|||||||
value: components.OpenResponsesCustomTool = /* values here */
|
value: components.OpenResponsesCustomTool = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.DatetimeServerTool`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.DatetimeServerTool = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ResponsesWebSearchServerTool`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ResponsesWebSearchServerTool = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -167,3 +167,21 @@ value: components.OpenResponsesImageGenCallPartialImage = /* values here */
|
|||||||
value: components.OpenResponsesImageGenCallCompleted = /* values here */
|
value: components.OpenResponsesImageGenCallCompleted = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.OpenResponsesWebSearchCallInProgress`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.OpenResponsesWebSearchCallInProgress = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.OpenResponsesWebSearchCallSearching`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.OpenResponsesWebSearchCallSearching = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.OpenResponsesWebSearchCallCompleted`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.OpenResponsesWebSearchCallCompleted = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ Web search tool configuration (2025-08-26 version)
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `type` | [components.OpenResponsesWebSearch20250826ToolType](../components/openresponseswebsearch20250826tooltype.md) | :heavy_check_mark: | N/A | |
|
| `type` | [components.OpenResponsesWebSearch20250826ToolType](../components/openresponseswebsearch20250826tooltype.md) | :heavy_check_mark: | N/A | |
|
||||||
| `filters` | [OptionalNullable[components.OpenResponsesWebSearch20250826ToolFilters]](../components/openresponseswebsearch20250826toolfilters.md) | :heavy_minus_sign: | N/A | |
|
| `filters` | [OptionalNullable[components.OpenResponsesWebSearch20250826ToolFilters]](../components/openresponseswebsearch20250826toolfilters.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
||||||
| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} |
|
| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} |
|
||||||
|
| `engine` | [Optional[components.OpenResponsesWebSearch20250826ToolEngine]](../components/openresponseswebsearch20250826toolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# OpenResponsesWebSearch20250826ToolEngine
|
||||||
|
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `NATIVE` | native |
|
||||||
|
| `EXA` | exa |
|
||||||
@@ -6,3 +6,4 @@
|
|||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
|
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# OpenResponsesWebSearchCallCompleted
|
||||||
|
|
||||||
|
Web search call completed
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.OpenResponsesWebSearchCallCompletedType](../components/openresponseswebsearchcallcompletedtype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `item_id` | *str* | :heavy_check_mark: | N/A |
|
||||||
|
| `output_index` | *float* | :heavy_check_mark: | N/A |
|
||||||
|
| `sequence_number` | *float* | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# OpenResponsesWebSearchCallCompletedType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------ | ------------------------------------ |
|
||||||
|
| `RESPONSE_WEB_SEARCH_CALL_COMPLETED` | response.web_search_call.completed |
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# OpenResponsesWebSearchCallInProgress
|
||||||
|
|
||||||
|
Web search call in progress
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.OpenResponsesWebSearchCallInProgressType](../components/openresponseswebsearchcallinprogresstype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `item_id` | *str* | :heavy_check_mark: | N/A |
|
||||||
|
| `output_index` | *float* | :heavy_check_mark: | N/A |
|
||||||
|
| `sequence_number` | *float* | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# OpenResponsesWebSearchCallInProgressType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------------------------------- | -------------------------------------- |
|
||||||
|
| `RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS` | response.web_search_call.in_progress |
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# OpenResponsesWebSearchCallSearching
|
||||||
|
|
||||||
|
Web search call is searching
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.OpenResponsesWebSearchCallSearchingType](../components/openresponseswebsearchcallsearchingtype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `item_id` | *str* | :heavy_check_mark: | N/A |
|
||||||
|
| `output_index` | *float* | :heavy_check_mark: | N/A |
|
||||||
|
| `sequence_number` | *float* | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# OpenResponsesWebSearchCallSearchingType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------------ | ------------------------------------ |
|
||||||
|
| `RESPONSE_WEB_SEARCH_CALL_SEARCHING` | response.web_search_call.searching |
|
||||||
@@ -6,7 +6,10 @@ Web search preview tool configuration (2025-03-11 version)
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `type` | [components.OpenResponsesWebSearchPreview20250311ToolType](../components/openresponseswebsearchpreview20250311tooltype.md) | :heavy_check_mark: | N/A | |
|
| `type` | [components.OpenResponsesWebSearchPreview20250311ToolType](../components/openresponseswebsearchpreview20250311tooltype.md) | :heavy_check_mark: | N/A | |
|
||||||
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
||||||
| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | |
|
| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `engine` | [Optional[components.OpenResponsesWebSearchPreview20250311ToolEngine]](../components/openresponseswebsearchpreview20250311toolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
|
||||||
|
| `filters` | [OptionalNullable[components.OpenResponsesWebSearchPreview20250311ToolFilters]](../components/openresponseswebsearchpreview20250311toolfilters.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# OpenResponsesWebSearchPreview20250311ToolEngine
|
||||||
|
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `NATIVE` | native |
|
||||||
|
| `EXA` | exa |
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# OpenResponsesWebSearchPreview20250311ToolFilters
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
|
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
@@ -6,7 +6,10 @@ Web search preview tool configuration
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `type` | [components.OpenResponsesWebSearchPreviewToolType](../components/openresponseswebsearchpreviewtooltype.md) | :heavy_check_mark: | N/A | |
|
| `type` | [components.OpenResponsesWebSearchPreviewToolType](../components/openresponseswebsearchpreviewtooltype.md) | :heavy_check_mark: | N/A | |
|
||||||
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
||||||
| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | |
|
| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `engine` | [Optional[components.OpenResponsesWebSearchPreviewToolEngine]](../components/openresponseswebsearchpreviewtoolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
|
||||||
|
| `filters` | [OptionalNullable[components.OpenResponsesWebSearchPreviewToolFilters]](../components/openresponseswebsearchpreviewtoolfilters.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# OpenResponsesWebSearchPreviewToolEngine
|
||||||
|
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `NATIVE` | native |
|
||||||
|
| `EXA` | exa |
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# OpenResponsesWebSearchPreviewToolFilters
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
|
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
@@ -6,8 +6,10 @@ Web search tool configuration
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `type` | [components.OpenResponsesWebSearchToolType](../components/openresponseswebsearchtooltype.md) | :heavy_check_mark: | N/A | |
|
| `type` | [components.OpenResponsesWebSearchToolType](../components/openresponseswebsearchtooltype.md) | :heavy_check_mark: | N/A | |
|
||||||
| `filters` | [OptionalNullable[components.OpenResponsesWebSearchToolFilters]](../components/openresponseswebsearchtoolfilters.md) | :heavy_minus_sign: | N/A | |
|
| `filters` | [OptionalNullable[components.OpenResponsesWebSearchToolFilters]](../components/openresponseswebsearchtoolfilters.md) | :heavy_minus_sign: | N/A | |
|
||||||
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
|
||||||
| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} |
|
| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} |
|
||||||
|
| `engine` | [Optional[components.OpenResponsesWebSearchToolEngine]](../components/openresponseswebsearchtoolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# OpenResponsesWebSearchToolEngine
|
||||||
|
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `NATIVE` | native |
|
||||||
|
| `EXA` | exa |
|
||||||
@@ -6,3 +6,4 @@
|
|||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
|
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||||
@@ -41,3 +41,9 @@ value: components.ResponsesOutputItemFileSearchCall = /* values here */
|
|||||||
value: components.ResponsesImageGenerationCall = /* values here */
|
value: components.ResponsesImageGenerationCall = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.ResponsesServerToolOutput`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ResponsesServerToolOutput = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# ResponsesServerToolOutput
|
||||||
|
|
||||||
|
A generic OpenRouter server tool output item
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | *str* | :heavy_check_mark: | Server tool type (e.g. openrouter:datetime, openrouter:web_search) | |
|
||||||
|
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `status` | [components.ResponsesServerToolOutputStatus](../components/responsesservertooloutputstatus.md) | :heavy_check_mark: | N/A | |
|
||||||
|
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | {<br/>"type": "openrouter:web_search",<br/>"id": "ws_tmp_abc123",<br/>"status": "completed"<br/>} |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ResponsesServerToolOutputStatus
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `COMPLETED` | completed |
|
||||||
|
| `IN_PROGRESS` | in_progress |
|
||||||
|
| `INCOMPLETE` | incomplete |
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# ResponsesWebSearchServerTool
|
||||||
|
|
||||||
|
OpenRouter built-in server tool: searches the web for current information
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.ResponsesWebSearchServerToolType](../components/responseswebsearchservertooltype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `parameters` | [Optional[components.ResponsesWebSearchServerToolParameters]](../components/responseswebsearchservertoolparameters.md) | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# ResponsesWebSearchServerToolParameters
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. | 5 |
|
||||||
|
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. | 20 |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ResponsesWebSearchServerToolType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------------------- | ----------------------- |
|
||||||
|
| `OPENROUTER_WEB_SEARCH` | openrouter:web_search |
|
||||||
@@ -1,12 +1,49 @@
|
|||||||
# ToolDefinitionJSON
|
# ToolDefinitionJSON
|
||||||
|
|
||||||
Tool definition for function calling
|
Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ToolDefinitionJSONFunction`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ToolDefinitionJSONFunction = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.DatetimeServerTool`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.DatetimeServerTool = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.WebSearchServerTool`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.WebSearchServerTool = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.WebSearchShorthand`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.WebSearchShorthand = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.WebSearchShorthand`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.WebSearchShorthand = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.WebSearchShorthand`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.WebSearchShorthand = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.WebSearchShorthand`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.WebSearchShorthand = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `type` | [components.ToolDefinitionJSONType](../components/tooldefinitionjsontype.md) | :heavy_check_mark: | N/A | |
|
|
||||||
| `function` | [components.ToolDefinitionJSONFunction](../components/tooldefinitionjsonfunction.md) | :heavy_check_mark: | Function definition for tool calling | {<br/>"name": "get_weather",<br/>"description": "Get the current weather for a location",<br/>"parameters": {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>}<br/>} |
|
|
||||||
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {<br/>"type": "ephemeral",<br/>"ttl": "5m"<br/>} |
|
|
||||||
@@ -1,13 +1,10 @@
|
|||||||
# ToolDefinitionJSONFunction
|
# ToolDefinitionJSONFunction
|
||||||
|
|
||||||
Function definition for tool calling
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `name` | *str* | :heavy_check_mark: | Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) | get_weather |
|
| `type` | [components.ToolDefinitionJSONType](../components/tooldefinitionjsontype.md) | :heavy_check_mark: | N/A | |
|
||||||
| `description` | *Optional[str]* | :heavy_minus_sign: | Function description for the model | Get the current weather for a location |
|
| `function` | [components.ToolDefinitionJSONFunctionFunction](../components/tooldefinitionjsonfunctionfunction.md) | :heavy_check_mark: | Function definition for tool calling | {<br/>"name": "get_weather",<br/>"description": "Get the current weather for a location",<br/>"parameters": {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>}<br/>} |
|
||||||
| `parameters` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Function parameters as JSON Schema object | {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>} |
|
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {<br/>"type": "ephemeral",<br/>"ttl": "5m"<br/>} |
|
||||||
| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable strict schema adherence | false |
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# ToolDefinitionJSONFunctionFunction
|
||||||
|
|
||||||
|
Function definition for tool calling
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `name` | *str* | :heavy_check_mark: | Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) | get_weather |
|
||||||
|
| `description` | *Optional[str]* | :heavy_minus_sign: | Function description for the model | Get the current weather for a location |
|
||||||
|
| `parameters` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Function parameters as JSON Schema object | {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>} |
|
||||||
|
| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable strict schema adherence | false |
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# WebSearchServerTool
|
||||||
|
|
||||||
|
OpenRouter built-in server tool: searches the web for current information
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.WebSearchServerToolTypeOpenrouterWebSearch](../components/websearchservertooltypeopenrouterwebsearch.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `parameters` | [Optional[components.WebSearchServerToolParameters]](../components/websearchservertoolparameters.md) | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# WebSearchServerToolEngine
|
||||||
|
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `NATIVE` | native |
|
||||||
|
| `EXA` | exa |
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# WebSearchServerToolParameters
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `engine` | [Optional[components.WebSearchServerToolEngine]](../components/websearchservertoolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
|
||||||
|
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 |
|
||||||
|
| `search_context_size` | [Optional[components.WebSearchServerToolSearchContextSize]](../components/websearchservertoolsearchcontextsize.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
|
| `user_location` | [Optional[components.WebSearchServerToolUserLocation]](../components/websearchservertooluserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | |
|
||||||
|
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
|
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# WebSearchServerToolParametersType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `APPROXIMATE` | approximate |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# WebSearchServerToolSearchContextSize
|
||||||
|
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `LOW` | low |
|
||||||
|
| `MEDIUM` | medium |
|
||||||
|
| `HIGH` | high |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# WebSearchServerToolTypeOpenrouterWebSearch
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------------------- | ----------------------- |
|
||||||
|
| `OPENROUTER_WEB_SEARCH` | openrouter:web_search |
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# WebSearchServerToolUserLocation
|
||||||
|
|
||||||
|
Approximate user location for location-biased results.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `type` | [Optional[components.WebSearchServerToolParametersType]](../components/websearchservertoolparameterstype.md) | :heavy_minus_sign: | N/A |
|
||||||
|
| `city` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `region` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `country` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# WebSearchShorthand
|
||||||
|
|
||||||
|
Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.WebSearchShorthandType](../components/websearchshorthandtype.md) | :heavy_check_mark: | N/A | |
|
||||||
|
| `engine` | [Optional[components.WebSearchShorthandEngine]](../components/websearchshorthandengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
|
||||||
|
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 |
|
||||||
|
| `search_context_size` | [Optional[components.WebSearchShorthandSearchContextSize]](../components/websearchshorthandsearchcontextsize.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
|
| `user_location` | [Optional[components.WebSearchShorthandUserLocation]](../components/websearchshorthanduserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | |
|
||||||
|
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
|
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
|
| `parameters` | [Optional[components.WebSearchShorthandParameters]](../components/websearchshorthandparameters.md) | :heavy_minus_sign: | N/A | |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# WebSearchShorthandEngine
|
||||||
|
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `NATIVE` | native |
|
||||||
|
| `EXA` | exa |
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# WebSearchShorthandParameters
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `engine` | [Optional[components.WebSearchShorthandParametersEngine]](../components/websearchshorthandparametersengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
|
||||||
|
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 |
|
||||||
|
| `search_context_size` | [Optional[components.WebSearchShorthandParametersSearchContextSize]](../components/websearchshorthandparameterssearchcontextsize.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
|
| `user_location` | [Optional[components.WebSearchShorthandParametersUserLocation]](../components/websearchshorthandparametersuserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | |
|
||||||
|
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
|
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# WebSearchShorthandParametersEngine
|
||||||
|
|
||||||
|
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `NATIVE` | native |
|
||||||
|
| `EXA` | exa |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# WebSearchShorthandParametersSearchContextSize
|
||||||
|
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `LOW` | low |
|
||||||
|
| `MEDIUM` | medium |
|
||||||
|
| `HIGH` | high |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# WebSearchShorthandParametersType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `APPROXIMATE` | approximate |
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# WebSearchShorthandParametersUserLocation
|
||||||
|
|
||||||
|
Approximate user location for location-biased results.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [Optional[components.WebSearchShorthandParametersType]](../components/websearchshorthandparameterstype.md) | :heavy_minus_sign: | N/A |
|
||||||
|
| `city` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `region` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `country` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# WebSearchShorthandSearchContextSize
|
||||||
|
|
||||||
|
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------- | -------- |
|
||||||
|
| `LOW` | low |
|
||||||
|
| `MEDIUM` | medium |
|
||||||
|
| `HIGH` | high |
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# WebSearchShorthandType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------------------------- | ------------------------------- |
|
||||||
|
| `WEB_SEARCH` | web_search |
|
||||||
|
| `WEB_SEARCH_PREVIEW` | web_search_preview |
|
||||||
|
| `WEB_SEARCH_PREVIEW_2025_03_11` | web_search_preview_2025_03_11 |
|
||||||
|
| `WEB_SEARCH_2025_08_26` | web_search_2025_08_26 |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# WebSearchShorthandTypeApproximate
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `APPROXIMATE` | approximate |
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# WebSearchShorthandUserLocation
|
||||||
|
|
||||||
|
Approximate user location for location-biased results.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `type` | [Optional[components.WebSearchShorthandTypeApproximate]](../components/websearchshorthandtypeapproximate.md) | :heavy_minus_sign: | N/A |
|
||||||
|
| `city` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `region` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `country` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# ConflictResponseError
|
||||||
|
|
||||||
|
Conflict - Resource conflict or concurrent modification
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||||
|
| `error` | [components.ConflictResponseErrorData](../components/conflictresponseerrordata.md) | :heavy_check_mark: | Error data for ConflictResponse | {<br/>"code": 409,<br/>"message": "Resource conflict. Please try again later."<br/>} |
|
||||||
|
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||||
@@ -10,4 +10,4 @@
|
|||||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||||
| `category` | [Optional[operations.Category]](../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
| `category` | [Optional[operations.Category]](../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
||||||
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
||||||
| `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||||
| `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
||||||
@@ -44,7 +44,7 @@ with OpenRouter(
|
|||||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||||
| `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
||||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
@@ -94,7 +94,7 @@ with OpenRouter(
|
|||||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||||
| `category` | [Optional[operations.Category]](../../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
| `category` | [Optional[operations.Category]](../../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
||||||
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
||||||
| `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
||||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|||||||
@@ -113,5 +113,6 @@ with OpenRouter(
|
|||||||
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
| ---------------------------------- | ---------------------------------- | ---------------------------------- |
|
||||||
| errors.BadRequestResponseError | 400 | application/json |
|
| errors.BadRequestResponseError | 400 | application/json |
|
||||||
| errors.UnauthorizedResponseError | 401 | application/json |
|
| errors.UnauthorizedResponseError | 401 | application/json |
|
||||||
|
| errors.ConflictResponseError | 409 | application/json |
|
||||||
| errors.InternalServerResponseError | 500 | application/json |
|
| errors.InternalServerResponseError | 500 | application/json |
|
||||||
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "openrouter"
|
name = "openrouter"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
description = "Official Python Client SDK for OpenRouter."
|
description = "Official Python Client SDK for OpenRouter."
|
||||||
authors = [{ name = "OpenRouter" },]
|
authors = [{ name = "OpenRouter" },]
|
||||||
readme = "README-PYPI.md"
|
readme = "README-PYPI.md"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
|
|
||||||
__title__: str = "openrouter"
|
__title__: str = "openrouter"
|
||||||
__version__: str = "0.8.0"
|
__version__: str = "0.9.0"
|
||||||
__openapi_doc_version__: str = "1.0.0"
|
__openapi_doc_version__: str = "1.0.0"
|
||||||
__gen_version__: str = "2.768.0"
|
__gen_version__: str = "2.768.0"
|
||||||
__user_agent__: str = "speakeasy-sdk/python 0.8.0 2.768.0 1.0.0 openrouter"
|
__user_agent__: str = "speakeasy-sdk/python 0.9.0 2.768.0 1.0.0 openrouter"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if __package__ is not None:
|
if __package__ is not None:
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ if TYPE_CHECKING:
|
|||||||
ChatGenerationParams,
|
ChatGenerationParams,
|
||||||
ChatGenerationParamsBy,
|
ChatGenerationParamsBy,
|
||||||
ChatGenerationParamsIDAutoRouter,
|
ChatGenerationParamsIDAutoRouter,
|
||||||
|
ChatGenerationParamsIDContextCompression,
|
||||||
ChatGenerationParamsIDFileParser,
|
ChatGenerationParamsIDFileParser,
|
||||||
ChatGenerationParamsIDModeration,
|
ChatGenerationParamsIDModeration,
|
||||||
ChatGenerationParamsIDResponseHealing,
|
ChatGenerationParamsIDResponseHealing,
|
||||||
@@ -56,6 +57,8 @@ if TYPE_CHECKING:
|
|||||||
ChatGenerationParamsPartition,
|
ChatGenerationParamsPartition,
|
||||||
ChatGenerationParamsPluginAutoRouter,
|
ChatGenerationParamsPluginAutoRouter,
|
||||||
ChatGenerationParamsPluginAutoRouterTypedDict,
|
ChatGenerationParamsPluginAutoRouterTypedDict,
|
||||||
|
ChatGenerationParamsPluginContextCompression,
|
||||||
|
ChatGenerationParamsPluginContextCompressionTypedDict,
|
||||||
ChatGenerationParamsPluginFileParser,
|
ChatGenerationParamsPluginFileParser,
|
||||||
ChatGenerationParamsPluginFileParserTypedDict,
|
ChatGenerationParamsPluginFileParserTypedDict,
|
||||||
ChatGenerationParamsPluginModeration,
|
ChatGenerationParamsPluginModeration,
|
||||||
@@ -193,12 +196,24 @@ if TYPE_CHECKING:
|
|||||||
CompoundFilterType,
|
CompoundFilterType,
|
||||||
CompoundFilterTypedDict,
|
CompoundFilterTypedDict,
|
||||||
)
|
)
|
||||||
|
from .conflictresponseerrordata import (
|
||||||
|
ConflictResponseErrorData,
|
||||||
|
ConflictResponseErrorDataTypedDict,
|
||||||
|
)
|
||||||
|
from .contextcompressionengine import ContextCompressionEngine
|
||||||
from .createchargerequest import (
|
from .createchargerequest import (
|
||||||
ChainID,
|
ChainID,
|
||||||
CreateChargeRequest,
|
CreateChargeRequest,
|
||||||
CreateChargeRequestTypedDict,
|
CreateChargeRequestTypedDict,
|
||||||
)
|
)
|
||||||
from .datacollection import DataCollection
|
from .datacollection import DataCollection
|
||||||
|
from .datetimeservertool import (
|
||||||
|
DatetimeServerTool,
|
||||||
|
DatetimeServerToolParameters,
|
||||||
|
DatetimeServerToolParametersTypedDict,
|
||||||
|
DatetimeServerToolType,
|
||||||
|
DatetimeServerToolTypedDict,
|
||||||
|
)
|
||||||
from .debugoptions import DebugOptions, DebugOptionsTypedDict
|
from .debugoptions import DebugOptions, DebugOptionsTypedDict
|
||||||
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
|
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
|
||||||
from .developermessage import (
|
from .developermessage import (
|
||||||
@@ -608,6 +623,7 @@ if TYPE_CHECKING:
|
|||||||
from .openresponsesrequest import (
|
from .openresponsesrequest import (
|
||||||
OpenResponsesRequest,
|
OpenResponsesRequest,
|
||||||
OpenResponsesRequestIDAutoRouter,
|
OpenResponsesRequestIDAutoRouter,
|
||||||
|
OpenResponsesRequestIDContextCompression,
|
||||||
OpenResponsesRequestIDFileParser,
|
OpenResponsesRequestIDFileParser,
|
||||||
OpenResponsesRequestIDModeration,
|
OpenResponsesRequestIDModeration,
|
||||||
OpenResponsesRequestIDResponseHealing,
|
OpenResponsesRequestIDResponseHealing,
|
||||||
@@ -624,6 +640,8 @@ if TYPE_CHECKING:
|
|||||||
OpenResponsesRequestOrderTypedDict,
|
OpenResponsesRequestOrderTypedDict,
|
||||||
OpenResponsesRequestPluginAutoRouter,
|
OpenResponsesRequestPluginAutoRouter,
|
||||||
OpenResponsesRequestPluginAutoRouterTypedDict,
|
OpenResponsesRequestPluginAutoRouterTypedDict,
|
||||||
|
OpenResponsesRequestPluginContextCompression,
|
||||||
|
OpenResponsesRequestPluginContextCompressionTypedDict,
|
||||||
OpenResponsesRequestPluginFileParser,
|
OpenResponsesRequestPluginFileParser,
|
||||||
OpenResponsesRequestPluginFileParserTypedDict,
|
OpenResponsesRequestPluginFileParserTypedDict,
|
||||||
OpenResponsesRequestPluginModeration,
|
OpenResponsesRequestPluginModeration,
|
||||||
@@ -733,23 +751,46 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
from .openresponseswebsearch20250826tool import (
|
from .openresponseswebsearch20250826tool import (
|
||||||
OpenResponsesWebSearch20250826Tool,
|
OpenResponsesWebSearch20250826Tool,
|
||||||
|
OpenResponsesWebSearch20250826ToolEngine,
|
||||||
OpenResponsesWebSearch20250826ToolFilters,
|
OpenResponsesWebSearch20250826ToolFilters,
|
||||||
OpenResponsesWebSearch20250826ToolFiltersTypedDict,
|
OpenResponsesWebSearch20250826ToolFiltersTypedDict,
|
||||||
OpenResponsesWebSearch20250826ToolType,
|
OpenResponsesWebSearch20250826ToolType,
|
||||||
OpenResponsesWebSearch20250826ToolTypedDict,
|
OpenResponsesWebSearch20250826ToolTypedDict,
|
||||||
)
|
)
|
||||||
|
from .openresponseswebsearchcallcompleted import (
|
||||||
|
OpenResponsesWebSearchCallCompleted,
|
||||||
|
OpenResponsesWebSearchCallCompletedType,
|
||||||
|
OpenResponsesWebSearchCallCompletedTypedDict,
|
||||||
|
)
|
||||||
|
from .openresponseswebsearchcallinprogress import (
|
||||||
|
OpenResponsesWebSearchCallInProgress,
|
||||||
|
OpenResponsesWebSearchCallInProgressType,
|
||||||
|
OpenResponsesWebSearchCallInProgressTypedDict,
|
||||||
|
)
|
||||||
|
from .openresponseswebsearchcallsearching import (
|
||||||
|
OpenResponsesWebSearchCallSearching,
|
||||||
|
OpenResponsesWebSearchCallSearchingType,
|
||||||
|
OpenResponsesWebSearchCallSearchingTypedDict,
|
||||||
|
)
|
||||||
from .openresponseswebsearchpreview20250311tool import (
|
from .openresponseswebsearchpreview20250311tool import (
|
||||||
OpenResponsesWebSearchPreview20250311Tool,
|
OpenResponsesWebSearchPreview20250311Tool,
|
||||||
|
OpenResponsesWebSearchPreview20250311ToolEngine,
|
||||||
|
OpenResponsesWebSearchPreview20250311ToolFilters,
|
||||||
|
OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict,
|
||||||
OpenResponsesWebSearchPreview20250311ToolType,
|
OpenResponsesWebSearchPreview20250311ToolType,
|
||||||
OpenResponsesWebSearchPreview20250311ToolTypedDict,
|
OpenResponsesWebSearchPreview20250311ToolTypedDict,
|
||||||
)
|
)
|
||||||
from .openresponseswebsearchpreviewtool import (
|
from .openresponseswebsearchpreviewtool import (
|
||||||
OpenResponsesWebSearchPreviewTool,
|
OpenResponsesWebSearchPreviewTool,
|
||||||
|
OpenResponsesWebSearchPreviewToolEngine,
|
||||||
|
OpenResponsesWebSearchPreviewToolFilters,
|
||||||
|
OpenResponsesWebSearchPreviewToolFiltersTypedDict,
|
||||||
OpenResponsesWebSearchPreviewToolType,
|
OpenResponsesWebSearchPreviewToolType,
|
||||||
OpenResponsesWebSearchPreviewToolTypedDict,
|
OpenResponsesWebSearchPreviewToolTypedDict,
|
||||||
)
|
)
|
||||||
from .openresponseswebsearchtool import (
|
from .openresponseswebsearchtool import (
|
||||||
OpenResponsesWebSearchTool,
|
OpenResponsesWebSearchTool,
|
||||||
|
OpenResponsesWebSearchToolEngine,
|
||||||
OpenResponsesWebSearchToolFilters,
|
OpenResponsesWebSearchToolFilters,
|
||||||
OpenResponsesWebSearchToolFiltersTypedDict,
|
OpenResponsesWebSearchToolFiltersTypedDict,
|
||||||
OpenResponsesWebSearchToolType,
|
OpenResponsesWebSearchToolType,
|
||||||
@@ -1018,6 +1059,11 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
from .responsesoutputmodality import ResponsesOutputModality
|
from .responsesoutputmodality import ResponsesOutputModality
|
||||||
from .responsessearchcontextsize import ResponsesSearchContextSize
|
from .responsessearchcontextsize import ResponsesSearchContextSize
|
||||||
|
from .responsesservertooloutput import (
|
||||||
|
ResponsesServerToolOutput,
|
||||||
|
ResponsesServerToolOutputStatus,
|
||||||
|
ResponsesServerToolOutputTypedDict,
|
||||||
|
)
|
||||||
from .responseswebsearchcalloutput import (
|
from .responseswebsearchcalloutput import (
|
||||||
Action,
|
Action,
|
||||||
ActionFindInPage,
|
ActionFindInPage,
|
||||||
@@ -1037,6 +1083,13 @@ if TYPE_CHECKING:
|
|||||||
TypeURL,
|
TypeURL,
|
||||||
TypeWebSearchCall,
|
TypeWebSearchCall,
|
||||||
)
|
)
|
||||||
|
from .responseswebsearchservertool import (
|
||||||
|
ResponsesWebSearchServerTool,
|
||||||
|
ResponsesWebSearchServerToolParameters,
|
||||||
|
ResponsesWebSearchServerToolParametersTypedDict,
|
||||||
|
ResponsesWebSearchServerToolType,
|
||||||
|
ResponsesWebSearchServerToolTypedDict,
|
||||||
|
)
|
||||||
from .responseswebsearchuserlocation import (
|
from .responseswebsearchuserlocation import (
|
||||||
ResponsesWebSearchUserLocation,
|
ResponsesWebSearchUserLocation,
|
||||||
ResponsesWebSearchUserLocationType,
|
ResponsesWebSearchUserLocationType,
|
||||||
@@ -1070,6 +1123,8 @@ if TYPE_CHECKING:
|
|||||||
from .tooldefinitionjson import (
|
from .tooldefinitionjson import (
|
||||||
ToolDefinitionJSON,
|
ToolDefinitionJSON,
|
||||||
ToolDefinitionJSONFunction,
|
ToolDefinitionJSONFunction,
|
||||||
|
ToolDefinitionJSONFunctionFunction,
|
||||||
|
ToolDefinitionJSONFunctionFunctionTypedDict,
|
||||||
ToolDefinitionJSONFunctionTypedDict,
|
ToolDefinitionJSONFunctionTypedDict,
|
||||||
ToolDefinitionJSONType,
|
ToolDefinitionJSONType,
|
||||||
ToolDefinitionJSONTypedDict,
|
ToolDefinitionJSONTypedDict,
|
||||||
@@ -1109,6 +1164,35 @@ if TYPE_CHECKING:
|
|||||||
WebSearchPreviewToolUserLocationType,
|
WebSearchPreviewToolUserLocationType,
|
||||||
WebSearchPreviewToolUserLocationTypedDict,
|
WebSearchPreviewToolUserLocationTypedDict,
|
||||||
)
|
)
|
||||||
|
from .websearchservertool import (
|
||||||
|
WebSearchServerTool,
|
||||||
|
WebSearchServerToolEngine,
|
||||||
|
WebSearchServerToolParameters,
|
||||||
|
WebSearchServerToolParametersType,
|
||||||
|
WebSearchServerToolParametersTypedDict,
|
||||||
|
WebSearchServerToolSearchContextSize,
|
||||||
|
WebSearchServerToolTypeOpenrouterWebSearch,
|
||||||
|
WebSearchServerToolTypedDict,
|
||||||
|
WebSearchServerToolUserLocation,
|
||||||
|
WebSearchServerToolUserLocationTypedDict,
|
||||||
|
)
|
||||||
|
from .websearchshorthand import (
|
||||||
|
WebSearchShorthand,
|
||||||
|
WebSearchShorthandEngine,
|
||||||
|
WebSearchShorthandParameters,
|
||||||
|
WebSearchShorthandParametersEngine,
|
||||||
|
WebSearchShorthandParametersSearchContextSize,
|
||||||
|
WebSearchShorthandParametersType,
|
||||||
|
WebSearchShorthandParametersTypedDict,
|
||||||
|
WebSearchShorthandParametersUserLocation,
|
||||||
|
WebSearchShorthandParametersUserLocationTypedDict,
|
||||||
|
WebSearchShorthandSearchContextSize,
|
||||||
|
WebSearchShorthandType,
|
||||||
|
WebSearchShorthandTypeApproximate,
|
||||||
|
WebSearchShorthandTypedDict,
|
||||||
|
WebSearchShorthandUserLocation,
|
||||||
|
WebSearchShorthandUserLocationTypedDict,
|
||||||
|
)
|
||||||
from .websearchstatus import WebSearchStatus
|
from .websearchstatus import WebSearchStatus
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@@ -1152,6 +1236,7 @@ __all__ = [
|
|||||||
"ChatGenerationParams",
|
"ChatGenerationParams",
|
||||||
"ChatGenerationParamsBy",
|
"ChatGenerationParamsBy",
|
||||||
"ChatGenerationParamsIDAutoRouter",
|
"ChatGenerationParamsIDAutoRouter",
|
||||||
|
"ChatGenerationParamsIDContextCompression",
|
||||||
"ChatGenerationParamsIDFileParser",
|
"ChatGenerationParamsIDFileParser",
|
||||||
"ChatGenerationParamsIDModeration",
|
"ChatGenerationParamsIDModeration",
|
||||||
"ChatGenerationParamsIDResponseHealing",
|
"ChatGenerationParamsIDResponseHealing",
|
||||||
@@ -1169,6 +1254,8 @@ __all__ = [
|
|||||||
"ChatGenerationParamsPartition",
|
"ChatGenerationParamsPartition",
|
||||||
"ChatGenerationParamsPluginAutoRouter",
|
"ChatGenerationParamsPluginAutoRouter",
|
||||||
"ChatGenerationParamsPluginAutoRouterTypedDict",
|
"ChatGenerationParamsPluginAutoRouterTypedDict",
|
||||||
|
"ChatGenerationParamsPluginContextCompression",
|
||||||
|
"ChatGenerationParamsPluginContextCompressionTypedDict",
|
||||||
"ChatGenerationParamsPluginFileParser",
|
"ChatGenerationParamsPluginFileParser",
|
||||||
"ChatGenerationParamsPluginFileParserTypedDict",
|
"ChatGenerationParamsPluginFileParserTypedDict",
|
||||||
"ChatGenerationParamsPluginModeration",
|
"ChatGenerationParamsPluginModeration",
|
||||||
@@ -1265,12 +1352,15 @@ __all__ = [
|
|||||||
"CompoundFilter",
|
"CompoundFilter",
|
||||||
"CompoundFilterType",
|
"CompoundFilterType",
|
||||||
"CompoundFilterTypedDict",
|
"CompoundFilterTypedDict",
|
||||||
|
"ConflictResponseErrorData",
|
||||||
|
"ConflictResponseErrorDataTypedDict",
|
||||||
"ConnectorID",
|
"ConnectorID",
|
||||||
"Container",
|
"Container",
|
||||||
"ContainerAuto",
|
"ContainerAuto",
|
||||||
"ContainerAutoTypedDict",
|
"ContainerAutoTypedDict",
|
||||||
"ContainerType",
|
"ContainerType",
|
||||||
"ContainerTypedDict",
|
"ContainerTypedDict",
|
||||||
|
"ContextCompressionEngine",
|
||||||
"CostDetails",
|
"CostDetails",
|
||||||
"CostDetailsTypedDict",
|
"CostDetailsTypedDict",
|
||||||
"CreateChargeRequest",
|
"CreateChargeRequest",
|
||||||
@@ -1278,6 +1368,11 @@ __all__ = [
|
|||||||
"Data",
|
"Data",
|
||||||
"DataCollection",
|
"DataCollection",
|
||||||
"DataTypedDict",
|
"DataTypedDict",
|
||||||
|
"DatetimeServerTool",
|
||||||
|
"DatetimeServerToolParameters",
|
||||||
|
"DatetimeServerToolParametersTypedDict",
|
||||||
|
"DatetimeServerToolType",
|
||||||
|
"DatetimeServerToolTypedDict",
|
||||||
"DebugOptions",
|
"DebugOptions",
|
||||||
"DebugOptionsTypedDict",
|
"DebugOptionsTypedDict",
|
||||||
"DefaultParameters",
|
"DefaultParameters",
|
||||||
@@ -1576,6 +1671,7 @@ __all__ = [
|
|||||||
"OpenResponsesReasoningTypedDict",
|
"OpenResponsesReasoningTypedDict",
|
||||||
"OpenResponsesRequest",
|
"OpenResponsesRequest",
|
||||||
"OpenResponsesRequestIDAutoRouter",
|
"OpenResponsesRequestIDAutoRouter",
|
||||||
|
"OpenResponsesRequestIDContextCompression",
|
||||||
"OpenResponsesRequestIDFileParser",
|
"OpenResponsesRequestIDFileParser",
|
||||||
"OpenResponsesRequestIDModeration",
|
"OpenResponsesRequestIDModeration",
|
||||||
"OpenResponsesRequestIDResponseHealing",
|
"OpenResponsesRequestIDResponseHealing",
|
||||||
@@ -1592,6 +1688,8 @@ __all__ = [
|
|||||||
"OpenResponsesRequestOrderTypedDict",
|
"OpenResponsesRequestOrderTypedDict",
|
||||||
"OpenResponsesRequestPluginAutoRouter",
|
"OpenResponsesRequestPluginAutoRouter",
|
||||||
"OpenResponsesRequestPluginAutoRouterTypedDict",
|
"OpenResponsesRequestPluginAutoRouterTypedDict",
|
||||||
|
"OpenResponsesRequestPluginContextCompression",
|
||||||
|
"OpenResponsesRequestPluginContextCompressionTypedDict",
|
||||||
"OpenResponsesRequestPluginFileParser",
|
"OpenResponsesRequestPluginFileParser",
|
||||||
"OpenResponsesRequestPluginFileParserTypedDict",
|
"OpenResponsesRequestPluginFileParserTypedDict",
|
||||||
"OpenResponsesRequestPluginModeration",
|
"OpenResponsesRequestPluginModeration",
|
||||||
@@ -1664,17 +1762,34 @@ __all__ = [
|
|||||||
"OpenResponsesUsage",
|
"OpenResponsesUsage",
|
||||||
"OpenResponsesUsageTypedDict",
|
"OpenResponsesUsageTypedDict",
|
||||||
"OpenResponsesWebSearch20250826Tool",
|
"OpenResponsesWebSearch20250826Tool",
|
||||||
|
"OpenResponsesWebSearch20250826ToolEngine",
|
||||||
"OpenResponsesWebSearch20250826ToolFilters",
|
"OpenResponsesWebSearch20250826ToolFilters",
|
||||||
"OpenResponsesWebSearch20250826ToolFiltersTypedDict",
|
"OpenResponsesWebSearch20250826ToolFiltersTypedDict",
|
||||||
"OpenResponsesWebSearch20250826ToolType",
|
"OpenResponsesWebSearch20250826ToolType",
|
||||||
"OpenResponsesWebSearch20250826ToolTypedDict",
|
"OpenResponsesWebSearch20250826ToolTypedDict",
|
||||||
|
"OpenResponsesWebSearchCallCompleted",
|
||||||
|
"OpenResponsesWebSearchCallCompletedType",
|
||||||
|
"OpenResponsesWebSearchCallCompletedTypedDict",
|
||||||
|
"OpenResponsesWebSearchCallInProgress",
|
||||||
|
"OpenResponsesWebSearchCallInProgressType",
|
||||||
|
"OpenResponsesWebSearchCallInProgressTypedDict",
|
||||||
|
"OpenResponsesWebSearchCallSearching",
|
||||||
|
"OpenResponsesWebSearchCallSearchingType",
|
||||||
|
"OpenResponsesWebSearchCallSearchingTypedDict",
|
||||||
"OpenResponsesWebSearchPreview20250311Tool",
|
"OpenResponsesWebSearchPreview20250311Tool",
|
||||||
|
"OpenResponsesWebSearchPreview20250311ToolEngine",
|
||||||
|
"OpenResponsesWebSearchPreview20250311ToolFilters",
|
||||||
|
"OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict",
|
||||||
"OpenResponsesWebSearchPreview20250311ToolType",
|
"OpenResponsesWebSearchPreview20250311ToolType",
|
||||||
"OpenResponsesWebSearchPreview20250311ToolTypedDict",
|
"OpenResponsesWebSearchPreview20250311ToolTypedDict",
|
||||||
"OpenResponsesWebSearchPreviewTool",
|
"OpenResponsesWebSearchPreviewTool",
|
||||||
|
"OpenResponsesWebSearchPreviewToolEngine",
|
||||||
|
"OpenResponsesWebSearchPreviewToolFilters",
|
||||||
|
"OpenResponsesWebSearchPreviewToolFiltersTypedDict",
|
||||||
"OpenResponsesWebSearchPreviewToolType",
|
"OpenResponsesWebSearchPreviewToolType",
|
||||||
"OpenResponsesWebSearchPreviewToolTypedDict",
|
"OpenResponsesWebSearchPreviewToolTypedDict",
|
||||||
"OpenResponsesWebSearchTool",
|
"OpenResponsesWebSearchTool",
|
||||||
|
"OpenResponsesWebSearchToolEngine",
|
||||||
"OpenResponsesWebSearchToolFilters",
|
"OpenResponsesWebSearchToolFilters",
|
||||||
"OpenResponsesWebSearchToolFiltersTypedDict",
|
"OpenResponsesWebSearchToolFiltersTypedDict",
|
||||||
"OpenResponsesWebSearchToolType",
|
"OpenResponsesWebSearchToolType",
|
||||||
@@ -1898,8 +2013,16 @@ __all__ = [
|
|||||||
"ResponsesOutputMessageTypedDict",
|
"ResponsesOutputMessageTypedDict",
|
||||||
"ResponsesOutputModality",
|
"ResponsesOutputModality",
|
||||||
"ResponsesSearchContextSize",
|
"ResponsesSearchContextSize",
|
||||||
|
"ResponsesServerToolOutput",
|
||||||
|
"ResponsesServerToolOutputStatus",
|
||||||
|
"ResponsesServerToolOutputTypedDict",
|
||||||
"ResponsesWebSearchCallOutput",
|
"ResponsesWebSearchCallOutput",
|
||||||
"ResponsesWebSearchCallOutputTypedDict",
|
"ResponsesWebSearchCallOutputTypedDict",
|
||||||
|
"ResponsesWebSearchServerTool",
|
||||||
|
"ResponsesWebSearchServerToolParameters",
|
||||||
|
"ResponsesWebSearchServerToolParametersTypedDict",
|
||||||
|
"ResponsesWebSearchServerToolType",
|
||||||
|
"ResponsesWebSearchServerToolTypedDict",
|
||||||
"ResponsesWebSearchUserLocation",
|
"ResponsesWebSearchUserLocation",
|
||||||
"ResponsesWebSearchUserLocationType",
|
"ResponsesWebSearchUserLocationType",
|
||||||
"ResponsesWebSearchUserLocationTypedDict",
|
"ResponsesWebSearchUserLocationTypedDict",
|
||||||
@@ -1930,6 +2053,8 @@ __all__ = [
|
|||||||
"ToolChoiceOptionTypedDict",
|
"ToolChoiceOptionTypedDict",
|
||||||
"ToolDefinitionJSON",
|
"ToolDefinitionJSON",
|
||||||
"ToolDefinitionJSONFunction",
|
"ToolDefinitionJSONFunction",
|
||||||
|
"ToolDefinitionJSONFunctionFunction",
|
||||||
|
"ToolDefinitionJSONFunctionFunctionTypedDict",
|
||||||
"ToolDefinitionJSONFunctionTypedDict",
|
"ToolDefinitionJSONFunctionTypedDict",
|
||||||
"ToolDefinitionJSONType",
|
"ToolDefinitionJSONType",
|
||||||
"ToolDefinitionJSONTypedDict",
|
"ToolDefinitionJSONTypedDict",
|
||||||
@@ -1992,6 +2117,31 @@ __all__ = [
|
|||||||
"WebSearchPreviewToolUserLocation",
|
"WebSearchPreviewToolUserLocation",
|
||||||
"WebSearchPreviewToolUserLocationType",
|
"WebSearchPreviewToolUserLocationType",
|
||||||
"WebSearchPreviewToolUserLocationTypedDict",
|
"WebSearchPreviewToolUserLocationTypedDict",
|
||||||
|
"WebSearchServerTool",
|
||||||
|
"WebSearchServerToolEngine",
|
||||||
|
"WebSearchServerToolParameters",
|
||||||
|
"WebSearchServerToolParametersType",
|
||||||
|
"WebSearchServerToolParametersTypedDict",
|
||||||
|
"WebSearchServerToolSearchContextSize",
|
||||||
|
"WebSearchServerToolTypeOpenrouterWebSearch",
|
||||||
|
"WebSearchServerToolTypedDict",
|
||||||
|
"WebSearchServerToolUserLocation",
|
||||||
|
"WebSearchServerToolUserLocationTypedDict",
|
||||||
|
"WebSearchShorthand",
|
||||||
|
"WebSearchShorthandEngine",
|
||||||
|
"WebSearchShorthandParameters",
|
||||||
|
"WebSearchShorthandParametersEngine",
|
||||||
|
"WebSearchShorthandParametersSearchContextSize",
|
||||||
|
"WebSearchShorthandParametersType",
|
||||||
|
"WebSearchShorthandParametersTypedDict",
|
||||||
|
"WebSearchShorthandParametersUserLocation",
|
||||||
|
"WebSearchShorthandParametersUserLocationTypedDict",
|
||||||
|
"WebSearchShorthandSearchContextSize",
|
||||||
|
"WebSearchShorthandType",
|
||||||
|
"WebSearchShorthandTypeApproximate",
|
||||||
|
"WebSearchShorthandTypedDict",
|
||||||
|
"WebSearchShorthandUserLocation",
|
||||||
|
"WebSearchShorthandUserLocationTypedDict",
|
||||||
"WebSearchStatus",
|
"WebSearchStatus",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2019,6 +2169,7 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ChatGenerationParams": ".chatgenerationparams",
|
"ChatGenerationParams": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsBy": ".chatgenerationparams",
|
"ChatGenerationParamsBy": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsIDAutoRouter": ".chatgenerationparams",
|
"ChatGenerationParamsIDAutoRouter": ".chatgenerationparams",
|
||||||
|
"ChatGenerationParamsIDContextCompression": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsIDFileParser": ".chatgenerationparams",
|
"ChatGenerationParamsIDFileParser": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsIDModeration": ".chatgenerationparams",
|
"ChatGenerationParamsIDModeration": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsIDResponseHealing": ".chatgenerationparams",
|
"ChatGenerationParamsIDResponseHealing": ".chatgenerationparams",
|
||||||
@@ -2036,6 +2187,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ChatGenerationParamsPartition": ".chatgenerationparams",
|
"ChatGenerationParamsPartition": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams",
|
"ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams",
|
"ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams",
|
||||||
|
"ChatGenerationParamsPluginContextCompression": ".chatgenerationparams",
|
||||||
|
"ChatGenerationParamsPluginContextCompressionTypedDict": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
|
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
|
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
|
||||||
"ChatGenerationParamsPluginModeration": ".chatgenerationparams",
|
"ChatGenerationParamsPluginModeration": ".chatgenerationparams",
|
||||||
@@ -2145,10 +2298,18 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"CompoundFilter": ".compoundfilter",
|
"CompoundFilter": ".compoundfilter",
|
||||||
"CompoundFilterType": ".compoundfilter",
|
"CompoundFilterType": ".compoundfilter",
|
||||||
"CompoundFilterTypedDict": ".compoundfilter",
|
"CompoundFilterTypedDict": ".compoundfilter",
|
||||||
|
"ConflictResponseErrorData": ".conflictresponseerrordata",
|
||||||
|
"ConflictResponseErrorDataTypedDict": ".conflictresponseerrordata",
|
||||||
|
"ContextCompressionEngine": ".contextcompressionengine",
|
||||||
"ChainID": ".createchargerequest",
|
"ChainID": ".createchargerequest",
|
||||||
"CreateChargeRequest": ".createchargerequest",
|
"CreateChargeRequest": ".createchargerequest",
|
||||||
"CreateChargeRequestTypedDict": ".createchargerequest",
|
"CreateChargeRequestTypedDict": ".createchargerequest",
|
||||||
"DataCollection": ".datacollection",
|
"DataCollection": ".datacollection",
|
||||||
|
"DatetimeServerTool": ".datetimeservertool",
|
||||||
|
"DatetimeServerToolParameters": ".datetimeservertool",
|
||||||
|
"DatetimeServerToolParametersTypedDict": ".datetimeservertool",
|
||||||
|
"DatetimeServerToolType": ".datetimeservertool",
|
||||||
|
"DatetimeServerToolTypedDict": ".datetimeservertool",
|
||||||
"DebugOptions": ".debugoptions",
|
"DebugOptions": ".debugoptions",
|
||||||
"DebugOptionsTypedDict": ".debugoptions",
|
"DebugOptionsTypedDict": ".debugoptions",
|
||||||
"DefaultParameters": ".defaultparameters",
|
"DefaultParameters": ".defaultparameters",
|
||||||
@@ -2481,6 +2642,7 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent",
|
"OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent",
|
||||||
"OpenResponsesRequest": ".openresponsesrequest",
|
"OpenResponsesRequest": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestIDAutoRouter": ".openresponsesrequest",
|
"OpenResponsesRequestIDAutoRouter": ".openresponsesrequest",
|
||||||
|
"OpenResponsesRequestIDContextCompression": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestIDFileParser": ".openresponsesrequest",
|
"OpenResponsesRequestIDFileParser": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestIDModeration": ".openresponsesrequest",
|
"OpenResponsesRequestIDModeration": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestIDResponseHealing": ".openresponsesrequest",
|
"OpenResponsesRequestIDResponseHealing": ".openresponsesrequest",
|
||||||
@@ -2497,6 +2659,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"OpenResponsesRequestOrderTypedDict": ".openresponsesrequest",
|
"OpenResponsesRequestOrderTypedDict": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest",
|
"OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest",
|
"OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest",
|
||||||
|
"OpenResponsesRequestPluginContextCompression": ".openresponsesrequest",
|
||||||
|
"OpenResponsesRequestPluginContextCompressionTypedDict": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
|
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
|
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
|
||||||
"OpenResponsesRequestPluginModeration": ".openresponsesrequest",
|
"OpenResponsesRequestPluginModeration": ".openresponsesrequest",
|
||||||
@@ -2598,17 +2762,34 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"OutputTokensDetails": ".openresponsesusage",
|
"OutputTokensDetails": ".openresponsesusage",
|
||||||
"OutputTokensDetailsTypedDict": ".openresponsesusage",
|
"OutputTokensDetailsTypedDict": ".openresponsesusage",
|
||||||
"OpenResponsesWebSearch20250826Tool": ".openresponseswebsearch20250826tool",
|
"OpenResponsesWebSearch20250826Tool": ".openresponseswebsearch20250826tool",
|
||||||
|
"OpenResponsesWebSearch20250826ToolEngine": ".openresponseswebsearch20250826tool",
|
||||||
"OpenResponsesWebSearch20250826ToolFilters": ".openresponseswebsearch20250826tool",
|
"OpenResponsesWebSearch20250826ToolFilters": ".openresponseswebsearch20250826tool",
|
||||||
"OpenResponsesWebSearch20250826ToolFiltersTypedDict": ".openresponseswebsearch20250826tool",
|
"OpenResponsesWebSearch20250826ToolFiltersTypedDict": ".openresponseswebsearch20250826tool",
|
||||||
"OpenResponsesWebSearch20250826ToolType": ".openresponseswebsearch20250826tool",
|
"OpenResponsesWebSearch20250826ToolType": ".openresponseswebsearch20250826tool",
|
||||||
"OpenResponsesWebSearch20250826ToolTypedDict": ".openresponseswebsearch20250826tool",
|
"OpenResponsesWebSearch20250826ToolTypedDict": ".openresponseswebsearch20250826tool",
|
||||||
|
"OpenResponsesWebSearchCallCompleted": ".openresponseswebsearchcallcompleted",
|
||||||
|
"OpenResponsesWebSearchCallCompletedType": ".openresponseswebsearchcallcompleted",
|
||||||
|
"OpenResponsesWebSearchCallCompletedTypedDict": ".openresponseswebsearchcallcompleted",
|
||||||
|
"OpenResponsesWebSearchCallInProgress": ".openresponseswebsearchcallinprogress",
|
||||||
|
"OpenResponsesWebSearchCallInProgressType": ".openresponseswebsearchcallinprogress",
|
||||||
|
"OpenResponsesWebSearchCallInProgressTypedDict": ".openresponseswebsearchcallinprogress",
|
||||||
|
"OpenResponsesWebSearchCallSearching": ".openresponseswebsearchcallsearching",
|
||||||
|
"OpenResponsesWebSearchCallSearchingType": ".openresponseswebsearchcallsearching",
|
||||||
|
"OpenResponsesWebSearchCallSearchingTypedDict": ".openresponseswebsearchcallsearching",
|
||||||
"OpenResponsesWebSearchPreview20250311Tool": ".openresponseswebsearchpreview20250311tool",
|
"OpenResponsesWebSearchPreview20250311Tool": ".openresponseswebsearchpreview20250311tool",
|
||||||
|
"OpenResponsesWebSearchPreview20250311ToolEngine": ".openresponseswebsearchpreview20250311tool",
|
||||||
|
"OpenResponsesWebSearchPreview20250311ToolFilters": ".openresponseswebsearchpreview20250311tool",
|
||||||
|
"OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict": ".openresponseswebsearchpreview20250311tool",
|
||||||
"OpenResponsesWebSearchPreview20250311ToolType": ".openresponseswebsearchpreview20250311tool",
|
"OpenResponsesWebSearchPreview20250311ToolType": ".openresponseswebsearchpreview20250311tool",
|
||||||
"OpenResponsesWebSearchPreview20250311ToolTypedDict": ".openresponseswebsearchpreview20250311tool",
|
"OpenResponsesWebSearchPreview20250311ToolTypedDict": ".openresponseswebsearchpreview20250311tool",
|
||||||
"OpenResponsesWebSearchPreviewTool": ".openresponseswebsearchpreviewtool",
|
"OpenResponsesWebSearchPreviewTool": ".openresponseswebsearchpreviewtool",
|
||||||
|
"OpenResponsesWebSearchPreviewToolEngine": ".openresponseswebsearchpreviewtool",
|
||||||
|
"OpenResponsesWebSearchPreviewToolFilters": ".openresponseswebsearchpreviewtool",
|
||||||
|
"OpenResponsesWebSearchPreviewToolFiltersTypedDict": ".openresponseswebsearchpreviewtool",
|
||||||
"OpenResponsesWebSearchPreviewToolType": ".openresponseswebsearchpreviewtool",
|
"OpenResponsesWebSearchPreviewToolType": ".openresponseswebsearchpreviewtool",
|
||||||
"OpenResponsesWebSearchPreviewToolTypedDict": ".openresponseswebsearchpreviewtool",
|
"OpenResponsesWebSearchPreviewToolTypedDict": ".openresponseswebsearchpreviewtool",
|
||||||
"OpenResponsesWebSearchTool": ".openresponseswebsearchtool",
|
"OpenResponsesWebSearchTool": ".openresponseswebsearchtool",
|
||||||
|
"OpenResponsesWebSearchToolEngine": ".openresponseswebsearchtool",
|
||||||
"OpenResponsesWebSearchToolFilters": ".openresponseswebsearchtool",
|
"OpenResponsesWebSearchToolFilters": ".openresponseswebsearchtool",
|
||||||
"OpenResponsesWebSearchToolFiltersTypedDict": ".openresponseswebsearchtool",
|
"OpenResponsesWebSearchToolFiltersTypedDict": ".openresponseswebsearchtool",
|
||||||
"OpenResponsesWebSearchToolType": ".openresponseswebsearchtool",
|
"OpenResponsesWebSearchToolType": ".openresponseswebsearchtool",
|
||||||
@@ -2806,6 +2987,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ResponsesOutputMessageTypedDict": ".responsesoutputmessage",
|
"ResponsesOutputMessageTypedDict": ".responsesoutputmessage",
|
||||||
"ResponsesOutputModality": ".responsesoutputmodality",
|
"ResponsesOutputModality": ".responsesoutputmodality",
|
||||||
"ResponsesSearchContextSize": ".responsessearchcontextsize",
|
"ResponsesSearchContextSize": ".responsessearchcontextsize",
|
||||||
|
"ResponsesServerToolOutput": ".responsesservertooloutput",
|
||||||
|
"ResponsesServerToolOutputStatus": ".responsesservertooloutput",
|
||||||
|
"ResponsesServerToolOutputTypedDict": ".responsesservertooloutput",
|
||||||
"Action": ".responseswebsearchcalloutput",
|
"Action": ".responseswebsearchcalloutput",
|
||||||
"ActionFindInPage": ".responseswebsearchcalloutput",
|
"ActionFindInPage": ".responseswebsearchcalloutput",
|
||||||
"ActionFindInPageTypedDict": ".responseswebsearchcalloutput",
|
"ActionFindInPageTypedDict": ".responseswebsearchcalloutput",
|
||||||
@@ -2823,6 +3007,11 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"TypeSearch": ".responseswebsearchcalloutput",
|
"TypeSearch": ".responseswebsearchcalloutput",
|
||||||
"TypeURL": ".responseswebsearchcalloutput",
|
"TypeURL": ".responseswebsearchcalloutput",
|
||||||
"TypeWebSearchCall": ".responseswebsearchcalloutput",
|
"TypeWebSearchCall": ".responseswebsearchcalloutput",
|
||||||
|
"ResponsesWebSearchServerTool": ".responseswebsearchservertool",
|
||||||
|
"ResponsesWebSearchServerToolParameters": ".responseswebsearchservertool",
|
||||||
|
"ResponsesWebSearchServerToolParametersTypedDict": ".responseswebsearchservertool",
|
||||||
|
"ResponsesWebSearchServerToolType": ".responseswebsearchservertool",
|
||||||
|
"ResponsesWebSearchServerToolTypedDict": ".responseswebsearchservertool",
|
||||||
"ResponsesWebSearchUserLocation": ".responseswebsearchuserlocation",
|
"ResponsesWebSearchUserLocation": ".responseswebsearchuserlocation",
|
||||||
"ResponsesWebSearchUserLocationType": ".responseswebsearchuserlocation",
|
"ResponsesWebSearchUserLocationType": ".responseswebsearchuserlocation",
|
||||||
"ResponsesWebSearchUserLocationTypedDict": ".responseswebsearchuserlocation",
|
"ResponsesWebSearchUserLocationTypedDict": ".responseswebsearchuserlocation",
|
||||||
@@ -2846,6 +3035,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ToolChoiceOptionTypedDict": ".toolchoiceoption",
|
"ToolChoiceOptionTypedDict": ".toolchoiceoption",
|
||||||
"ToolDefinitionJSON": ".tooldefinitionjson",
|
"ToolDefinitionJSON": ".tooldefinitionjson",
|
||||||
"ToolDefinitionJSONFunction": ".tooldefinitionjson",
|
"ToolDefinitionJSONFunction": ".tooldefinitionjson",
|
||||||
|
"ToolDefinitionJSONFunctionFunction": ".tooldefinitionjson",
|
||||||
|
"ToolDefinitionJSONFunctionFunctionTypedDict": ".tooldefinitionjson",
|
||||||
"ToolDefinitionJSONFunctionTypedDict": ".tooldefinitionjson",
|
"ToolDefinitionJSONFunctionTypedDict": ".tooldefinitionjson",
|
||||||
"ToolDefinitionJSONType": ".tooldefinitionjson",
|
"ToolDefinitionJSONType": ".tooldefinitionjson",
|
||||||
"ToolDefinitionJSONTypedDict": ".tooldefinitionjson",
|
"ToolDefinitionJSONTypedDict": ".tooldefinitionjson",
|
||||||
@@ -2876,6 +3067,31 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation",
|
"WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation",
|
||||||
"WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation",
|
"WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation",
|
||||||
"WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation",
|
"WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation",
|
||||||
|
"WebSearchServerTool": ".websearchservertool",
|
||||||
|
"WebSearchServerToolEngine": ".websearchservertool",
|
||||||
|
"WebSearchServerToolParameters": ".websearchservertool",
|
||||||
|
"WebSearchServerToolParametersType": ".websearchservertool",
|
||||||
|
"WebSearchServerToolParametersTypedDict": ".websearchservertool",
|
||||||
|
"WebSearchServerToolSearchContextSize": ".websearchservertool",
|
||||||
|
"WebSearchServerToolTypeOpenrouterWebSearch": ".websearchservertool",
|
||||||
|
"WebSearchServerToolTypedDict": ".websearchservertool",
|
||||||
|
"WebSearchServerToolUserLocation": ".websearchservertool",
|
||||||
|
"WebSearchServerToolUserLocationTypedDict": ".websearchservertool",
|
||||||
|
"WebSearchShorthand": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandEngine": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandParameters": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandParametersEngine": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandParametersSearchContextSize": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandParametersType": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandParametersTypedDict": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandParametersUserLocation": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandParametersUserLocationTypedDict": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandSearchContextSize": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandType": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandTypeApproximate": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandTypedDict": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandUserLocation": ".websearchshorthand",
|
||||||
|
"WebSearchShorthandUserLocationTypedDict": ".websearchshorthand",
|
||||||
"WebSearchStatus": ".websearchstatus",
|
"WebSearchStatus": ".websearchstatus",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
|
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
|
||||||
|
from .contextcompressionengine import ContextCompressionEngine
|
||||||
from .datacollection import DataCollection
|
from .datacollection import DataCollection
|
||||||
from .debugoptions import DebugOptions, DebugOptionsTypedDict
|
from .debugoptions import DebugOptions, DebugOptionsTypedDict
|
||||||
from .message import Message, MessageTypedDict
|
from .message import Message, MessageTypedDict
|
||||||
@@ -405,6 +406,27 @@ class ChatGenerationParamsProvider(BaseModel):
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
ChatGenerationParamsIDContextCompression = Literal["context-compression",]
|
||||||
|
|
||||||
|
|
||||||
|
class ChatGenerationParamsPluginContextCompressionTypedDict(TypedDict):
|
||||||
|
id: ChatGenerationParamsIDContextCompression
|
||||||
|
enabled: NotRequired[bool]
|
||||||
|
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
|
||||||
|
engine: NotRequired[ContextCompressionEngine]
|
||||||
|
r"""The compression engine to use. Defaults to \"middle-out\"."""
|
||||||
|
|
||||||
|
|
||||||
|
class ChatGenerationParamsPluginContextCompression(BaseModel):
|
||||||
|
id: ChatGenerationParamsIDContextCompression
|
||||||
|
|
||||||
|
enabled: Optional[bool] = None
|
||||||
|
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
|
||||||
|
|
||||||
|
engine: Optional[ContextCompressionEngine] = None
|
||||||
|
r"""The compression engine to use. Defaults to \"middle-out\"."""
|
||||||
|
|
||||||
|
|
||||||
ChatGenerationParamsIDResponseHealing = Literal["response-healing",]
|
ChatGenerationParamsIDResponseHealing = Literal["response-healing",]
|
||||||
|
|
||||||
|
|
||||||
@@ -520,6 +542,7 @@ ChatGenerationParamsPluginUnionTypedDict = TypeAliasType(
|
|||||||
ChatGenerationParamsPluginResponseHealingTypedDict,
|
ChatGenerationParamsPluginResponseHealingTypedDict,
|
||||||
ChatGenerationParamsPluginAutoRouterTypedDict,
|
ChatGenerationParamsPluginAutoRouterTypedDict,
|
||||||
ChatGenerationParamsPluginFileParserTypedDict,
|
ChatGenerationParamsPluginFileParserTypedDict,
|
||||||
|
ChatGenerationParamsPluginContextCompressionTypedDict,
|
||||||
ChatGenerationParamsPluginWebTypedDict,
|
ChatGenerationParamsPluginWebTypedDict,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@@ -532,6 +555,9 @@ ChatGenerationParamsPluginUnion = Annotated[
|
|||||||
Annotated[ChatGenerationParamsPluginWeb, Tag("web")],
|
Annotated[ChatGenerationParamsPluginWeb, Tag("web")],
|
||||||
Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")],
|
Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")],
|
||||||
Annotated[ChatGenerationParamsPluginResponseHealing, Tag("response-healing")],
|
Annotated[ChatGenerationParamsPluginResponseHealing, Tag("response-healing")],
|
||||||
|
Annotated[
|
||||||
|
ChatGenerationParamsPluginContextCompression, Tag("context-compression")
|
||||||
|
],
|
||||||
],
|
],
|
||||||
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import (
|
||||||
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
)
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from typing import Any, Dict
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ConflictResponseErrorDataTypedDict(TypedDict):
|
||||||
|
r"""Error data for ConflictResponse"""
|
||||||
|
|
||||||
|
code: int
|
||||||
|
message: str
|
||||||
|
metadata: NotRequired[Nullable[Dict[str, Nullable[Any]]]]
|
||||||
|
|
||||||
|
|
||||||
|
class ConflictResponseErrorData(BaseModel):
|
||||||
|
r"""Error data for ConflictResponse"""
|
||||||
|
|
||||||
|
code: int
|
||||||
|
|
||||||
|
message: str
|
||||||
|
|
||||||
|
metadata: OptionalNullable[Dict[str, Nullable[Any]]] = UNSET
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = ["metadata"]
|
||||||
|
nullable_fields = ["metadata"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from typing import Literal
|
||||||
|
|
||||||
|
|
||||||
|
ContextCompressionEngine = Literal["middle-out",]
|
||||||
|
r"""The compression engine to use. Defaults to \"middle-out\"."""
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal, Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
DatetimeServerToolType = Literal["openrouter:datetime",]
|
||||||
|
|
||||||
|
|
||||||
|
class DatetimeServerToolParametersTypedDict(TypedDict):
|
||||||
|
timezone: NotRequired[str]
|
||||||
|
r"""IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC."""
|
||||||
|
|
||||||
|
|
||||||
|
class DatetimeServerToolParameters(BaseModel):
|
||||||
|
timezone: Optional[str] = None
|
||||||
|
r"""IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC."""
|
||||||
|
|
||||||
|
|
||||||
|
class DatetimeServerToolTypedDict(TypedDict):
|
||||||
|
r"""OpenRouter built-in server tool: returns the current date and time"""
|
||||||
|
|
||||||
|
type: DatetimeServerToolType
|
||||||
|
parameters: NotRequired[DatetimeServerToolParametersTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class DatetimeServerTool(BaseModel):
|
||||||
|
r"""OpenRouter built-in server tool: returns the current date and time"""
|
||||||
|
|
||||||
|
type: DatetimeServerToolType
|
||||||
|
|
||||||
|
parameters: Optional[DatetimeServerToolParameters] = None
|
||||||
@@ -40,6 +40,10 @@ from .responsesoutputitemfunctioncall import (
|
|||||||
ResponsesOutputItemFunctionCall,
|
ResponsesOutputItemFunctionCall,
|
||||||
ResponsesOutputItemFunctionCallTypedDict,
|
ResponsesOutputItemFunctionCallTypedDict,
|
||||||
)
|
)
|
||||||
|
from .responsesservertooloutput import (
|
||||||
|
ResponsesServerToolOutput,
|
||||||
|
ResponsesServerToolOutputTypedDict,
|
||||||
|
)
|
||||||
from .responseswebsearchcalloutput import (
|
from .responseswebsearchcalloutput import (
|
||||||
ResponsesWebSearchCallOutput,
|
ResponsesWebSearchCallOutput,
|
||||||
ResponsesWebSearchCallOutputTypedDict,
|
ResponsesWebSearchCallOutputTypedDict,
|
||||||
@@ -339,6 +343,7 @@ OpenResponsesInputUnion1TypedDict = TypeAliasType(
|
|||||||
ResponsesWebSearchCallOutputTypedDict,
|
ResponsesWebSearchCallOutputTypedDict,
|
||||||
ResponsesOutputItemFileSearchCallTypedDict,
|
ResponsesOutputItemFileSearchCallTypedDict,
|
||||||
ResponsesImageGenerationCallTypedDict,
|
ResponsesImageGenerationCallTypedDict,
|
||||||
|
ResponsesServerToolOutputTypedDict,
|
||||||
OpenResponsesFunctionCallOutputTypedDict,
|
OpenResponsesFunctionCallOutputTypedDict,
|
||||||
OpenResponsesFunctionToolCallTypedDict,
|
OpenResponsesFunctionToolCallTypedDict,
|
||||||
OpenResponsesInputMessageTypedDict,
|
OpenResponsesInputMessageTypedDict,
|
||||||
@@ -357,6 +362,7 @@ OpenResponsesInputUnion1 = TypeAliasType(
|
|||||||
ResponsesWebSearchCallOutput,
|
ResponsesWebSearchCallOutput,
|
||||||
ResponsesOutputItemFileSearchCall,
|
ResponsesOutputItemFileSearchCall,
|
||||||
ResponsesImageGenerationCall,
|
ResponsesImageGenerationCall,
|
||||||
|
ResponsesServerToolOutput,
|
||||||
OpenResponsesFunctionCallOutput,
|
OpenResponsesFunctionCallOutput,
|
||||||
OpenResponsesFunctionToolCall,
|
OpenResponsesFunctionToolCall,
|
||||||
OpenResponsesInputMessage,
|
OpenResponsesInputMessage,
|
||||||
|
|||||||
@@ -151,18 +151,18 @@ class OpenResponsesNonStreamingResponseToolFunction(BaseModel):
|
|||||||
OpenResponsesNonStreamingResponseToolUnionTypedDict = TypeAliasType(
|
OpenResponsesNonStreamingResponseToolUnionTypedDict = TypeAliasType(
|
||||||
"OpenResponsesNonStreamingResponseToolUnionTypedDict",
|
"OpenResponsesNonStreamingResponseToolUnionTypedDict",
|
||||||
Union[
|
Union[
|
||||||
|
OpenResponsesLocalShellToolTypedDict,
|
||||||
OpenResponsesApplyPatchToolTypedDict,
|
OpenResponsesApplyPatchToolTypedDict,
|
||||||
OpenResponsesFunctionShellToolTypedDict,
|
OpenResponsesFunctionShellToolTypedDict,
|
||||||
OpenResponsesLocalShellToolTypedDict,
|
|
||||||
OpenResponsesCodeInterpreterToolTypedDict,
|
OpenResponsesCodeInterpreterToolTypedDict,
|
||||||
OpenResponsesWebSearchPreviewToolTypedDict,
|
|
||||||
OpenResponsesWebSearchPreview20250311ToolTypedDict,
|
|
||||||
OpenResponsesComputerToolTypedDict,
|
|
||||||
OpenResponsesWebSearch20250826ToolTypedDict,
|
|
||||||
OpenResponsesWebSearchToolTypedDict,
|
|
||||||
OpenResponsesCustomToolTypedDict,
|
OpenResponsesCustomToolTypedDict,
|
||||||
|
OpenResponsesComputerToolTypedDict,
|
||||||
OpenResponsesNonStreamingResponseToolFunctionTypedDict,
|
OpenResponsesNonStreamingResponseToolFunctionTypedDict,
|
||||||
OpenResponsesFileSearchToolTypedDict,
|
OpenResponsesFileSearchToolTypedDict,
|
||||||
|
OpenResponsesWebSearchToolTypedDict,
|
||||||
|
OpenResponsesWebSearch20250826ToolTypedDict,
|
||||||
|
OpenResponsesWebSearchPreview20250311ToolTypedDict,
|
||||||
|
OpenResponsesWebSearchPreviewToolTypedDict,
|
||||||
OpenResponsesMcpToolTypedDict,
|
OpenResponsesMcpToolTypedDict,
|
||||||
OpenResponsesImageGenerationToolTypedDict,
|
OpenResponsesImageGenerationToolTypedDict,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from .contextcompressionengine import ContextCompressionEngine
|
||||||
from .datacollection import DataCollection
|
from .datacollection import DataCollection
|
||||||
|
from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict
|
||||||
from .openairesponsesincludable import OpenAIResponsesIncludable
|
from .openairesponsesincludable import OpenAIResponsesIncludable
|
||||||
from .openairesponsesprompt import OpenAIResponsesPrompt, OpenAIResponsesPromptTypedDict
|
from .openairesponsesprompt import OpenAIResponsesPrompt, OpenAIResponsesPromptTypedDict
|
||||||
from .openairesponsestoolchoice_union import (
|
from .openairesponsestoolchoice_union import (
|
||||||
@@ -80,6 +82,10 @@ from .providersort import ProviderSort
|
|||||||
from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict
|
from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict
|
||||||
from .quantization import Quantization
|
from .quantization import Quantization
|
||||||
from .responsesoutputmodality import ResponsesOutputModality
|
from .responsesoutputmodality import ResponsesOutputModality
|
||||||
|
from .responseswebsearchservertool import (
|
||||||
|
ResponsesWebSearchServerTool,
|
||||||
|
ResponsesWebSearchServerToolTypedDict,
|
||||||
|
)
|
||||||
from .websearchengine import WebSearchEngine
|
from .websearchengine import WebSearchEngine
|
||||||
from openrouter.types import (
|
from openrouter.types import (
|
||||||
BaseModel,
|
BaseModel,
|
||||||
@@ -157,18 +163,20 @@ class OpenResponsesRequestToolFunction(BaseModel):
|
|||||||
OpenResponsesRequestToolUnionTypedDict = TypeAliasType(
|
OpenResponsesRequestToolUnionTypedDict = TypeAliasType(
|
||||||
"OpenResponsesRequestToolUnionTypedDict",
|
"OpenResponsesRequestToolUnionTypedDict",
|
||||||
Union[
|
Union[
|
||||||
|
OpenResponsesLocalShellToolTypedDict,
|
||||||
OpenResponsesApplyPatchToolTypedDict,
|
OpenResponsesApplyPatchToolTypedDict,
|
||||||
OpenResponsesFunctionShellToolTypedDict,
|
OpenResponsesFunctionShellToolTypedDict,
|
||||||
OpenResponsesLocalShellToolTypedDict,
|
ResponsesWebSearchServerToolTypedDict,
|
||||||
|
DatetimeServerToolTypedDict,
|
||||||
OpenResponsesCodeInterpreterToolTypedDict,
|
OpenResponsesCodeInterpreterToolTypedDict,
|
||||||
OpenResponsesWebSearchPreviewToolTypedDict,
|
|
||||||
OpenResponsesWebSearchPreview20250311ToolTypedDict,
|
|
||||||
OpenResponsesComputerToolTypedDict,
|
|
||||||
OpenResponsesWebSearch20250826ToolTypedDict,
|
|
||||||
OpenResponsesWebSearchToolTypedDict,
|
|
||||||
OpenResponsesCustomToolTypedDict,
|
OpenResponsesCustomToolTypedDict,
|
||||||
|
OpenResponsesComputerToolTypedDict,
|
||||||
OpenResponsesRequestToolFunctionTypedDict,
|
OpenResponsesRequestToolFunctionTypedDict,
|
||||||
OpenResponsesFileSearchToolTypedDict,
|
OpenResponsesFileSearchToolTypedDict,
|
||||||
|
OpenResponsesWebSearch20250826ToolTypedDict,
|
||||||
|
OpenResponsesWebSearchToolTypedDict,
|
||||||
|
OpenResponsesWebSearchPreview20250311ToolTypedDict,
|
||||||
|
OpenResponsesWebSearchPreviewToolTypedDict,
|
||||||
OpenResponsesMcpToolTypedDict,
|
OpenResponsesMcpToolTypedDict,
|
||||||
OpenResponsesImageGenerationToolTypedDict,
|
OpenResponsesImageGenerationToolTypedDict,
|
||||||
],
|
],
|
||||||
@@ -194,6 +202,8 @@ OpenResponsesRequestToolUnion = Annotated[
|
|||||||
Annotated[OpenResponsesFunctionShellTool, Tag("shell")],
|
Annotated[OpenResponsesFunctionShellTool, Tag("shell")],
|
||||||
Annotated[OpenResponsesApplyPatchTool, Tag("apply_patch")],
|
Annotated[OpenResponsesApplyPatchTool, Tag("apply_patch")],
|
||||||
Annotated[OpenResponsesCustomTool, Tag("custom")],
|
Annotated[OpenResponsesCustomTool, Tag("custom")],
|
||||||
|
Annotated[DatetimeServerTool, Tag("openrouter:datetime")],
|
||||||
|
Annotated[ResponsesWebSearchServerTool, Tag("openrouter:web_search")],
|
||||||
],
|
],
|
||||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||||
]
|
]
|
||||||
@@ -449,6 +459,27 @@ class OpenResponsesRequestProvider(BaseModel):
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesRequestIDContextCompression = Literal["context-compression",]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesRequestPluginContextCompressionTypedDict(TypedDict):
|
||||||
|
id: OpenResponsesRequestIDContextCompression
|
||||||
|
enabled: NotRequired[bool]
|
||||||
|
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
|
||||||
|
engine: NotRequired[ContextCompressionEngine]
|
||||||
|
r"""The compression engine to use. Defaults to \"middle-out\"."""
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesRequestPluginContextCompression(BaseModel):
|
||||||
|
id: OpenResponsesRequestIDContextCompression
|
||||||
|
|
||||||
|
enabled: Optional[bool] = None
|
||||||
|
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
|
||||||
|
|
||||||
|
engine: Optional[ContextCompressionEngine] = None
|
||||||
|
r"""The compression engine to use. Defaults to \"middle-out\"."""
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesRequestIDResponseHealing = Literal["response-healing",]
|
OpenResponsesRequestIDResponseHealing = Literal["response-healing",]
|
||||||
|
|
||||||
|
|
||||||
@@ -564,6 +595,7 @@ OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
|
|||||||
OpenResponsesRequestPluginResponseHealingTypedDict,
|
OpenResponsesRequestPluginResponseHealingTypedDict,
|
||||||
OpenResponsesRequestPluginAutoRouterTypedDict,
|
OpenResponsesRequestPluginAutoRouterTypedDict,
|
||||||
OpenResponsesRequestPluginFileParserTypedDict,
|
OpenResponsesRequestPluginFileParserTypedDict,
|
||||||
|
OpenResponsesRequestPluginContextCompressionTypedDict,
|
||||||
OpenResponsesRequestPluginWebTypedDict,
|
OpenResponsesRequestPluginWebTypedDict,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@@ -576,6 +608,9 @@ OpenResponsesRequestPluginUnion = Annotated[
|
|||||||
Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
|
Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
|
||||||
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
|
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
|
||||||
Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
|
Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
|
||||||
|
Annotated[
|
||||||
|
OpenResponsesRequestPluginContextCompression, Tag("context-compression")
|
||||||
|
],
|
||||||
],
|
],
|
||||||
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
Discriminator(lambda m: get_discriminator(m, "id", "id")),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -53,6 +53,18 @@ from .openresponsesreasoningsummarytextdoneevent import (
|
|||||||
OpenResponsesReasoningSummaryTextDoneEvent,
|
OpenResponsesReasoningSummaryTextDoneEvent,
|
||||||
OpenResponsesReasoningSummaryTextDoneEventTypedDict,
|
OpenResponsesReasoningSummaryTextDoneEventTypedDict,
|
||||||
)
|
)
|
||||||
|
from .openresponseswebsearchcallcompleted import (
|
||||||
|
OpenResponsesWebSearchCallCompleted,
|
||||||
|
OpenResponsesWebSearchCallCompletedTypedDict,
|
||||||
|
)
|
||||||
|
from .openresponseswebsearchcallinprogress import (
|
||||||
|
OpenResponsesWebSearchCallInProgress,
|
||||||
|
OpenResponsesWebSearchCallInProgressTypedDict,
|
||||||
|
)
|
||||||
|
from .openresponseswebsearchcallsearching import (
|
||||||
|
OpenResponsesWebSearchCallSearching,
|
||||||
|
OpenResponsesWebSearchCallSearchingTypedDict,
|
||||||
|
)
|
||||||
from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict
|
from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict
|
||||||
from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict
|
from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict
|
||||||
from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict
|
from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict
|
||||||
@@ -672,22 +684,25 @@ OpenResponsesStreamEventTypedDict = TypeAliasType(
|
|||||||
OpenResponsesStreamEventResponseFailedTypedDict,
|
OpenResponsesStreamEventResponseFailedTypedDict,
|
||||||
OpenResponsesStreamEventResponseOutputItemAddedTypedDict,
|
OpenResponsesStreamEventResponseOutputItemAddedTypedDict,
|
||||||
OpenResponsesStreamEventResponseOutputItemDoneTypedDict,
|
OpenResponsesStreamEventResponseOutputItemDoneTypedDict,
|
||||||
|
OpenResponsesWebSearchCallCompletedTypedDict,
|
||||||
|
OpenResponsesWebSearchCallSearchingTypedDict,
|
||||||
|
OpenResponsesWebSearchCallInProgressTypedDict,
|
||||||
OpenResponsesImageGenCallCompletedTypedDict,
|
OpenResponsesImageGenCallCompletedTypedDict,
|
||||||
OpenResponsesImageGenCallGeneratingTypedDict,
|
OpenResponsesImageGenCallGeneratingTypedDict,
|
||||||
OpenResponsesImageGenCallInProgressTypedDict,
|
OpenResponsesImageGenCallInProgressTypedDict,
|
||||||
OpenResponsesErrorEventTypedDict,
|
|
||||||
OpenResponsesStreamEventResponseFunctionCallArgumentsDeltaTypedDict,
|
OpenResponsesStreamEventResponseFunctionCallArgumentsDeltaTypedDict,
|
||||||
OpenResponsesStreamEventResponseRefusalDeltaTypedDict,
|
OpenResponsesErrorEventTypedDict,
|
||||||
OpenResponsesReasoningSummaryPartAddedEventTypedDict,
|
|
||||||
OpenResponsesStreamEventResponseContentPartAddedTypedDict,
|
|
||||||
OpenResponsesImageGenCallPartialImageTypedDict,
|
|
||||||
OpenResponsesStreamEventResponseFunctionCallArgumentsDoneTypedDict,
|
|
||||||
OpenResponsesReasoningDeltaEventTypedDict,
|
|
||||||
OpenResponsesReasoningDoneEventTypedDict,
|
|
||||||
OpenResponsesStreamEventResponseRefusalDoneTypedDict,
|
|
||||||
OpenResponsesStreamEventResponseReasoningSummaryPartDoneTypedDict,
|
|
||||||
OpenResponsesReasoningSummaryTextDeltaEventTypedDict,
|
OpenResponsesReasoningSummaryTextDeltaEventTypedDict,
|
||||||
OpenResponsesReasoningSummaryTextDoneEventTypedDict,
|
OpenResponsesReasoningSummaryTextDoneEventTypedDict,
|
||||||
|
OpenResponsesReasoningDeltaEventTypedDict,
|
||||||
|
OpenResponsesReasoningDoneEventTypedDict,
|
||||||
|
OpenResponsesReasoningSummaryPartAddedEventTypedDict,
|
||||||
|
OpenResponsesStreamEventResponseReasoningSummaryPartDoneTypedDict,
|
||||||
|
OpenResponsesStreamEventResponseContentPartAddedTypedDict,
|
||||||
|
OpenResponsesStreamEventResponseFunctionCallArgumentsDoneTypedDict,
|
||||||
|
OpenResponsesStreamEventResponseRefusalDoneTypedDict,
|
||||||
|
OpenResponsesStreamEventResponseRefusalDeltaTypedDict,
|
||||||
|
OpenResponsesImageGenCallPartialImageTypedDict,
|
||||||
OpenResponsesStreamEventResponseContentPartDoneTypedDict,
|
OpenResponsesStreamEventResponseContentPartDoneTypedDict,
|
||||||
OpenResponsesStreamEventResponseOutputTextDeltaTypedDict,
|
OpenResponsesStreamEventResponseOutputTextDeltaTypedDict,
|
||||||
OpenResponsesStreamEventResponseOutputTextDoneTypedDict,
|
OpenResponsesStreamEventResponseOutputTextDoneTypedDict,
|
||||||
@@ -787,6 +802,18 @@ OpenResponsesStreamEvent = Annotated[
|
|||||||
OpenResponsesImageGenCallCompleted,
|
OpenResponsesImageGenCallCompleted,
|
||||||
Tag("response.image_generation_call.completed"),
|
Tag("response.image_generation_call.completed"),
|
||||||
],
|
],
|
||||||
|
Annotated[
|
||||||
|
OpenResponsesWebSearchCallInProgress,
|
||||||
|
Tag("response.web_search_call.in_progress"),
|
||||||
|
],
|
||||||
|
Annotated[
|
||||||
|
OpenResponsesWebSearchCallSearching,
|
||||||
|
Tag("response.web_search_call.searching"),
|
||||||
|
],
|
||||||
|
Annotated[
|
||||||
|
OpenResponsesWebSearchCallCompleted,
|
||||||
|
Tag("response.web_search_call.completed"),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -12,11 +12,12 @@ from openrouter.types import (
|
|||||||
OptionalNullable,
|
OptionalNullable,
|
||||||
UNSET,
|
UNSET,
|
||||||
UNSET_SENTINEL,
|
UNSET_SENTINEL,
|
||||||
|
UnrecognizedStr,
|
||||||
)
|
)
|
||||||
from openrouter.utils import validate_open_enum
|
from openrouter.utils import validate_open_enum
|
||||||
from pydantic import model_serializer
|
from pydantic import model_serializer
|
||||||
from pydantic.functional_validators import PlainValidator
|
from pydantic.functional_validators import PlainValidator
|
||||||
from typing import List, Literal, Optional
|
from typing import List, Literal, Optional, Union
|
||||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
@@ -25,15 +26,18 @@ OpenResponsesWebSearch20250826ToolType = Literal["web_search_2025_08_26",]
|
|||||||
|
|
||||||
class OpenResponsesWebSearch20250826ToolFiltersTypedDict(TypedDict):
|
class OpenResponsesWebSearch20250826ToolFiltersTypedDict(TypedDict):
|
||||||
allowed_domains: NotRequired[Nullable[List[str]]]
|
allowed_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
excluded_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearch20250826ToolFilters(BaseModel):
|
class OpenResponsesWebSearch20250826ToolFilters(BaseModel):
|
||||||
allowed_domains: OptionalNullable[List[str]] = UNSET
|
allowed_domains: OptionalNullable[List[str]] = UNSET
|
||||||
|
|
||||||
|
excluded_domains: OptionalNullable[List[str]] = UNSET
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = ["allowed_domains"]
|
optional_fields = ["allowed_domains", "excluded_domains"]
|
||||||
nullable_fields = ["allowed_domains"]
|
nullable_fields = ["allowed_domains", "excluded_domains"]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
serialized = handler(self)
|
serialized = handler(self)
|
||||||
@@ -61,6 +65,17 @@ class OpenResponsesWebSearch20250826ToolFilters(BaseModel):
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesWebSearch20250826ToolEngine = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"native",
|
||||||
|
"exa",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict):
|
class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict):
|
||||||
r"""Web search tool configuration (2025-08-26 version)"""
|
r"""Web search tool configuration (2025-08-26 version)"""
|
||||||
|
|
||||||
@@ -70,6 +85,10 @@ class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict):
|
|||||||
r"""Size of the search context for web search tools"""
|
r"""Size of the search context for web search tools"""
|
||||||
user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]]
|
user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]]
|
||||||
r"""User location information for web search"""
|
r"""User location information for web search"""
|
||||||
|
engine: NotRequired[OpenResponsesWebSearch20250826ToolEngine]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearch20250826Tool(BaseModel):
|
class OpenResponsesWebSearch20250826Tool(BaseModel):
|
||||||
@@ -87,9 +106,24 @@ class OpenResponsesWebSearch20250826Tool(BaseModel):
|
|||||||
user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET
|
user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET
|
||||||
r"""User location information for web search"""
|
r"""User location information for web search"""
|
||||||
|
|
||||||
|
engine: Annotated[
|
||||||
|
Optional[OpenResponsesWebSearch20250826ToolEngine],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = ["filters", "search_context_size", "user_location"]
|
optional_fields = [
|
||||||
|
"filters",
|
||||||
|
"search_context_size",
|
||||||
|
"user_location",
|
||||||
|
"engine",
|
||||||
|
"max_results",
|
||||||
|
]
|
||||||
nullable_fields = ["filters", "user_location"]
|
nullable_fields = ["filters", "user_location"]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesWebSearchCallCompletedType = Literal["response.web_search_call.completed",]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchCallCompletedTypedDict(TypedDict):
|
||||||
|
r"""Web search call completed"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchCallCompletedType
|
||||||
|
item_id: str
|
||||||
|
output_index: float
|
||||||
|
sequence_number: float
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchCallCompleted(BaseModel):
|
||||||
|
r"""Web search call completed"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchCallCompletedType
|
||||||
|
|
||||||
|
item_id: str
|
||||||
|
|
||||||
|
output_index: float
|
||||||
|
|
||||||
|
sequence_number: float
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesWebSearchCallInProgressType = Literal[
|
||||||
|
"response.web_search_call.in_progress",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchCallInProgressTypedDict(TypedDict):
|
||||||
|
r"""Web search call in progress"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchCallInProgressType
|
||||||
|
item_id: str
|
||||||
|
output_index: float
|
||||||
|
sequence_number: float
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchCallInProgress(BaseModel):
|
||||||
|
r"""Web search call in progress"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchCallInProgressType
|
||||||
|
|
||||||
|
item_id: str
|
||||||
|
|
||||||
|
output_index: float
|
||||||
|
|
||||||
|
sequence_number: float
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesWebSearchCallSearchingType = Literal["response.web_search_call.searching",]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchCallSearchingTypedDict(TypedDict):
|
||||||
|
r"""Web search call is searching"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchCallSearchingType
|
||||||
|
item_id: str
|
||||||
|
output_index: float
|
||||||
|
sequence_number: float
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchCallSearching(BaseModel):
|
||||||
|
r"""Web search call is searching"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchCallSearchingType
|
||||||
|
|
||||||
|
item_id: str
|
||||||
|
|
||||||
|
output_index: float
|
||||||
|
|
||||||
|
sequence_number: float
|
||||||
@@ -12,11 +12,12 @@ from openrouter.types import (
|
|||||||
OptionalNullable,
|
OptionalNullable,
|
||||||
UNSET,
|
UNSET,
|
||||||
UNSET_SENTINEL,
|
UNSET_SENTINEL,
|
||||||
|
UnrecognizedStr,
|
||||||
)
|
)
|
||||||
from openrouter.utils import validate_open_enum
|
from openrouter.utils import validate_open_enum
|
||||||
from pydantic import model_serializer
|
from pydantic import model_serializer
|
||||||
from pydantic.functional_validators import PlainValidator
|
from pydantic.functional_validators import PlainValidator
|
||||||
from typing import Literal, Optional
|
from typing import List, Literal, Optional, Union
|
||||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
@@ -25,31 +26,107 @@ OpenResponsesWebSearchPreview20250311ToolType = Literal[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearchPreview20250311ToolTypedDict(TypedDict):
|
OpenResponsesWebSearchPreview20250311ToolEngine = Union[
|
||||||
r"""Web search preview tool configuration (2025-03-11 version)"""
|
Literal[
|
||||||
|
"auto",
|
||||||
type: OpenResponsesWebSearchPreview20250311ToolType
|
"native",
|
||||||
search_context_size: NotRequired[ResponsesSearchContextSize]
|
"exa",
|
||||||
r"""Size of the search context for web search tools"""
|
],
|
||||||
user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]]
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearchPreview20250311Tool(BaseModel):
|
class OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict(TypedDict):
|
||||||
r"""Web search preview tool configuration (2025-03-11 version)"""
|
allowed_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
excluded_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
|
||||||
type: OpenResponsesWebSearchPreview20250311ToolType
|
|
||||||
|
|
||||||
search_context_size: Annotated[
|
class OpenResponsesWebSearchPreview20250311ToolFilters(BaseModel):
|
||||||
Optional[ResponsesSearchContextSize], PlainValidator(validate_open_enum(False))
|
allowed_domains: OptionalNullable[List[str]] = UNSET
|
||||||
] = None
|
|
||||||
r"""Size of the search context for web search tools"""
|
|
||||||
|
|
||||||
user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET
|
excluded_domains: OptionalNullable[List[str]] = UNSET
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = ["search_context_size", "user_location"]
|
optional_fields = ["allowed_domains", "excluded_domains"]
|
||||||
nullable_fields = ["user_location"]
|
nullable_fields = ["allowed_domains", "excluded_domains"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchPreview20250311ToolTypedDict(TypedDict):
|
||||||
|
r"""Web search preview tool configuration (2025-03-11 version)"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchPreview20250311ToolType
|
||||||
|
search_context_size: NotRequired[ResponsesSearchContextSize]
|
||||||
|
r"""Size of the search context for web search tools"""
|
||||||
|
user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]]
|
||||||
|
engine: NotRequired[OpenResponsesWebSearchPreview20250311ToolEngine]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
filters: NotRequired[
|
||||||
|
Nullable[OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict]
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchPreview20250311Tool(BaseModel):
|
||||||
|
r"""Web search preview tool configuration (2025-03-11 version)"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchPreview20250311ToolType
|
||||||
|
|
||||||
|
search_context_size: Annotated[
|
||||||
|
Optional[ResponsesSearchContextSize], PlainValidator(validate_open_enum(False))
|
||||||
|
] = None
|
||||||
|
r"""Size of the search context for web search tools"""
|
||||||
|
|
||||||
|
user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET
|
||||||
|
|
||||||
|
engine: Annotated[
|
||||||
|
Optional[OpenResponsesWebSearchPreview20250311ToolEngine],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
filters: OptionalNullable[OpenResponsesWebSearchPreview20250311ToolFilters] = UNSET
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"search_context_size",
|
||||||
|
"user_location",
|
||||||
|
"engine",
|
||||||
|
"max_results",
|
||||||
|
"filters",
|
||||||
|
]
|
||||||
|
nullable_fields = ["user_location", "filters"]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
serialized = handler(self)
|
serialized = handler(self)
|
||||||
|
|||||||
@@ -12,42 +12,117 @@ from openrouter.types import (
|
|||||||
OptionalNullable,
|
OptionalNullable,
|
||||||
UNSET,
|
UNSET,
|
||||||
UNSET_SENTINEL,
|
UNSET_SENTINEL,
|
||||||
|
UnrecognizedStr,
|
||||||
)
|
)
|
||||||
from openrouter.utils import validate_open_enum
|
from openrouter.utils import validate_open_enum
|
||||||
from pydantic import model_serializer
|
from pydantic import model_serializer
|
||||||
from pydantic.functional_validators import PlainValidator
|
from pydantic.functional_validators import PlainValidator
|
||||||
from typing import Literal, Optional
|
from typing import List, Literal, Optional, Union
|
||||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesWebSearchPreviewToolType = Literal["web_search_preview",]
|
OpenResponsesWebSearchPreviewToolType = Literal["web_search_preview",]
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearchPreviewToolTypedDict(TypedDict):
|
OpenResponsesWebSearchPreviewToolEngine = Union[
|
||||||
r"""Web search preview tool configuration"""
|
Literal[
|
||||||
|
"auto",
|
||||||
type: OpenResponsesWebSearchPreviewToolType
|
"native",
|
||||||
search_context_size: NotRequired[ResponsesSearchContextSize]
|
"exa",
|
||||||
r"""Size of the search context for web search tools"""
|
],
|
||||||
user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]]
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearchPreviewTool(BaseModel):
|
class OpenResponsesWebSearchPreviewToolFiltersTypedDict(TypedDict):
|
||||||
r"""Web search preview tool configuration"""
|
allowed_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
excluded_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
|
||||||
type: OpenResponsesWebSearchPreviewToolType
|
|
||||||
|
|
||||||
search_context_size: Annotated[
|
class OpenResponsesWebSearchPreviewToolFilters(BaseModel):
|
||||||
Optional[ResponsesSearchContextSize], PlainValidator(validate_open_enum(False))
|
allowed_domains: OptionalNullable[List[str]] = UNSET
|
||||||
] = None
|
|
||||||
r"""Size of the search context for web search tools"""
|
|
||||||
|
|
||||||
user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET
|
excluded_domains: OptionalNullable[List[str]] = UNSET
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = ["search_context_size", "user_location"]
|
optional_fields = ["allowed_domains", "excluded_domains"]
|
||||||
nullable_fields = ["user_location"]
|
nullable_fields = ["allowed_domains", "excluded_domains"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchPreviewToolTypedDict(TypedDict):
|
||||||
|
r"""Web search preview tool configuration"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchPreviewToolType
|
||||||
|
search_context_size: NotRequired[ResponsesSearchContextSize]
|
||||||
|
r"""Size of the search context for web search tools"""
|
||||||
|
user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]]
|
||||||
|
engine: NotRequired[OpenResponsesWebSearchPreviewToolEngine]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
filters: NotRequired[Nullable[OpenResponsesWebSearchPreviewToolFiltersTypedDict]]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesWebSearchPreviewTool(BaseModel):
|
||||||
|
r"""Web search preview tool configuration"""
|
||||||
|
|
||||||
|
type: OpenResponsesWebSearchPreviewToolType
|
||||||
|
|
||||||
|
search_context_size: Annotated[
|
||||||
|
Optional[ResponsesSearchContextSize], PlainValidator(validate_open_enum(False))
|
||||||
|
] = None
|
||||||
|
r"""Size of the search context for web search tools"""
|
||||||
|
|
||||||
|
user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET
|
||||||
|
|
||||||
|
engine: Annotated[
|
||||||
|
Optional[OpenResponsesWebSearchPreviewToolEngine],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
filters: OptionalNullable[OpenResponsesWebSearchPreviewToolFilters] = UNSET
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"search_context_size",
|
||||||
|
"user_location",
|
||||||
|
"engine",
|
||||||
|
"max_results",
|
||||||
|
"filters",
|
||||||
|
]
|
||||||
|
nullable_fields = ["user_location", "filters"]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
serialized = handler(self)
|
serialized = handler(self)
|
||||||
|
|||||||
@@ -12,11 +12,12 @@ from openrouter.types import (
|
|||||||
OptionalNullable,
|
OptionalNullable,
|
||||||
UNSET,
|
UNSET,
|
||||||
UNSET_SENTINEL,
|
UNSET_SENTINEL,
|
||||||
|
UnrecognizedStr,
|
||||||
)
|
)
|
||||||
from openrouter.utils import validate_open_enum
|
from openrouter.utils import validate_open_enum
|
||||||
from pydantic import model_serializer
|
from pydantic import model_serializer
|
||||||
from pydantic.functional_validators import PlainValidator
|
from pydantic.functional_validators import PlainValidator
|
||||||
from typing import List, Literal, Optional
|
from typing import List, Literal, Optional, Union
|
||||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
@@ -25,15 +26,18 @@ OpenResponsesWebSearchToolType = Literal["web_search",]
|
|||||||
|
|
||||||
class OpenResponsesWebSearchToolFiltersTypedDict(TypedDict):
|
class OpenResponsesWebSearchToolFiltersTypedDict(TypedDict):
|
||||||
allowed_domains: NotRequired[Nullable[List[str]]]
|
allowed_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
excluded_domains: NotRequired[Nullable[List[str]]]
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearchToolFilters(BaseModel):
|
class OpenResponsesWebSearchToolFilters(BaseModel):
|
||||||
allowed_domains: OptionalNullable[List[str]] = UNSET
|
allowed_domains: OptionalNullable[List[str]] = UNSET
|
||||||
|
|
||||||
|
excluded_domains: OptionalNullable[List[str]] = UNSET
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = ["allowed_domains"]
|
optional_fields = ["allowed_domains", "excluded_domains"]
|
||||||
nullable_fields = ["allowed_domains"]
|
nullable_fields = ["allowed_domains", "excluded_domains"]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
serialized = handler(self)
|
serialized = handler(self)
|
||||||
@@ -61,6 +65,17 @@ class OpenResponsesWebSearchToolFilters(BaseModel):
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesWebSearchToolEngine = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"native",
|
||||||
|
"exa",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearchToolTypedDict(TypedDict):
|
class OpenResponsesWebSearchToolTypedDict(TypedDict):
|
||||||
r"""Web search tool configuration"""
|
r"""Web search tool configuration"""
|
||||||
|
|
||||||
@@ -70,6 +85,10 @@ class OpenResponsesWebSearchToolTypedDict(TypedDict):
|
|||||||
r"""Size of the search context for web search tools"""
|
r"""Size of the search context for web search tools"""
|
||||||
user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]]
|
user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]]
|
||||||
r"""User location information for web search"""
|
r"""User location information for web search"""
|
||||||
|
engine: NotRequired[OpenResponsesWebSearchToolEngine]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesWebSearchTool(BaseModel):
|
class OpenResponsesWebSearchTool(BaseModel):
|
||||||
@@ -87,9 +106,24 @@ class OpenResponsesWebSearchTool(BaseModel):
|
|||||||
user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET
|
user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET
|
||||||
r"""User location information for web search"""
|
r"""User location information for web search"""
|
||||||
|
|
||||||
|
engine: Annotated[
|
||||||
|
Optional[OpenResponsesWebSearchToolEngine],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = ["filters", "search_context_size", "user_location"]
|
optional_fields = [
|
||||||
|
"filters",
|
||||||
|
"search_context_size",
|
||||||
|
"user_location",
|
||||||
|
"engine",
|
||||||
|
"max_results",
|
||||||
|
]
|
||||||
nullable_fields = ["filters", "user_location"]
|
nullable_fields = ["filters", "user_location"]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
|
|||||||
@@ -21,14 +21,16 @@ from .responsesoutputmessage import (
|
|||||||
ResponsesOutputMessage,
|
ResponsesOutputMessage,
|
||||||
ResponsesOutputMessageTypedDict,
|
ResponsesOutputMessageTypedDict,
|
||||||
)
|
)
|
||||||
|
from .responsesservertooloutput import (
|
||||||
|
ResponsesServerToolOutput,
|
||||||
|
ResponsesServerToolOutputTypedDict,
|
||||||
|
)
|
||||||
from .responseswebsearchcalloutput import (
|
from .responseswebsearchcalloutput import (
|
||||||
ResponsesWebSearchCallOutput,
|
ResponsesWebSearchCallOutput,
|
||||||
ResponsesWebSearchCallOutputTypedDict,
|
ResponsesWebSearchCallOutputTypedDict,
|
||||||
)
|
)
|
||||||
from openrouter.utils import get_discriminator
|
|
||||||
from pydantic import Discriminator, Tag
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
from typing_extensions import Annotated, TypeAliasType
|
from typing_extensions import TypeAliasType
|
||||||
|
|
||||||
|
|
||||||
ResponsesOutputItemTypedDict = TypeAliasType(
|
ResponsesOutputItemTypedDict = TypeAliasType(
|
||||||
@@ -37,6 +39,7 @@ ResponsesOutputItemTypedDict = TypeAliasType(
|
|||||||
ResponsesWebSearchCallOutputTypedDict,
|
ResponsesWebSearchCallOutputTypedDict,
|
||||||
ResponsesOutputItemFileSearchCallTypedDict,
|
ResponsesOutputItemFileSearchCallTypedDict,
|
||||||
ResponsesImageGenerationCallTypedDict,
|
ResponsesImageGenerationCallTypedDict,
|
||||||
|
ResponsesServerToolOutputTypedDict,
|
||||||
ResponsesOutputMessageTypedDict,
|
ResponsesOutputMessageTypedDict,
|
||||||
ResponsesOutputItemFunctionCallTypedDict,
|
ResponsesOutputItemFunctionCallTypedDict,
|
||||||
ResponsesOutputItemReasoningTypedDict,
|
ResponsesOutputItemReasoningTypedDict,
|
||||||
@@ -45,15 +48,16 @@ ResponsesOutputItemTypedDict = TypeAliasType(
|
|||||||
r"""An output item from the response"""
|
r"""An output item from the response"""
|
||||||
|
|
||||||
|
|
||||||
ResponsesOutputItem = Annotated[
|
ResponsesOutputItem = TypeAliasType(
|
||||||
|
"ResponsesOutputItem",
|
||||||
Union[
|
Union[
|
||||||
Annotated[ResponsesOutputMessage, Tag("message")],
|
ResponsesWebSearchCallOutput,
|
||||||
Annotated[ResponsesOutputItemReasoning, Tag("reasoning")],
|
ResponsesOutputItemFileSearchCall,
|
||||||
Annotated[ResponsesOutputItemFunctionCall, Tag("function_call")],
|
ResponsesImageGenerationCall,
|
||||||
Annotated[ResponsesWebSearchCallOutput, Tag("web_search_call")],
|
ResponsesServerToolOutput,
|
||||||
Annotated[ResponsesOutputItemFileSearchCall, Tag("file_search_call")],
|
ResponsesOutputMessage,
|
||||||
Annotated[ResponsesImageGenerationCall, Tag("image_generation_call")],
|
ResponsesOutputItemFunctionCall,
|
||||||
|
ResponsesOutputItemReasoning,
|
||||||
],
|
],
|
||||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
)
|
||||||
]
|
|
||||||
r"""An output item from the response"""
|
r"""An output item from the response"""
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel, Nullable, UnrecognizedStr
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
import pydantic
|
||||||
|
from pydantic import ConfigDict
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import Any, Dict, Literal, Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
ResponsesServerToolOutputStatus = Union[
|
||||||
|
Literal[
|
||||||
|
"completed",
|
||||||
|
"in_progress",
|
||||||
|
"incomplete",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class ResponsesServerToolOutputTypedDict(TypedDict):
|
||||||
|
r"""A generic OpenRouter server tool output item"""
|
||||||
|
|
||||||
|
type: str
|
||||||
|
r"""Server tool type (e.g. openrouter:datetime, openrouter:web_search)"""
|
||||||
|
status: ResponsesServerToolOutputStatus
|
||||||
|
id: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
|
class ResponsesServerToolOutput(BaseModel):
|
||||||
|
r"""A generic OpenRouter server tool output item"""
|
||||||
|
|
||||||
|
model_config = ConfigDict(
|
||||||
|
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
||||||
|
)
|
||||||
|
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
|
||||||
|
|
||||||
|
type: str
|
||||||
|
r"""Server tool type (e.g. openrouter:datetime, openrouter:web_search)"""
|
||||||
|
|
||||||
|
status: Annotated[
|
||||||
|
ResponsesServerToolOutputStatus, PlainValidator(validate_open_enum(False))
|
||||||
|
]
|
||||||
|
|
||||||
|
id: Optional[str] = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_properties(self):
|
||||||
|
return self.__pydantic_extra__
|
||||||
|
|
||||||
|
@additional_properties.setter
|
||||||
|
def additional_properties(self, value):
|
||||||
|
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal, Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
ResponsesWebSearchServerToolType = Literal["openrouter:web_search",]
|
||||||
|
|
||||||
|
|
||||||
|
class ResponsesWebSearchServerToolParametersTypedDict(TypedDict):
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5."""
|
||||||
|
max_total_results: NotRequired[float]
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results."""
|
||||||
|
|
||||||
|
|
||||||
|
class ResponsesWebSearchServerToolParameters(BaseModel):
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5."""
|
||||||
|
|
||||||
|
max_total_results: Optional[float] = None
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results."""
|
||||||
|
|
||||||
|
|
||||||
|
class ResponsesWebSearchServerToolTypedDict(TypedDict):
|
||||||
|
r"""OpenRouter built-in server tool: searches the web for current information"""
|
||||||
|
|
||||||
|
type: ResponsesWebSearchServerToolType
|
||||||
|
parameters: NotRequired[ResponsesWebSearchServerToolParametersTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class ResponsesWebSearchServerTool(BaseModel):
|
||||||
|
r"""OpenRouter built-in server tool: searches the web for current information"""
|
||||||
|
|
||||||
|
type: ResponsesWebSearchServerToolType
|
||||||
|
|
||||||
|
parameters: Optional[ResponsesWebSearchServerToolParameters] = None
|
||||||
@@ -5,6 +5,9 @@ from .chatmessagecontentitemcachecontrol import (
|
|||||||
ChatMessageContentItemCacheControl,
|
ChatMessageContentItemCacheControl,
|
||||||
ChatMessageContentItemCacheControlTypedDict,
|
ChatMessageContentItemCacheControlTypedDict,
|
||||||
)
|
)
|
||||||
|
from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict
|
||||||
|
from .websearchservertool import WebSearchServerTool, WebSearchServerToolTypedDict
|
||||||
|
from .websearchshorthand import WebSearchShorthand, WebSearchShorthandTypedDict
|
||||||
from openrouter.types import (
|
from openrouter.types import (
|
||||||
BaseModel,
|
BaseModel,
|
||||||
Nullable,
|
Nullable,
|
||||||
@@ -12,15 +15,16 @@ from openrouter.types import (
|
|||||||
UNSET,
|
UNSET,
|
||||||
UNSET_SENTINEL,
|
UNSET_SENTINEL,
|
||||||
)
|
)
|
||||||
from pydantic import model_serializer
|
from openrouter.utils import get_discriminator
|
||||||
from typing import Any, Dict, Literal, Optional
|
from pydantic import Discriminator, Tag, model_serializer
|
||||||
from typing_extensions import NotRequired, TypedDict
|
from typing import Any, Dict, Literal, Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||||
|
|
||||||
|
|
||||||
ToolDefinitionJSONType = Literal["function",]
|
ToolDefinitionJSONType = Literal["function",]
|
||||||
|
|
||||||
|
|
||||||
class ToolDefinitionJSONFunctionTypedDict(TypedDict):
|
class ToolDefinitionJSONFunctionFunctionTypedDict(TypedDict):
|
||||||
r"""Function definition for tool calling"""
|
r"""Function definition for tool calling"""
|
||||||
|
|
||||||
name: str
|
name: str
|
||||||
@@ -33,7 +37,7 @@ class ToolDefinitionJSONFunctionTypedDict(TypedDict):
|
|||||||
r"""Enable strict schema adherence"""
|
r"""Enable strict schema adherence"""
|
||||||
|
|
||||||
|
|
||||||
class ToolDefinitionJSONFunction(BaseModel):
|
class ToolDefinitionJSONFunctionFunction(BaseModel):
|
||||||
r"""Function definition for tool calling"""
|
r"""Function definition for tool calling"""
|
||||||
|
|
||||||
name: str
|
name: str
|
||||||
@@ -79,23 +83,46 @@ class ToolDefinitionJSONFunction(BaseModel):
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
class ToolDefinitionJSONTypedDict(TypedDict):
|
class ToolDefinitionJSONFunctionTypedDict(TypedDict):
|
||||||
r"""Tool definition for function calling"""
|
|
||||||
|
|
||||||
type: ToolDefinitionJSONType
|
type: ToolDefinitionJSONType
|
||||||
function: ToolDefinitionJSONFunctionTypedDict
|
function: ToolDefinitionJSONFunctionFunctionTypedDict
|
||||||
r"""Function definition for tool calling"""
|
r"""Function definition for tool calling"""
|
||||||
cache_control: NotRequired[ChatMessageContentItemCacheControlTypedDict]
|
cache_control: NotRequired[ChatMessageContentItemCacheControlTypedDict]
|
||||||
r"""Cache control for the content part"""
|
r"""Cache control for the content part"""
|
||||||
|
|
||||||
|
|
||||||
class ToolDefinitionJSON(BaseModel):
|
class ToolDefinitionJSONFunction(BaseModel):
|
||||||
r"""Tool definition for function calling"""
|
|
||||||
|
|
||||||
type: ToolDefinitionJSONType
|
type: ToolDefinitionJSONType
|
||||||
|
|
||||||
function: ToolDefinitionJSONFunction
|
function: ToolDefinitionJSONFunctionFunction
|
||||||
r"""Function definition for tool calling"""
|
r"""Function definition for tool calling"""
|
||||||
|
|
||||||
cache_control: Optional[ChatMessageContentItemCacheControl] = None
|
cache_control: Optional[ChatMessageContentItemCacheControl] = None
|
||||||
r"""Cache control for the content part"""
|
r"""Cache control for the content part"""
|
||||||
|
|
||||||
|
|
||||||
|
ToolDefinitionJSONTypedDict = TypeAliasType(
|
||||||
|
"ToolDefinitionJSONTypedDict",
|
||||||
|
Union[
|
||||||
|
DatetimeServerToolTypedDict,
|
||||||
|
WebSearchServerToolTypedDict,
|
||||||
|
ToolDefinitionJSONFunctionTypedDict,
|
||||||
|
WebSearchShorthandTypedDict,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
r"""Tool definition for function calling (regular function or OpenRouter built-in server tool)"""
|
||||||
|
|
||||||
|
|
||||||
|
ToolDefinitionJSON = Annotated[
|
||||||
|
Union[
|
||||||
|
Annotated[ToolDefinitionJSONFunction, Tag("function")],
|
||||||
|
Annotated[DatetimeServerTool, Tag("openrouter:datetime")],
|
||||||
|
Annotated[WebSearchServerTool, Tag("openrouter:web_search")],
|
||||||
|
Annotated[WebSearchShorthand, Tag("web_search")],
|
||||||
|
Annotated[WebSearchShorthand, Tag("web_search_preview")],
|
||||||
|
Annotated[WebSearchShorthand, Tag("web_search_preview_2025_03_11")],
|
||||||
|
Annotated[WebSearchShorthand, Tag("web_search_2025_08_26")],
|
||||||
|
],
|
||||||
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||||
|
]
|
||||||
|
r"""Tool definition for function calling (regular function or OpenRouter built-in server tool)"""
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel, UnrecognizedStr
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import List, Literal, Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchServerToolTypeOpenrouterWebSearch = Literal["openrouter:web_search",]
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchServerToolEngine = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"native",
|
||||||
|
"exa",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchServerToolSearchContextSize = Union[
|
||||||
|
Literal[
|
||||||
|
"low",
|
||||||
|
"medium",
|
||||||
|
"high",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchServerToolParametersType = Literal["approximate",]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchServerToolUserLocationTypedDict(TypedDict):
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
type: NotRequired[WebSearchServerToolParametersType]
|
||||||
|
city: NotRequired[str]
|
||||||
|
region: NotRequired[str]
|
||||||
|
country: NotRequired[str]
|
||||||
|
timezone: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchServerToolUserLocation(BaseModel):
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
type: Optional[WebSearchServerToolParametersType] = None
|
||||||
|
|
||||||
|
city: Optional[str] = None
|
||||||
|
|
||||||
|
region: Optional[str] = None
|
||||||
|
|
||||||
|
country: Optional[str] = None
|
||||||
|
|
||||||
|
timezone: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchServerToolParametersTypedDict(TypedDict):
|
||||||
|
engine: NotRequired[WebSearchServerToolEngine]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
max_total_results: NotRequired[float]
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
|
||||||
|
search_context_size: NotRequired[WebSearchServerToolSearchContextSize]
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
user_location: NotRequired[WebSearchServerToolUserLocationTypedDict]
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
allowed_domains: NotRequired[List[str]]
|
||||||
|
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
excluded_domains: NotRequired[List[str]]
|
||||||
|
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchServerToolParameters(BaseModel):
|
||||||
|
engine: Annotated[
|
||||||
|
Optional[WebSearchServerToolEngine], PlainValidator(validate_open_enum(False))
|
||||||
|
] = None
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
max_total_results: Optional[float] = None
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
|
||||||
|
|
||||||
|
search_context_size: Annotated[
|
||||||
|
Optional[WebSearchServerToolSearchContextSize],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
user_location: Optional[WebSearchServerToolUserLocation] = None
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
allowed_domains: Optional[List[str]] = None
|
||||||
|
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
excluded_domains: Optional[List[str]] = None
|
||||||
|
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchServerToolTypedDict(TypedDict):
|
||||||
|
r"""OpenRouter built-in server tool: searches the web for current information"""
|
||||||
|
|
||||||
|
type: WebSearchServerToolTypeOpenrouterWebSearch
|
||||||
|
parameters: NotRequired[WebSearchServerToolParametersTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchServerTool(BaseModel):
|
||||||
|
r"""OpenRouter built-in server tool: searches the web for current information"""
|
||||||
|
|
||||||
|
type: WebSearchServerToolTypeOpenrouterWebSearch
|
||||||
|
|
||||||
|
parameters: Optional[WebSearchServerToolParameters] = None
|
||||||
@@ -0,0 +1,218 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel, UnrecognizedStr
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import List, Literal, Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchShorthandType = Union[
|
||||||
|
Literal[
|
||||||
|
"web_search",
|
||||||
|
"web_search_preview",
|
||||||
|
"web_search_preview_2025_03_11",
|
||||||
|
"web_search_2025_08_26",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchShorthandEngine = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"native",
|
||||||
|
"exa",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchShorthandSearchContextSize = Union[
|
||||||
|
Literal[
|
||||||
|
"low",
|
||||||
|
"medium",
|
||||||
|
"high",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchShorthandTypeApproximate = Literal["approximate",]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthandUserLocationTypedDict(TypedDict):
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
type: NotRequired[WebSearchShorthandTypeApproximate]
|
||||||
|
city: NotRequired[str]
|
||||||
|
region: NotRequired[str]
|
||||||
|
country: NotRequired[str]
|
||||||
|
timezone: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthandUserLocation(BaseModel):
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
type: Optional[WebSearchShorthandTypeApproximate] = None
|
||||||
|
|
||||||
|
city: Optional[str] = None
|
||||||
|
|
||||||
|
region: Optional[str] = None
|
||||||
|
|
||||||
|
country: Optional[str] = None
|
||||||
|
|
||||||
|
timezone: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchShorthandParametersEngine = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"native",
|
||||||
|
"exa",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchShorthandParametersSearchContextSize = Union[
|
||||||
|
Literal[
|
||||||
|
"low",
|
||||||
|
"medium",
|
||||||
|
"high",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
|
WebSearchShorthandParametersType = Literal["approximate",]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthandParametersUserLocationTypedDict(TypedDict):
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
type: NotRequired[WebSearchShorthandParametersType]
|
||||||
|
city: NotRequired[str]
|
||||||
|
region: NotRequired[str]
|
||||||
|
country: NotRequired[str]
|
||||||
|
timezone: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthandParametersUserLocation(BaseModel):
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
type: Optional[WebSearchShorthandParametersType] = None
|
||||||
|
|
||||||
|
city: Optional[str] = None
|
||||||
|
|
||||||
|
region: Optional[str] = None
|
||||||
|
|
||||||
|
country: Optional[str] = None
|
||||||
|
|
||||||
|
timezone: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthandParametersTypedDict(TypedDict):
|
||||||
|
engine: NotRequired[WebSearchShorthandParametersEngine]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
max_total_results: NotRequired[float]
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
|
||||||
|
search_context_size: NotRequired[WebSearchShorthandParametersSearchContextSize]
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
user_location: NotRequired[WebSearchShorthandParametersUserLocationTypedDict]
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
allowed_domains: NotRequired[List[str]]
|
||||||
|
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
excluded_domains: NotRequired[List[str]]
|
||||||
|
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthandParameters(BaseModel):
|
||||||
|
engine: Annotated[
|
||||||
|
Optional[WebSearchShorthandParametersEngine],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
max_total_results: Optional[float] = None
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
|
||||||
|
|
||||||
|
search_context_size: Annotated[
|
||||||
|
Optional[WebSearchShorthandParametersSearchContextSize],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
user_location: Optional[WebSearchShorthandParametersUserLocation] = None
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
allowed_domains: Optional[List[str]] = None
|
||||||
|
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
excluded_domains: Optional[List[str]] = None
|
||||||
|
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthandTypedDict(TypedDict):
|
||||||
|
r"""Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search."""
|
||||||
|
|
||||||
|
type: WebSearchShorthandType
|
||||||
|
engine: NotRequired[WebSearchShorthandEngine]
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
max_results: NotRequired[float]
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
max_total_results: NotRequired[float]
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
|
||||||
|
search_context_size: NotRequired[WebSearchShorthandSearchContextSize]
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
user_location: NotRequired[WebSearchShorthandUserLocationTypedDict]
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
allowed_domains: NotRequired[List[str]]
|
||||||
|
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
excluded_domains: NotRequired[List[str]]
|
||||||
|
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
parameters: NotRequired[WebSearchShorthandParametersTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class WebSearchShorthand(BaseModel):
|
||||||
|
r"""Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search."""
|
||||||
|
|
||||||
|
type: Annotated[WebSearchShorthandType, PlainValidator(validate_open_enum(False))]
|
||||||
|
|
||||||
|
engine: Annotated[
|
||||||
|
Optional[WebSearchShorthandEngine], PlainValidator(validate_open_enum(False))
|
||||||
|
] = None
|
||||||
|
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
|
||||||
|
|
||||||
|
max_results: Optional[float] = None
|
||||||
|
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
max_total_results: Optional[float] = None
|
||||||
|
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
|
||||||
|
|
||||||
|
search_context_size: Annotated[
|
||||||
|
Optional[WebSearchShorthandSearchContextSize],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
user_location: Optional[WebSearchShorthandUserLocation] = None
|
||||||
|
r"""Approximate user location for location-biased results."""
|
||||||
|
|
||||||
|
allowed_domains: Optional[List[str]] = None
|
||||||
|
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
excluded_domains: Optional[List[str]] = None
|
||||||
|
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
|
||||||
|
|
||||||
|
parameters: Optional[WebSearchShorthandParameters] = None
|
||||||
@@ -15,6 +15,7 @@ if TYPE_CHECKING:
|
|||||||
BadRequestResponseError,
|
BadRequestResponseError,
|
||||||
BadRequestResponseErrorData,
|
BadRequestResponseErrorData,
|
||||||
)
|
)
|
||||||
|
from .conflictresponse_error import ConflictResponseError, ConflictResponseErrorData
|
||||||
from .edgenetworktimeoutresponse_error import (
|
from .edgenetworktimeoutresponse_error import (
|
||||||
EdgeNetworkTimeoutResponseError,
|
EdgeNetworkTimeoutResponseError,
|
||||||
EdgeNetworkTimeoutResponseErrorData,
|
EdgeNetworkTimeoutResponseErrorData,
|
||||||
@@ -69,6 +70,8 @@ __all__ = [
|
|||||||
"BadGatewayResponseErrorData",
|
"BadGatewayResponseErrorData",
|
||||||
"BadRequestResponseError",
|
"BadRequestResponseError",
|
||||||
"BadRequestResponseErrorData",
|
"BadRequestResponseErrorData",
|
||||||
|
"ConflictResponseError",
|
||||||
|
"ConflictResponseErrorData",
|
||||||
"EdgeNetworkTimeoutResponseError",
|
"EdgeNetworkTimeoutResponseError",
|
||||||
"EdgeNetworkTimeoutResponseErrorData",
|
"EdgeNetworkTimeoutResponseErrorData",
|
||||||
"ForbiddenResponseError",
|
"ForbiddenResponseError",
|
||||||
@@ -104,6 +107,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"BadGatewayResponseErrorData": ".badgatewayresponse_error",
|
"BadGatewayResponseErrorData": ".badgatewayresponse_error",
|
||||||
"BadRequestResponseError": ".badrequestresponse_error",
|
"BadRequestResponseError": ".badrequestresponse_error",
|
||||||
"BadRequestResponseErrorData": ".badrequestresponse_error",
|
"BadRequestResponseErrorData": ".badrequestresponse_error",
|
||||||
|
"ConflictResponseError": ".conflictresponse_error",
|
||||||
|
"ConflictResponseErrorData": ".conflictresponse_error",
|
||||||
"EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error",
|
"EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error",
|
||||||
"EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponse_error",
|
"EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponse_error",
|
||||||
"ForbiddenResponseError": ".forbiddenresponse_error",
|
"ForbiddenResponseError": ".forbiddenresponse_error",
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from dataclasses import dataclass, field
|
||||||
|
import httpx
|
||||||
|
from openrouter.components import (
|
||||||
|
conflictresponseerrordata as components_conflictresponseerrordata,
|
||||||
|
)
|
||||||
|
from openrouter.errors import OpenRouterError
|
||||||
|
from openrouter.types import BaseModel, OptionalNullable, UNSET
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
|
||||||
|
class ConflictResponseErrorData(BaseModel):
|
||||||
|
error: components_conflictresponseerrordata.ConflictResponseErrorData
|
||||||
|
r"""Error data for ConflictResponse"""
|
||||||
|
|
||||||
|
user_id: OptionalNullable[str] = UNSET
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass(unsafe_hash=True)
|
||||||
|
class ConflictResponseError(OpenRouterError):
|
||||||
|
r"""Conflict - Resource conflict or concurrent modification"""
|
||||||
|
|
||||||
|
data: ConflictResponseErrorData = field(hash=False)
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
data: ConflictResponseErrorData,
|
||||||
|
raw_response: httpx.Response,
|
||||||
|
body: Optional[str] = None,
|
||||||
|
):
|
||||||
|
fallback = body or raw_response.text
|
||||||
|
message = str(data.error.message) or fallback
|
||||||
|
super().__init__(message, raw_response, body)
|
||||||
|
object.__setattr__(self, "data", data)
|
||||||
+12
-12
@@ -18,7 +18,7 @@ class Models(BaseSDK):
|
|||||||
http_referer: Optional[str] = None,
|
http_referer: Optional[str] = None,
|
||||||
x_open_router_title: Optional[str] = None,
|
x_open_router_title: Optional[str] = None,
|
||||||
x_open_router_categories: Optional[str] = None,
|
x_open_router_categories: Optional[str] = None,
|
||||||
output_modality: Optional[str] = None,
|
output_modalities: Optional[str] = None,
|
||||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
server_url: Optional[str] = None,
|
server_url: Optional[str] = None,
|
||||||
timeout_ms: Optional[int] = None,
|
timeout_ms: Optional[int] = None,
|
||||||
@@ -33,7 +33,7 @@ class Models(BaseSDK):
|
|||||||
|
|
||||||
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
:param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
||||||
:param retries: Override the default retry configuration for this method
|
:param retries: Override the default retry configuration for this method
|
||||||
:param server_url: Override the default server URL for this method
|
:param server_url: Override the default server URL for this method
|
||||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
@@ -53,7 +53,7 @@ class Models(BaseSDK):
|
|||||||
http_referer=http_referer,
|
http_referer=http_referer,
|
||||||
x_open_router_title=x_open_router_title,
|
x_open_router_title=x_open_router_title,
|
||||||
x_open_router_categories=x_open_router_categories,
|
x_open_router_categories=x_open_router_categories,
|
||||||
output_modality=output_modality,
|
output_modalities=output_modalities,
|
||||||
)
|
)
|
||||||
|
|
||||||
req = self._build_request(
|
req = self._build_request(
|
||||||
@@ -133,7 +133,7 @@ class Models(BaseSDK):
|
|||||||
http_referer: Optional[str] = None,
|
http_referer: Optional[str] = None,
|
||||||
x_open_router_title: Optional[str] = None,
|
x_open_router_title: Optional[str] = None,
|
||||||
x_open_router_categories: Optional[str] = None,
|
x_open_router_categories: Optional[str] = None,
|
||||||
output_modality: Optional[str] = None,
|
output_modalities: Optional[str] = None,
|
||||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
server_url: Optional[str] = None,
|
server_url: Optional[str] = None,
|
||||||
timeout_ms: Optional[int] = None,
|
timeout_ms: Optional[int] = None,
|
||||||
@@ -148,7 +148,7 @@ class Models(BaseSDK):
|
|||||||
|
|
||||||
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
:param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
||||||
:param retries: Override the default retry configuration for this method
|
:param retries: Override the default retry configuration for this method
|
||||||
:param server_url: Override the default server URL for this method
|
:param server_url: Override the default server URL for this method
|
||||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
@@ -168,7 +168,7 @@ class Models(BaseSDK):
|
|||||||
http_referer=http_referer,
|
http_referer=http_referer,
|
||||||
x_open_router_title=x_open_router_title,
|
x_open_router_title=x_open_router_title,
|
||||||
x_open_router_categories=x_open_router_categories,
|
x_open_router_categories=x_open_router_categories,
|
||||||
output_modality=output_modality,
|
output_modalities=output_modalities,
|
||||||
)
|
)
|
||||||
|
|
||||||
req = self._build_request_async(
|
req = self._build_request_async(
|
||||||
@@ -250,7 +250,7 @@ class Models(BaseSDK):
|
|||||||
x_open_router_categories: Optional[str] = None,
|
x_open_router_categories: Optional[str] = None,
|
||||||
category: Optional[operations.Category] = None,
|
category: Optional[operations.Category] = None,
|
||||||
supported_parameters: Optional[str] = None,
|
supported_parameters: Optional[str] = None,
|
||||||
output_modality: Optional[str] = None,
|
output_modalities: Optional[str] = None,
|
||||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
server_url: Optional[str] = None,
|
server_url: Optional[str] = None,
|
||||||
timeout_ms: Optional[int] = None,
|
timeout_ms: Optional[int] = None,
|
||||||
@@ -267,7 +267,7 @@ class Models(BaseSDK):
|
|||||||
|
|
||||||
:param category: Filter models by use case category
|
:param category: Filter models by use case category
|
||||||
:param supported_parameters:
|
:param supported_parameters:
|
||||||
:param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
||||||
:param retries: Override the default retry configuration for this method
|
:param retries: Override the default retry configuration for this method
|
||||||
:param server_url: Override the default server URL for this method
|
:param server_url: Override the default server URL for this method
|
||||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
@@ -289,7 +289,7 @@ class Models(BaseSDK):
|
|||||||
x_open_router_categories=x_open_router_categories,
|
x_open_router_categories=x_open_router_categories,
|
||||||
category=category,
|
category=category,
|
||||||
supported_parameters=supported_parameters,
|
supported_parameters=supported_parameters,
|
||||||
output_modality=output_modality,
|
output_modalities=output_modalities,
|
||||||
)
|
)
|
||||||
|
|
||||||
req = self._build_request(
|
req = self._build_request(
|
||||||
@@ -371,7 +371,7 @@ class Models(BaseSDK):
|
|||||||
x_open_router_categories: Optional[str] = None,
|
x_open_router_categories: Optional[str] = None,
|
||||||
category: Optional[operations.Category] = None,
|
category: Optional[operations.Category] = None,
|
||||||
supported_parameters: Optional[str] = None,
|
supported_parameters: Optional[str] = None,
|
||||||
output_modality: Optional[str] = None,
|
output_modalities: Optional[str] = None,
|
||||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
server_url: Optional[str] = None,
|
server_url: Optional[str] = None,
|
||||||
timeout_ms: Optional[int] = None,
|
timeout_ms: Optional[int] = None,
|
||||||
@@ -388,7 +388,7 @@ class Models(BaseSDK):
|
|||||||
|
|
||||||
:param category: Filter models by use case category
|
:param category: Filter models by use case category
|
||||||
:param supported_parameters:
|
:param supported_parameters:
|
||||||
:param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
||||||
:param retries: Override the default retry configuration for this method
|
:param retries: Override the default retry configuration for this method
|
||||||
:param server_url: Override the default server URL for this method
|
:param server_url: Override the default server URL for this method
|
||||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
@@ -410,7 +410,7 @@ class Models(BaseSDK):
|
|||||||
x_open_router_categories=x_open_router_categories,
|
x_open_router_categories=x_open_router_categories,
|
||||||
category=category,
|
category=category,
|
||||||
supported_parameters=supported_parameters,
|
supported_parameters=supported_parameters,
|
||||||
output_modality=output_modality,
|
output_modalities=output_modalities,
|
||||||
)
|
)
|
||||||
|
|
||||||
req = self._build_request_async(
|
req = self._build_request_async(
|
||||||
|
|||||||
+12
-2
@@ -411,7 +411,7 @@ class OAuth(BaseSDK):
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
request=req,
|
request=req,
|
||||||
error_status_codes=["400", "401", "4XX", "500", "5XX"],
|
error_status_codes=["400", "401", "409", "4XX", "500", "5XX"],
|
||||||
retry_config=retry_config,
|
retry_config=retry_config,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -430,6 +430,11 @@ class OAuth(BaseSDK):
|
|||||||
errors.UnauthorizedResponseErrorData, http_res
|
errors.UnauthorizedResponseErrorData, http_res
|
||||||
)
|
)
|
||||||
raise errors.UnauthorizedResponseError(response_data, http_res)
|
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "409", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.ConflictResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.ConflictResponseError(response_data, http_res)
|
||||||
if utils.match_response(http_res, "500", "application/json"):
|
if utils.match_response(http_res, "500", "application/json"):
|
||||||
response_data = unmarshal_json_response(
|
response_data = unmarshal_json_response(
|
||||||
errors.InternalServerResponseErrorData, http_res
|
errors.InternalServerResponseErrorData, http_res
|
||||||
@@ -564,7 +569,7 @@ class OAuth(BaseSDK):
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
request=req,
|
request=req,
|
||||||
error_status_codes=["400", "401", "4XX", "500", "5XX"],
|
error_status_codes=["400", "401", "409", "4XX", "500", "5XX"],
|
||||||
retry_config=retry_config,
|
retry_config=retry_config,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -583,6 +588,11 @@ class OAuth(BaseSDK):
|
|||||||
errors.UnauthorizedResponseErrorData, http_res
|
errors.UnauthorizedResponseErrorData, http_res
|
||||||
)
|
)
|
||||||
raise errors.UnauthorizedResponseError(response_data, http_res)
|
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "409", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.ConflictResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.ConflictResponseError(response_data, http_res)
|
||||||
if utils.match_response(http_res, "500", "application/json"):
|
if utils.match_response(http_res, "500", "application/json"):
|
||||||
response_data = unmarshal_json_response(
|
response_data = unmarshal_json_response(
|
||||||
errors.InternalServerResponseErrorData, http_res
|
errors.InternalServerResponseErrorData, http_res
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class GetModelsRequestTypedDict(TypedDict):
|
|||||||
category: NotRequired[Category]
|
category: NotRequired[Category]
|
||||||
r"""Filter models by use case category"""
|
r"""Filter models by use case category"""
|
||||||
supported_parameters: NotRequired[str]
|
supported_parameters: NotRequired[str]
|
||||||
output_modality: NotRequired[str]
|
output_modalities: NotRequired[str]
|
||||||
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
|
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
|
||||||
|
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ class GetModelsRequest(BaseModel):
|
|||||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
] = None
|
] = None
|
||||||
|
|
||||||
output_modality: Annotated[
|
output_modalities: Annotated[
|
||||||
Optional[str],
|
Optional[str],
|
||||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
] = None
|
] = None
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class ListModelsCountRequestTypedDict(TypedDict):
|
|||||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
output_modality: NotRequired[str]
|
output_modalities: NotRequired[str]
|
||||||
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
|
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
|
||||||
|
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class ListModelsCountRequest(BaseModel):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
output_modality: Annotated[
|
output_modalities: Annotated[
|
||||||
Optional[str],
|
Optional[str],
|
||||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
] = None
|
] = None
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openrouter"
|
name = "openrouter"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "httpcore" },
|
{ name = "httpcore" },
|
||||||
|
|||||||
Reference in New Issue
Block a user