feat: add Anthropic Claude message format helpers, fix some types and change names #140
pr-validation.yaml
on: pull_request
validate
/
validate
1m 23s
Annotations
5 errors
|
validate / validate
Process completed with exit code 1.
|
|
tests/e2e/call-model.test.ts > callModel E2E Tests > response.message - Complete message extraction > should have proper message structure:
tests/e2e/call-model.test.ts#L375
TypeError: (0 , toChatMessage) is not a function
❯ tests/e2e/call-model.test.ts:375:23
|
|
tests/e2e/call-model.test.ts > callModel E2E Tests > response.message - Complete message extraction > should successfully get a complete message from response:
tests/e2e/call-model.test.ts#L341
TypeError: (0 , toChatMessage) is not a function
❯ tests/e2e/call-model.test.ts:341:23
|
|
tests/e2e/call-model.test.ts > callModel E2E Tests > Claude-style messages support > should handle Claude-style messages with multiple text blocks:
src/lib/schemas.ts#L42
SDKValidationError: Input validation failed: [
{
"code": "invalid_union",
"errors": [
[
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received array"
}
],
[
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"function_call"
],
"path": [
"type"
],
"message": "Invalid input: expected \"function_call\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"callId"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"name"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"arguments"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"id"
],
"message": "Invalid input: expected string, received undefined"
}
],
[
{
"expected": "string",
"code": "invalid_type",
"path": [
"id"
],
"message": "Invalid input: expected string, received undefined"
},
{
"code": "invalid_value",
"values": [
"assistant"
],
"path": [
"role"
],
"message": "Invalid input: expected \"assistant\""
},
{
"code": "invalid_value",
"values": [
"message"
],
"path": [
"type"
],
"message": "Invalid input: expected \"message\""
},
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"output_text"
],
"path": [
"type"
],
"message": "Invalid input: expected \"output_text\""
}
],
[
{
"code": "invalid_value",
"values": [
"refusal"
],
"path": [
"type"
],
"message": "Invalid input: expected \"refusal\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"refusal"
],
"message": "Invalid input: expected string, received undefined"
}
]
],
"path": [
"content",
0
],
"message": "Invalid input"
},
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_v
|
|
tests/e2e/call-model.test.ts > callModel E2E Tests > Claude-style messages support > should handle Claude-style messages with content blocks array:
src/lib/schemas.ts#L42
SDKValidationError: Input validation failed: [
{
"code": "invalid_union",
"errors": [
[
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received array"
}
],
[
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"function_call"
],
"path": [
"type"
],
"message": "Invalid input: expected \"function_call\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"callId"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"name"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"arguments"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"id"
],
"message": "Invalid input: expected string, received undefined"
}
],
[
{
"expected": "string",
"code": "invalid_type",
"path": [
"id"
],
"message": "Invalid input: expected string, received undefined"
},
{
"code": "invalid_value",
"values": [
"assistant"
],
"path": [
"role"
],
"message": "Invalid input: expected \"assistant\""
},
{
"code": "invalid_value",
"values": [
"message"
],
"path": [
"type"
],
"message": "Invalid input: expected \"message\""
},
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"output_text"
],
"path": [
"type"
],
"message": "Invalid input: expected \"output_text\""
}
],
[
{
"code": "invalid_value",
"values": [
"refusal"
],
"path": [
"type"
],
"message": "Invalid input: expected \"refusal\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"refusal"
],
"message": "Invalid input: expected string, received undefined"
}
]
],
"path": [
"content",
0
],
"message": "Invalid input"
}
],
[
{
"code": "invalid_value",
"values": [
"function_call"
],
|