Skip to content
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

Merged
merged 1 commit into from
Sep 21, 2024
Merged

chore: tests for simple value classes #10

merged 1 commit into from
Sep 21, 2024

Conversation

chr-hertel
Copy link
Member

No description provided.

@chr-hertel chr-hertel merged commit d67c5e7 into main Sep 21, 2024
4 checks passed
@chr-hertel chr-hertel deleted the tests branch September 21, 2024 23:45
Message::ofUser('Hello, world!'),
);

$systemMessage = $messageBag->getSystemMessage();
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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:

  1. -> incoming function call
  2. <- system: please show only name, price and the product url from the following product data
  3. <- 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:

  1. The time is now.....
  2. You are a helpful assistant
  3. etc.

#[Small]
final class MessageTest extends TestCase
{
public function testCreateSystemMessage(): void
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants