ag2 0.4.1__py3-none-any.whl → 0.5.0b2__py3-none-any.whl

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.

Potentially problematic release.


This version of ag2 might be problematic. Click here for more details.

Files changed (160) hide show
  1. {ag2-0.4.1.dist-info → ag2-0.5.0b2.dist-info}/METADATA +5 -146
  2. ag2-0.5.0b2.dist-info/RECORD +6 -0
  3. ag2-0.5.0b2.dist-info/top_level.txt +1 -0
  4. ag2-0.4.1.dist-info/RECORD +0 -158
  5. ag2-0.4.1.dist-info/top_level.txt +0 -1
  6. autogen/__init__.py +0 -17
  7. autogen/_pydantic.py +0 -116
  8. autogen/agentchat/__init__.py +0 -42
  9. autogen/agentchat/agent.py +0 -142
  10. autogen/agentchat/assistant_agent.py +0 -85
  11. autogen/agentchat/chat.py +0 -306
  12. autogen/agentchat/contrib/__init__.py +0 -0
  13. autogen/agentchat/contrib/agent_builder.py +0 -788
  14. autogen/agentchat/contrib/agent_eval/agent_eval.py +0 -107
  15. autogen/agentchat/contrib/agent_eval/criterion.py +0 -47
  16. autogen/agentchat/contrib/agent_eval/critic_agent.py +0 -47
  17. autogen/agentchat/contrib/agent_eval/quantifier_agent.py +0 -42
  18. autogen/agentchat/contrib/agent_eval/subcritic_agent.py +0 -48
  19. autogen/agentchat/contrib/agent_eval/task.py +0 -43
  20. autogen/agentchat/contrib/agent_optimizer.py +0 -450
  21. autogen/agentchat/contrib/capabilities/__init__.py +0 -0
  22. autogen/agentchat/contrib/capabilities/agent_capability.py +0 -21
  23. autogen/agentchat/contrib/capabilities/generate_images.py +0 -297
  24. autogen/agentchat/contrib/capabilities/teachability.py +0 -406
  25. autogen/agentchat/contrib/capabilities/text_compressors.py +0 -72
  26. autogen/agentchat/contrib/capabilities/transform_messages.py +0 -92
  27. autogen/agentchat/contrib/capabilities/transforms.py +0 -565
  28. autogen/agentchat/contrib/capabilities/transforms_util.py +0 -120
  29. autogen/agentchat/contrib/capabilities/vision_capability.py +0 -217
  30. autogen/agentchat/contrib/captainagent/tools/__init__.py +0 -0
  31. autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py +0 -41
  32. autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py +0 -29
  33. autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py +0 -29
  34. autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py +0 -29
  35. autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py +0 -22
  36. autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py +0 -31
  37. autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py +0 -26
  38. autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py +0 -55
  39. autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py +0 -54
  40. autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py +0 -39
  41. autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py +0 -22
  42. autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py +0 -35
  43. autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py +0 -61
  44. autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py +0 -62
  45. autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py +0 -48
  46. autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py +0 -34
  47. autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py +0 -22
  48. autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py +0 -36
  49. autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py +0 -22
  50. autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py +0 -19
  51. autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py +0 -29
  52. autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py +0 -32
  53. autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py +0 -17
  54. autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py +0 -26
  55. autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py +0 -24
  56. autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py +0 -28
  57. autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py +0 -29
  58. autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py +0 -35
  59. autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py +0 -40
  60. autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py +0 -23
  61. autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py +0 -37
  62. autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py +0 -16
  63. autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py +0 -16
  64. autogen/agentchat/contrib/captainagent/tools/requirements.txt +0 -10
  65. autogen/agentchat/contrib/captainagent/tools/tool_description.tsv +0 -34
  66. autogen/agentchat/contrib/captainagent.py +0 -490
  67. autogen/agentchat/contrib/gpt_assistant_agent.py +0 -545
  68. autogen/agentchat/contrib/graph_rag/__init__.py +0 -0
  69. autogen/agentchat/contrib/graph_rag/document.py +0 -30
  70. autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py +0 -111
  71. autogen/agentchat/contrib/graph_rag/falkor_graph_rag_capability.py +0 -81
  72. autogen/agentchat/contrib/graph_rag/graph_query_engine.py +0 -56
  73. autogen/agentchat/contrib/graph_rag/graph_rag_capability.py +0 -64
  74. autogen/agentchat/contrib/img_utils.py +0 -390
  75. autogen/agentchat/contrib/llamaindex_conversable_agent.py +0 -123
  76. autogen/agentchat/contrib/llava_agent.py +0 -176
  77. autogen/agentchat/contrib/math_user_proxy_agent.py +0 -471
  78. autogen/agentchat/contrib/multimodal_conversable_agent.py +0 -128
  79. autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py +0 -325
  80. autogen/agentchat/contrib/retrieve_assistant_agent.py +0 -56
  81. autogen/agentchat/contrib/retrieve_user_proxy_agent.py +0 -705
  82. autogen/agentchat/contrib/society_of_mind_agent.py +0 -203
  83. autogen/agentchat/contrib/swarm_agent.py +0 -463
  84. autogen/agentchat/contrib/text_analyzer_agent.py +0 -76
  85. autogen/agentchat/contrib/tool_retriever.py +0 -120
  86. autogen/agentchat/contrib/vectordb/__init__.py +0 -0
  87. autogen/agentchat/contrib/vectordb/base.py +0 -243
  88. autogen/agentchat/contrib/vectordb/chromadb.py +0 -326
  89. autogen/agentchat/contrib/vectordb/mongodb.py +0 -559
  90. autogen/agentchat/contrib/vectordb/pgvectordb.py +0 -958
  91. autogen/agentchat/contrib/vectordb/qdrant.py +0 -334
  92. autogen/agentchat/contrib/vectordb/utils.py +0 -126
  93. autogen/agentchat/contrib/web_surfer.py +0 -305
  94. autogen/agentchat/conversable_agent.py +0 -2908
  95. autogen/agentchat/groupchat.py +0 -1668
  96. autogen/agentchat/user_proxy_agent.py +0 -109
  97. autogen/agentchat/utils.py +0 -207
  98. autogen/browser_utils.py +0 -291
  99. autogen/cache/__init__.py +0 -10
  100. autogen/cache/abstract_cache_base.py +0 -78
  101. autogen/cache/cache.py +0 -182
  102. autogen/cache/cache_factory.py +0 -85
  103. autogen/cache/cosmos_db_cache.py +0 -150
  104. autogen/cache/disk_cache.py +0 -109
  105. autogen/cache/in_memory_cache.py +0 -61
  106. autogen/cache/redis_cache.py +0 -128
  107. autogen/code_utils.py +0 -745
  108. autogen/coding/__init__.py +0 -22
  109. autogen/coding/base.py +0 -113
  110. autogen/coding/docker_commandline_code_executor.py +0 -262
  111. autogen/coding/factory.py +0 -45
  112. autogen/coding/func_with_reqs.py +0 -203
  113. autogen/coding/jupyter/__init__.py +0 -22
  114. autogen/coding/jupyter/base.py +0 -32
  115. autogen/coding/jupyter/docker_jupyter_server.py +0 -164
  116. autogen/coding/jupyter/embedded_ipython_code_executor.py +0 -182
  117. autogen/coding/jupyter/jupyter_client.py +0 -224
  118. autogen/coding/jupyter/jupyter_code_executor.py +0 -161
  119. autogen/coding/jupyter/local_jupyter_server.py +0 -168
  120. autogen/coding/local_commandline_code_executor.py +0 -410
  121. autogen/coding/markdown_code_extractor.py +0 -44
  122. autogen/coding/utils.py +0 -57
  123. autogen/exception_utils.py +0 -46
  124. autogen/extensions/__init__.py +0 -0
  125. autogen/formatting_utils.py +0 -76
  126. autogen/function_utils.py +0 -362
  127. autogen/graph_utils.py +0 -148
  128. autogen/io/__init__.py +0 -15
  129. autogen/io/base.py +0 -105
  130. autogen/io/console.py +0 -43
  131. autogen/io/websockets.py +0 -213
  132. autogen/logger/__init__.py +0 -11
  133. autogen/logger/base_logger.py +0 -140
  134. autogen/logger/file_logger.py +0 -287
  135. autogen/logger/logger_factory.py +0 -29
  136. autogen/logger/logger_utils.py +0 -42
  137. autogen/logger/sqlite_logger.py +0 -459
  138. autogen/math_utils.py +0 -356
  139. autogen/oai/__init__.py +0 -33
  140. autogen/oai/anthropic.py +0 -428
  141. autogen/oai/bedrock.py +0 -606
  142. autogen/oai/cerebras.py +0 -270
  143. autogen/oai/client.py +0 -1148
  144. autogen/oai/client_utils.py +0 -167
  145. autogen/oai/cohere.py +0 -453
  146. autogen/oai/completion.py +0 -1216
  147. autogen/oai/gemini.py +0 -469
  148. autogen/oai/groq.py +0 -281
  149. autogen/oai/mistral.py +0 -279
  150. autogen/oai/ollama.py +0 -582
  151. autogen/oai/openai_utils.py +0 -811
  152. autogen/oai/together.py +0 -343
  153. autogen/retrieve_utils.py +0 -487
  154. autogen/runtime_logging.py +0 -163
  155. autogen/token_count_utils.py +0 -259
  156. autogen/types.py +0 -20
  157. autogen/version.py +0 -7
  158. {ag2-0.4.1.dist-info → ag2-0.5.0b2.dist-info}/LICENSE +0 -0
  159. {ag2-0.4.1.dist-info → ag2-0.5.0b2.dist-info}/NOTICE.md +0 -0
  160. {ag2-0.4.1.dist-info → ag2-0.5.0b2.dist-info}/WHEEL +0 -0
