Skip to content

zxs731/android_gpt4o_app

Repository files navigation

GPT-4o APP for Android

This sample demonstrates how to make speech on GPT-4o with Java using the Speech SDK for Android.

Need replace the parameters("***") in java file. eg: subscribe key etc..

  • MainActivity.java

private static final String SpeechSubscriptionKey = "xxx"; pprivate static final String SpeechRegion = "xxx";

  • ChatAPI.java

URL url = new URL("https://xxx.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-02-15-preview"); // Replace with actual API endpoint HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("api-key", "xxx");

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages