ateve 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ateve
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Official Python SDK for the Ateve Search API
5
5
  Project-URL: Homepage, https://ateve.ai
6
6
  Project-URL: Documentation, https://ateve.ai/docs
@@ -81,24 +81,32 @@ decisions remain caller-owned.
81
81
 
82
82
  ## Search contract limits
83
83
 
84
- Use `max_results` (1–100, default 10); `limit` and `offset` have been removed.
85
- `ContentOptions.snippet` is optional and defaults to `True`. To retrieve full
86
- text, pass `content=ContentOptions(text=TextOptions())`, or configure
84
+ Use `max_results` to set the maximum number of results (1–100, default 10).
85
+ `limit` and `offset` have been removed. Both synchronous and asynchronous
86
+ clients accept `content` and `max_results`, or a `SearchRequest` instance.
87
+
88
+ Snippets are always returned and cannot be disabled. To request full text, pass
89
+ `content=ContentOptions(text=TextOptions())`. To customize the output, use
87
90
  `TextOptions(max_characters=8000, format=ContentFormat.MARKDOWN)`.
88
- `format` accepts `"text"` (default) or `"markdown"`. Omitting `text` does not
89
- request full text. `max_characters` remains a strict positive signed 32-bit
90
- integer; its server default is 5000 per result, applied after format conversion.
91
- Use `content=ContentOptions(highlights=True)` to receive query-relevant excerpts
92
- in `SearchResult.highlights` (`list[str]`, or `None` when absent). Highlights
93
- default to `False` and can coexist with snippets and full text. They focus on
94
- evidence that directly supports answers, reducing unrelated information compared
95
- with snippets. `summary` has been removed from `ContentOptions`; `favicon`
96
- remains optional. Both synchronous and asynchronous clients accept `content`
97
- and `max_results`, or a `SearchRequest` instance.
98
-
99
- Both formats return content in `SearchResult.text`. It defaults to `None` when
100
- absent or when extraction fails; `model_fields_set` distinguishes those cases.
101
- Snippets may coexist with text; set `ContentOptions(snippet=False)` to omit
102
- them. Obsolete answer, usage, news/video, query tuning and raw content/summary
103
- response fields and models have been removed. Unknown response
104
- fields continue to be retained by Pydantic for forward compatibility.
91
+ `format` accepts `ContentFormat.TEXT` (default) or `ContentFormat.MARKDOWN`.
92
+ Full text is requested only when `text` is supplied. `max_characters` must be a
93
+ strict positive signed 32-bit integer. The server default is 5,000 characters
94
+ per result, applied after format conversion. Both formats return content in
95
+ `SearchResult.text`, which is `None` when absent or when extraction fails.
96
+ `model_fields_set` distinguishes those cases. Full text is returned alongside
97
+ snippets.
98
+
99
+ Highlights are optional and disabled by default. Set
100
+ `content=ContentOptions(highlights=True)` to return concise, query-relevant
101
+ excerpts in addition to snippets. `SearchResult.highlights` is a `list[str]`, or
102
+ `None` when the field is absent. Highlights can coexist with snippets and full text.
103
+
104
+ For token-efficient workflows, your agent can prioritize highlights when building
105
+ model context and supplement them with snippets when additional context is needed.
106
+ When the API returns both fields, token savings depend on which content your
107
+ agent passes to the model.
108
+
109
+ `summary` and the snippet toggle have been removed from `ContentOptions`.
110
+ `favicon` remains optional under `content`. Obsolete answer, usage, news/video,
111
+ query tuning, and raw content/summary response fields and models have been removed.
112
+ Unknown response fields continue to be retained by Pydantic for forward compatibility.
@@ -55,24 +55,32 @@ decisions remain caller-owned.
55
55
 
56
56
  ## Search contract limits
57
57
 
