File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,26 @@ Here is a simple example using the SerpApiSearch tool to create an autonomous PH
6
6
You just need to describe the objective and add the tools you want to use.
7
7
We will add more tools in the future.
8
8
9
+ Here is the simplest example:
10
+
11
+ ``` php
12
+ <?php
13
+
14
+ use AutoPHP\AutoPHP;
15
+
16
+ require_once 'vendor/autoload.php';
17
+
18
+ // You describe the objective
19
+ $objective = 'what is 1+1 ?';
20
+
21
+ $autoPHP = new AutoPHP($objective, []);
22
+ $answer = $autoPHP->run();
23
+
24
+ echo $answer;
25
+ ```
26
+
27
+ Another one using serpapi to search for information:
28
+
9
29
``` php
10
30
use LLPhant\AutoPHP;
11
31
use LLPhant\Chat\FunctionInfo\FunctionBuilder;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use AutoPHP \AutoPHP ;
4
- use LLPhant \Chat \FunctionInfo \FunctionBuilder ;
5
- use LLPhant \Tool \SerpApiSearch ;
6
4
7
5
require_once 'vendor/autoload.php ' ;
8
6
9
7
// You describe the objective
10
8
$ objective = 'what is 1+1 ? ' ;
11
9
12
- // You can add tools to the agent, so it can use them. You need an API key to use SerpApiSearch
13
- // Have a look here: https://serpapi.com
14
- //$searchApi = new SerpApiSearch();
15
- //$function = FunctionBuilder::buildFunctionInfo($searchApi, 'search');
16
-
17
10
$ autoPHP = new AutoPHP ($ objective , []);
18
11
$ answer = $ autoPHP ->run ();
19
12
You can’t perform that action at this time.
0 commit comments