Skip to content

Commit

Permalink
Merge pull request #153 from janhq/redir-test
Browse files Browse the repository at this point in the history
feat: add openai compatible path
  • Loading branch information
tikikun authored Nov 20, 2023
2 parents a5860b7 + ed5e5fb commit 29dff69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/llamaCPP.h
Original file line number Diff line number Diff line change
Expand Up @@ -2127,6 +2127,10 @@ class llamaCPP : public drogon::HttpController<llamaCPP> {
METHOD_ADD(llamaCPP::unloadModel, "unloadmodel", Get);
METHOD_ADD(llamaCPP::modelStatus, "modelstatus", Get);

// Openai compatible path
ADD_METHOD_TO(llamaCPP::chatCompletion, "/v1/chat/completions", Post);
ADD_METHOD_TO(llamaCPP::embedding, "/v1/embeddings", Post);

// PATH_ADD("/llama/chat_completion", Post);
METHOD_LIST_END
void chatCompletion(const HttpRequestPtr &req,
Expand Down

0 comments on commit 29dff69

Please sign in to comment.