diff --git a/docs/Chat_Completions.md b/docs/Chat_Completions.md index cff675b..77b7248 100644 --- a/docs/Chat_Completions.md +++ b/docs/Chat_Completions.md @@ -12,7 +12,7 @@ openai = OpenAI( ) completion = client.chat.completions.create( - model="qwen2.5-0.5b-p256-ax630c", + model="qwen2.5-0.5B-p256-ax630c", messages=[ {"role": "developer", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"} @@ -28,7 +28,7 @@ print(completion.choices[0].message) A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. ### model `string` Required -Model ID used to generate the response, like `qwen2.5-0.5b-p256-ax630c` or `deepseek-r1-1.5b-p256-ax630c`. StackFlow offers a wide range of models with different capabilities, performance characteristics. Refer to the model Docs to browse and compare available models. +Model ID used to generate the response, like `qwen2.5-0.5B-p256-ax630c` or `deepseek-r1-1.5B-p256-ax630c`. StackFlow offers a wide range of models with different capabilities, performance characteristics. Refer to the model Docs to browse and compare available models. ### audio `Audio output is not currently supported` diff --git a/docs/Models.md b/docs/Models.md index 9229088..2de0fe6 100644 --- a/docs/Models.md +++ b/docs/Models.md @@ -8,12 +8,13 @@ Lists the currently available models, and provides basic information about each ```python from openai import OpenAI -openai = OpenAI( +client = OpenAI( api_key="sk-", base_url="http://192.168.20.186:8000/v1" ) client.models.list() +print(client.models.list()) ``` ## Returns diff --git a/docs/Speech_to_text.md b/docs/Speech_to_text.md index 94ba957..b7f8757 100644 --- a/docs/Speech_to_text.md +++ b/docs/Speech_to_text.md @@ -1,45 +1,33 @@ -# Audio -Learn how to turn audio into text or text into audio. - -# Create speech -post https://192.168.20.186:8000/v1/audio/speech - -Generates audio from the input text. +# Create transcription +`post http://192.168.20.186:8000/v1/audio/transcriptions` +Transcribes audio into the input language. ```python -from pathlib import Path from openai import OpenAI - -openai = OpenAI( +client = OpenAI( api_key="sk-", base_url="http://192.168.20.186:8000/v1" ) -speech_file_path = Path(__file__).parent / "speech.mp3" -with openai.audio.speech.with_streaming_response.create( - model="gpt-4o-mini-tts", - voice="alloy", - input="The quick brown fox jumped over the lazy dog." -) as response: - response.stream_to_file(speech_file_path) +audio_file = open("speech.mp3", "rb") +transcript = client.audio.transcriptions.create( + model="whisper-tiny", + language="en", + file=audio_file +) ``` ## Request body -### input `string` Required -The text to generate audio for. The maximum length is `1024` characters. +### file file Required +The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. ### model `string` Required -One of the available TTS models: `melotts-zh-cn`, `melotts-en-us`. +ID of the model to use. The options are `whisper-tiny`, `whisper-base`, and `whisper-small`. -### voice -`Voice selection is not currently supported` +### language `string` Required +The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency. -### response_format `string` Optional Defaults to mp3 -The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. - -### speed `number` Optional Defaults to 1 -The speed of the generated audio. Select a value from `0.25` to `2.0`. `1.0` is the default. - -## Returns -The audio file content. \ No newline at end of file +### response_format string Optional +Defaults to json +`Currently only supported format is json.` \ No newline at end of file diff --git a/docs/Text_to_speech.md b/docs/Text_to_speech.md index b7f8757..b8b973e 100644 --- a/docs/Text_to_speech.md +++ b/docs/Text_to_speech.md @@ -1,33 +1,45 @@ -# Create transcription -`post http://192.168.20.186:8000/v1/audio/transcriptions` -Transcribes audio into the input language. +# Audio +Learn how to turn audio into text or text into audio. + +# Create speech +post https://192.168.20.186:8000/v1/audio/speech + +Generates audio from the input text. ```python +from pathlib import Path from openai import OpenAI -client = OpenAI( + +openai = OpenAI( api_key="sk-", base_url="http://192.168.20.186:8000/v1" ) -audio_file = open("speech.mp3", "rb") -transcript = client.audio.transcriptions.create( - model="whisper-tiny", - language="en", - file=audio_file -) +speech_file_path = Path(__file__).parent / "speech.mp3" +with openai.audio.speech.with_streaming_response.create( + model="melotts-en-us", + voice="alloy", + input="The quick brown fox jumped over the lazy dog." +) as response: + response.stream_to_file(speech_file_path) ``` ## Request body -### file file Required -The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. +### input `string` Required +The text to generate audio for. The maximum length is `1024` characters. ### model `string` Required -ID of the model to use. The options are `whisper-tiny`, `whisper-base`, and `whisper-small`. +One of the available TTS models: `melotts-zh-cn`, `melotts-en-us`. -### language `string` Required -The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency. +### voice +`Voice selection is not currently supported` -### response_format string Optional -Defaults to json -`Currently only supported format is json.` \ No newline at end of file +### response_format `string` Optional Defaults to mp3 +The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. + +### speed `number` Optional Defaults to 1 +The speed of the generated audio. Select a value from `0.25` to `2.0`. `1.0` is the default. + +## Returns +The audio file content. \ No newline at end of file