-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored existing class. Added an example.
- Loading branch information
1 parent
65850a9
commit 5a97512
Showing
4 changed files
with
186 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /usr/bin/php env | ||
<?php | ||
|
||
/** | ||
* Run this file in CLI and see the response. | ||
* | ||
* `php hello.php` | ||
* | ||
* Ensure that you create a .env file in root and add your CLAUDE_API. | ||
*/ | ||
|
||
use Dikki\Claude\Claude; | ||
|
||
require_once dirname(__DIR__) . '/vendor/autoload.php'; | ||
|
||
$claude = new Claude(parse_ini_file(dirname(__DIR__) . '/.env')['CLAUDE_API']); | ||
|
||
var_dump($claude->getResponse("Define AI in one sentence.")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="ClaudeSDK"> | ||
<description>PHP CodeSniffer rules for ClaudeSDK</description> | ||
|
||
<rule ref="PSR12"/> | ||
|
||
<rule ref="Generic.WhiteSpace.DisallowTabIndent" severity="error"/> | ||
<rule ref="Squiz.WhiteSpace.FunctionSpacing" severity="warning"/> | ||
|
||
<file>src/</file> | ||
|
||
<exclude-pattern>vendor/*</exclude-pattern> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters