Skip to content

Commit 7b4b65e

Browse files
committed
apply review suggestions
1 parent 8164794 commit 7b4b65e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/Anthropic.Vertex/AnthropicVertexClientWithRawResponse.cs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ private static void ValidateRequest(HttpRequestMessage requestMessage, out bool
9191
if (requestMessage.RequestUri is null)
9292
{
9393
throw new AnthropicInvalidDataException(
94-
"Request is missing required path segments. Expected > 1 segments found none."
94+
"Request is missing required path segments. Expected > 1 segments, found none."
9595
);
9696
}
9797

9898
if (requestMessage.RequestUri.Segments.Length < 1)
9999
{
100100
throw new AnthropicInvalidDataException(
101-
"Request is missing required path segments. Expected > 1 segments found none."
101+
"Request is missing required path segments. Expected > 1 segments, found none."
102102
);
103103
}
104104

105105
if (requestMessage.RequestUri.Segments[1].Trim('/') != "v1")
106106
{
107107
throw new AnthropicInvalidDataException(
108-
$"Request is missing required path segments. Expected [0] segment to be 'v1' found {requestMessage.RequestUri.Segments[0]}."
108+
$"Request is missing required path segments. Expected [0] segment to be 'v1', found {requestMessage.RequestUri.Segments[0]}."
109109
);
110110
}
111111

@@ -119,17 +119,10 @@ private static void ValidateRequest(HttpRequestMessage requestMessage, out bool
119119
$"The requested endpoint '{requestMessage.RequestUri.Segments.Last().Trim('/')}' is not yet supported."
120120
);
121121
}
122-
if (
122+
123+
isCountEndpoint =
123124
requestMessage.RequestUri.Segments.Length >= 4
124125
&& requestMessage.RequestUri.Segments[2].Trim('/') is "messages"
125-
&& requestMessage.RequestUri.Segments[3].Trim('/') is "count_tokens"
126-
)
127-
{
128-
isCountEndpoint = true;
129-
}
130-
else
131-
{
132-
isCountEndpoint = false;
133-
}
126+
&& requestMessage.RequestUri.Segments[3].Trim('/') is "count_tokens";
134127
}
135128
}

0 commit comments

Comments
 (0)