Skip to content

Commit 6717618

Browse files
committed
release version 2.0.26
1 parent d9af885 commit 6717618

146 files changed

Lines changed: 5083 additions & 409 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dataforseo_client/api/merchant_api.py

Lines changed: 1404 additions & 240 deletions
Large diffs are not rendered by default.

dataforseo_client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
self.default_headers[header_name] = header_value
6363
self.cookie = cookie
6464
# Set default User-Agent.
65-
self.user_agent = 'python-client/2.0.25'
65+
self.user_agent = 'python-client/2.0.26'
6666
self.client_side_validation = configuration.client_side_validation
6767

6868
def __enter__(self):

dataforseo_client/models/ai_optimization_chat_gpt_llm_responses_live_request_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class AiOptimizationChatGptLlmResponsesLiveRequestInfo(BaseModel):
2020
model_name: Optional[StrictStr] = Field(default=None, description=r"name of the AI modelrequired fieldmodel_nameconsists of the actual model name and version name;if the basic model name is specified, its latest version will be set by default;for example, if gpt-4.1 is specified, the gpt-4.1-2025-04-14 will be set as model_name automatically;you can receive the list of available LLM models by making a separate request to the https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models")
2121
max_output_tokens: Optional[StrictInt] = Field(default=None, description=r"maximum number of tokens in the AI responseoptional fieldminimum value for reasoning models (e.g., reasoning is true in the Models endpoint): 1024;minimum value for non-reasoning models: 16;maximum value: 4096;default value: 2048Note: if web_search is set to true or the reasoning model is specified in the request, the output token count may exceed the specified max_output_tokens limit")
2222
temperature: Optional[StrictFloat] = Field(default=None, description=r"randomness of the AI responseoptional fieldhigher values make output more diverse; lower values make output more focused;minimum value: 0maximum value: 2default value: 0.94Note: not supported in reasoning models")
23-
top_p: Optional[StrictFloat] = Field(default=None, description=r"")
23+
top_p: Optional[StrictFloat] = Field(default=None, description=r"diversity of the AI responseoptional field controls diversity of the response by limiting token selection;minimum value: 0maximum value: 1 default value: 0.92Note: top_p cannot be used together with temperature in the same request")
2424
web_search: Optional[StrictBool] = Field(default=None, description=r"enable web searchoptional fieldwhen enabled, the AI model can access and cite current web information;default value: false;Note: refer to the Models endpoint for a list of models that support web_search;")
2525
force_web_search: Optional[StrictBool] = Field(default=None, description=r"force AI agent to use web searchoptional fieldto enable this parameter, web_search must also be enabled;when enabled, the AI model is forced to access and cite current web information;default value: false;Note: even if the parameter is set to true, there is no guarantee web sources will be cited in the response Note #2: not supported in reasoning models")
26-
web_search_country_iso_code: Optional[StrictStr] = Field(default=None, description=r"ISO country code of the locationoptional fieldrequired if web_search_city is specified;to enable this parameter, web_search must also be enabled;when enabled, the AI model will search the web from the country you specify;Note: not supported in o3-mini, o1-pro, o1 models")
27-
web_search_city: Optional[StrictStr] = Field(default=None, description=r"city name of the locationoptional fieldNote: specify web_search_country_iso_code to use this parameterNote #2: not supported in o3-mini, o1-pro, o1 models")
26+
web_search_country_iso_code: Optional[StrictStr] = Field(default=None, description=r"ISO country code of the locationoptional fieldto enable this parameter, web_search must also be enabled;when enabled, the AI model will search the web from the country you specify;Note: not supported in o3-mini, o1-pro, o1 models")
27+
web_search_city: Optional[StrictStr] = Field(default=None, description=r"city name of the locationoptional fieldNote: not supported in o3-mini, o1-pro, o1 models")
2828
system_message: Optional[StrictStr] = Field(default=None, description=r"instructions for the AI behaviouroptional fielddefines the AI's role, tone, or specific behavior you can specify up to 500 characters in the system_message field")
2929
message_chain: Optional[List[Optional[LlmMessageChainItem]]] = Field(default=None, description=r"conversation history. optional field. array of message objects representing previous conversation turns;. each object must contain:. role string with either user or ai role;. message string with message content (max 500 characters);. you can specify maximum of 10 message objects in the array;. Note: for Perplexity models, messages must strictly alternate between user and AI roles (user → ai);. example:. 'message_chain': [{'role':'user','message':'Hello, what’s up?'},{'role':'ai','message':'Hello! I’m doing well, thank you. How can I assist you today?'}]")
3030
tag: Optional[StrictStr] = Field(default=None, description=r"user-defined task identifieroptional fieldthe character limit is 255you can use this parameter to identify the task and match it with the resultyou will find the specified tag value in the data object of the response")

