develop-tests changedtest-and-evaluate/develop-tests
Nearest release: v2.1.301, published 5 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+433added
Lines−40removed
From line
152
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits11to this page, all time
The whole hunk
from line 152, old and new numbered
/
The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
from line 152
152152 def get_completion(prompt: str):
153153 message = client.messages.create(
154154 model="claude-opus-5-5",
155 max_tokens=50,
155 max_tokens=1024,
156156 messages=[{"role": "user", "content": prompt}],
157157 )
158158 return next(block.text for block in message.content if block.type == "text")
from line 164
164164
165165 outputs = [
166166 get_completion(
167 f"Classify this as 'positive', 'negative', 'neutral', or 'mixed': {tweet['text']}"
167 f"Classify this as 'positive', 'negative', 'neutral', or 'mixed'. Output only the label: {tweet['text']}"
168168 )
169169 for tweet in tweets
170170 ]
from line 195
195195 async function getCompletion(prompt: string): Promise<string> {
196196 const message = await client.messages.create({
197197 model: "claude-opus-5-5",
198 max_tokens: 50,
198 max_tokens: 1024,
199199 messages: [{ role: "user", content: prompt }]
200200 });
201201 const textBlock = message.content.find((block) => block.type === "text");
from line 209
209209 let correctCount = 0;
210210 for (const tweet of tweets) {
211211 const output = await getCompletion(
212 `Classify this as 'positive', 'negative', 'neutral', or 'mixed': ${tweet.text}`
212 `Classify this as 'positive', 'negative', 'neutral', or 'mixed'. Output only the label: ${tweet.text}`
213213 );
214214 if (evaluateExactMatch(output, tweet.sentiment)) {
215215 correctCount++;
from line 237
237237 var message = await client.Messages.Create(new MessageCreateParams
238238 {
239239 Model = Model.ClaudeOpus5_5,
240 MaxTokens = 50,
240 MaxTokens = 1024,
241241 Messages = [new() { Role = Role.User, Content = prompt }],
242242 });
243243 return ContentText(message);
from line 265
265265 foreach (var tweet in tweets)
266266 {
267267 var output = await GetCompletion(
268 $"Classify this as 'positive', 'negative', 'neutral', or 'mixed': {tweet.Text}");
268 $"Classify this as 'positive', 'negative', 'neutral', or 'mixed'. Output only the label: {tweet.Text}");
269269 if (EvaluateExactMatch(output, tweet.Sentiment))
270270 {
271271 correct++;
from line 307
307307 func getCompletion(prompt string) string {
308308 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
309309 Model: anthropic.ModelClaudeOpus5_5,
310 MaxTokens: 50,
310 MaxTokens: 1024,
311311 Messages: []anthropic.MessageParam{
312312 anthropic.NewUserMessage(anthropic.NewTextBlock(prompt)),
313313 },
from line 325
325325 func main() {
326326 correct := 0
327327 for _, item := range tweets {
328 output := getCompletion("Classify this as 'positive', 'negative', 'neutral', or 'mixed': " + item.Text)
328 output := getCompletion("Classify this as 'positive', 'negative', 'neutral', or 'mixed'. Output only the label: " + item.Text)
329329 if evaluateExactMatch(output, item.Sentiment) {
330330 correct++
331331 }
from line 360
360360 String getCompletion(String prompt) {
361361 var params = MessageCreateParams.builder()
362362 .model(Model.CLAUDE_OPUS_5_5)
363 .maxTokens(50L)
363 .maxTokens(1024L)
364364 .addUserMessage(prompt)
365365 .build();
366366 return contentText(client.messages().create(params));
from line 374
374374 int correct = 0;
375375 for (var tweet : tweets) {
376376 var output = getCompletion(
377 "Classify this as 'positive', 'negative', 'neutral', or 'mixed': " + tweet.text());
377 "Classify this as 'positive', 'negative', 'neutral', or 'mixed'. Output only the label: " + tweet.text());
378378 if (evaluateExactMatch(output, tweet.sentiment())) {
379379 correct++;
380380 }
from line 400
400400 {
401401 $message = $client->messages->create(
402402 model: Model::CLAUDE_OPUS_5_5,
403 maxTokens: 50,
403 maxTokens: 1024,
404404 messages: [
405405 [
406406 'role' => 'user',
from line 431
431431 foreach ($tweets as $tweet) {
432432 $output = getCompletion(
433433 $client,
434 "Classify this as 'positive', 'negative', 'neutral', or 'mixed': {$tweet['text']}",
434 "Classify this as 'positive', 'negative', 'neutral', or 'mixed'. Output only the label: {$tweet['text']}",
435435 );
436436 if (evaluateExactMatch($output, $tweet['sentiment'])) {
437437 $correct++;
from line 460
460460 def get_completion(client, prompt)
461461 message = client.messages.create(
462462 model: Anthropic::Model::CLAUDE_OPUS_5_5,
463 max_tokens: 50,
463 max_tokens: 1024,
464464 messages: [
465465 {
466466 role: "user",
from line 478
478478 correct = tweets.count do |tweet|
479479 output = get_completion(
480480 client,
481 "Classify this as 'positive', 'negative', 'neutral', or 'mixed': #{tweet[:text]}"
481 "Classify this as 'positive', 'negative', 'neutral', or 'mixed'. Output only the label: #{tweet[:text]}"
482482 )
483483 evaluate_exact_match(output, tweet[:sentiment])
484484 end
from line 619
619619 ```
620620
621621 ```csharp C#
622 // Sentence-embedding models are not available as a native C# library. See the Python or TypeScript tab for this eval recipe.
622 using System.Numerics.Tensors;
623 // ...
624 using Microsoft.Extensions.AI;
625 using Microsoft.SemanticKernel;
626
627 Faq[] faqVariations =
628 [
629 new(
630 [
631 "What's your return policy?",
632 "How can I return an item?",
633 "Wut's yur retrn polcy?",
634 ],
635 "Our return policy allows..."), // Edge case: Typos
636 new(
637 [
638 "I bought something last week, and it's not really what I expected, so I was wondering if maybe I could possibly return it?",
639 "I read online that your policy is 30 days but that seems like it might be out of date because the website was updated six months ago, so I'm wondering what exactly is your current policy?",
640 ],
641 "Our return policy allows..."), // Edge case: Long, rambling question
642 new(
643 [
644 "I'm Jane's cousin, and she said you guys have great customer service. Can I return this?",
645 "Reddit told me that contacting customer service this way was the fastest way to get an answer. I hope they're right! What is the return window for a jacket?",
646 ],
647 "Our return policy allows..."), // Edge case: Irrelevant info
648 // ... 47 more FAQs
649 ];
650
651 var client = new AnthropicClient();
652
653 // Download onnx/model.onnx and vocab.txt from https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2
654 #pragma warning disable SKEXP0070
655 var kernel = Kernel.CreateBuilder()
656 .AddBertOnnxEmbeddingGenerator("model.onnx", "vocab.txt")
657 .Build();
658 #pragma warning restore SKEXP0070
659 var embeddingGenerator = kernel.GetRequiredService<IEmbeddingGenerator<string, Embedding<float>>>();
660
661 async Task<string> GetCompletion(string prompt)
662 {
663 var message = await client.Messages.Create(new MessageCreateParams
664 {
665 Model = Model.ClaudeOpus5_5,
666 MaxTokens = 2048,
667 Messages = [new() { Role = Role.User, Content = prompt }],
668 });
669 foreach (var block in message.Content)
670 {
671 if (block.TryPickText(out var textBlock))
672 {
673 return textBlock.Text;
674 }
675 }
676 return "";
677 }
678
679 async Task<double> EvaluateCosineSimilarity(List<string> outputs)
680 {
681 var embeddings = await embeddingGenerator.GenerateAsync(outputs);
682
683 double total = 0;
684 foreach (var embeddingA in embeddings)
685 {
686 foreach (var embeddingB in embeddings)
687 {
688 total += TensorPrimitives.CosineSimilarity(embeddingA.Vector.Span, embeddingB.Vector.Span);
689 }
690 }
691 return total / (embeddings.Count * embeddings.Count);
692 }
693
694 foreach (var faq in faqVariations)
695 {
696 var outputs = new List<string>();
697 foreach (var question in faq.Questions)
698 {
699 outputs.Add(await GetCompletion(question));
700 }
701 var similarityScore = await EvaluateCosineSimilarity(outputs);
702 Console.WriteLine($"FAQ Consistency Score: {similarityScore * 100}%");
703 }
704
705 record Faq(string[] Questions, string Answer);
623706 ```
624707
625708 ```go Go
626 // Sentence-embedding models are not available as a native Go library. See the Python or TypeScript tab for this eval recipe.
709 import (
710 "context"
711 "fmt"
712 "log"
713 "math"
714
715 // ...
716 "github.com/knights-analytics/hugot"
717 "github.com/knights-analytics/hugot/pipelines"
718 )
719
720 var client = anthropic.NewClient()
721
722 type faq struct {
723 Questions []string
724 Answer string
725 }
726
727 var faqVariations = []faq{
728 {
729 []string{
730 "What's your return policy?",
731 "How can I return an item?",
732 "Wut's yur retrn polcy?",
733 },
734 "Our return policy allows...",
735 }, // Edge case: Typos
736 {
737 []string{
738 "I bought something last week, and it's not really what I expected, so I was wondering if maybe I could possibly return it?",
739 "I read online that your policy is 30 days but that seems like it might be out of date because the website was updated six months ago, so I'm wondering what exactly is your current policy?",
740 },
741 "Our return policy allows...",
742 }, // Edge case: Long, rambling question
743 {
744 []string{
745 "I'm Jane's cousin, and she said you guys have great customer service. Can I return this?",
746 "Reddit told me that contacting customer service this way was the fastest way to get an answer. I hope they're right! What is the return window for a jacket?",
747 },
748 "Our return policy allows...",
749 }, // Edge case: Irrelevant info
750 // ... 47 more FAQs
751 }
752
753 func getCompletion(prompt string) string {
754 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
755 Model: anthropic.ModelClaudeOpus5_5,
756 MaxTokens: 2048,
757 Messages: []anthropic.MessageParam{
758 anthropic.NewUserMessage(anthropic.NewTextBlock(prompt)),
759 },
760 })
761 if err != nil {
762 log.Fatal(err)
763 }
764 for _, block := range message.Content {
765 if textBlock, ok := block.AsAny().(anthropic.TextBlock); ok {
766 return textBlock.Text
767 }
768 }
769 return ""
770 }
771
772 func cosineSimilarity(embeddingA, embeddingB []float32) float64 {
773 var dot, normA, normB float64
774 for i := range embeddingA {
775 dot += float64(embeddingA[i] * embeddingB[i])
776 normA += float64(embeddingA[i] * embeddingA[i])
777 normB += float64(embeddingB[i] * embeddingB[i])
778 }
779 return dot / (math.Sqrt(normA) * math.Sqrt(normB))
780 }
781
782 func evaluateCosineSimilarity(embeddingPipeline *pipelines.FeatureExtractionPipeline, outputs []string) float64 {
783 result, err := embeddingPipeline.RunPipeline(context.Background(), outputs)
784 if err != nil {
785 log.Fatal(err)
786 }
787
788 total := 0.0
789 for _, embeddingA := range result.Embeddings {
790 for _, embeddingB := range result.Embeddings {
791 total += cosineSimilarity(embeddingA, embeddingB)
792 }
793 }
794 return total / float64(len(result.Embeddings)*len(result.Embeddings))
795 }
796
797 func main() {
798 ctx := context.Background()
799 session, err := hugot.NewGoSession(ctx)
800 if err != nil {
801 log.Fatal(err)
802 }
803 defer session.Destroy()
804
805 downloadOptions := hugot.NewDownloadOptions()
806 downloadOptions.OnnxFilePath = "onnx/model.onnx"
807 modelPath, err := hugot.DownloadModel(ctx, "sentence-transformers/all-MiniLM-L6-v2", "./models/", downloadOptions)
808 if err != nil {
809 log.Fatal(err)
810 }
811 embeddingPipeline, err := hugot.NewPipeline(session, hugot.FeatureExtractionConfig{
812 ModelPath: modelPath,
813 Name: "embeddingPipeline",
814 })
815 if err != nil {
816 log.Fatal(err)
817 }
818
819 for _, item := range faqVariations {
820 var outputs []string
821 for _, question := range item.Questions {
822 outputs = append(outputs, getCompletion(question))
823 }
824 similarityScore := evaluateCosineSimilarity(embeddingPipeline, outputs)
825 fmt.Printf("FAQ Consistency Score: %v%%\n", similarityScore*100)
826 }
827 }
627828 ```
628829
629830 ```java Java
630 // Sentence-embedding models are not available as a native Java library. See the Python or TypeScript tab for this eval recipe.
831 import dev.langchain4j.data.segment.TextSegment;
832 import dev.langchain4j.model.embedding.onnx.allminilml6v2.AllMiniLmL6V2EmbeddingModel;
833 import dev.langchain4j.store.embedding.CosineSimilarity;
834 // ...
835
836 record Faq(List<String> questions, String answer) {}
837
838 List<Faq> faqVariations = List.of(
839 new Faq(
840 List.of(
841 "What's your return policy?",
842 "How can I return an item?",
843 "Wut's yur retrn polcy?"),
844 "Our return policy allows..."), // Edge case: Typos
845 new Faq(
846 List.of(
847 "I bought something last week, and it's not really what I expected, so I was wondering if maybe I could possibly return it?",
848 "I read online that your policy is 30 days but that seems like it might be out of date because the website was updated six months ago, so I'm wondering what exactly is your current policy?"),
849 "Our return policy allows..."), // Edge case: Long, rambling question
850 new Faq(
851 List.of(
852 "I'm Jane's cousin, and she said you guys have great customer service. Can I return this?",
853 "Reddit told me that contacting customer service this way was the fastest way to get an answer. I hope they're right! What is the return window for a jacket?"),
854 "Our return policy allows...") // Edge case: Irrelevant info
855 // ... 47 more FAQs
856 );
857
858 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
859
860 String getCompletion(String prompt) {
861 var params = MessageCreateParams.builder()
862 .model(Model.CLAUDE_OPUS_5_5)
863 .maxTokens(2048L)
864 .addUserMessage(prompt)
865 .build();
866 Message message = client.messages().create(params);
867 return message.content().stream()
868 .flatMap(block -> block.text().stream())
869 .map(textBlock -> textBlock.text())
870 .findFirst()
871 .orElse("");
872 }
873
874 double evaluateCosineSimilarity(List<String> outputs) {
875 var embeddingModel = new AllMiniLmL6V2EmbeddingModel();
876 var segments = outputs.stream().map(TextSegment::from).toList();
877 var embeddings = embeddingModel.embedAll(segments).content();
878
879 double total = 0;
880 for (var embeddingA : embeddings) {
881 for (var embeddingB : embeddings) {
882 total += CosineSimilarity.between(embeddingA, embeddingB);
883 }
884 }
885 return total / (embeddings.size() * embeddings.size());
886 }
887
888 void main() {
889 for (var faq : faqVariations) {
890 var outputs = faq.questions().stream().map(this::getCompletion).toList();
891 double similarityScore = evaluateCosineSimilarity(outputs);
892 IO.println("FAQ Consistency Score: " + similarityScore * 100 + "%");
893 }
894 }
631895 ```
632896
633897 ```php PHP
634 // Sentence-embedding models are not available as a native PHP library. See the Python or TypeScript tab for this eval recipe.
898 use function Codewithkyrian\Transformers\Pipelines\pipeline;
899
900 $client = new Client();
901
902 $faqVariations = [
903 [
904 'questions' => [
905 "What's your return policy?",
906 'How can I return an item?',
907 "Wut's yur retrn polcy?",
908 ],
909 'answer' => 'Our return policy allows...',
910 ], // Edge case: Typos
911 [
912 'questions' => [
913 "I bought something last week, and it's not really what I expected, so I was wondering if maybe I could possibly return it?",
914 "I read online that your policy is 30 days but that seems like it might be out of date because the website was updated six months ago, so I'm wondering what exactly is your current policy?",
915 ],
916 'answer' => 'Our return policy allows...',
917 ], // Edge case: Long, rambling question
918 [
919 'questions' => [
920 "I'm Jane's cousin, and she said you guys have great customer service. Can I return this?",
921 "Reddit told me that contacting customer service this way was the fastest way to get an answer. I hope they're right! What is the return window for a jacket?",
922 ],
923 'answer' => 'Our return policy allows...',
924 ], // Edge case: Irrelevant info
925 // ... 47 more FAQs
926 ];
927
928 function getCompletion(Client $client, string $prompt): string
929 {
930 $message = $client->messages->create(
931 model: Model::CLAUDE_OPUS_5_5,
932 maxTokens: 2048,
933 messages: [
934 [
935 'role' => 'user',
936 'content' => $prompt,
937 ],
938 ],
939 );
940 foreach ($message->content as $block) {
941 if ($block instanceof \Anthropic\Messages\TextBlock) {
942 return $block->text;
943 }
944 }
945 return '';
946 }
947
948 function evaluateCosineSimilarity(array $outputs): float
949 {
950 $extractor = pipeline('embeddings', 'Xenova/all-MiniLM-L6-v2');
951 $embeddings = $extractor($outputs, normalize: true, pooling: 'mean');
952
953 $total = 0.0;
954 foreach ($embeddings as $embeddingA) {
955 foreach ($embeddings as $embeddingB) {
956 // Vectors are normalized, so cosine similarity is the dot product
957 $total += array_sum(array_map(fn ($valueA, $valueB) => $valueA * $valueB, $embeddingA, $embeddingB));
958 }
959 }
960 return $total / count($embeddings) ** 2;
961 }
962
963 foreach ($faqVariations as $faq) {
964 $outputs = array_map(fn ($question) => getCompletion($client, $question), $faq['questions']);
965 $similarityScore = evaluateCosineSimilarity($outputs);
966 echo 'FAQ Consistency Score: ' . ($similarityScore * 100) . '%' . PHP_EOL;
967 }
635968 ```
636969
637970 ```ruby Ruby
638 # Sentence-embedding models are not available as a native Ruby library. See the Python or TypeScript tab for this eval recipe.
971 require "informers"
972
973 client = Anthropic::Client.new
974
975 faq_variations = [
976 {
977 questions: [
978 "What's your return policy?",
979 "How can I return an item?",
980 "Wut's yur retrn polcy?"
981 ],
982 answer: "Our return policy allows..."
983 }, # Edge case: Typos
984 {
985 questions: [
986 "I bought something last week, and it's not really what I expected, so I was wondering if maybe I could possibly return it?",
987 "I read online that your policy is 30 days but that seems like it might be out of date because the website was updated six months ago, so I'm wondering what exactly is your current policy?"
988 ],
989 answer: "Our return policy allows..."
990 }, # Edge case: Long, rambling question
991 {
992 questions: [
993 "I'm Jane's cousin, and she said you guys have great customer service. Can I return this?",
994 "Reddit told me that contacting customer service this way was the fastest way to get an answer. I hope they're right! What is the return window for a jacket?"
995 ],
996 answer: "Our return policy allows..."
997 } # Edge case: Irrelevant info
998 # ... 47 more FAQs
999 ]
1000
1001 def get_completion(client, prompt)
1002 message = client.messages.create(
1003 model: Anthropic::Model::CLAUDE_OPUS_5_5,
1004 max_tokens: 2048,
1005 messages: [
1006 {
1007 role: "user",
1008 content: prompt
1009 }
1010 ]
1011 )
1012 text_block = message.content.find { |block| block.is_a?(Anthropic::Models::TextBlock) }
1013 text_block ? text_block.text : ""
1014 end
1015
1016 def evaluate_cosine_similarity(outputs)
1017 model = Informers.pipeline("embedding", "sentence-transformers/all-MiniLM-L6-v2")
1018 embeddings = model.(outputs)
1019
1020 # Vectors are normalized, so cosine similarity is the dot product
1021 total = embeddings.sum do |embedding_a|
1022 embeddings.sum { |embedding_b| embedding_a.zip(embedding_b).sum { |value_a, value_b| value_a * value_b } }
1023 end
1024 total / embeddings.length**2
1025 end
1026
1027 faq_variations.each do |faq|
1028 outputs = faq[:questions].map { |question| get_completion(client, question) }
1029 similarity_score = evaluate_cosine_similarity(outputs)
1030 puts "FAQ Consistency Score: #{similarity_score * 100}%"
1031 end
6391032 ```
6401033 </CodeGroup>
6411034 </Accordion>
from line 1605
12121605 # Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
12131606 response = client.messages.create(
12141607 model="claude-opus-5-5",
1215 max_tokens=50,
1608 max_tokens=1024,
12161609 messages=[{"role": "user", "content": tone_prompt}],
12171610 )
12181611 return int(
from line 1663
12701663 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
12711664 const response = await client.messages.create({
12721665 model: "claude-opus-5-5",
1273 max_tokens: 50,
1666 max_tokens: 1024,
12741667 messages: [{ role: "user", content: tonePrompt }]
12751668 });
12761669 const textBlock = response.content.find((block) => block.type === "text");
from line 1725
13321725 var response = await client.Messages.Create(new MessageCreateParams
13331726 {
13341727 Model = Model.ClaudeOpus5_5,
1335 MaxTokens = 50,
1728 MaxTokens = 1024,
13361729 Messages = [new() { Role = Role.User, Content = tonePrompt }],
13371730 });
13381731 return int.Parse(ContentText(response).Trim());
from line 1807
14141807 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
14151808 response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
14161809 Model: anthropic.ModelClaudeOpus5_5,
1417 MaxTokens: 50,
1810 MaxTokens: 1024,
14181811 Messages: []anthropic.MessageParam{
14191812 anthropic.NewUserMessage(anthropic.NewTextBlock(tonePrompt)),
14201813 },
from line 1876
14831876 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
14841877 var params = MessageCreateParams.builder()
14851878 .model(Model.CLAUDE_OPUS_5_5)
1486 .maxTokens(50L)
1879 .maxTokens(1024L)
14871880 .addUserMessage(tonePrompt)
14881881 .build();
14891882 var judgment = contentText(client.messages().create(params));
from line 1934
15411934 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
15421935 $response = $client->messages->create(
15431936 model: Model::CLAUDE_OPUS_5_5,
1544 maxTokens: 50,
1937 maxTokens: 1024,
15451938 messages: [
15461939 [
15471940 'role' => 'user',
from line 2011
16182011 # Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
16192012 response = client.messages.create(
16202013 model: Anthropic::Model::CLAUDE_OPUS_5_5,
1621 max_tokens: 50,
2014 max_tokens: 1024,
16222015 messages: [
16232016 {
16242017 role: "user",
from line 2085
16922085 # Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
16932086 response = client.messages.create(
16942087 model="claude-opus-5-5",
1695 max_tokens=50,
2088 max_tokens=1024,
16962089 messages=[{"role": "user", "content": binary_prompt}],
16972090 )
16982091 return (
from line 2162
17692162 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
17702163 const response = await client.messages.create({
17712164 model: "claude-opus-5-5",
1772 max_tokens: 50,
2165 max_tokens: 1024,
17732166 messages: [{ role: "user", content: binaryPrompt }]
17742167 });
17752168 const textBlock = response.content.find((block) => block.type === "text");
from line 2231
18382231 var response = await client.Messages.Create(new MessageCreateParams
18392232 {
18402233 Model = Model.ClaudeOpus5_5,
1841 MaxTokens = 50,
2234 MaxTokens = 1024,
18422235 Messages = [new() { Role = Role.User, Content = binaryPrompt }],
18432236 });
18442237 return ContentText(response).Trim().ToLowerInvariant() == "no";
from line 2327
19342327 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
19352328 response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
19362329 Model: anthropic.ModelClaudeOpus5_5,
1937 MaxTokens: 50,
2330 MaxTokens: 1024,
19382331 Messages: []anthropic.MessageParam{
19392332 anthropic.NewUserMessage(anthropic.NewTextBlock(binaryPrompt)),
19402333 },
from line 2404
20112404 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
20122405 var params = MessageCreateParams.builder()
20132406 .model(Model.CLAUDE_OPUS_5_5)
2014 .maxTokens(50L)
2407 .maxTokens(1024L)
20152408 .addUserMessage(binaryPrompt)
20162409 .build();
20172410 var judgment = contentText(client.messages().create(params));
from line 2475
20822475 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
20832476 $response = $client->messages->create(
20842477 model: Model::CLAUDE_OPUS_5_5,
2085 maxTokens: 50,
2478 maxTokens: 1024,
20862479 messages: [
20872480 [
20882481 'role' => 'user',
from line 2561
21682561 # Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
21692562 response = client.messages.create(
21702563 model: Anthropic::Model::CLAUDE_OPUS_5_5,
2171 max_tokens: 50,
2564 max_tokens: 1024,
21722565 messages: [
21732566 {
21742567 role: "user",
from line 2659
22662659 # Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
22672660 response = client.messages.create(
22682661 model="claude-opus-5-5",
2269 max_tokens=50,
2662 max_tokens=1024,
22702663 messages=[{"role": "user", "content": ordinal_prompt}],
22712664 )
22722665 return int(
from line 2751
23582751 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
23592752 const response = await client.messages.create({
23602753 model: "claude-opus-5-5",
2361 max_tokens: 50,
2754 max_tokens: 1024,
23622755 messages: [{ role: "user", content: ordinalPrompt }]
23632756 });
23642757 const textBlock = response.content.find((block) => block.type === "text");
from line 2834
24412834 var response = await client.Messages.Create(new MessageCreateParams
24422835 {
24432836 Model = Model.ClaudeOpus5_5,
2444 MaxTokens = 50,
2837 MaxTokens = 1024,
24452838 Messages = [new() { Role = Role.User, Content = ordinalPrompt }],
24462839 });
24472840 return int.Parse(ContentText(response).Trim());
from line 2944
25512944 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
25522945 response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
25532946 Model: anthropic.ModelClaudeOpus5_5,
2554 MaxTokens: 50,
2947 MaxTokens: 1024,
25552948 Messages: []anthropic.MessageParam{
25562949 anthropic.NewUserMessage(anthropic.NewTextBlock(ordinalPrompt)),
25572950 },
from line 3033
26403033 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
26413034 var params = MessageCreateParams.builder()
26423035 .model(Model.CLAUDE_OPUS_5_5)
2643 .maxTokens(50L)
3036 .maxTokens(1024L)
26443037 .addUserMessage(ordinalPrompt)
26453038 .build();
26463039 var judgment = contentText(client.messages().create(params));
from line 3104
27113104 // Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
27123105 $response = $client->messages->create(
27133106 model: Model::CLAUDE_OPUS_5_5,
2714 maxTokens: 50,
3107 maxTokens: 1024,
27153108 messages: [
27163109 [
27173110 'role' => 'user',
from line 3191
27983191 # Generally best practice to use a different model to evaluate than the model used to generate the evaluated output
27993192 response = client.messages.create(
28003193 model: Anthropic::Model::CLAUDE_OPUS_5_5,
2801 max_tokens: 50,
3194 max_tokens: 1024,
28023195 messages: [
28033196 {
28043197 role: "user",
28053198
No line in this hunk matches that.