Skip to content

Commit

Permalink
remove static global
Browse files Browse the repository at this point in the history
  • Loading branch information
dhconnelly committed Nov 28, 2024
1 parent 03ef241 commit 914c8d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ std::string ReadAll(FILE* stream) {
return data;
}

static json::ValuePtr kStubResponse = json::Parse(R"(
json::ValuePtr StubResponse() {
return json::Parse(R"(
{
"id": "gabby-completion-123",
"object": "chat.completion",
Expand Down Expand Up @@ -64,6 +65,7 @@ static json::ValuePtr kStubResponse = json::Parse(R"(
}
}
)");
}

} // namespace

Expand Down Expand Up @@ -94,7 +96,7 @@ http::Handler InferenceService::ChatCompletions() {
LOG(DEBUG) << "read json request: " << *request;

resp.WriteStatus(http::StatusCode::OK);
resp.WriteData(to_string(*kStubResponse));
resp.WriteData(to_string(*StubResponse()));
};
}

Expand Down

0 comments on commit 914c8d9

Please sign in to comment.