dataforseo_client/models/ai_optimization_chat_gpt_llm_responses_task_post_request_info.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class AiOptimizationChatGptLlmResponsesTaskPostRequestInfo(BaseModel):
2020
model_name: Optional[StrictStr] = Field(default=None, description=r"name of the AI modelrequired fieldmodel_nameconsists of the actual model name and version name;if the basic model name is specified, its latest version will be set by default;for example, if gpt-4.1 is specified, the gpt-4.1-2025-04-14 will be set as model_name automatically;you can receive the list of available LLM models by making a separate request to the https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models")
2121
max_output_tokens: Optional[StrictInt] = Field(default=None, description=r"maximum number of tokens in the AI responseoptional fieldminimum value for reasoning models (e.g., reasoning is true in the Models endpoint): 1024;minimum value for non-reasoning models: 16;maximum value: 4096;default value: 2048")
2222
temperature: Optional[StrictFloat] = Field(default=None, description=r"randomness of the AI responseoptional fieldhigher values make output more diverse; lower values make output more focused;minimum value: 0maximum value: 2default value: 0.94Note: not supported in reasoning models")
23-
top_p: Optional[StrictFloat] = Field(default=None, description=r"")
23+
top_p: Optional[StrictFloat] = Field(default=None, description=r"diversity of the AI responseoptional field controls diversity of the response by limiting token selection;minimum value: 0maximum value: 1 default value: 0.92Note: top_p cannot be used together with temperature in the same request")
24+
web_search: Optional[StrictBool] = Field(default=None, description=r"enable web searchoptional fieldwhen enabled, the AI model can access and cite current web information;default value: false;Note: refer to the Models endpoint for a list of models that support web_search;")
25+
force_web_search: Optional[StrictBool] = Field(default=None, description=r"force AI agent to use web searchoptional fieldto enable this parameter, web_search must also be enabled;when enabled, the AI model is forced to access and cite current web information;default value: false;Note: even if the parameter is set to true, there is no guarantee web sources will be cited in the response Note #2: not supported in reasoning models")
26+
web_search_country_iso_code: Optional[StrictStr] = Field(default=None, description=r"ISO country code of the locationoptional fieldto enable this parameter, web_search must also be enabled;when enabled, the AI model will search the web from the country you specify;Note: not supported in o3-mini, o1-pro, o1 models")
27+
web_search_city: Optional[StrictStr] = Field(default=None, description=r"city name of the locationoptional fieldNote: not supported in o3-mini, o1-pro, o1 models")
2428
system_message: Optional[StrictStr] = Field(default=None, description=r"instructions for the AI behaviouroptional fielddefines the AI's role, tone, or specific behavior;you can specify up to 500 characters in the system_message field")
2529
message_chain: Optional[List[Optional[LlmMessageChainItem]]] = Field(default=None, description=r"conversation history. optional field. array of message objects representing previous conversation turns;. each object must contain:. role string with either user or ai role;. message string with message content (max 500 characters);. you can specify maximum of 10 message objects in the array;. Note: for Perplexity models, messages must strictly alternate between user and AI roles (user → ai);. example:. 'message_chain': [{'role':'user','message':'Hello, what’s up?'},{'role':'ai','message':'Hello! I’m doing well, thank you. How can I assist you today?'}]")
2630
postback_url: Optional[StrictStr] = Field(default=None, description=r"URL for sending task resultsoptional fieldonce the task is completed, we will send a POST request with its results compressed in the gzip format to the postback_url you specifiedyou can use the ‘$id’ string as a $id variable and ‘$tag’ as urlencoded $tag variable. We will set the necessary values before sending the request.example:http://your-server.com/postbackscript?id=$idhttp://your-server.com/postbackscript?id=$id&tag=$tagNote: special character in postback_url will be urlencoded;i.a., the # character will be encoded into %23learn more on our Help Center")
@@ -32,6 +36,10 @@ class AiOptimizationChatGptLlmResponsesTaskPostRequestInfo(BaseModel):
3236
"max_output_tokens",
3337
"temperature",
3438
"top_p",
39+
"web_search",
40+
"force_web_search",
41+
"web_search_country_iso_code",
42+
"web_search_city",
3543
"system_message",
3644
"message_chain",
3745
"postback_url",
@@ -68,6 +76,10 @@ def to_dict(self) -> Dict[str, Any]:
6876
_dict['max_output_tokens'] = self.max_output_tokens
6977
_dict['temperature'] = self.temperature
7078
_dict['top_p'] = self.top_p
79+
_dict['web_search'] = self.web_search
80+
_dict['force_web_search'] = self.force_web_search
81+
_dict['web_search_country_iso_code'] = self.web_search_country_iso_code
82+
_dict['web_search_city'] = self.web_search_city
7183
_dict['system_message'] = self.system_message
7284
message_chain_items = []
7385
if self.message_chain:
@@ -95,6 +107,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95107
"max_output_tokens": obj.get("max_output_tokens"),
96108
"temperature": obj.get("temperature"),
97109
"top_p": obj.get("top_p"),
110+
"web_search": obj.get("web_search"),
111+
"force_web_search": obj.get("force_web_search"),
112+
"web_search_country_iso_code": obj.get("web_search_country_iso_code"),
113+
"web_search_city": obj.get("web_search_city"),
98114
"system_message": obj.get("system_message"),
99115
"message_chain": [LlmMessageChainItem.from_dict(_item) for _item in obj["message_chain"]] if obj.get("message_chain") is not None else None,
100116
"postback_url": obj.get("postback_url"),

