Hi 🔒[private user] i'm UTC+1 timezone i'm available
For more details, here is the source code from what I describe https://github.com/matyo91/recherche-entreprise-mcp-server
I have that type of issue Error sending metrics to Arize: {"code":3, "message":"proto: syntax error (line 1:113): unexpected token \"AGENCE WEB BOOSTER 62.01Z PME 13 GRANDE RUE 72120 SAINT-CALAIS 72120 SAINT-CALAIS\"", "details":[]} I share some code
public function logPrediction(array $input, array $prediction, array $metrics = []): void
{
$payload = [
'space_key' => $this->spaceId,
'model_id' => $this->modelId,
'prediction' => [
'features' => $this->prepareFeatures($input),
'prediction_label' => [
'score_categorical' => [
'category' => [
'category' => $this->sanitizeText($prediction['category'] ?? 'default')
],
'score_value' => [
'value' => (float)($prediction['score'] ?? 1.0)
]
]
],
'tags' => array_map(function($value) {
if (is_string($value)) {
return $this->sanitizeText($value);
} elseif (is_array($value)) {
return $this->prepareFeatures($value);
}
return $value;
}, $metrics)
],
'environment_params' => [
'production' => []
]
];
try {
// Convert the payload to JSON and then back to array to ensure proper encoding
$jsonPayload = json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
if ($jsonPayload === false) {
throw new \RuntimeException('Failed to encode payload to JSON');
}
$payload = json_decode($jsonPayload, true);
$response = $this->httpClient->request('POST', self::ARIZE_API_URL, [
'headers' => [
'Authorization' => $this->arizeApiKey,
'Content-Type' => 'application/json',
'Grpc-Metadata-arize-space-id' => $this->spaceId,
'Grpc-Metadata-arize-interface' => 'stream',
'Grpc-Metadata-sdk-language' => 'php',
'Grpc-Metadata-language-version' => PHP_VERSION,
'Grpc-Metadata-sdk-version' => self::SDK_VERSION,
],
'json' => $payload,
]);
if ($response->getStatusCode() !== 200) {
// Log the error but don't throw to avoid breaking the main flow
error_log(sprintf(
'Error sending metrics to Arize: %s',
$response->getContent(false)
));
}
} catch (\Exception $e) {
// Log the error but don't throw to avoid breaking the main flow
error_log(sprintf(
'Exception while sending metrics to Arize: %s',
$e->getMessage()
));
}
}Hi team, I am a senior developer at Twenga Solutions. I learned more about the framework from a conference on Astra. I am quite interested in using the Phoenix open-source project in my spare time. I am wondering, is there any advice on how to start it? Is there a good first tutorial here to read? Any advice is appreciated. Thanks!
