Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/ai_map_include.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from oxylabs_ai_studio.apps.ai_map import AiMap

ai_map = AiMap(api_key="<API_KEY>")

payload = {
"url": "https://oxylabs.io",
"user_prompt": "find product pages",
"return_sources_limit": 10,
"include_sitemap": False,
"include_paths": [".*/?products/.*"],
}
result = ai_map.map(**payload)
print(result.data)

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "oxylabs-ai-studio"
version = "0.2.16"
version = "0.2.17"
description = "Oxylabs studio python sdk"
readme = "README.md"
keywords = ["oxylabs", "ai", "studio"]
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ print(result.data)
- `render_javascript` (bool): Render JavaScript (default: False)
- `return_sources_limit` (int): Max number of sources to return (default: 25)
- `geo_location` (str): proxy location in ISO2 format.
- `include_sitemap` (bool): Include URLs discovered via sitemap. (default: False)
- `include_paths` (list[str] | None): Regex patterns to include (matched against URL path, e.g., `.*/?products/.*`)
- `exclude_paths` (list[str] | None): Regex patterns to exclude (matched against URL path)


---
See the [examples](https://github.com/oxylabs/oxylabs-ai-studio-py/tree/main/examples) folder for usage examples of each method. Each method has corresponding async version.
12 changes: 12 additions & 0 deletions src/oxylabs_ai_studio/apps/ai_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ def map(
return_sources_limit: int = 25,
geo_location: str | None = None,
render_javascript: bool = False,
include_sitemap: bool = False,
include_paths: list[str] | None = None,
exclude_paths: list[str] | None = None,
) -> AiMapJob:
body = {
"url": url,
"user_prompt": user_prompt,
"return_sources_limit": return_sources_limit,
"geo_location": geo_location,
"render_html": render_javascript,
"include_sitemap": include_sitemap,
"include_paths": include_paths,
"exclude_paths": exclude_paths,
}
client = self.get_client()
create_response = self.call_api(
Expand Down Expand Up @@ -103,13 +109,19 @@ async def map_async(
return_sources_limit: int = 25,
geo_location: str | None = None,
render_javascript: bool = False,
include_sitemap: bool = False,
include_paths: list[str] | None = None,
exclude_paths: list[str] | None = None,
) -> AiMapJob:
body = {
"url": url,
"user_prompt": user_prompt,
"return_sources_limit": return_sources_limit,
"geo_location": geo_location,
"render_html": render_javascript,
"include_sitemap": include_sitemap,
"include_paths": include_paths,
"exclude_paths": exclude_paths,
}
async with self.async_client() as client:
create_response = await self.call_api_async(
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.