58
- Use `max_results` (1–100, default 10); `limit` and `offset` have been removed.
59
- `ContentOptions.snippet` is optional and defaults to `True`. To retrieve full
60
- text, pass `content=ContentOptions(text=TextOptions())`, or configure
58
+ Use `max_results` to set the maximum number of results (1–100, default 10).
59
+ `limit` and `offset` have been removed. Both synchronous and asynchronous
60
+ clients accept `content` and `max_results`, or a `SearchRequest` instance.
61
+
62
+ Snippets are always returned and cannot be disabled. To request full text, pass
63
+ `content=ContentOptions(text=TextOptions())`. To customize the output, use
61
64
  `TextOptions(max_characters=8000, format=ContentFormat.MARKDOWN)`.
62
- `format` accepts `"text"` (default) or `"markdown"`. Omitting `text` does not
63
- request full text. `max_characters` remains a strict positive signed 32-bit
64
- integer; its server default is 5000 per result, applied after format conversion.
65
- Use `content=ContentOptions(highlights=True)` to receive query-relevant excerpts
66
- in `SearchResult.highlights` (`list[str]`, or `None` when absent). Highlights
67
- default to `False` and can coexist with snippets and full text. They focus on
68
- evidence that directly supports answers, reducing unrelated information compared
69
- with snippets. `summary` has been removed from `ContentOptions`; `favicon`
70
- remains optional. Both synchronous and asynchronous clients accept `content`
71
- and `max_results`, or a `SearchRequest` instance.
72
-
73
- Both formats return content in `SearchResult.text`. It defaults to `None` when
74
- absent or when extraction fails; `model_fields_set` distinguishes those cases.
75
- Snippets may coexist with text; set `ContentOptions(snippet=False)` to omit
76
- them. Obsolete answer, usage, news/video, query tuning and raw content/summary
77
- response fields and models have been removed. Unknown response
78
- fields continue to be retained by Pydantic for forward compatibility.
65
+ `format` accepts `ContentFormat.TEXT` (default) or `ContentFormat.MARKDOWN`.
66
+ Full text is requested only when `text` is supplied. `max_characters` must be a
67
+ strict positive signed 32-bit integer. The server default is 5,000 characters
68
+ per result, applied after format conversion. Both formats return content in
69
+ `SearchResult.text`, which is `None` when absent or when extraction fails.
70
+ `model_fields_set` distinguishes those cases. Full text is returned alongside
71
+ snippets.
72
+
73
+ Highlights are optional and disabled by default. Set
74
+ `content=ContentOptions(highlights=True)` to return concise, query-relevant
75
+ excerpts in addition to snippets. `SearchResult.highlights` is a `list[str]`, or
76
+ `None` when the field is absent. Highlights can coexist with snippets and full text.
77
+
78
+ For token-efficient workflows, your agent can prioritize highlights when building
79
+ model context and supplement them with snippets when additional context is needed.
80
+ When the API returns both fields, token savings depend on which content your
81
+ agent passes to the model.
82
+
83
+ `summary` and the snippet toggle have been removed from `ContentOptions`.
84
+ `favicon` remains optional under `content`. Obsolete answer, usage, news/video,
85
+ query tuning, and raw content/summary response fields and models have been removed.
86
+ Unknown response fields continue to be retained by Pydantic for forward compatibility.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ateve"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "Official Python SDK for the Ateve Search API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -0,0 +1 @@
1
+ __version__ = "0.2.2"
@@ -87,7 +87,6 @@ class TextOptions(RequestModel):
87
87
 
88
88
 
89
89
  class ContentOptions(RequestModel):
90
- snippet: Optional[bool] = Field(default=True)
91
90
  highlights: Optional[bool] = Field(default=False)
92
91
  text: Optional[TextOptions] = None
93
92
  favicon: Optional[bool] = None
@@ -57,7 +57,7 @@ def test_sync_golden_contract_and_wire_names() -> None:
57
57
  date_range="2026-01-01..2026-06-30",
58
58
  locale=LocaleSettings(mkt="US", language="en"),
59
59
  content=ContentOptions(
60
- snippet=False, highlights=True,
60
+ highlights=True,
61
61
  text=TextOptions(format=ContentFormat.MARKDOWN, max_characters=5000)
62
62
  ),
63
63
  safe_search=False,
@@ -67,7 +67,7 @@ def test_sync_golden_contract_and_wire_names() -> None:
67
67
  assert payload["date_range"] == "2026-01-01..2026-06-30"
68
68
  assert payload["safe_search"] is False
69
69
  assert payload["max_results"] == 20
70
- assert payload["content"]["snippet"] is False
70
+ assert "snippet" not in payload["content"]
71
71
  assert payload["content"]["highlights"] is True
72
72
  assert not {"limit", "offset", "contents"}.intersection(payload)
73
73
  assert payload["content"]["text"]["max_characters"] == 5000
@@ -345,7 +345,7 @@ def test_sync_and_async_send_new_defaults_and_nested_text_options() -> None:
345
345
  AsyncAteve("sk_test", http_client=transport) as client,
346
346
  ):
347
347
  response = await client.search(
348
- "q", max_results=100, content=ContentOptions(snippet=False, highlights=True)
348
+ "q", max_results=100, content=ContentOptions(highlights=True)
349
349
  )
350
350
  assert response.results[0].highlights == GOLDEN_RESPONSE["results"][0]["highlights"]
351
351
  await client.search(
@@ -358,12 +358,12 @@ def test_sync_and_async_send_new_defaults_and_nested_text_options() -> None:
358
358
  {
359
359
  "query": "q",
360
360
  "max_results": 10,
361
- "content": {"snippet": True, "highlights": False, "text": {"format": "text"}},
361
+ "content": {"highlights": False, "text": {"format": "text"}},
362
362
  },
363
- {"query": "q", "max_results": 100, "content": {"snippet": False, "highlights": True}},
363
+ {"query": "q", "max_results": 100, "content": {"highlights": True}},
364
364
  {
365
365
  "query": "q",
366
366
  "max_results": 10,
367
- "content": {"snippet": True, "highlights": False, "text": {"format": "text"}},
367
+ "content": {"highlights": False, "text": {"format": "text"}},
368
368
  },
369
369
  ]
@@ -25,6 +25,8 @@ def test_request_models_preserve_validation_and_frozen_configuration() -> None:
25
25
  request.query = "changed"
26
26
  with pytest.raises(ValidationError):
27
27
  TextOptions(max_characters=True)
28
+ with pytest.raises(ValidationError, match="snippet"):
29
+ ContentOptions.model_validate({"snippet": False})
28
30
 
29
31
 
30
32
  def test_response_models_preserve_defaults_nulls_extra_fields_and_dates() -> None:
@@ -54,7 +56,6 @@ def test_request_lists_are_snapshots_and_wire_names_stay_snake_case() -> None:
54
56
 
55
57
  def test_request_defaults_and_nested_text_activation() -> None:
56
58
  assert SearchRequest(query="q").max_results == 10
57
- assert ContentOptions().snippet is True
58
59
  assert ContentOptions().highlights is False
59
60
  assert ContentOptions().text is None
60
61
  assert TextOptions().format == ContentFormat.TEXT
@@ -62,10 +63,7 @@ def test_request_defaults_and_nested_text_activation() -> None:
62
63
  assert request.model_dump(mode="json", exclude_none=True) == {
63
64
  "query": "q",
64
65
  "max_results": 10,
65
- "content": {"snippet": True, "highlights": False, "text": {"format": "text"}},
66
- }
67
- assert ContentOptions(snippet=False).model_dump(exclude_none=True) == {
68
- "snippet": False, "highlights": False
66
+ "content": {"highlights": False, "text": {"format": "text"}},
69
67
  }
70
68
  assert ContentOptions(highlights=True).highlights is True
71
69
 
@@ -1 +0,0 @@
1
- __version__ = "0.2.1"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes