getanyapi 0.112.0__tar.gz → 0.113.0__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.
- {getanyapi-0.112.0 → getanyapi-0.113.0}/PKG-INFO +1 -1
- {getanyapi-0.112.0 → getanyapi-0.113.0}/pyproject.toml +1 -1
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/__init__.py +1 -1
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/__init__.py +1 -0
- getanyapi-0.113.0/src/getanyapi/platforms/bing.py +339 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/.gitignore +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/README.md +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/_account.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/_async_client.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/_client.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/_errors.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/_idempotency.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/_pagination.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/_transport.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/discovery_types.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/ahrefs.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/airbnb.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/alibaba.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/amazon.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/apollo.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/appstore.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/bluesky.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/booking.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/capterra.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/chatgpt.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/coinmarketcap.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/company.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/company_enrichment.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/company_identify.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/company_search.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/congress.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/contact_enrichment.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/douyin.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/ebay.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/email.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/email_finding.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/email_verification.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/facebook.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/fiverr.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/g2.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/gemini.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/github.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/glassdoor.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/google.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/google_ads.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/google_finance.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/google_hotels.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/google_shopping.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/hackernews.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/indeed.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/instagram.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/job_search.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/linkedin.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/maps.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/mobile_phone.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/naver.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/nextdoor.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/people_search.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/perplexity.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/person.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/person_enrichment.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/pexels.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/pinterest.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/playstore.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/polymarket.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/property_records.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/realtor.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/reddit.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/redfin.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/rednote.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/sec.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/semrush.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/seo.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/similarweb.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/snapchat.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/social.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/spotify.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/substack.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/technographics.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/threads.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/tiktok.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/tiktok_shop.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/tripadvisor.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/trustpilot.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/truthsocial.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/twitter.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/unsplash.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/upwork.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/walmart.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/web.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/weibo.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/yahoo_finance.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/yelp.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/youtube.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/zhihu.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/platforms/zillow.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/py.typed +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/src/getanyapi/types.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/conftest.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_account.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_client.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_durable_requests.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_envelope.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_errors.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_fixture_roundtrip.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_fixture_sweep.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_not_found_reason.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_pagination.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/tests/test_transport.py +0 -0
- {getanyapi-0.112.0 → getanyapi-0.113.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: getanyapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.113.0
|
|
4
4
|
Summary: Official typed Python SDK for AnyAPI: any API, one wallet, USD, no subscriptions.
|
|
5
5
|
Project-URL: Homepage, https://getanyapi.com
|
|
6
6
|
Project-URL: Documentation, https://getanyapi.com/docs
|
|
@@ -15,6 +15,7 @@ REGISTRY: dict[str, tuple[str, str, str]] = {
|
|
|
15
15
|
"amazon": ("amazon", "AmazonNamespace", "AsyncAmazonNamespace"),
|
|
16
16
|
"apollo": ("apollo", "ApolloNamespace", "AsyncApolloNamespace"),
|
|
17
17
|
"appstore": ("appstore", "AppstoreNamespace", "AsyncAppstoreNamespace"),
|
|
18
|
+
"bing": ("bing", "BingNamespace", "AsyncBingNamespace"),
|
|
18
19
|
"bluesky": ("bluesky", "BlueskyNamespace", "AsyncBlueskyNamespace"),
|
|
19
20
|
"booking": ("booking", "BookingNamespace", "AsyncBookingNamespace"),
|
|
20
21
|
"capterra": ("capterra", "CapterraNamespace", "AsyncCapterraNamespace"),
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the bing platform."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import Literal, TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
|
|
10
|
+
|
|
11
|
+
from ..types import RequestOptions, RunResult
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from .._async_client import AsyncAnyAPI
|
|
15
|
+
from .._client import AnyAPI
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BingCopilotInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Microsoft Copilot Search."""
|
|
20
|
+
|
|
21
|
+
allowFallbacks: NotRequired[bool]
|
|
22
|
+
"""Optional, default true. When false, only the sources listed in `source` may serve; the request is refused with no charge if none of them can. When true, the listed sources are tried first and any other source may serve after them, at the normal price. Default: true."""
|
|
23
|
+
ignoreSources: NotRequired[list[str]]
|
|
24
|
+
"""Optional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way."""
|
|
25
|
+
preferLatencyUnderMs: NotRequired[int]
|
|
26
|
+
"""Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted. Minimum: 1."""
|
|
27
|
+
prompt: Required[str]
|
|
28
|
+
"""The question or prompt for Microsoft Copilot to answer using Bing web search."""
|
|
29
|
+
requireFields: NotRequired[
|
|
30
|
+
list[
|
|
31
|
+
Literal[
|
|
32
|
+
"additionalSections",
|
|
33
|
+
"answerMarkdown",
|
|
34
|
+
"caption",
|
|
35
|
+
"complete",
|
|
36
|
+
"domain",
|
|
37
|
+
"headers",
|
|
38
|
+
"inlineCitations",
|
|
39
|
+
"name",
|
|
40
|
+
"recommendations",
|
|
41
|
+
"researchSources",
|
|
42
|
+
"rows",
|
|
43
|
+
"tables",
|
|
44
|
+
"text",
|
|
45
|
+
]
|
|
46
|
+
]
|
|
47
|
+
]
|
|
48
|
+
"""Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `answerMarkdown`, `inlineCitations` or `tables`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on an answer that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge."""
|
|
49
|
+
source: NotRequired[list[str]]
|
|
50
|
+
"""Optional. Source ids to prefer, in order, taken from this endpoint's `lanes[].source.id` in /catalog or /apis. Omit it and the cheapest source serves, with automatic failover. Listed sources are tried first in the order given, then the others, unless `allowFallbacks` is false. A single source with `allowFallbacks` false is served only by that source at its price, quoted and charged exactly, with no failover. The price is that of the dearest source that may serve. An id that does not serve this endpoint is rejected as invalid input with no charge; a listed source that is not serving right now is refused with no charge, so omit `source` to be served by another. On a paginated walk, later pages must include the source that served page one, or omit `source`."""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class BingSearchInput(TypedDict, total=False):
|
|
54
|
+
"""Input for Bing Search."""
|
|
55
|
+
|
|
56
|
+
allowFallbacks: NotRequired[bool]
|
|
57
|
+
"""Optional, default true. When false, only the sources listed in `source` may serve; the request is refused with no charge if none of them can. When true, the listed sources are tried first and any other source may serve after them, at the normal price. Default: true."""
|
|
58
|
+
country: NotRequired[str]
|
|
59
|
+
"""ISO-3166 alpha-2 country Bing searches from, e.g. US, GB, DE. Bing ranks and localizes results for that country and its main language. Common countries are served by every source; a country only some sources cover is served by those, and one no source covers is refused with no charge. Default: US."""
|
|
60
|
+
ignoreSources: NotRequired[list[str]]
|
|
61
|
+
"""Optional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way."""
|
|
62
|
+
limit: NotRequired[int]
|
|
63
|
+
"""Maximum number of organic results to return (1-10, default 10). Bing serves about 10 organic results per page, and some queries carry fewer. Range: 1 to 10. Default: 10."""
|
|
64
|
+
preferLatencyUnderMs: NotRequired[int]
|
|
65
|
+
"""Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted. Minimum: 1."""
|
|
66
|
+
query: Required[str]
|
|
67
|
+
"""The Bing search query."""
|
|
68
|
+
requireFields: NotRequired[
|
|
69
|
+
list[Literal["answer", "peopleAlsoAsk", "publishedUtc", "question", "siteName"]]
|
|
70
|
+
]
|
|
71
|
+
"""Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `siteName` or `publishedUtc`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a result that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge."""
|
|
72
|
+
source: NotRequired[list[str]]
|
|
73
|
+
"""Optional. Source ids to prefer, in order, taken from this endpoint's `lanes[].source.id` in /catalog or /apis. Omit it and the cheapest source serves, with automatic failover. Listed sources are tried first in the order given, then the others, unless `allowFallbacks` is false. A single source with `allowFallbacks` false is served only by that source at its price, quoted and charged exactly, with no failover. The price is that of the dearest source that may serve. An id that does not serve this endpoint is rejected as invalid input with no charge; a listed source that is not serving right now is refused with no charge, so omit `source` to be served by another. On a paginated walk, later pages must include the source that served page one, or omit `source`."""
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class BingCopilotData(BaseModel):
|
|
77
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
78
|
+
|
|
79
|
+
additional_sections: list[str] | None = Field(
|
|
80
|
+
alias="additionalSections",
|
|
81
|
+
description="Text of answer sections Copilot rendered outside the main answer, such as a section heading or a card, kept so nothing it showed is lost. null means the source that answered cannot report them.",
|
|
82
|
+
)
|
|
83
|
+
answer: str = Field(
|
|
84
|
+
description="Copilot's answer as text. Citation markers Copilot places inline can appear as numbers or source names next to the words they support. Populated whenever the provider has data for the entity."
|
|
85
|
+
)
|
|
86
|
+
answer_markdown: str | None = Field(
|
|
87
|
+
alias="answerMarkdown",
|
|
88
|
+
description="Copilot's answer in Markdown, keeping its bold text, lists and tables. null means the source that answered returns plain text only; name answerMarkdown in requireFields to be served only by a source that returns it.",
|
|
89
|
+
)
|
|
90
|
+
citations: list[BingCopilotCitation] = Field(
|
|
91
|
+
description="Sources Copilot cites for the answer, in the order it lists them. Populated whenever the provider has data for the entity."
|
|
92
|
+
)
|
|
93
|
+
complete: bool | None = Field(
|
|
94
|
+
description="Whether Copilot finished the answer. false means the answer may be cut short. null means the source that answered cannot report it, which is not the same as true."
|
|
95
|
+
)
|
|
96
|
+
inline_citations: list[BingCopilotInlineCitation] | None = Field(
|
|
97
|
+
alias="inlineCitations",
|
|
98
|
+
description="Each claim in the answer that Copilot ties to a source, with the source it cites. null means the source that answered cannot report them.",
|
|
99
|
+
)
|
|
100
|
+
prompt: str = Field(description="The prompt Copilot answered.")
|
|
101
|
+
recommendations: list[BingCopilotRecommendation] | None = Field(
|
|
102
|
+
description="Products, brands or options Copilot recommends in the answer, each with the sentence that recommends it. null means the source that answered cannot report them."
|
|
103
|
+
)
|
|
104
|
+
research_sources: list[BingCopilotResearchSource] | None = Field(
|
|
105
|
+
alias="researchSources",
|
|
106
|
+
description="Pages Copilot searched while researching the answer. A different list from citations: a page here was read but is not necessarily cited. null means the source that answered cannot report them.",
|
|
107
|
+
)
|
|
108
|
+
tables: list[BingCopilotTable] | None = Field(
|
|
109
|
+
description="Tables in the answer, e.g. a comparison table. null means the source that answered cannot report them."
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class BingCopilotCitation(BaseModel):
|
|
114
|
+
model_config = ConfigDict(extra="allow")
|
|
115
|
+
|
|
116
|
+
domain: str | None = Field(
|
|
117
|
+
description="Host of the source page as Copilot shows it, e.g. blog.salesflare.com. null means the source that answered cannot report it."
|
|
118
|
+
)
|
|
119
|
+
snippet: str | None = Field(
|
|
120
|
+
description="Excerpt of the source page Copilot shows. null when Copilot shows none or the source that answered cannot report it."
|
|
121
|
+
)
|
|
122
|
+
title: str = Field(description="Source page title, empty when Copilot shows none.")
|
|
123
|
+
url: str = Field(
|
|
124
|
+
description="Source page URL. Populated whenever the provider has data for the entity."
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class BingCopilotInlineCitation(BaseModel):
|
|
129
|
+
model_config = ConfigDict(extra="allow")
|
|
130
|
+
|
|
131
|
+
text: str | None = Field(
|
|
132
|
+
default=None, description="The sentence of the answer the citation supports."
|
|
133
|
+
)
|
|
134
|
+
title: str | None = Field(
|
|
135
|
+
default=None,
|
|
136
|
+
description="Title of the cited source, empty when Copilot shows none.",
|
|
137
|
+
)
|
|
138
|
+
url: str = Field(description="URL of the cited source.")
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class BingCopilotRecommendation(BaseModel):
|
|
142
|
+
model_config = ConfigDict(extra="allow")
|
|
143
|
+
|
|
144
|
+
name: str = Field(description="Name of the recommended product, brand or option.")
|
|
145
|
+
text: str | None = Field(
|
|
146
|
+
default=None, description="The sentence of the answer that recommends it."
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class BingCopilotResearchSource(BaseModel):
|
|
151
|
+
model_config = ConfigDict(extra="allow")
|
|
152
|
+
|
|
153
|
+
snippet: str | None = Field(
|
|
154
|
+
default=None,
|
|
155
|
+
description="Excerpt of the page Copilot shows, null when it shows none.",
|
|
156
|
+
)
|
|
157
|
+
title: str | None = Field(
|
|
158
|
+
default=None, description="Title of the page, empty when Copilot shows none."
|
|
159
|
+
)
|
|
160
|
+
url: str = Field(description="URL of the page.")
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class BingCopilotTable(BaseModel):
|
|
164
|
+
model_config = ConfigDict(extra="allow")
|
|
165
|
+
|
|
166
|
+
caption: str | None = Field(
|
|
167
|
+
default=None, description="Table caption, null when the table has none."
|
|
168
|
+
)
|
|
169
|
+
headers: list[str] | None = Field(default=None, description="Column headers.")
|
|
170
|
+
rows: list[list[str]] | None = Field(
|
|
171
|
+
default=None,
|
|
172
|
+
description="Table rows, each a list of cell texts in column order.",
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class BingSearchData(BaseModel):
|
|
177
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
178
|
+
|
|
179
|
+
items: list[BingSearchItem] = Field(
|
|
180
|
+
description="Organic results in Bing's ranked order. Ads are not included. Populated whenever the provider has data for the entity."
|
|
181
|
+
)
|
|
182
|
+
people_also_ask: list[BingSearchPeopleAlsoAsk] | None = Field(
|
|
183
|
+
alias="peopleAlsoAsk",
|
|
184
|
+
description="Bing's People also ask questions with the answer it shows. An empty array means Bing showed none; null means the source that answered cannot report them.",
|
|
185
|
+
)
|
|
186
|
+
query: str = Field(description="The query Bing searched.")
|
|
187
|
+
related_searches: list[str] | None = Field(
|
|
188
|
+
alias="relatedSearches",
|
|
189
|
+
description="Bing's related searches for the query. An empty array means Bing showed none; null means the source that answered cannot report them.",
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class BingSearchItem(BaseModel):
|
|
194
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
195
|
+
|
|
196
|
+
display_url: str | None = Field(
|
|
197
|
+
alias="displayUrl",
|
|
198
|
+
description="The URL as Bing displays it under the title, e.g. a host or a breadcrumb path. Its format differs by source. null when the source did not send one.",
|
|
199
|
+
)
|
|
200
|
+
domain: str | None = Field(
|
|
201
|
+
description="Host of the result URL without a leading www., e.g. seriouseats.com."
|
|
202
|
+
)
|
|
203
|
+
position: int = Field(
|
|
204
|
+
description="1-based rank of the result on the page. Populated whenever the provider has data for the entity."
|
|
205
|
+
)
|
|
206
|
+
published_utc: int | None = Field(
|
|
207
|
+
alias="publishedUtc",
|
|
208
|
+
description="Page date Bing shows for the result. UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. null when Bing shows no date or the source that answered cannot report it.",
|
|
209
|
+
)
|
|
210
|
+
site_name: str | None = Field(
|
|
211
|
+
alias="siteName",
|
|
212
|
+
description="Site name Bing shows beside the result, e.g. Serious Eats. null means the source that answered cannot report it.",
|
|
213
|
+
)
|
|
214
|
+
snippet: str | None = Field(
|
|
215
|
+
default=None,
|
|
216
|
+
description="Text excerpt Bing shows under the result, often led by the page date. Populated whenever the provider has data for the entity. Present whenever the upstream returns this record.",
|
|
217
|
+
)
|
|
218
|
+
title: str = Field(
|
|
219
|
+
description="Result title as Bing shows it. Populated whenever the provider has data for the entity."
|
|
220
|
+
)
|
|
221
|
+
url: str = Field(
|
|
222
|
+
description="Destination URL of the result. Populated whenever the provider has data for the entity."
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
class BingSearchPeopleAlsoAsk(BaseModel):
|
|
227
|
+
model_config = ConfigDict(extra="allow")
|
|
228
|
+
|
|
229
|
+
answer: str | None = Field(
|
|
230
|
+
default=None,
|
|
231
|
+
description="The answer Bing shows under the question, null when it shows none.",
|
|
232
|
+
)
|
|
233
|
+
question: str = Field(description="The question.")
|
|
234
|
+
title: str | None = Field(
|
|
235
|
+
default=None,
|
|
236
|
+
description="Title of the page the answer is taken from, null when Bing names none.",
|
|
237
|
+
)
|
|
238
|
+
url: str | None = Field(
|
|
239
|
+
default=None,
|
|
240
|
+
description="URL of the page the answer is taken from, null when Bing links none.",
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
class BingNamespace:
|
|
245
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
246
|
+
|
|
247
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
248
|
+
self._client = client
|
|
249
|
+
|
|
250
|
+
def copilot(
|
|
251
|
+
self,
|
|
252
|
+
*,
|
|
253
|
+
options: RequestOptions | None = None,
|
|
254
|
+
**input: Unpack[BingCopilotInput],
|
|
255
|
+
) -> RunResult[BingCopilotData]:
|
|
256
|
+
"""Microsoft Copilot Search
|
|
257
|
+
|
|
258
|
+
Ask Microsoft Copilot (the AI answer in Bing) a question and get its
|
|
259
|
+
web-grounded answer with the sources it cites as clean JSON - for tracking
|
|
260
|
+
how Copilot answers and which sites it cites.
|
|
261
|
+
|
|
262
|
+
Price: $0.00085 per request.
|
|
263
|
+
|
|
264
|
+
Example:
|
|
265
|
+
res = client.bing.copilot(prompt="what is the capital of australia and why")
|
|
266
|
+
"""
|
|
267
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
268
|
+
"bing.copilot", dict(input), options
|
|
269
|
+
)
|
|
270
|
+
return RunResult[BingCopilotData].model_validate(raw)
|
|
271
|
+
|
|
272
|
+
def search(
|
|
273
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[BingSearchInput]
|
|
274
|
+
) -> RunResult[BingSearchData]:
|
|
275
|
+
"""Bing Search
|
|
276
|
+
|
|
277
|
+
Run a Bing web search and get the ranked organic results (title, URL,
|
|
278
|
+
snippet, position, display URL, domain) plus Bing's related searches as
|
|
279
|
+
clean JSON. Returns up to 10 results per call; pick the country Bing
|
|
280
|
+
searches from.
|
|
281
|
+
|
|
282
|
+
Price: $0.00085 per request.
|
|
283
|
+
|
|
284
|
+
Example:
|
|
285
|
+
res = client.bing.search(country="US", limit=10, query="best espresso machines")
|
|
286
|
+
"""
|
|
287
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
288
|
+
"bing.search", dict(input), options
|
|
289
|
+
)
|
|
290
|
+
return RunResult[BingSearchData].model_validate(raw)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
class AsyncBingNamespace:
|
|
294
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
295
|
+
|
|
296
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
297
|
+
self._client = client
|
|
298
|
+
|
|
299
|
+
async def copilot(
|
|
300
|
+
self,
|
|
301
|
+
*,
|
|
302
|
+
options: RequestOptions | None = None,
|
|
303
|
+
**input: Unpack[BingCopilotInput],
|
|
304
|
+
) -> RunResult[BingCopilotData]:
|
|
305
|
+
"""Microsoft Copilot Search
|
|
306
|
+
|
|
307
|
+
Ask Microsoft Copilot (the AI answer in Bing) a question and get its
|
|
308
|
+
web-grounded answer with the sources it cites as clean JSON - for tracking
|
|
309
|
+
how Copilot answers and which sites it cites.
|
|
310
|
+
|
|
311
|
+
Price: $0.00085 per request.
|
|
312
|
+
|
|
313
|
+
Example:
|
|
314
|
+
res = client.bing.copilot(prompt="what is the capital of australia and why")
|
|
315
|
+
"""
|
|
316
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
317
|
+
"bing.copilot", dict(input), options
|
|
318
|
+
)
|
|
319
|
+
return RunResult[BingCopilotData].model_validate(raw)
|
|
320
|
+
|
|
321
|
+
async def search(
|
|
322
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[BingSearchInput]
|
|
323
|
+
) -> RunResult[BingSearchData]:
|
|
324
|
+
"""Bing Search
|
|
325
|
+
|
|
326
|
+
Run a Bing web search and get the ranked organic results (title, URL,
|
|
327
|
+
snippet, position, display URL, domain) plus Bing's related searches as
|
|
328
|
+
clean JSON. Returns up to 10 results per call; pick the country Bing
|
|
329
|
+
searches from.
|
|
330
|
+
|
|
331
|
+
Price: $0.00085 per request.
|
|
332
|
+
|
|
333
|
+
Example:
|
|
334
|
+
res = client.bing.search(country="US", limit=10, query="best espresso machines")
|
|
335
|
+
"""
|
|
336
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
337
|
+
"bing.search", dict(input), options
|
|
338
|
+
)
|
|
339
|
+
return RunResult[BingSearchData].model_validate(raw)
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|