dataforseo_client/models/ai_optimization_claude_llm_responses_live_request_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class AiOptimizationClaudeLlmResponsesLiveRequestInfo(BaseModel):
2323
top_p: Optional[StrictFloat] = Field(default=None, description=r"diversity of the AI responseoptional field controls diversity of the response by limiting token selection;minimum value: 0maximum value: 1 default value: nullNote: top_p cannot be used together with temperature in the same request")
2424
web_search: Optional[StrictBool] = Field(default=None, description=r"enable web search for current informationoptional fieldwhen enabled, the AI model can access and cite current web information;Note: refer to the Models endpoint for a list of models that support web_search; default value: false;The cost of the parameter can be calculated on the Pricing page")
2525
force_web_search: Optional[StrictBool] = Field(default=None, description=r"force AI agent to use web searchoptional fieldto enable this parameter, web_search must also be enabled;when enabled, the AI model is forced to access and cite current web information;default value: false;Note: even if the parameter is set to true, there is no guarantee web sources will be cited in the response")
26-
web_search_country_iso_code: Optional[StrictStr] = Field(default=None, description=r"ISO country code of the locationoptional fieldpossible values: 'AR','AT','AU','BE','BR','CA','CH','CL','CN','DE','DK','ES','FI','FR','GB','HK','ID','IN','IT','JP','KR','MX','MY','NL','NO','NZ','PH','PL','PT','RU','SA','SE','TR','TW','US','ZA'")
27-
web_search_city: Optional[StrictStr] = Field(default=None, description=r"city name of the locationoptional fieldNote: specify web_search_country_iso_code to use this parameter")
26+
web_search_country_iso_code: Optional[StrictStr] = Field(default=None, description=r"ISO country code of the location used for searching the weboptional fieldpossible values: 'AR','AT','AU','BE','BR','CA','CH','CL','CN','DE','DK','ES','FI','FR','GB','HK','ID','IN','IT','JP','KR','MX','MY','NL','NO','NZ','PH','PL','PT','RU','SA','SE','TR','TW','US','ZA'")
27+
web_search_city: Optional[StrictStr] = Field(default=None, description=r"city name of the location used for searching the weboptional field")
2828
system_message: Optional[StrictStr] = Field(default=None, description=r"instructions for the AI behaviouroptional fielddefines the AI's role, tone, or specific behavior;you can specify up to 500 characters in the system_message field")
2929
message_chain: Optional[List[Optional[LlmMessageChainItem]]] = Field(default=None, description=r"conversation history. optional field. array of message objects representing previous conversation turns;. each object must contain:. role string with either user or ai role;. message string with message content (max 500 characters);. you can specify maximum of 10 message objects in the array;. Note: for Perplexity models, messages must strictly alternate between user and AI roles (user → ai);. example:. 'message_chain': [{'role':'user','message':'Hello, what’s up?'},{'role':'ai','message':'Hello! I’m doing well, thank you. How can I assist you today?'}]")
3030
use_reasoning: Optional[StrictBool] = Field(default=None, description=r"enable reasoning for the AI modeloptional fieldwhen enabled, the model will perform reasoning before generating a responserefer to the Models endpoint for a list of models that support reasoningdefault value: falseNote: if set to true, the minimum value for max_output_tokens is 1025Note #2: if set to true, force_web_search must be set to falseNote #3: if set to true, the temperature and top_p cannot be used")

