This repository was archived by the owner on Jul 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 19 files changed +60
-60
lines changed Expand file tree Collapse file tree 19 files changed +60
-60
lines changed Original file line number Diff line number Diff line change @@ -21,19 +21,19 @@ composer require php-llm/llm-chain
2121
2222When using Symfony Framework, check out the integration bundle [ php-llm/llm-chain-bundle] ( https://github.com/php-llm/llm-chain-bundle ) .
2323
24- Supported Models & Runtimes
25- ---------------------------
24+ Supported Models & Platforms
25+ ----------------------------
2626
27- Currently supported models and runtimes :
27+ Currently supported models and platforms :
2828
29- | Vendor | Model | Runtime |
30- | ----------------| ------------------------| ---------------------------------- |
31- | ** OpenAI** | - GPT<br />- Embeddings | - OpenAI<br />- Azure |
32- | ** Anthropic** | - Claude | - Anthropic |
29+ | Vendor | Model | Platform |
30+ | ----------------| ------------------------| ----------------------|
31+ | ** OpenAI** | - GPT<br />- Embeddings | - OpenAI<br />- Azure |
32+ | ** Anthropic** | - Claude | - Anthropic |
3333
34- Planned Models & Runtimes (not implemented yet):
34+ Planned Models & Platforms (not implemented yet):
3535
36- | Vendor | Model | Runtime |
36+ | Vendor | Model | Platform |
3737| ----------------| ------------------------| ----------------------------------|
3838| ** Anthropic** | - Voyage | - GPC<br />- AWS |
3939| ** Google** | - Gemini<br />- Gemma | - GPC |
Original file line number Diff line number Diff line change 11<?php
22
33use PhpLlm \LlmChain \Anthropic \Model \Claude ;
4- use PhpLlm \LlmChain \Anthropic \Runtime \Anthropic ;
4+ use PhpLlm \LlmChain \Anthropic \Platform \Anthropic ;
55use PhpLlm \LlmChain \Chain ;
66use PhpLlm \LlmChain \Message \Message ;
77use PhpLlm \LlmChain \Message \MessageBag ;
88use Symfony \Component \HttpClient \HttpClient ;
99
1010require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1111
12- $ runtime = new Anthropic (HttpClient::create (), getenv ('ANTHROPIC_API_KEY ' ));
13- $ llm = new Claude ($ runtime );
12+ $ platform = new Anthropic (HttpClient::create (), getenv ('ANTHROPIC_API_KEY ' ));
13+ $ llm = new Claude ($ platform );
1414
1515$ chain = new Chain ($ llm );
1616$ messages = new MessageBag (
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \Azure ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \Azure ;
99use Symfony \Component \HttpClient \HttpClient ;
1010
1111require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1212
13- $ runtime = new Azure (HttpClient::create (),
13+ $ platform = new Azure (HttpClient::create (),
1414 getenv ('AZURE_OPENAI_BASEURL ' ),
1515 getenv ('AZURE_OPENAI_DEPLOYMENT ' ),
1616 getenv ('AZURE_OPENAI_VERSION ' ),
1717 getenv ('AZURE_OPENAI_KEY ' )
1818);
19- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
19+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
2020
2121$ chain = new Chain ($ llm );
2222$ messages = new MessageBag (
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \OpenAI ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \OpenAI ;
99use Symfony \Component \HttpClient \HttpClient ;
1010
1111require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1212
13- $ runtime = new OpenAI (HttpClient::create (), getenv ('OPENAI_API_KEY ' ));
14- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
13+ $ platform = new OpenAI (HttpClient::create (), getenv ('OPENAI_API_KEY ' ));
14+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
1515
1616$ chain = new Chain ($ llm );
1717$ messages = new MessageBag (
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \OpenAI ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \OpenAI ;
99use PhpLlm \LlmChain \StructuredOutput \ResponseFormatFactory ;
1010use PhpLlm \LlmChain \StructuredOutput \SchemaFactory ;
1111use PhpLlm \LlmChain \Tests \StructuredOutput \Data \MathReasoning ;
1616
1717require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1818
19- $ runtime = new OpenAI (HttpClient::create (), getenv ('OPENAI_API_KEY ' ));
20- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
19+ $ platform = new OpenAI (HttpClient::create (), getenv ('OPENAI_API_KEY ' ));
20+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
2121$ responseFormatFactory = new ResponseFormatFactory (SchemaFactory::create ());
2222$ serializer = new Serializer ([new ObjectNormalizer ()], [new JsonEncoder ()]);
2323
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \OpenAI ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \OpenAI ;
99use PhpLlm \LlmChain \ToolBox \Tool \Clock ;
1010use PhpLlm \LlmChain \ToolBox \ToolAnalyzer ;
1111use PhpLlm \LlmChain \ToolBox \ToolBox ;
1414
1515require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1616
17- $ runtime = new OpenAI (HttpClient::create (), getenv ('OPENAI_API_KEY ' ));
18- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
17+ $ platform = new OpenAI (HttpClient::create (), getenv ('OPENAI_API_KEY ' ));
18+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
1919
2020$ clock = new Clock (new SymfonyClock ());
2121$ toolBox = new ToolBox (new ToolAnalyzer (), [$ clock ]);
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \OpenAI ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \OpenAI ;
99use PhpLlm \LlmChain \ToolBox \Tool \SerpApi ;
1010use PhpLlm \LlmChain \ToolBox \ToolAnalyzer ;
1111use PhpLlm \LlmChain \ToolBox \ToolBox ;
1414require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1515
1616$ httpClient = HttpClient::create ();
17- $ runtime = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
17+ $ platform = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
1919
2020$ serpApi = new SerpApi ($ httpClient , getenv ('SERP_API_KEY ' ));
2121$ toolBox = new ToolBox (new ToolAnalyzer (), [$ serpApi ]);
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \OpenAI ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \OpenAI ;
99use PhpLlm \LlmChain \ToolBox \Tool \OpenMeteo ;
1010use PhpLlm \LlmChain \ToolBox \ToolAnalyzer ;
1111use PhpLlm \LlmChain \ToolBox \ToolBox ;
1414require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1515
1616$ httpClient = HttpClient::create ();
17- $ runtime = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
17+ $ platform = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
1919
2020$ wikipedia = new OpenMeteo ($ httpClient );
2121$ toolBox = new ToolBox (new ToolAnalyzer (), [$ wikipedia ]);
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \OpenAI ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \OpenAI ;
99use PhpLlm \LlmChain \ToolBox \Tool \Wikipedia ;
1010use PhpLlm \LlmChain \ToolBox \ToolAnalyzer ;
1111use PhpLlm \LlmChain \ToolBox \ToolBox ;
1414require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1515
1616$ httpClient = HttpClient::create ();
17- $ runtime = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
17+ $ platform = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
1919
2020$ wikipedia = new Wikipedia ($ httpClient );
2121$ toolBox = new ToolBox (new ToolAnalyzer (), [$ wikipedia ]);
Original file line number Diff line number Diff line change 55use PhpLlm \LlmChain \Message \MessageBag ;
66use PhpLlm \LlmChain \OpenAI \Model \Gpt ;
77use PhpLlm \LlmChain \OpenAI \Model \Gpt \Version ;
8- use PhpLlm \LlmChain \OpenAI \Runtime \OpenAI ;
8+ use PhpLlm \LlmChain \OpenAI \Platform \OpenAI ;
99use PhpLlm \LlmChain \ToolBox \Tool \YouTubeTranscriber ;
1010use PhpLlm \LlmChain \ToolBox \ToolAnalyzer ;
1111use PhpLlm \LlmChain \ToolBox \ToolBox ;
1414require_once dirname (__DIR__ ).'/vendor/autoload.php ' ;
1515
1616$ httpClient = HttpClient::create ();
17- $ runtime = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18- $ llm = new Gpt ($ runtime , Version::gpt4oMini ());
17+ $ platform = new OpenAI ($ httpClient , getenv ('OPENAI_API_KEY ' ));
18+ $ llm = new Gpt ($ platform , Version::gpt4oMini ());
1919
2020$ transcriber = new YouTubeTranscriber ($ httpClient );
2121$ toolBox = new ToolBox (new ToolAnalyzer (), [$ transcriber ]);
You can’t perform that action at this time.
0 commit comments