Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin committed Aug 9, 2024
1 parent 2ea86f8 commit c666e48
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions evdschat/src/getter.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ char* post_request(const char *url, const char *prompt, const char *api_key) {
CURLcode res;
struct response_data chunk;

chunk.memory = malloc(1); // Initial memory allocation
chunk.size = 0; // No data at this point
chunk.memory = malloc(1);
chunk.size = 0;

curl_global_init(CURL_GLOBAL_DEFAULT);
curl = curl_easy_init();

if(curl) {
// Prepare the JSON payload
char data[1024];
snprintf(data, sizeof(data), "{\"prompt\": \"%s\", \"api_key\": \"%s\"}", prompt, api_key);

Expand Down

0 comments on commit c666e48

Please sign in to comment.