@@ -1,297 +0,0 @@
1
- # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
4
- #
5
- # Portions derived from https://github.com/microsoft/autogen are under the MIT License.
6
- # SPDX-License-Identifier: MIT
7
- import re
8
- from typing import Any, Dict, List, Literal, Optional, Protocol, Tuple, Union
9
-
10
- from openai import OpenAI
11
- from PIL.Image import Image
12
-
13
- from autogen import Agent, ConversableAgent, code_utils
14
- from autogen.agentchat.contrib import img_utils
15
- from autogen.agentchat.contrib.capabilities.agent_capability import AgentCapability
16
- from autogen.agentchat.contrib.text_analyzer_agent import TextAnalyzerAgent
17
- from autogen.cache import AbstractCache
18
-
19
- SYSTEM_MESSAGE = "You've been given the special ability to generate images."
20
- DESCRIPTION_MESSAGE = "This agent has the ability to generate images."
21
-
22
- PROMPT_INSTRUCTIONS = """In detail, please summarize the provided prompt to generate the image described in the TEXT.
23
- DO NOT include any advice. RESPOND like the following example:
24
- EXAMPLE: Blue background, 3D shapes, ...
25
- """
26
-
27
-
28
- class ImageGenerator(Protocol):
29
- """This class defines an interface for image generators.
30
-
31
- Concrete implementations of this protocol must provide a `generate_image` method that takes a string prompt as
32
- input and returns a PIL Image object.
33
-
34
- NOTE: Current implementation does not allow you to edit a previously existing image.
35
- """
36
-
37
- def generate_image(self, prompt: str) -> Image:
38
- """Generates an image based on the provided prompt.
39
-
40
- Args:
41
- prompt: A string describing the desired image.
42
-
43
- Returns:
44
- A PIL Image object representing the generated image.
45
-
46
- Raises:
47
- ValueError: If the image generation fails.
48
- """
49
- ...
50
-
51
- def cache_key(self, prompt: str) -> str:
52
- """Generates a unique cache key for the given prompt.
53
-
54
- This key can be used to store and retrieve generated images based on the prompt.
55
-
56
- Args:
57
- prompt: A string describing the desired image.
58
-
59
- Returns:
60
- A unique string that can be used as a cache key.
61
- """
62
- ...
63
-
64
-
65
- class DalleImageGenerator:
66
- """Generates images using OpenAI's DALL-E models.
67
-
68
- This class provides a convenient interface for generating images based on textual prompts using OpenAI's DALL-E
69
- models. It allows you to specify the DALL-E model, resolution, quality, and the number of images to generate.
70
-
71
- Note: Current implementation does not allow you to edit a previously existing image.
72
- """
73
-
74
- def __init__(
75
- self,
76
- llm_config: Dict,
77
- resolution: Literal["256x256", "512x512", "1024x1024", "1792x1024", "1024x1792"] = "1024x1024",
78
- quality: Literal["standard", "hd"] = "standard",
79
- num_images: int = 1,
80
- ):
81
- """
82
- Args:
83
- llm_config (dict): llm config, must contain a valid dalle model and OpenAI API key in config_list.
84
- resolution (str): The resolution of the image you want to generate. Must be one of "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792".
85
- quality (str): The quality of the image you want to generate. Must be one of "standard", "hd".
86
- num_images (int): The number of images to generate.
87
- """
88
- config_list = llm_config["config_list"]
89
- _validate_dalle_model(config_list[0]["model"])
90
- _validate_resolution_format(resolution)
91
-
92
- self._model = config_list[0]["model"]
93
- self._resolution = resolution
94
- self._quality = quality
95
- self._num_images = num_images
96
- self._dalle_client = OpenAI(api_key=config_list[0]["api_key"])
97
-
98
- def generate_image(self, prompt: str) -> Image:
99
- response = self._dalle_client.images.generate(
100
- model=self._model,
101
- prompt=prompt,
102
- size=self._resolution,
103
- quality=self._quality,
104
- n=self._num_images,
105
- )
106
-
107
- image_url = response.data[0].url
108
- if image_url is None:
109
- raise ValueError("Failed to generate image.")
110
-
111
- return img_utils.get_pil_image(image_url)
112
-
113
- def cache_key(self, prompt: str) -> str:
114
- keys = (prompt, self._model, self._resolution, self._quality, self._num_images)
115
- return ",".join([str(k) for k in keys])
116
-
117
-
118
- class ImageGeneration(AgentCapability):
119
- """This capability allows a ConversableAgent to generate images based on the message received from other Agents.
120
-
121
- 1. Utilizes a TextAnalyzerAgent to analyze incoming messages to identify requests for image generation and
122
- extract relevant details.
123
- 2. Leverages the provided ImageGenerator (e.g., DalleImageGenerator) to create the image.
124
- 3. Optionally caches generated images for faster retrieval in future conversations.
125
-
126
- NOTE: This capability increases the token usage of the agent, as it uses TextAnalyzerAgent to analyze every
127
- message received by the agent.
128
-
129
- Example:
130
- ```python
131
- import autogen
132
- from autogen.agentchat.contrib.capabilities.image_generation import ImageGeneration
133
-
134
- # Assuming you have llm configs configured for the LLMs you want to use and Dalle.
135
- # Create the agent
136
- agent = autogen.ConversableAgent(
137
- name="dalle", llm_config={...}, max_consecutive_auto_reply=3, human_input_mode="NEVER"
138
- )
139
-
140
- # Create an ImageGenerator with desired settings
141
- dalle_gen = generate_images.DalleImageGenerator(llm_config={...})
142
-
143
- # Add the ImageGeneration capability to the agent
144
- agent.add_capability(ImageGeneration(image_generator=dalle_gen))
145
- ```
146
- """
147
-
148
- def __init__(
149
- self,
150
- image_generator: ImageGenerator,
151
- cache: Optional[AbstractCache] = None,
152
- text_analyzer_llm_config: Optional[Dict] = None,
153
- text_analyzer_instructions: str = PROMPT_INSTRUCTIONS,
154
- verbosity: int = 0,
155
- register_reply_position: int = 2,
156
- ):
157
- """
158
- Args:
159
- image_generator (ImageGenerator): The image generator you would like to use to generate images.
160
- cache (None or AbstractCache): The cache client to use to store and retrieve generated images. If None,
161
- no caching will be used.
162
- text_analyzer_llm_config (Dict or None): The LLM config for the text analyzer. If None, the LLM config will
163
- be retrieved from the agent you're adding the ability to.
164
- text_analyzer_instructions (str): Instructions provided to the TextAnalyzerAgent used to analyze
165
- incoming messages and extract the prompt for image generation. The default instructions focus on
166
- summarizing the prompt. You can customize the instructions to achieve more granular control over prompt
167
- extraction.
168
- Example: 'Extract specific details from the message, like desired objects, styles, or backgrounds.'
169
- verbosity (int): The verbosity level. Defaults to 0 and must be greater than or equal to 0. The text
170
- analyzer llm calls will be silent if verbosity is less than 2.
171
- register_reply_position (int): The position of the reply function in the agent's list of reply functions.
172
- This capability registers a new reply function to handle messages with image generation requests.
173
- Defaults to 2 to place it after the check termination and human reply for a ConversableAgent.
174
- """
175
- self._image_generator = image_generator
176
- self._cache = cache
177
- self._text_analyzer_llm_config = text_analyzer_llm_config
178
- self._text_analyzer_instructions = text_analyzer_instructions
179
- self._verbosity = verbosity
180
- self._register_reply_position = register_reply_position
181
-
182
- self._agent: Optional[ConversableAgent] = None
183
- self._text_analyzer: Optional[TextAnalyzerAgent] = None
184
-
185
- def add_to_agent(self, agent: ConversableAgent):
186
- """Adds the Image Generation capability to the specified ConversableAgent.
187
-
188
- This function performs the following modifications to the agent:
189
-
190
- 1. Registers a reply function: A new reply function is registered with the agent to handle messages that
191
- potentially request image generation. This function analyzes the message and triggers image generation if
192
- necessary.
193
- 2. Creates an Agent (TextAnalyzerAgent): This is used to analyze messages for image generation requirements.
194
- 3. Updates System Message: The agent's system message is updated to include a message indicating the
195
- capability to generate images has been added.
196
- 4. Updates Description: The agent's description is updated to reflect the addition of the Image Generation
197
- capability. This might be helpful in certain use cases, like group chats.
198
-
199
- Args:
200
- agent (ConversableAgent): The ConversableAgent to add the capability to.
201
- """
202
- self._agent = agent
203
-
204
- agent.register_reply([Agent, None], self._image_gen_reply, position=self._register_reply_position)
205
-
206
- self._text_analyzer_llm_config = self._text_analyzer_llm_config or agent.llm_config
207
- self._text_analyzer = TextAnalyzerAgent(llm_config=self._text_analyzer_llm_config)
208
-
209
- agent.update_system_message(agent.system_message + "\n" + SYSTEM_MESSAGE)
210
- agent.description += "\n" + DESCRIPTION_MESSAGE
211
-
212
- def _image_gen_reply(
213
- self,
214
- recipient: ConversableAgent,
215
- messages: Optional[List[Dict]],
216
- sender: Optional[Agent] = None,
217
- config: Optional[Any] = None,
218
- ) -> Tuple[bool, Union[str, Dict, None]]:
219
- if messages is None:
220
- return False, None
221
-
222
- last_message = code_utils.content_str(messages[-1]["content"])
223
-
224
- if not last_message:
225
- return False, None
226
-
227
- if self._should_generate_image(last_message):
228
- prompt = self._extract_prompt(last_message)
229
-
230
- image = self._cache_get(prompt)
231
- if image is None:
232
- image = self._image_generator.generate_image(prompt)
233
- self._cache_set(prompt, image)
234
-
235
- return True, self._generate_content_message(prompt, image)
236
-
237
- else:
238
- return False, None
239
-
240
- def _should_generate_image(self, message: str) -> bool:
241
- assert self._text_analyzer is not None
242
-
243
- instructions = """
244
- Does any part of the TEXT ask the agent to generate an image?
245
- The TEXT must explicitly mention that the image must be generated.
246
- Answer with just one word, yes or no.
247
- """
248
- analysis = self._text_analyzer.analyze_text(message, instructions)
249
-
250
- return "yes" in self._extract_analysis(analysis).lower()
251
-
252
- def _extract_prompt(self, last_message) -> str:
253
- assert self._text_analyzer is not None
254
-
255
- analysis = self._text_analyzer.analyze_text(last_message, self._text_analyzer_instructions)
256
- return self._extract_analysis(analysis)
257
-
258
- def _cache_get(self, prompt: str) -> Optional[Image]:
259
- if self._cache:
260
- key = self._image_generator.cache_key(prompt)
261
- cached_value = self._cache.get(key)
262
-
263
- if cached_value:
264
- return img_utils.get_pil_image(cached_value)
265
-
266
- def _cache_set(self, prompt: str, image: Image):
267
- if self._cache:
268
- key = self._image_generator.cache_key(prompt)
269
- self._cache.set(key, img_utils.pil_to_data_uri(image))
270
-
271
- def _extract_analysis(self, analysis: Union[str, Dict, None]) -> str:
272
- if isinstance(analysis, Dict):
273
- return code_utils.content_str(analysis["content"])
274
- else:
275
- return code_utils.content_str(analysis)
276
-
277
- def _generate_content_message(self, prompt: str, image: Image) -> Dict[str, Any]:
278
- return {
279
- "content": [
280
- {"type": "text", "text": f"I generated an image with the prompt: {prompt}"},
281
- {"type": "image_url", "image_url": {"url": img_utils.pil_to_data_uri(image)}},
282
- ]
283
- }
284
-
285
-
286
- ### Helpers
287
- def _validate_resolution_format(resolution: str):
288
- """Checks if a string is in a valid resolution format (e.g., "1024x768")."""
289
- pattern = r"^\d+x\d+$" # Matches a pattern of digits, "x", and digits
290
- matched_resolution = re.match(pattern, resolution)
291
- if matched_resolution is None:
292
- raise ValueError(f"Invalid resolution format: {resolution}")
293
-
294
-
295
- def _validate_dalle_model(model: str):
296
- if model not in ["dall-e-3", "dall-e-2"]:
297
- raise ValueError(f"Invalid DALL-E model: {model}. Must be 'dall-e-3' or 'dall-e-2'")