You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8cce45f
Browse filesBrowse the repository at this point in the historyBrowse files
stlc-bot
committed
feat(answers): limit research to listed sources with controls (#3252)
Copy file name to clipboardExpand all lines: src/ServiceContracts/WebContract.php
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
7
7
useContextDev\Core\Exceptions\APIException;
8
8
useContextDev\RequestOptions;
9
+
useContextDev\Web\WebAnswersParams\Controls;
9
10
useContextDev\Web\WebAnswersParams\Mode;
10
11
useContextDev\Web\WebAnswersParams\TimeoutOpts;
11
12
useContextDev\Web\WebAnswersParams\Zdr;
@@ -39,6 +40,7 @@
39
40
useContextDev\Web\WebWebCrawlMdResponse;
40
41
41
42
/**
43
+
* @phpstan-import-type ControlsShape from \ContextDev\Web\WebAnswersParams\Controls
42
44
* @phpstan-import-type TimeoutOptsShape from \ContextDev\Web\WebAnswersParams\TimeoutOpts
43
45
* @phpstan-import-type TimeoutOptsShape from \ContextDev\Web\WebExtractCompetitorsParams\TimeoutOpts as TimeoutOptsShape1
44
46
* @phpstan-import-type TimeoutOptsShape from \ContextDev\Web\WebExtractStyleguideParams\TimeoutOpts as TimeoutOptsShape2
@@ -69,6 +71,7 @@ interface WebContract
69
71
* @api
70
72
*
71
73
* @param string $task Research task, up to 2000 characters. The agent selects company/profile lookups, web searches, or page reads. Include domains or URLs to focus the research.
74
+
* @param Controls|ControlsShape $controls limits what the research may use
72
75
* @param array<string,mixed> $jsonFormat Example answer object, not JSON Schema. Up to 8 levels, 500 values, and 16000 characters; unknowns may be null.
73
76
* @param Mode|value-of<Mode> $mode `fast` prioritizes speed, with extra verification for people and companies; `ultra` supports deeper research (default)
74
77
* @param list<string> $policies Access policy IDs to apply. A URL must pass every policy. Leave it out unless access policies are enabled for your organization; otherwise the request fails with `ACCESS_POLICIES_NOT_ENABLED`.
Copy file name to clipboardExpand all lines: src/Services/WebService.php
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
useContextDev\Core\Util;
10
10
useContextDev\RequestOptions;
11
11
useContextDev\ServiceContracts\WebContract;
12
+
useContextDev\Web\WebAnswersParams\Controls;
12
13
useContextDev\Web\WebAnswersParams\Mode;
13
14
useContextDev\Web\WebAnswersParams\TimeoutOpts;
14
15
useContextDev\Web\WebAnswersParams\Zdr;
@@ -42,6 +43,7 @@
42
43
useContextDev\Web\WebWebCrawlMdResponse;
43
44
44
45
/**
46
+
* @phpstan-import-type ControlsShape from \ContextDev\Web\WebAnswersParams\Controls
45
47
* @phpstan-import-type TimeoutOptsShape from \ContextDev\Web\WebAnswersParams\TimeoutOpts
46
48
* @phpstan-import-type TimeoutOptsShape from \ContextDev\Web\WebExtractCompetitorsParams\TimeoutOpts as TimeoutOptsShape1
47
49
* @phpstan-import-type TimeoutOptsShape from \ContextDev\Web\WebExtractStyleguideParams\TimeoutOpts as TimeoutOptsShape2
@@ -87,6 +89,7 @@ public function __construct(private Client $client)
87
89
* Research the web and return a sourced answer in your JSON shape. Choose `fast` for a short task or `ultra` for deeper research.
88
90
*
89
91
* @param string $task Research task, up to 2000 characters. The agent selects company/profile lookups, web searches, or page reads. Include domains or URLs to focus the research.
92
+
* @param Controls|ControlsShape $controls limits what the research may use
90
93
* @param array<string,mixed> $jsonFormat Example answer object, not JSON Schema. Up to 8 levels, 500 values, and 16000 characters; unknowns may be null.
91
94
* @param Mode|value-of<Mode> $mode `fast` prioritizes speed, with extra verification for people and companies; `ultra` supports deeper research (default)
92
95
* @param list<string> $policies Access policy IDs to apply. A URL must pass every policy. Leave it out unless access policies are enabled for your organization; otherwise the request fails with `ACCESS_POLICIES_NOT_ENABLED`.
@@ -99,6 +102,7 @@ public function __construct(private Client $client)
* Never search, read or cite these sites, sections or pages. Same format as `sources`. Up to 100 entries.
25
+
*
26
+
* @var list<string>|null $excludeSources
27
+
*/
28
+
#[Optional(list: 'string')]
29
+
public ?array$excludeSources;
30
+
31
+
/**
32
+
* Only search, read and cite these sites, sections or pages. Each entry is a URL prefix: "example.com" covers the site and its subdomains, "example.com/docs" covers that section, and "example.com/docs/setup.html" is one page. Up to 20 entries.
33
+
*
34
+
* @var list<string>|null $sources
35
+
*/
36
+
#[Optional(list: 'string')]
37
+
public ?array$sources;
38
+
39
+
publicfunction__construct()
40
+
{
41
+
$this->initialize();
42
+
}
43
+
44
+
/**
45
+
* Construct an instance from the required parameters.
46
+
*
47
+
* You must use named parameters to construct any parameters with a default value.
* Only search, read and cite these sites, sections or pages. Each entry is a URL prefix: "example.com" covers the site and its subdomains, "example.com/docs" covers that section, and "example.com/docs/setup.html" is one page. Up to 20 entries.
0 commit comments