-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from aschet/cmake_improvements
CMake improvements
- Loading branch information
Showing
39 changed files
with
748 additions
and
214 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.vs | ||
build | ||
out | ||
TestApp |
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,14 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(liboai) | ||
|
||
option(BUILD_EXAMPLES "Build example applications" OFF) | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
|
||
add_subdirectory(liboai) | ||
|
||
if(BUILD_EXAMPLES) | ||
add_subdirectory(documentation) | ||
endif() | ||
|
||
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT oai) |
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,27 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(documentation) | ||
|
||
macro(add_example target_name source_name) | ||
add_executable(${target_name} "${source_name}") | ||
target_link_libraries(${target_name} oai) | ||
set_target_properties(${target_name} PROPERTIES FOLDER "examples/${PROJECT_NAME}") | ||
endmacro() | ||
|
||
macro(add_basic_example source_base_name) | ||
add_example(${source_base_name} "${source_base_name}.cpp") | ||
endmacro() | ||
|
||
add_subdirectory(audio/examples) | ||
add_subdirectory(authorization/examples) | ||
add_subdirectory(azure/examples) | ||
add_subdirectory(chat/examples) | ||
add_subdirectory(chat/conversation/examples) | ||
add_subdirectory(completions/examples) | ||
add_subdirectory(edits/examples) | ||
add_subdirectory(embeddings/examples) | ||
add_subdirectory(files/examples) | ||
add_subdirectory(fine-tunes/examples) | ||
add_subdirectory(images/examples) | ||
add_subdirectory(models/examples) | ||
add_subdirectory(moderations/examples) |
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,10 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(audio) | ||
|
||
add_basic_example(create_speech) | ||
add_basic_example(create_speech_async) | ||
add_basic_example(create_transcription) | ||
add_basic_example(create_transcription_async) | ||
add_basic_example(create_translation) | ||
add_basic_example(create_translation_async) |
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,15 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(authorization) | ||
|
||
add_basic_example(set_azure_key) | ||
add_basic_example(set_azure_key_env) | ||
add_basic_example(set_azure_key_file) | ||
add_basic_example(set_key) | ||
add_basic_example(set_key_env_var) | ||
add_basic_example(set_key_file) | ||
add_basic_example(set_organization) | ||
add_basic_example(set_organization_env_var) | ||
add_basic_example(set_organization_file) | ||
add_basic_example(set_proxies) | ||
add_basic_example(set_proxy_auth) |
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 |
---|---|---|
|
@@ -5,6 +5,6 @@ using namespace liboai; | |
int main() { | ||
OpenAI oai; | ||
if (oai.auth.SetAzureKeyEnv("AZURE_API_KEY")) { | ||
... | ||
// ... | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,6 +5,6 @@ using namespace liboai; | |
int main() { | ||
OpenAI oai; | ||
if (oai.auth.SetKeyEnv("OPENAI_API_KEY")) { | ||
... | ||
// ... | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -16,6 +16,6 @@ int main() { | |
}); | ||
|
||
if (oai.auth.SetKeyEnv("OPENAI_API_KEY")) { | ||
... | ||
// ... | ||
} | ||
} |
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 |
---|---|---|
|
@@ -26,6 +26,6 @@ int main() { | |
}); | ||
|
||
if (oai.auth.SetKeyEnv("OPENAI_API_KEY")) { | ||
... | ||
// ... | ||
} | ||
} |
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,16 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(azure) | ||
|
||
add_example(create_chat_completion_azure "create_chat_completion.cpp") | ||
add_example(create_chat_completion_async_azure "create_chat_completion_async.cpp") | ||
add_basic_example(create_completion) | ||
add_basic_example(create_completion_async) | ||
add_example(create_embedding_azure "create_embedding.cpp") | ||
add_example(create_embedding_async_azure "create_embedding_async.cpp") | ||
add_basic_example(delete_generated_image) | ||
add_basic_example(delete_generated_image_async) | ||
add_basic_example(get_generated_image) | ||
add_basic_example(get_generated_image_async) | ||
add_basic_example(request_image_generation) | ||
add_basic_example(request_image_generation_async) |
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,13 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(conversation) | ||
|
||
add_basic_example(adduserdata) | ||
add_basic_example(getjsonobject) | ||
add_basic_example(getlastresponse) | ||
add_basic_example(getrawconversation) | ||
add_basic_example(poplastresponse) | ||
add_basic_example(popsystemdata) | ||
add_basic_example(popuserdata) | ||
add_basic_example(setsystemdata) | ||
add_basic_example(update) |
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 |
---|---|---|
|
@@ -17,5 +17,5 @@ int main() { | |
// add different user data | ||
convo.AddUserData("What is the size of the universe?"); | ||
|
||
... | ||
// ... | ||
} |
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,7 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(chat) | ||
|
||
add_basic_example(create_chat_completion) | ||
add_basic_example(create_chat_completion_async) | ||
add_basic_example(ongoing_user_convo) |
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,6 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(completions) | ||
|
||
add_basic_example(generate_completion) | ||
add_basic_example(generate_completion_async) |
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,6 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(edits) | ||
|
||
add_basic_example(create_edit) | ||
add_basic_example(create_edit_async) |
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,6 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(embeddings) | ||
|
||
add_basic_example(create_embedding) | ||
add_basic_example(create_embedding_async) |
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,14 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(files) | ||
|
||
add_basic_example(delete_file) | ||
add_basic_example(delete_file_async) | ||
add_basic_example(download_uploaded_file) | ||
add_basic_example(download_uploaded_file_async) | ||
add_basic_example(list_files) | ||
add_basic_example(list_files_async) | ||
add_basic_example(retrieve_file) | ||
add_basic_example(retrieve_file_async) | ||
add_basic_example(upload_file) | ||
add_basic_example(upload_file_async) |
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,16 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(fine-tunes) | ||
|
||
add_basic_example(cancel_fine_tune) | ||
add_basic_example(cancel_fine_tune_async) | ||
add_basic_example(create_fine_tune) | ||
add_basic_example(create_fine_tune_async) | ||
add_basic_example(delete_fine_tune_model) | ||
add_basic_example(delete_fine_tune_model_async) | ||
add_basic_example(list_fine_tune_events) | ||
add_basic_example(list_fine_tune_events_async) | ||
add_basic_example(list_fine_tunes) | ||
add_basic_example(list_fine_tunes_async) | ||
add_basic_example(retrieve_fine_tune) | ||
add_basic_example(retrieve_fine_tune_async) |
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,12 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(images) | ||
|
||
# compilation error | ||
#add_basic_example(download_generated_image) | ||
add_basic_example(generate_edit) | ||
add_basic_example(generate_edit_async) | ||
add_basic_example(generate_image) | ||
add_basic_example(generate_image_async) | ||
add_basic_example(generate_variation) | ||
add_basic_example(generate_variation_async) |
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,8 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(models) | ||
|
||
add_basic_example(list_models) | ||
add_basic_example(list_models_async) | ||
add_basic_example(retrieve_model) | ||
add_basic_example(retrieve_model_async) |
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,6 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(moderations) | ||
|
||
add_basic_example(create_moderation) | ||
add_basic_example(create_moderation_async) |
Oops, something went wrong.