-
Notifications
You must be signed in to change notification settings - Fork 0
Python SDK 2.3.0 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
97e218a
5c6db5c
f2ec857
69f6fc0
6bf7e78
b63f8b9
389f900
219390b
bd463f6
9398028
5e6dff9
38eba43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: test | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: "1.22" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
| pip install pytest pytest-asyncio | ||
|
|
||
| - name: Build and start mock server | ||
| working-directory: tests/mockserver | ||
| run: | | ||
| go build -o mockserver . | ||
| ./mockserver & | ||
| sleep 2 | ||
| curl -sf http://localhost:18080/ || echo "mock server ready" | ||
|
|
||
| - name: Run tests | ||
| run: pytest tests/ -v --tb=short -x |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,41 @@ All notable changes to the You.com Python SDK will be documented in this file. | |
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [2.3.0] - 2026-02-27 | ||
|
|
||
| ### Added | ||
|
|
||
| - **Research API**: New `research()` and `research_async()` methods on the main `You` client for comprehensive, multi-step research answers with citations. The Research API goes beyond a single web search by running multiple searches, reading sources, and synthesizing thorough, well-cited answers. | ||
|
|
||
| ```python | ||
| from youdotcom import You | ||
| from youdotcom.models import ResearchEffort | ||
|
|
||
| you = You() | ||
| res = you.research( | ||
| input="What are the latest advances in quantum computing?", | ||
| research_effort=ResearchEffort.DEEP, | ||
| ) | ||
| print(res.output.content) | ||
| for source in res.output.sources: | ||
| print(f" - {source.title or 'Untitled'}: {source.url}") | ||
| ``` | ||
|
|
||
| - **`ResearchEffort` enum**: Controls depth of research (`lite`, `standard`, `deep`, `exhaustive`) | ||
| - **Research models**: `ResearchRequest`, `ResearchResponse`, `Output`, `Source`, `ContentType` | ||
| - **Research errors**: `ResearchUnauthorizedError`, `ResearchForbiddenError`, `ResearchInternalServerError`, `UnprocessableEntityError` | ||
| - **`AgentRuns400ResponseError`**: New error class for 400 Bad Request responses from the Agents API | ||
|
|
||
| ### Changed | ||
|
|
||
| - **Default server URL**: Changed from `https://ydc-index.io` to `https://api.you.com`. If you were relying on the default, no action needed as both resolve to the same API. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wording is inaccurate for Search and Contents endpoints. The code in SEARCH_OP_SERVERS = ["https://ydc-index.io"]
CONTENTS_OP_SERVERS = ["https://ydc-index.io"]
|
||
| - **Python version requirement**: Now requires Python >=3.10 (previously >=3.9.2) | ||
| - **Search API `count` parameter**: Now defaults to `10` instead of `None` | ||
| - **Contents API `crawl_timeout`**: Type changed from `float` to `int`, default is now `10` seconds | ||
| - **Speakeasy generator**: Updated from v2.801.2 to v2.845.12 | ||
|
|
||
| --- | ||
|
|
||
| ## [2.2.0] - 2026-01-29 | ||
|
|
||
| ### Changed | ||
|
|
@@ -302,7 +337,7 @@ Error classes have been renamed for consistency and clarity: | |
| | Old Name (1.x) | New Name (2.0) | | ||
| |----------------|----------------| | ||
| | `PostV1AgentsRunsUnauthorizedError` | `AgentRuns401ResponseError` | | ||
| | `PostV1AgentsRunsForbiddenError` | `AgentRuns422ResponseError` | | ||
| | `PostV1AgentsRunsForbiddenError` | Removed (403 now handled by `YouDefaultError`) | | ||
| | `GetV1SearchUnauthorizedError` | `SearchUnauthorizedError` | | ||
| | `GetV1SearchForbiddenError` | `SearchForbiddenError` | | ||
| | `PostV1ContentsUnauthorizedError` | `ContentsUnauthorizedError` | | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,47 @@ | ||||||
| # Migration Guide: 1.x to 2.0 | ||||||
| # Migration Guide | ||||||
|
|
||||||
| ## 1.x → 2.3.0 (Latest) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Misleading section title. The section below covers only the 2.x → 2.3.0 upgrade path (Python version,
Suggested change
|
||||||
|
|
||||||
| This guide covers breaking changes introduced in 2.3.0. If you are upgrading from 1.x, also read the [1.x → 2.0](#1x-to-20) section below. | ||||||
|
|
||||||
| ### Breaking Changes in 2.3.0 | ||||||
|
|
||||||
| #### Python 3.10 now required | ||||||
|
|
||||||
| The minimum supported Python version has been raised from `>=3.9.2` to `>=3.10`. If you are running Python 3.9, you must upgrade before installing this version. | ||||||
|
|
||||||
| ```bash | ||||||
| python --version # must be 3.10 or later | ||||||
| pip install "youdotcom>=2.3.0" | ||||||
| ``` | ||||||
|
|
||||||
| #### Search API: `count` default changed | ||||||
|
|
||||||
| `you.search.unified()` now defaults `count` to `10` (previously `None`/no default). If your code omits `count` and relies on the API-server default, you will now always receive 10 results. | ||||||
|
|
||||||
| ```python | ||||||
| # Before (2.x < 2.3.0): count was unset, server decided | ||||||
| res = you.search.unified(query="AI news") | ||||||
|
|
||||||
| # After (2.3.0+): equivalent explicit call | ||||||
| res = you.search.unified(query="AI news", count=10) | ||||||
| ``` | ||||||
|
|
||||||
| #### Contents API: `crawl_timeout` type changed | ||||||
|
|
||||||
| `crawl_timeout` has changed from `float` to `int`. Passing a float (e.g., `crawl_timeout=5.5`) will now raise a validation error. | ||||||
tyler5673 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ```python | ||||||
| # Before: float was accepted | ||||||
| res = you.contents.generate(urls=["https://example.com"], crawl_timeout=5.5) | ||||||
|
|
||||||
| # After: use int | ||||||
| res = you.contents.generate(urls=["https://example.com"], crawl_timeout=5) | ||||||
| ``` | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## 1.x to 2.0 | ||||||
|
|
||||||
| This guide helps you upgrade your code from You.com Python SDK 1.x to 2.0. | ||||||
|
|
||||||
|
|
@@ -12,7 +55,7 @@ This guide helps you upgrade your code from You.com Python SDK 1.x to 2.0. | |||||
| | Custom agent | `agent="uuid-string"` | `request=CustomAgentRunsRequest(agent="uuid-string", ...)` | | ||||||
| | Verbosity enum | `Verbosity` | `ReportVerbosity` | | ||||||
| | Format enum | `Format` | `ContentsFormats` | | ||||||
| | Contents format param | `format_=ContentsFormat.X` | `formats=[ContentsFormats.X]` | | ||||||
| | Contents format param | `format_=Format.X` | `formats=[ContentsFormats.X]` | | ||||||
|
|
||||||
| ## Step-by-Step Migration | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.