Commit 1c1d80d
committed
fix: support freeform stopReason in sampling
Previously, sampling response parsing would fail if a stopReason
was provided besides endTurn/stopSequence/maxTokens. This fixes
that to map the arbitrary values to UNKNOWN instead.
Spec: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/f5ccad944fdf2b7d9cc70cf817f66ca5a8aa03a4/schema/2024-11-05/schema.ts#L8071 parent b701a36 commit 1c1d80d
File tree
2 files changed
+37
-3
lines changed- mcp/src
- main/java/io/modelcontextprotocol/spec
- test/java/io/modelcontextprotocol/spec
2 files changed
+37
-3
lines changedLines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
1072 | 1074 | | |
1073 | 1075 | | |
1074 | 1076 | | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1078 | 1095 | | |
1079 | 1096 | | |
1080 | 1097 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
832 | 849 | | |
833 | 850 | | |
834 | 851 | | |
| |||
0 commit comments