-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: tests for simple value classes #10
Conversation
Message::ofUser('Hello, world!'), | ||
); | ||
|
||
$systemMessage = $messageBag->getSystemMessage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this method name confusing. What if a bag contains many system messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it should. I'd rather say the MessageBag should make sure there is only one and that it's the first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When answering to a function call I create 2 messages:
- -> incoming function call
- <- system: please show only name, price and the product url from the following product data
- <- json encoded string of a product
-> call() the llm
so I decided in my world, I always return a MessageBag from my function responses and append them.
I also compose my initial chat with many SYSTEM messages:
- The time is now.....
- You are a helpful assistant
- etc.
#[Small] | ||
final class MessageTest extends TestCase | ||
{ | ||
public function testCreateSystemMessage(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use Test Attribute instead of the prefix in the method name. Interested? If yes I can provide a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, never ever used that. What's pro or con? Or rather style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather style, as I switched from @test
annotation to #[Test]
attribute
No description provided.