Run with:
# AZURE:
OPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
AZURE_OPEN_AI_KEY="my-key" \
AZURE_OPEN_AI_ENDPOINT="endpoint url" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
# OPENAI:
OPENAI_CLIENT_TYPE=OPENAI \
OPEN_AI_KEY="my-key" \
OPEN_AI_ORGANIZATION_ID="organisation id" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCodeThese samples can be compiled via:
../../mvnw clean packageThey can then be run by:
../../mvnw exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode<<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< head
head <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream ======= ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes <<<<<<< AI ======= <<<<<<< HEAD main <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream Stashed changes ======= ======= Stashed changes Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes You can define the provider of Open AI by setting the
OPENAI_CLIENT_TYPEproperty or environment variable to eitherOPENAIorAZURE_OPEN_AI. By default, the samples will use the Open AI client.
OPENAI_CLIENT_TYPE=OPEN_AI ../../mvnw exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
OR
../../mvnw exec:java -DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI -Dsample=Example04_CombineLLMPromptsAndNativeCodeThe samples search for the client settings in the following order:
- Properties file whose location is defined by the
CONF_PROPERTIESproperty or environment variable. - System properties defined on the command line.
- Environment variables.
- Properties file at
java/samples/conf.properties. - Properties file at
~/.sk/conf.properties.
You can set the location of a properties file, by setting the CONF_PROPERTIES property or environment variable, ie:
CONF_PROPERTIES=my.properties \
OPENAI_CLIENT_TYPE=OPEN_AI \
../../mvnw exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
OR
../../mvnw exec:java \
-DCONF_PROPERTIES=my.properties \
-DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
-Dsample=Example04_CombineLLMPromptsAndNativeCodeA properties file looks as follows:
# If using openai.com
client.openai.key:"my-key"
client.openai.organizationid:"my-org-id"
# if using Azure Open AI
client.azureopenai.key:"my-key"
client.azureopenai.endpoint:"url of azure openai endpoint"
client.azureopenai.deploymentname:"deployment name"As an alternative to providing the key/endpoint properties via a file, you can set them directly via system properties, ie:
# OpenAI
../../mvnw exec:java \
-DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
-Dclient.openai.key="my-key" \
-Dclient.openai.organizationid="my-org-id" \
-Dsample=Example04_CombineLLMPromptsAndNativeCode
# Azure
../../mvnw exec:java \
-DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
-Dclient.azureopenai.key="my-key" \
-Dclient.azureopenai.endpoint="url of azure openai endpoint" \
-Dsample=Example04_CombineLLMPromptsAndNativeCodeAlternative to properties, you can set environment variables as follows:
# AZURE:
OPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
AZURE_OPEN_AI_KEY="my-key" \
AZURE_OPEN_AI_ENDPOINT="endpoint url" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
# OPENAI:
OPENAI_CLIENT_TYPE=OPEN_AI \
OPEN_AI_KEY="my-key" \
OPEN_AI_ORGANIZATION_ID="organisation id" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCodeRun with:
# AZURE:
OPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
AZURE_OPEN_AI_KEY="my-key" \
AZURE_OPEN_AI_ENDPOINT="endpoint url" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
# OPENAI:
OPENAI_CLIENT_TYPE=OPENAI \
OPEN_AI_KEY="my-key" \
OPEN_AI_ORGANIZATION_ID="organisation id" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCodeThese samples can be compiled via:
../../mvnw clean packageThey can then be run by:
../../mvnw exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCodemain ======= <<<<<<< Updated upstream <<<<<<< Updated upstream ======= origin/main ======= Stashed changes ======= Stashed changes head <<<<<<< AI ======= <<<<<<< HEAD main You can define the provider of Open AI by setting the
OPENAI_CLIENT_TYPEproperty or environment variable to eitherOPENAIorAZURE_OPEN_AI. By default, the samples will use the Open AI client.
OPENAI_CLIENT_TYPE=OPEN_AI ../../mvnw exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
<<<<<<< AI
=======
=======
>>>>>>> main
By default, the samples will use the Open AI client, but you can also use the Azure Open AI client.
## Open AI client type
You can define the provider of Open AI (openai.com or Azure), this can be done by setting the `OPENAI_CLIENT_TYPE`
property or environment variable to either `OPENAI` or `AZURE_OPEN_AI`, i.e.:
```shell
OPENAI_CLIENT_TYPE=OPENAI ../../mvnw exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
<<<<<<< AI
=======
>>>>>>> beeed7b7a795d8c989165740de6ddb21aeacbb6f
>>>>>>> main
OR
../../mvnw exec:java -DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI -Dsample=Example04_CombineLLMPromptsAndNativeCode<<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< head
head <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream ======= ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes <<<<<<< main The samples search for the client settings in the following order: The tests search for the client settings in the following order: ======= <<<<<<< HEAD The samples search for the client settings in the following order: ======= <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream Stashed changes ======= ======= Stashed changes Stashed changes ======= Stashed changes ======= Stashed changes ======= Stashed changes ======= origin/main ======= Stashed changes ======= Stashed changes <<<<<<< div ======= main ======= head The samples search for the client settings in the following order: The tests search for the client settings in the following order: ======= <<<<<<< HEAD The samples search for the client settings in the following order: <<<<<<< div <<<<<<< div ======= <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< head head <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream <<<<<<< Updated upstream ======= origin/main Stashed changes ======= origin/main Stashed changes ======= origin/main Stashed changes ======= origin/main Stashed changes ======= origin/main Stashed changes ======= origin/main Stashed changes ======= <<<<<<< div main ======= ======= Stashed changes ======= Stashed changes origin/main head ======= The tests search for the client settings in the following order: beeed7b7a795d8c989165740de6ddb21aeacbb6f main
- Properties file whose location is defined by the
CONF_PROPERTIESproperty or environment variable. - System properties defined on the command line.
- Environment variables.
- Properties file at
java/samples/conf.properties. - Properties file at
~/.sk/conf.properties.
You can set the location of a properties file, by setting the CONF_PROPERTIES property or environment variable, ie:
CONF_PROPERTIES=my.properties \
<<<<<<< AI
<<<<<<< div
<<<<<<< div
=======
>>>>>>> head
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< head
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
<<<<<<< main
=======
>>>>>>> origin/main
=======
<<<<<<< main
>>>>>>> Stashed changes
=======
<<<<<<< main
<<<<<<< div
=======
>>>>>>> main
=======
>>>>>>> Stashed changes
>>>>>>> head
OPENAI_CLIENT_TYPE=OPEN_AI \
OPENAI_CLIENT_TYPE=OPENAI \
=======
<<<<<<< HEAD
<<<<<<< div
<<<<<<< div
=======
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< head
>>>>>>> head
OPENAI_CLIENT_TYPE=OPEN_AI \
=======
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
OPENAI_CLIENT_TYPE=OPEN_AI \
=======
>>>>>>> Stashed changes
=======
OPENAI_CLIENT_TYPE=OPEN_AI \
=======
>>>>>>> Stashed changes
OPENAI_CLIENT_TYPE=OPEN_AI \
OPENAI_CLIENT_TYPE=OPENAI \
=======
<<<<<<< HEAD
OPENAI_CLIENT_TYPE=OPEN_AI \
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
=======
>>>>>>> origin/main
>>>>>>> Stashed changes
>>>>>>> Stashed changes
=======
>>>>>>> origin/main
>>>>>>> Stashed changes
=======
>>>>>>> origin/main
>>>>>>> Stashed changes
=======
>>>>>>> origin/main
>>>>>>> Stashed changes
=======
>>>>>>> origin/main
>>>>>>> Stashed changes
=======
>>>>>>> origin/main
>>>>>>> Stashed changes
=======
OPENAI_CLIENT_TYPE=OPEN_AI \
<<<<<<< div
>>>>>>> main
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
>>>>>>> origin/main
>>>>>>> head
=======
OPENAI_CLIENT_TYPE=OPENAI \
>>>>>>> beeed7b7a795d8c989165740de6ddb21aeacbb6f
>>>>>>> main
../../mvnw exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
OR
../../mvnw exec:java \
-DCONF_PROPERTIES=my.properties \
-DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
-Dsample=Example04_CombineLLMPromptsAndNativeCodeA properties file looks as follows:
# If using openai.com
client.openai.key:"my-key"
client.openai.organizationid:"my-org-id"
# if using Azure Open AI
client.azureopenai.key:"my-key"
client.azureopenai.endpoint:"url of azure openai endpoint"
client.azureopenai.deploymentname:"deployment name"As an alternative to providing the key/endpoint properties via a file, you can set them directly via system properties, ie:
# OpenAI
../../mvnw exec:java \
-DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
-Dclient.openai.key="my-key" \
-Dclient.openai.organizationid="my-org-id" \
-Dsample=Example04_CombineLLMPromptsAndNativeCode
# Azure
../../mvnw exec:java \
-DOPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
-Dclient.azureopenai.key="my-key" \
-Dclient.azureopenai.endpoint="url of azure openai endpoint" \
-Dsample=Example04_CombineLLMPromptsAndNativeCodeAlternative to properties, you can set environment variables as follows:
# AZURE:
OPENAI_CLIENT_TYPE=AZURE_OPEN_AI \
AZURE_OPEN_AI_KEY="my-key" \
AZURE_OPEN_AI_ENDPOINT="endpoint url" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
# OPENAI:
<<<<<<< AI
=======
<<<<<<< HEAD
>>>>>>> main
OPENAI_CLIENT_TYPE=OPEN_AI \
OPEN_AI_KEY="my-key" \
OPEN_AI_ORGANIZATION_ID="organisation id" \
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode=======
main OPENAI_CLIENT_TYPE=OPENAI
OPEN_AI_KEY="my-key"
OPEN_AI_ORGANIZATION_ID="organisation id"
../../mvnw clean package exec:java -Dsample=Example04_CombineLLMPromptsAndNativeCode
<<<<<<< AI
=======
>>>>>>> beeed7b7a795d8c989165740de6ddb21aeacbb6f
>>>>>>> main