client initialization time #205
-
Hi, I was running some basic benchmarking on my code and noticed that the time to initialize the client seemed overly long. $start_time_init_client = microtime(true);
// Initialize OpenAI client
function initialize_client() {
$yourApiKey = 'YOUR_API_KEY';
if (!$yourApiKey) {
die("API key not found. Please set the environment variable 'YOUR_API_KEY'.");
}
return OpenAI::client($yourApiKey);
}
$client = initialize_client();
$end_time_init_client = microtime(true);
echo "Time to initialize client: " . (($end_time_init_client - $start_time_init_client) * 1000) . " ms\n"; Output: Time to initialize client: 4877.8939247131 ms Is this the expected time everyone else is experiencing? |
Beta Was this translation helpful? Give feedback.
Answered by
gehrisandro
Sep 8, 2023
Replies: 2 comments
-
No this is far too long. Creating the client should work instantly. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
githubhkdw
-
Hmm very strange. I will need to go back and test. Ended up using curl commands but I appreciate the project. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No this is far too long. Creating the client should work instantly.