Skip to content

Commit 303ae1a

Browse files
update example
1 parent 9fa0c47 commit 303ae1a

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ Here is a simple example using the SerpApiSearch tool to create an autonomous PH
66
You just need to describe the objective and add the tools you want to use.
77
We will add more tools in the future.
88

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+
929
```php
1030
use LLPhant\AutoPHP;
1131
use LLPhant\Chat\FunctionInfo\FunctionBuilder;

simple-test.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
<?php
22

33
use AutoPHP\AutoPHP;
4-
use LLPhant\Chat\FunctionInfo\FunctionBuilder;
5-
use LLPhant\Tool\SerpApiSearch;
64

75
require_once 'vendor/autoload.php';
86

97
// You describe the objective
108
$objective = 'what is 1+1 ?';
119

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-
1710
$autoPHP = new AutoPHP($objective, []);
1811
$answer = $autoPHP->run();
1912

0 commit comments

Comments
 (0)