php-llm / llm-chain

PHP library for building LLM-based features and applications.
MIT License
12 stars 3 forks source link

Add ability to describe tool parameters via `#[ToolParameter]` attribute #75

Closed OskarStark closed 1 month ago

OskarStark commented 2 months ago

Todo

validate, that this is not allowed:

#[ToolParameter(const: 'my-string')]
int $number
chr-hertel commented 2 months ago

i guess i would prefer PhpLlm\LlmChain\Attribute\ToolParameter 🤔 but with explicit arguments like you did, e.g. pattern: ... or minItems: 5 etc

and i think it would be great to consider all the standardized cases: image see https://json-schema.org/draft/2019-09/json-schema-validation#rfc.section.6

OskarStark commented 2 months ago

and i think it would be great to consider all the standardized cases:

In this case it would be good to a) map the type, so that pattern can only be used if it is a string or define the type, but that would double the noise.

chr-hertel commented 1 month ago

Nice one :muscle:

OskarStark commented 1 month ago

Nice one 💪

Tough one