Brief summary of what type to be stored in LLMMaster.results for each model.
Important Note: since v0.6.0, results are stored as either one of the following types.
str
:- Most of text-output models return str, which seems easiest to handle for next process in your program.
- In case of any error, the result will be stored as str. Print it to see problem details.
dict
:- Native or converted object of JSON, including url of generated media and other important information. Save in text file with "w" option.
requests.models.Response
, including both text and binary data of generated media. Save media and other information separately.
bytes
: binary data of generated media. Follow the provider instruction to save.
Remarks:
- For general REST API calls using
requests
library, return value isrequests.models.Response
. CheckResponse.status_code == 200
first if response is successful. If response includes binary output, saveResponse.content
in file with "wb" option for generated media. If response contains only text, possible to convert into dict byResponse.json()
, which seems convenient for many cases. - For OpenAI text-to-image and image-to-image, return type is
openai.types.images_response.ImagesResponse
. This object can be converted into dict usingmodel_dump()
. - For ElevenLabs models, return type is proprietary binary. Use
elevenlabs.save(object, "output.mp3")
to save output. Only mp3 format might be supported for the moment. - For Luma Dream Machine models, return type is
LumaAI.Generation
class. This class is possible to convert todict
usingjson.loads()
.
- AnthropicLLM: str = response.content[0].text.strip()
- CerebrasLLM: str = response.choices[0].message.content.strip()
- GoogleLLM: str = response.text.strip()
- GroqLLM: str = response.choices[0].message.content.strip()
- MistralLLM: str = response.choices[0].message.content.strip()
- OpenAILLM: str = response.choices[0].message.content.strip()
- PerplexityLLM: str = response.choices[0].message.content.strip()
- Flux1FalTextToImage: dict = SyncRequestHandle
- OpenAITextToImage: dict = openai.types.images_response.ImagesResponse
- StableDiffusionTextToImage: dict = requests.models.Response with binary content
- ElevenLabsTextToSpeech: bytes = TextToSpeechClient.convert.generator
- ElevenLabsTextToSoundEffect: bytes = TextToSpeechClient.convert.generator
- OpenAITextToSpeech: bytes = openai._legacy_response.HttpxBinaryResponseContent
- VoicevoxTextToSpeech: dict = requests.models.Response with binary content
- GoogleImageToText: str = response.text.strip()
- OpenAIImageToText: str = response.choices[0].message.content.strip()
- Flux1FalImageToImage: dict = SyncRequestHandle
- OpenAIImageToImage: dict = openai.types.images_response.ImagesResponse
- StableDiffusionImageToImage: dict = requests.models.Response with binary content
- StableDiffusionImageToVideo: dict = requests.models.Response with binary content
- GoogleSpeechToText: str = response.text.strip()
- OpenAISpeechToText: dependent on response_format
- str = client.audio.transcriptions
- dict = Translation or Transcription class
- ElevenLabsAudioIsolation: bytes = AudioIsolationClient.audio_isolation
- GoogleVideoToText: str = response.text.strip()
- MeshyTextToTexture: dict = requests.models.Response with text content
- MeshyTextTo3D: dict = requests.models.Response with text content
- MeshyTextTo3DRefine: dict = requests.models.Response with text content
- MeshyTextToVoxel: dict = requests.models.Response with text content
- MeshyImageTo3D: dict = requests.models.Response with text content
- TripoTextTo3D: dict = requests.models.Response with text content
- TripoImageTo3D: dict = requests.models.Response with text content
- TripoMultiviewTo3D: dict = requests.models.Response with text content
- TripoRefineModel: dict = requests.models.Response with text content
- TripoAnimationPreRigCheck: dict = requests.models.Response with text content
- TripoAnimationRig: dict = requests.models.Response with text content
- TripoAnimationRetarget: dict = requests.models.Response with text content
- TripoStylization: dict = requests.models.Response with text content
- TripoConversion: dict = requests.models.Response with text content
- PikaPikaPikaGeneration: dict = requests.models.Response with text content
- LumaDreamMachineTextToVideo: dict = LumaAI.Generation
- LumaDreamMachineImageToVideo: dict = LumaAI.Generation
- LumaDreamMachineVideoToVideo: dict = LumaAI.Generation
- SkyboxTextToPanorama: dict = requests.models.Response with text content
- SkyboxPanoramaToImageVideo: dict = requests.models.Response with text content