dataforseo_client/models/ai_optimization_claude_llm_responses_task_post_request_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class AiOptimizationClaudeLlmResponsesTaskPostRequestInfo(BaseModel):
2323
top_p: Optional[StrictFloat] = Field(default=None, description=r"diversity of the AI responseoptional field controls diversity of the response by limiting token selection;minimum value: 0maximum value: 1 default value: nullNote: top_p cannot be used together with temperature in the same request")
2424
web_search: Optional[StrictBool] = Field(default=None, description=r"enable web search for current informationoptional fieldwhen enabled, the AI model can access and cite current web information;Note: refer to the Models endpoint for a list of models that support web_search; default value: false;The cost of the parameter can be calculated on the Pricing page")
2525
force_web_search: Optional[StrictBool] = Field(default=None, description=r"force AI agent to use web searchoptional fieldto enable this parameter, web_search must also be enabled;when enabled, the AI model is forced to access and cite current web information;default value: false;Note: even if the parameter is set to true, there is no guarantee web sources will be cited in the response")
26-
web_search_country_iso_code: Optional[StrictStr] = Field(default=None, description=r"ISO country code of the locationoptional fieldpossible values: 'AR','AT','AU','BE','BR','CA','CH','CL','CN','DE','DK','ES','FI','FR','GB','HK','ID','IN','IT','JP','KR','MX','MY','NL','NO','NZ','PH','PL','PT','RU','SA','SE','TR','TW','US','ZA'")
27-
web_search_city: Optional[StrictStr] = Field(default=None, description=r"city name of the locationoptional fieldNote: specify web_search_country_iso_code to use this parameter")
26+
web_search_country_iso_code: Optional[StrictStr] = Field(default=None, description=r"ISO country code of the location used for searching the weboptional fieldpossible values: 'AR','AT','AU','BE','BR','CA','CH','CL','CN','DE','DK','ES','FI','FR','GB','HK','ID','IN','IT','JP','KR','MX','MY','NL','NO','NZ','PH','PL','PT','RU','SA','SE','TR','TW','US','ZA'")
27+
web_search_city: Optional[StrictStr] = Field(default=None, description=r"city name of the location used for searching the weboptional field")
2828
system_message: Optional[StrictStr] = Field(default=None, description=r"instructions for the AI behaviouroptional fielddefines the AI's role, tone, or specific behavior;you can specify up to 500 characters in the system_message field")
2929
message_chain: Optional[List[Optional[LlmMessageChainItem]]] = Field(default=None, description=r"conversation history. optional field. array of message objects representing previous conversation turns;. each object must contain:. role string with either user or ai role;. message string with message content (max 500 characters);. you can specify maximum of 10 message objects in the array;. Note: for Perplexity models, messages must strictly alternate between user and AI roles (user → ai);. example:. 'message_chain': [{'role':'user','message':'Hello, what’s up?'},{'role':'ai','message':'Hello! I’m doing well, thank you. How can I assist you today?'}]")
3030
use_reasoning: Optional[StrictBool] = Field(default=None, description=r"enable reasoning for the AI modeloptional fieldwhen enabled, the model will perform reasoning before generating a responserefer to the Models endpoint for a list of models that support reasoningdefault value: falseNote: if set to true, the minimum value for max_output_tokens is 1025Note #2: if set to true, force_web_search must be set to falseNote #3: if set to true, the temperature and top_p cannot be used")

0 commit comments

Comments
 (0)