-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure code so we can support multiple LLMs
- Loading branch information
1 parent
ec3d427
commit f2999dc
Showing
16 changed files
with
154 additions
and
59 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
prompts/ChatGPT_AI_Model_AutoMap.txt → prompts/AI_Model_AutoMap.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
prompts/ChatGPT_AI_Node_AutoMap.txt → prompts/AI_Node_AutoMap.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
prompts/ChatGPT_AI_Strand_AutoMap.txt → prompts/AI_Strand_AutoMap.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
prompts/ChatGPT_AI_SubModel_AutoMap.txt → prompts/AI_SubModel_AutoMap.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "aiBase.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#pragma once | ||
|
||
/*************************************************************** | ||
* This source files comes from the xLights project | ||
* https://www.xlights.org | ||
* https://github.com/xLightsSequencer/xLights | ||
* See the github commit history for a record of contributing | ||
* developers. | ||
* Copyright claimed based on commit dates recorded in Github | ||
* License: https://github.com/xLightsSequencer/xLights/blob/master/License.txt | ||
**************************************************************/ | ||
|
||
#include "aiBase.h" | ||
|
||
#include <string> | ||
|
||
// https://platform.openai.com/docs/api-reference/introduction | ||
// to get a list of models curl https://api.openai.com/v1/models -H "Authorization: Bearer YOUR_API_KEY" | ||
|
||
class chatGPT : public aiBase { | ||
|
||
std::string url = "https://api.openai.com/v1/chat/completions"; | ||
std::string model = "gpt-4o-mini"; | ||
float temperature = 0.0; | ||
|
||
public: | ||
|
||
chatGPT(xLightsFrame* frame) : aiBase(frame) {} | ||
virtual ~chatGPT() {} | ||
|
||
std::string CallLLM(const std::string& prompt, const std::string& token = "") const override; | ||
bool TestLLM(const std::string& token = "") const override; | ||
bool IsAvailable(const std::string& token = "") const override; | ||
std::string GetLLMName() const override { | ||
return "ChatGPT"; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.