SimplerLLM 0.3.3.5__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/PKG-INFO +5 -12
- simplerllm-0.3.4/SimplerLLM/__init__.py +128 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/base.py +46 -9
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/providers/__init__.py +2 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/providers/google_image.py +25 -10
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/providers/openai_image.py +290 -86
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/providers/seedream_image.py +61 -14
- simplerllm-0.3.4/SimplerLLM/image/generation/providers/stability_image.py +592 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/wrappers/__init__.py +2 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/wrappers/google_wrapper.py +85 -17
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/wrappers/openai_wrapper.py +156 -42
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/wrappers/seedream_wrapper.py +162 -47
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/wrappers/stability_wrapper.py +267 -0
- simplerllm-0.3.4/SimplerLLM/language/__init__.py +77 -0
- simplerllm-0.3.4/SimplerLLM/language/embeddings/__init__.py +94 -0
- simplerllm-0.3.4/SimplerLLM/language/embeddings/base.py +175 -0
- simplerllm-0.3.4/SimplerLLM/language/embeddings/models.py +39 -0
- simplerllm-0.3.4/SimplerLLM/language/embeddings/providers.py +500 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm/__init__.py +2 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm/base.py +8 -0
- simplerllm-0.3.4/SimplerLLM/language/llm/reliable.py +487 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm/wrappers/__init__.py +2 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm/wrappers/anthropic_wrapper.py +33 -11
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/cohere_wrapper.py +325 -0
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/deepseek_wrapper.py +353 -0
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/gemini_wrapper.py +491 -0
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/hf_local_wrapper.py +280 -0
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/moonshot_wrapper.py +407 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm/wrappers/ollama_wrapper.py +110 -14
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/openai_wrapper.py +483 -0
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/openrouter_wrapper.py +452 -0
- simplerllm-0.3.4/SimplerLLM/language/llm/wrappers/perplexity_wrapper.py +432 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_addons/__init__.py +92 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_addons/cost_utils.py +65 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_addons/json_generation.py +701 -0
- simplerllm-0.3.3.5/SimplerLLM/language/llm_addons.py → simplerllm-0.3.4/SimplerLLM/language/llm_addons/pattern_extraction.py +122 -527
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_brainstorm/__init__.py +18 -14
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_brainstorm/models.py +59 -52
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_brainstorm/recursive_brainstorm.py +349 -114
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_feedback/feedback_loop.py +5 -2
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_judge/judge.py +151 -58
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/anthropic_llm.py +652 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/cohere_llm.py +773 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/deepseek_llm.py +471 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/gemini_llm.py +992 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/hf_local_llm.py +376 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_providers/llm_response_models.py +54 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/moonshot_llm.py +633 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/ollama_llm.py +278 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/openai_llm.py +944 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/openrouter_llm.py +997 -0
- simplerllm-0.3.4/SimplerLLM/language/llm_providers/perplexity_llm.py +651 -0
- simplerllm-0.3.4/SimplerLLM/tools/image_helpers.py +1042 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/json_helpers.py +329 -10
- simplerllm-0.3.4/SimplerLLM/vectors/__init__.py +134 -0
- simplerllm-0.3.4/SimplerLLM/vectors/base.py +205 -0
- simplerllm-0.3.4/SimplerLLM/vectors/exceptions.py +110 -0
- simplerllm-0.3.4/SimplerLLM/vectors/models.py +164 -0
- simplerllm-0.3.4/SimplerLLM/vectors/providers/__init__.py +28 -0
- simplerllm-0.3.4/SimplerLLM/vectors/providers/local_provider.py +706 -0
- simplerllm-0.3.4/SimplerLLM/vectors/providers/qdrant_provider.py +773 -0
- simplerllm-0.3.4/SimplerLLM/vectors/wrappers/__init__.py +28 -0
- simplerllm-0.3.4/SimplerLLM/vectors/wrappers/local_wrapper.py +679 -0
- simplerllm-0.3.4/SimplerLLM/vectors/wrappers/qdrant_wrapper.py +615 -0
- simplerllm-0.3.4/SimplerLLM/voice/__init__.py +66 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/__init__.py +79 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/base.py +167 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/factory.py +83 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/models.py +148 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/providers/__init__.py +24 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/providers/elevenlabs_tts.py +489 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/providers/lahajati_tts.py +629 -0
- simplerllm-0.3.4/SimplerLLM/voice/tts/providers/openai_tts.py +364 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM.egg-info/PKG-INFO +5 -12
- simplerllm-0.3.4/SimplerLLM.egg-info/SOURCES.txt +147 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM.egg-info/requires.txt +4 -13
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM.egg-info/top_level.txt +1 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/setup.py +6 -4
- simplerllm-0.3.4/tests/__init__.py +1 -0
- simplerllm-0.3.4/tests/test_anthropic.py +241 -0
- simplerllm-0.3.4/tests/test_brainstorm.py +331 -0
- simplerllm-0.3.4/tests/test_cohere.py +196 -0
- simplerllm-0.3.4/tests/test_deepseek.py +233 -0
- simplerllm-0.3.4/tests/test_embeddings.py +490 -0
- simplerllm-0.3.4/tests/test_gemini.py +276 -0
- simplerllm-0.3.4/tests/test_google_image.py +279 -0
- simplerllm-0.3.4/tests/test_hf_local.py +225 -0
- simplerllm-0.3.4/tests/test_hf_mini.py +12 -0
- simplerllm-0.3.4/tests/test_judge.py +298 -0
- simplerllm-0.3.4/tests/test_lahajati_tts.py +384 -0
- simplerllm-0.3.4/tests/test_llm_addons.py +480 -0
- simplerllm-0.3.4/tests/test_moonshot.py +320 -0
- simplerllm-0.3.4/tests/test_ollama.py +358 -0
- simplerllm-0.3.4/tests/test_openai.py +274 -0
- simplerllm-0.3.4/tests/test_openai_image.py +343 -0
- simplerllm-0.3.4/tests/test_openrouter.py +311 -0
- simplerllm-0.3.4/tests/test_perplexity.py +281 -0
- simplerllm-0.3.4/tests/test_pydantic_advanced.py +693 -0
- simplerllm-0.3.4/tests/test_pydantic_json.py +970 -0
- simplerllm-0.3.4/tests/test_reliable.py +362 -0
- simplerllm-0.3.4/tests/test_reliable_pydantic.py +431 -0
- simplerllm-0.3.4/tests/test_seedream_image.py +324 -0
- simplerllm-0.3.4/tests/test_stability_image.py +292 -0
- simplerllm-0.3.4/tests/test_tts.py +386 -0
- simplerllm-0.3.4/tests/test_vectors.py +403 -0
- simplerllm-0.3.3.5/SimplerLLM/__init__.py +0 -262
- simplerllm-0.3.3.5/SimplerLLM/image/generation/providers/stability_image.py +0 -263
- simplerllm-0.3.3.5/SimplerLLM/language/__init__.py +0 -139
- simplerllm-0.3.3.5/SimplerLLM/language/embeddings.py +0 -230
- simplerllm-0.3.3.5/SimplerLLM/language/flow/__init__.py +0 -8
- simplerllm-0.3.3.5/SimplerLLM/language/flow/flow.py +0 -693
- simplerllm-0.3.3.5/SimplerLLM/language/flow/models.py +0 -56
- simplerllm-0.3.3.5/SimplerLLM/language/flow/tool_registry.py +0 -105
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/__init__.py +0 -103
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/base.py +0 -244
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/exceptions.py +0 -102
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/input_guardrails/__init__.py +0 -20
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/input_guardrails/pii_detection.py +0 -236
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/input_guardrails/prompt_injection.py +0 -136
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/input_guardrails/topic_filter.py +0 -215
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/output_guardrails/__init__.py +0 -23
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/output_guardrails/content_safety.py +0 -299
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/output_guardrails/format_validator.py +0 -246
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/output_guardrails/length_validator.py +0 -260
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/output_guardrails/pii_detection.py +0 -273
- simplerllm-0.3.3.5/SimplerLLM/language/guardrails/wrapper.py +0 -558
- simplerllm-0.3.3.5/SimplerLLM/language/llm/reliable.py +0 -307
- simplerllm-0.3.3.5/SimplerLLM/language/llm/wrappers/cohere_wrapper.py +0 -179
- simplerllm-0.3.3.5/SimplerLLM/language/llm/wrappers/deepseek_wrapper.py +0 -185
- simplerllm-0.3.3.5/SimplerLLM/language/llm/wrappers/gemini_wrapper.py +0 -244
- simplerllm-0.3.3.5/SimplerLLM/language/llm/wrappers/openai_wrapper.py +0 -290
- simplerllm-0.3.3.5/SimplerLLM/language/llm/wrappers/openrouter_wrapper.py +0 -214
- simplerllm-0.3.3.5/SimplerLLM/language/llm/wrappers/perplexity_wrapper.py +0 -222
- simplerllm-0.3.3.5/SimplerLLM/language/llm_clustering/__init__.py +0 -118
- simplerllm-0.3.3.5/SimplerLLM/language/llm_clustering/chunk_store.py +0 -380
- simplerllm-0.3.3.5/SimplerLLM/language/llm_clustering/clusterer.py +0 -248
- simplerllm-0.3.3.5/SimplerLLM/language/llm_clustering/flat_clusterer.py +0 -361
- simplerllm-0.3.3.5/SimplerLLM/language/llm_clustering/models.py +0 -291
- simplerllm-0.3.3.5/SimplerLLM/language/llm_clustering/persistence.py +0 -484
- simplerllm-0.3.3.5/SimplerLLM/language/llm_clustering/tree_builder.py +0 -360
- simplerllm-0.3.3.5/SimplerLLM/language/llm_consistency/__init__.py +0 -22
- simplerllm-0.3.3.5/SimplerLLM/language/llm_consistency/consistency.py +0 -597
- simplerllm-0.3.3.5/SimplerLLM/language/llm_consistency/models.py +0 -113
- simplerllm-0.3.3.5/SimplerLLM/language/llm_provider_router/__init__.py +0 -63
- simplerllm-0.3.3.5/SimplerLLM/language/llm_provider_router/models.py +0 -238
- simplerllm-0.3.3.5/SimplerLLM/language/llm_provider_router/provider_router.py +0 -641
- simplerllm-0.3.3.5/SimplerLLM/language/llm_provider_router/query_classifier.py +0 -379
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/anthropic_llm.py +0 -299
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/cohere_llm.py +0 -358
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/deepseek_llm.py +0 -134
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/gemini_llm.py +0 -159
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/ollama_llm.py +0 -142
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/openai_llm.py +0 -472
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/openrouter_llm.py +0 -254
- simplerllm-0.3.3.5/SimplerLLM/language/llm_providers/perplexity_llm.py +0 -231
- simplerllm-0.3.3.5/SimplerLLM/language/llm_retrieval/__init__.py +0 -79
- simplerllm-0.3.3.5/SimplerLLM/language/llm_retrieval/models.py +0 -164
- simplerllm-0.3.3.5/SimplerLLM/language/llm_retrieval/retriever.py +0 -386
- simplerllm-0.3.3.5/SimplerLLM/language/llm_validator/__init__.py +0 -51
- simplerllm-0.3.3.5/SimplerLLM/language/llm_validator/models.py +0 -112
- simplerllm-0.3.3.5/SimplerLLM/language/llm_validator/validator.py +0 -475
- simplerllm-0.3.3.5/SimplerLLM/tools/brainstorm.py +0 -210
- simplerllm-0.3.3.5/SimplerLLM/tools/image_helpers.py +0 -266
- simplerllm-0.3.3.5/SimplerLLM/vectors/__init__.py +0 -5
- simplerllm-0.3.3.5/SimplerLLM/vectors/local_vector_db.py +0 -204
- simplerllm-0.3.3.5/SimplerLLM/vectors/qdrant_vector_db.py +0 -610
- simplerllm-0.3.3.5/SimplerLLM/vectors/simpler_vector.py +0 -475
- simplerllm-0.3.3.5/SimplerLLM/vectors/vector_db.py +0 -405
- simplerllm-0.3.3.5/SimplerLLM/vectors/vector_providers.py +0 -6
- simplerllm-0.3.3.5/SimplerLLM/voice/__init__.py +0 -121
- simplerllm-0.3.3.5/SimplerLLM/voice/dialogue_generator/__init__.py +0 -19
- simplerllm-0.3.3.5/SimplerLLM/voice/dialogue_generator/audio_merger.py +0 -362
- simplerllm-0.3.3.5/SimplerLLM/voice/dialogue_generator/dialogue_generator.py +0 -640
- simplerllm-0.3.3.5/SimplerLLM/voice/dialogue_generator/models.py +0 -183
- simplerllm-0.3.3.5/SimplerLLM/voice/live_voice_chat/__init__.py +0 -17
- simplerllm-0.3.3.5/SimplerLLM/voice/live_voice_chat/audio_player.py +0 -349
- simplerllm-0.3.3.5/SimplerLLM/voice/live_voice_chat/audio_recorder.py +0 -408
- simplerllm-0.3.3.5/SimplerLLM/voice/live_voice_chat/live_voice_chat.py +0 -373
- simplerllm-0.3.3.5/SimplerLLM/voice/live_voice_chat/models.py +0 -59
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/__init__.py +0 -105
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/audio_utils.py +0 -205
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/base.py +0 -286
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/models.py +0 -308
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/providers/__init__.py +0 -19
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/providers/elevenlabs_convai.py +0 -643
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/providers/openai_realtime.py +0 -511
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/providers/realtime_response_models.py +0 -172
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/realtime_voice_chat.py +0 -303
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/wrappers/__init__.py +0 -11
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/wrappers/elevenlabs_wrapper.py +0 -306
- simplerllm-0.3.3.5/SimplerLLM/voice/realtime_voice/wrappers/openai_wrapper.py +0 -444
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/__init__.py +0 -11
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/base.py +0 -125
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/providers/__init__.py +0 -18
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/providers/elevenlabs_tts.py +0 -227
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/providers/openai_tts.py +0 -190
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/providers/tts_response_models.py +0 -51
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/wrappers/__init__.py +0 -16
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/wrappers/elevenlabs_wrapper.py +0 -216
- simplerllm-0.3.3.5/SimplerLLM/voice/tts/wrappers/openai_wrapper.py +0 -172
- simplerllm-0.3.3.5/SimplerLLM/voice/video_dubbing/__init__.py +0 -37
- simplerllm-0.3.3.5/SimplerLLM/voice/video_dubbing/audio_sync.py +0 -326
- simplerllm-0.3.3.5/SimplerLLM/voice/video_dubbing/base.py +0 -370
- simplerllm-0.3.3.5/SimplerLLM/voice/video_dubbing/models.py +0 -61
- simplerllm-0.3.3.5/SimplerLLM/voice/video_dubbing/video_processor.py +0 -280
- simplerllm-0.3.3.5/SimplerLLM/voice/video_transcription/__init__.py +0 -26
- simplerllm-0.3.3.5/SimplerLLM/voice/video_transcription/base.py +0 -329
- simplerllm-0.3.3.5/SimplerLLM/voice/video_transcription/caption_generator.py +0 -357
- simplerllm-0.3.3.5/SimplerLLM/voice/video_transcription/models.py +0 -112
- simplerllm-0.3.3.5/SimplerLLM/voice/video_transcription/utils/__init__.py +0 -26
- simplerllm-0.3.3.5/SimplerLLM/voice/video_transcription/utils/subtitle_formatter.py +0 -58
- simplerllm-0.3.3.5/SimplerLLM/voice/video_transcription/utils/video_utils.py +0 -225
- simplerllm-0.3.3.5/SimplerLLM/voice/voice_chat/__init__.py +0 -19
- simplerllm-0.3.3.5/SimplerLLM/voice/voice_chat/conversation.py +0 -115
- simplerllm-0.3.3.5/SimplerLLM/voice/voice_chat/models.py +0 -125
- simplerllm-0.3.3.5/SimplerLLM/voice/voice_chat/voice_chat.py +0 -548
- simplerllm-0.3.3.5/SimplerLLM.egg-info/SOURCES.txt +0 -223
- simplerllm-0.3.3.5/tests/test_agent.py +0 -48
- simplerllm-0.3.3.5/tests/test_agent_full.py +0 -144
- simplerllm-0.3.3.5/tests/test_anthropic_web_search.py +0 -53
- simplerllm-0.3.3.5/tests/test_arabic_validator.py +0 -128
- simplerllm-0.3.3.5/tests/test_cohere.py +0 -66
- simplerllm-0.3.3.5/tests/test_cohere_embeddings.py +0 -105
- simplerllm-0.3.3.5/tests/test_comprehensive_llm.py +0 -459
- simplerllm-0.3.3.5/tests/test_embeddings_comprehensive.py +0 -561
- simplerllm-0.3.3.5/tests/test_flow_comprehensive.py +0 -1509
- simplerllm-0.3.3.5/tests/test_llm_brainstorm.py +0 -869
- simplerllm-0.3.3.5/tests/test_llm_clustering_retrieval.py +0 -355
- simplerllm-0.3.3.5/tests/test_llm_feedback.py +0 -346
- simplerllm-0.3.3.5/tests/test_llm_judge.py +0 -294
- simplerllm-0.3.3.5/tests/test_llm_provider_router.py +0 -522
- simplerllm-0.3.3.5/tests/test_llm_providers.py +0 -69
- simplerllm-0.3.3.5/tests/test_nested_models.py +0 -626
- simplerllm-0.3.3.5/tests/test_openrouter.py +0 -165
- simplerllm-0.3.3.5/tests/test_openrouter_full_response.py +0 -477
- simplerllm-0.3.3.5/tests/test_pattern_extraction.py +0 -534
- simplerllm-0.3.3.5/tests/test_pattern_helpers.py +0 -754
- simplerllm-0.3.3.5/tests/test_perplexity_pydantic.py +0 -49
- simplerllm-0.3.3.5/tests/test_perplexity_web_search.py +0 -32
- simplerllm-0.3.3.5/tests/test_production_vector_db.py +0 -765
- simplerllm-0.3.3.5/tests/test_pydantic_edge_cases.py +0 -374
- simplerllm-0.3.3.5/tests/test_pydantic_edge_cases_llm.py +0 -336
- simplerllm-0.3.3.5/tests/test_pydantic_structures.py +0 -365
- simplerllm-0.3.3.5/tests/test_pydantic_vision.py +0 -119
- simplerllm-0.3.3.5/tests/test_qdrant_comprehensive.py +0 -793
- simplerllm-0.3.3.5/tests/test_qdrant_connection.py +0 -165
- simplerllm-0.3.3.5/tests/test_qdrant_integration_live.py +0 -653
- simplerllm-0.3.3.5/tests/test_real_llm_generation.py +0 -630
- simplerllm-0.3.3.5/tests/test_reliable_fix.py +0 -60
- simplerllm-0.3.3.5/tests/test_reliable_vision.py +0 -186
- simplerllm-0.3.3.5/tests/test_router_simple.py +0 -249
- simplerllm-0.3.3.5/tests/test_router_youtube_titles.py +0 -117
- simplerllm-0.3.3.5/tests/test_unified_vector_interface.py +0 -222
- simplerllm-0.3.3.5/tests/test_vision_anthropic.py +0 -250
- simplerllm-0.3.3.5/tests/test_vision_openai.py +0 -254
- simplerllm-0.3.3.5/tests/test_vision_quick.py +0 -179
- simplerllm-0.3.3.5/tests/test_voyage_embeddings.py +0 -582
- simplerllm-0.3.3.5/tests/test_web_search_pydantic.py +0 -50
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/LICENSE +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/README.md +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/providers/image_response_models.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_feedback/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_feedback/models.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_judge/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_judge/models.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_providers/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_providers/voyage_llm.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_router/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_router/models.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/language/llm_router/router.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/prompts/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/prompts/hub/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/prompts/hub/agentic_prompts.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/prompts/hub/prompt_manager.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/prompts/messages_template.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/prompts/prompt_builder.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/apify_api.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/email_functions.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/file_functions.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/file_loader.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/generic_loader.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/pandas_func.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/pattern_helpers.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/python_func.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/rapid_api.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/serp.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/text_chunker.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/tools/youtube.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/utils/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/utils/custom_verbose.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/voice/stt/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/voice/stt/base.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/voice/stt/providers/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/voice/stt/providers/openai_stt.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/voice/stt/providers/stt_response_models.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/voice/stt/wrappers/__init__.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/voice/stt/wrappers/openai_wrapper.py +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM.egg-info/dependency_links.txt +0 -0
- {simplerllm-0.3.3.5 → simplerllm-0.3.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SimplerLLM
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: An easy-to-use Library for interacting with language models.
|
|
5
5
|
Home-page: https://github.com/hassancs91/SimplerLLM
|
|
6
6
|
Author: Hasan Aboul Hasan
|
|
@@ -48,17 +48,10 @@ Requires-Dist: pydub>=0.25.1
|
|
|
48
48
|
Requires-Dist: elevenlabs>=2.22.0
|
|
49
49
|
Requires-Dist: moviepy>=1.0.3
|
|
50
50
|
Requires-Dist: yt-dlp>=2023.3.4
|
|
51
|
-
Provides-Extra:
|
|
52
|
-
Requires-Dist:
|
|
53
|
-
Requires-Dist:
|
|
54
|
-
Requires-Dist:
|
|
55
|
-
Provides-Extra: live-voice
|
|
56
|
-
Requires-Dist: sounddevice>=0.4.6; extra == "live-voice"
|
|
57
|
-
Requires-Dist: pynput>=1.7.6; extra == "live-voice"
|
|
58
|
-
Provides-Extra: all
|
|
59
|
-
Requires-Dist: pygame>=2.5.0; extra == "all"
|
|
60
|
-
Requires-Dist: sounddevice>=0.4.6; extra == "all"
|
|
61
|
-
Requires-Dist: pynput>=1.7.6; extra == "all"
|
|
51
|
+
Provides-Extra: transformers
|
|
52
|
+
Requires-Dist: transformers>=4.36.0; extra == "transformers"
|
|
53
|
+
Requires-Dist: torch>=2.0.0; extra == "transformers"
|
|
54
|
+
Requires-Dist: accelerate>=0.25.0; extra == "transformers"
|
|
62
55
|
Dynamic: author
|
|
63
56
|
Dynamic: author-email
|
|
64
57
|
Dynamic: classifier
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# SimplerLLM - Simplified interface for LLMs and Voice APIs
|
|
2
|
+
|
|
3
|
+
# Language module exports
|
|
4
|
+
from .language import (
|
|
5
|
+
LLM,
|
|
6
|
+
LLMProvider,
|
|
7
|
+
ReliableLLM,
|
|
8
|
+
OpenAILLM,
|
|
9
|
+
GeminiLLM,
|
|
10
|
+
AnthropicLLM,
|
|
11
|
+
OllamaLLM,
|
|
12
|
+
DeepSeekLLM,
|
|
13
|
+
LLMJudge,
|
|
14
|
+
JudgeMode,
|
|
15
|
+
JudgeResult,
|
|
16
|
+
ProviderResponse,
|
|
17
|
+
ProviderEvaluation,
|
|
18
|
+
EvaluationReport,
|
|
19
|
+
LLMFeedbackLoop,
|
|
20
|
+
FeedbackResult,
|
|
21
|
+
IterationResult,
|
|
22
|
+
Critique,
|
|
23
|
+
EmbeddingsLLM,
|
|
24
|
+
EmbeddingsProvider,
|
|
25
|
+
OpenAIEmbeddings,
|
|
26
|
+
VoyageEmbeddings,
|
|
27
|
+
CohereEmbeddings,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# Voice module exports
|
|
31
|
+
from .voice import (
|
|
32
|
+
# TTS
|
|
33
|
+
TTS,
|
|
34
|
+
TTSBase,
|
|
35
|
+
TTSProvider,
|
|
36
|
+
TTSResponse,
|
|
37
|
+
Voice,
|
|
38
|
+
TTSError,
|
|
39
|
+
TTSValidationError,
|
|
40
|
+
TTSProviderError,
|
|
41
|
+
TTSVoiceNotFoundError,
|
|
42
|
+
OpenAITTS,
|
|
43
|
+
OPENAI_VOICES,
|
|
44
|
+
OPENAI_MODELS,
|
|
45
|
+
OPENAI_FORMATS,
|
|
46
|
+
ELEVENLABS_MODELS,
|
|
47
|
+
ELEVENLABS_FORMATS,
|
|
48
|
+
# STT
|
|
49
|
+
STT,
|
|
50
|
+
STTProvider,
|
|
51
|
+
OpenAISTT,
|
|
52
|
+
STTFullResponse,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Optional ElevenLabs TTS
|
|
56
|
+
try:
|
|
57
|
+
from .voice import ElevenLabsTTS
|
|
58
|
+
except (ImportError, TypeError):
|
|
59
|
+
ElevenLabsTTS = None
|
|
60
|
+
|
|
61
|
+
# Image module exports
|
|
62
|
+
from .image import (
|
|
63
|
+
ImageGenerator,
|
|
64
|
+
ImageProvider,
|
|
65
|
+
ImageSize,
|
|
66
|
+
OpenAIImageGenerator,
|
|
67
|
+
StabilityImageGenerator,
|
|
68
|
+
GoogleImageGenerator,
|
|
69
|
+
ImageGenerationResponse,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
__all__ = [
|
|
73
|
+
# Language module
|
|
74
|
+
'LLM',
|
|
75
|
+
'LLMProvider',
|
|
76
|
+
'ReliableLLM',
|
|
77
|
+
'OpenAILLM',
|
|
78
|
+
'GeminiLLM',
|
|
79
|
+
'AnthropicLLM',
|
|
80
|
+
'OllamaLLM',
|
|
81
|
+
'DeepSeekLLM',
|
|
82
|
+
'LLMJudge',
|
|
83
|
+
'JudgeMode',
|
|
84
|
+
'JudgeResult',
|
|
85
|
+
'ProviderResponse',
|
|
86
|
+
'ProviderEvaluation',
|
|
87
|
+
'EvaluationReport',
|
|
88
|
+
'LLMFeedbackLoop',
|
|
89
|
+
'FeedbackResult',
|
|
90
|
+
'IterationResult',
|
|
91
|
+
'Critique',
|
|
92
|
+
# Embeddings
|
|
93
|
+
'EmbeddingsLLM',
|
|
94
|
+
'EmbeddingsProvider',
|
|
95
|
+
'OpenAIEmbeddings',
|
|
96
|
+
'VoyageEmbeddings',
|
|
97
|
+
'CohereEmbeddings',
|
|
98
|
+
# Voice module - TTS
|
|
99
|
+
'TTS',
|
|
100
|
+
'TTSBase',
|
|
101
|
+
'TTSProvider',
|
|
102
|
+
'TTSResponse',
|
|
103
|
+
'Voice',
|
|
104
|
+
'TTSError',
|
|
105
|
+
'TTSValidationError',
|
|
106
|
+
'TTSProviderError',
|
|
107
|
+
'TTSVoiceNotFoundError',
|
|
108
|
+
'OpenAITTS',
|
|
109
|
+
'ElevenLabsTTS',
|
|
110
|
+
'OPENAI_VOICES',
|
|
111
|
+
'OPENAI_MODELS',
|
|
112
|
+
'OPENAI_FORMATS',
|
|
113
|
+
'ELEVENLABS_MODELS',
|
|
114
|
+
'ELEVENLABS_FORMATS',
|
|
115
|
+
# Voice module - STT
|
|
116
|
+
'STT',
|
|
117
|
+
'STTProvider',
|
|
118
|
+
'OpenAISTT',
|
|
119
|
+
'STTFullResponse',
|
|
120
|
+
# Image module
|
|
121
|
+
'ImageGenerator',
|
|
122
|
+
'ImageProvider',
|
|
123
|
+
'ImageSize',
|
|
124
|
+
'OpenAIImageGenerator',
|
|
125
|
+
'StabilityImageGenerator',
|
|
126
|
+
'GoogleImageGenerator',
|
|
127
|
+
'ImageGenerationResponse',
|
|
128
|
+
]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
-
import os
|
|
3
2
|
from SimplerLLM.utils.custom_verbose import verbose_print
|
|
4
3
|
|
|
5
4
|
|
|
@@ -16,10 +15,23 @@ class ImageProvider(Enum):
|
|
|
16
15
|
|
|
17
16
|
class ImageSize(Enum):
|
|
18
17
|
"""User-friendly image size options that map to provider-specific dimensions."""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
# Standard sizes
|
|
19
|
+
SQUARE = "square" # 1:1
|
|
20
|
+
HORIZONTAL = "horizontal" # 16:9
|
|
21
|
+
VERTICAL = "vertical" # 9:16
|
|
22
|
+
|
|
23
|
+
# Portrait ratios
|
|
24
|
+
PORTRAIT_3_4 = "portrait_3_4" # 3:4 aspect ratio, closest to A4 paper
|
|
25
|
+
PORTRAIT_2_3 = "portrait_2_3" # 2:3 aspect ratio
|
|
26
|
+
PORTRAIT_4_5 = "portrait_4_5" # 4:5 aspect ratio (Instagram portrait)
|
|
27
|
+
|
|
28
|
+
# Landscape ratios
|
|
29
|
+
LANDSCAPE_3_2 = "landscape_3_2" # 3:2 aspect ratio (classic photo)
|
|
30
|
+
LANDSCAPE_4_3 = "landscape_4_3" # 4:3 aspect ratio (standard monitor)
|
|
31
|
+
LANDSCAPE_5_4 = "landscape_5_4" # 5:4 aspect ratio
|
|
32
|
+
|
|
33
|
+
# Ultrawide
|
|
34
|
+
ULTRAWIDE = "ultrawide" # 21:9 aspect ratio (cinematic)
|
|
23
35
|
|
|
24
36
|
|
|
25
37
|
class ImageGenerator:
|
|
@@ -94,7 +106,7 @@ class ImageGenerator:
|
|
|
94
106
|
from .wrappers.google_wrapper import GoogleImageGenerator
|
|
95
107
|
return GoogleImageGenerator(
|
|
96
108
|
provider=provider,
|
|
97
|
-
model_name=model_name or "gemini-2.5-flash-image
|
|
109
|
+
model_name=model_name or "gemini-2.5-flash-image",
|
|
98
110
|
api_key=api_key,
|
|
99
111
|
verbose=verbose,
|
|
100
112
|
)
|
|
@@ -161,31 +173,50 @@ class ImageGenerator:
|
|
|
161
173
|
|
|
162
174
|
# Map sizes based on provider
|
|
163
175
|
if provider == ImageProvider.OPENAI_DALL_E:
|
|
176
|
+
# OpenAI has limited size options, map to closest equivalent
|
|
164
177
|
size_map = {
|
|
165
178
|
ImageSize.SQUARE: "1024x1024",
|
|
166
179
|
ImageSize.HORIZONTAL: "1792x1024",
|
|
167
180
|
ImageSize.VERTICAL: "1024x1792",
|
|
168
|
-
ImageSize.PORTRAIT_3_4: "
|
|
181
|
+
ImageSize.PORTRAIT_3_4: "1024x1792", # Map to vertical
|
|
182
|
+
ImageSize.PORTRAIT_2_3: "1024x1792", # Map to vertical
|
|
183
|
+
ImageSize.PORTRAIT_4_5: "1024x1792", # Map to vertical
|
|
184
|
+
ImageSize.LANDSCAPE_3_2: "1792x1024", # Map to horizontal
|
|
185
|
+
ImageSize.LANDSCAPE_4_3: "1792x1024", # Map to horizontal
|
|
186
|
+
ImageSize.LANDSCAPE_5_4: "1024x1024", # Map to square (closest)
|
|
187
|
+
ImageSize.ULTRAWIDE: "1792x1024", # Map to horizontal
|
|
169
188
|
}
|
|
170
189
|
return size_map.get(size, "1024x1024")
|
|
171
190
|
|
|
172
191
|
elif provider == ImageProvider.STABILITY_AI:
|
|
173
|
-
# Stability AI uses aspect ratios
|
|
192
|
+
# Stability AI uses aspect ratios
|
|
174
193
|
size_map = {
|
|
175
194
|
ImageSize.SQUARE: "1:1",
|
|
176
195
|
ImageSize.HORIZONTAL: "16:9",
|
|
177
196
|
ImageSize.VERTICAL: "9:16",
|
|
178
197
|
ImageSize.PORTRAIT_3_4: "3:4",
|
|
198
|
+
ImageSize.PORTRAIT_2_3: "2:3",
|
|
199
|
+
ImageSize.PORTRAIT_4_5: "4:5",
|
|
200
|
+
ImageSize.LANDSCAPE_3_2: "3:2",
|
|
201
|
+
ImageSize.LANDSCAPE_4_3: "4:3",
|
|
202
|
+
ImageSize.LANDSCAPE_5_4: "5:4",
|
|
203
|
+
ImageSize.ULTRAWIDE: "21:9",
|
|
179
204
|
}
|
|
180
205
|
return size_map.get(size, "1:1")
|
|
181
206
|
|
|
182
207
|
elif provider == ImageProvider.GOOGLE_GEMINI:
|
|
183
|
-
# Google Gemini
|
|
208
|
+
# Google Gemini supports: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
|
|
184
209
|
size_map = {
|
|
185
210
|
ImageSize.SQUARE: "1:1",
|
|
186
211
|
ImageSize.HORIZONTAL: "16:9",
|
|
187
212
|
ImageSize.VERTICAL: "9:16",
|
|
188
213
|
ImageSize.PORTRAIT_3_4: "3:4",
|
|
214
|
+
ImageSize.PORTRAIT_2_3: "2:3",
|
|
215
|
+
ImageSize.PORTRAIT_4_5: "4:5",
|
|
216
|
+
ImageSize.LANDSCAPE_3_2: "3:2",
|
|
217
|
+
ImageSize.LANDSCAPE_4_3: "4:3",
|
|
218
|
+
ImageSize.LANDSCAPE_5_4: "5:4",
|
|
219
|
+
ImageSize.ULTRAWIDE: "21:9",
|
|
189
220
|
}
|
|
190
221
|
return size_map.get(size, "1:1")
|
|
191
222
|
|
|
@@ -196,6 +227,12 @@ class ImageGenerator:
|
|
|
196
227
|
ImageSize.HORIZONTAL: "2K",
|
|
197
228
|
ImageSize.VERTICAL: "2K",
|
|
198
229
|
ImageSize.PORTRAIT_3_4: "2K",
|
|
230
|
+
ImageSize.PORTRAIT_2_3: "2K",
|
|
231
|
+
ImageSize.PORTRAIT_4_5: "2K",
|
|
232
|
+
ImageSize.LANDSCAPE_3_2: "2K",
|
|
233
|
+
ImageSize.LANDSCAPE_4_3: "2K",
|
|
234
|
+
ImageSize.LANDSCAPE_5_4: "2K",
|
|
235
|
+
ImageSize.ULTRAWIDE: "2K",
|
|
199
236
|
}
|
|
200
237
|
return size_map.get(size, "2K")
|
|
201
238
|
|
|
@@ -7,10 +7,12 @@ from .image_response_models import ImageGenerationResponse
|
|
|
7
7
|
from . import openai_image
|
|
8
8
|
from . import stability_image
|
|
9
9
|
from . import google_image
|
|
10
|
+
from . import seedream_image
|
|
10
11
|
|
|
11
12
|
__all__ = [
|
|
12
13
|
'ImageGenerationResponse',
|
|
13
14
|
'openai_image',
|
|
14
15
|
'stability_image',
|
|
15
16
|
'google_image',
|
|
17
|
+
'seedream_image',
|
|
16
18
|
]
|
{simplerllm-0.3.3.5 → simplerllm-0.3.4}/SimplerLLM/image/generation/providers/google_image.py
RENAMED
|
@@ -33,6 +33,27 @@ def _get_image_mime_type(image_source):
|
|
|
33
33
|
return 'image/jpeg'
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
def _is_gemini_3_model(model_name: str) -> bool:
|
|
37
|
+
"""
|
|
38
|
+
Check if the model is a Gemini 3+ model that supports advanced features.
|
|
39
|
+
|
|
40
|
+
Gemini 3+ models support:
|
|
41
|
+
- 4K resolution output
|
|
42
|
+
- Advanced reasoning/thinking mode
|
|
43
|
+
- Up to 14 reference images (6 object + 5 human)
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
model_name: The model name string
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
bool: True if model is Gemini 3+
|
|
50
|
+
"""
|
|
51
|
+
if not model_name:
|
|
52
|
+
return False
|
|
53
|
+
model_lower = model_name.lower()
|
|
54
|
+
return "gemini-3" in model_lower or "nano-banana-pro" in model_lower
|
|
55
|
+
|
|
56
|
+
|
|
36
57
|
def _load_image_data(image_source):
|
|
37
58
|
"""
|
|
38
59
|
Load image data from various source types.
|
|
@@ -130,9 +151,6 @@ def generate_image(
|
|
|
130
151
|
if verbose:
|
|
131
152
|
print(f"[Google Gemini] Generating image with model={model_name}, aspect_ratio={aspect_ratio}, resolution={resolution}")
|
|
132
153
|
|
|
133
|
-
# Always print which model is being used for verification
|
|
134
|
-
print(f"[Google Gemini API] Using model: {model_name}")
|
|
135
|
-
|
|
136
154
|
retry_delay = RETRY_DELAY
|
|
137
155
|
|
|
138
156
|
for attempt in range(MAX_RETRIES):
|
|
@@ -174,9 +192,9 @@ def generate_image(
|
|
|
174
192
|
]
|
|
175
193
|
|
|
176
194
|
# Configure generation with both IMAGE and TEXT modalities
|
|
177
|
-
# image_size only supported by Gemini 3+ models
|
|
195
|
+
# image_size (4K resolution) only supported by Gemini 3+ models
|
|
178
196
|
image_config_params = {"aspect_ratio": aspect_ratio}
|
|
179
|
-
if
|
|
197
|
+
if _is_gemini_3_model(model_name):
|
|
180
198
|
image_config_params["image_size"] = resolution
|
|
181
199
|
|
|
182
200
|
generate_content_config = types.GenerateContentConfig(
|
|
@@ -408,9 +426,6 @@ def edit_image(
|
|
|
408
426
|
print(f"[Google Gemini] Editing image with model={model_name}, aspect_ratio={aspect_ratio}, resolution={resolution}")
|
|
409
427
|
print(f"[Google Gemini] Edit prompt: {edit_prompt}")
|
|
410
428
|
|
|
411
|
-
# Always print which model is being used for verification
|
|
412
|
-
print(f"[Google Gemini API] Using model: {model_name}")
|
|
413
|
-
|
|
414
429
|
retry_delay = RETRY_DELAY
|
|
415
430
|
|
|
416
431
|
for attempt in range(MAX_RETRIES):
|
|
@@ -439,9 +454,9 @@ def edit_image(
|
|
|
439
454
|
]
|
|
440
455
|
|
|
441
456
|
# Configure generation with lower temperature for consistency
|
|
442
|
-
# image_size only supported by Gemini 3+ models
|
|
457
|
+
# image_size (4K resolution) only supported by Gemini 3+ models
|
|
443
458
|
image_config_params = {"aspect_ratio": aspect_ratio}
|
|
444
|
-
if
|
|
459
|
+
if _is_gemini_3_model(model_name):
|
|
445
460
|
image_config_params["image_size"] = resolution
|
|
446
461
|
|
|
447
462
|
generate_content_config = types.GenerateContentConfig(
|