test
testing my code
function llama_chatbot_response($user_input) { $api_key = ‘your_huggingface_or_olama_api_key_here’; $model_url = ‘https://api.huggingface.co/models/your_llama_model’; $headers = array( ‘Authorization’ => ‘Bearer ‘ . $api_key, ‘Content-Type’ => ‘application/json’ ); $data = json_encode(array(‘inputs’ => $user_input)); $args = array( ‘headers’ => $headers, ‘body’ => $data, ‘method’ => ‘POST’ ); $response = wp_remote_post($model_url, $args); if (is_wp_error($response)) { return “Sorry, I couldn’t process your request.”; } $body = wp_remote_retrieve_body($response); $response_data = json_decode($body, true); return $response_data[‘generated_text’]; }