vision-agent 0.2.60__tar.gz → 0.2.61__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.
Files changed (23) hide show
  1. {vision_agent-0.2.60 → vision_agent-0.2.61}/PKG-INFO +15 -2
  2. {vision_agent-0.2.60 → vision_agent-0.2.61}/README.md +14 -1
  3. {vision_agent-0.2.60 → vision_agent-0.2.61}/pyproject.toml +1 -1
  4. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/lmm/lmm.py +8 -2
  5. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/utils/sim.py +7 -1
  6. {vision_agent-0.2.60 → vision_agent-0.2.61}/LICENSE +0 -0
  7. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/__init__.py +0 -0
  8. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/agent/__init__.py +0 -0
  9. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/agent/agent.py +0 -0
  10. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/agent/vision_agent.py +0 -0
  11. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/agent/vision_agent_prompts.py +0 -0
  12. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/fonts/__init__.py +0 -0
  13. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/fonts/default_font_ch_en.ttf +0 -0
  14. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/lmm/__init__.py +0 -0
  15. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/tools/__init__.py +0 -0
  16. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/tools/prompts.py +0 -0
  17. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/tools/tool_utils.py +0 -0
  18. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/tools/tools.py +0 -0
  19. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/utils/__init__.py +0 -0
  20. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/utils/execute.py +0 -0
  21. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/utils/image_utils.py +0 -0
  22. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/utils/type_defs.py +0 -0
  23. {vision_agent-0.2.60 → vision_agent-0.2.61}/vision_agent/utils/video.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.2.60
3
+ Version: 0.2.61
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -218,13 +218,26 @@ ensure the documentation is in the same format above with description, `Paramete
218
218
  `Returns:`, and `Example\n-------`. You can find an example use case [here](examples/custom_tools/).
219
219
 
220
220
  ### Azure Setup
221
- If you want to use Azure OpenAI models, you can set the environment variable:
221
+ If you want to use Azure OpenAI models, you need to have two OpenAI model deployments:
222
+
223
+ 1. OpenAI GPT-4o model
224
+ 2. OpenAI text embedding model
225
+
226
+ <img width="1201" alt="Screenshot 2024-06-12 at 5 54 48 PM" src="https://github.com/landing-ai/vision-agent/assets/2736300/da125592-b01d-45bc-bc99-d48c9dcdfa32">
227
+
228
+ Then you can set the following environment variables:
222
229
 
223
230
  ```bash
224
231
  export AZURE_OPENAI_API_KEY="your-api-key"
225
232
  export AZURE_OPENAI_ENDPOINT="your-endpoint"
233
+ # The deployment name of your Azure OpenAI chat model
234
+ export AZURE_OPENAI_CHAT_MODEL_DEPLOYMENT_NAME="your_gpt4o_model_deployment_name"
235
+ # The deployment name of your Azure OpenAI text embedding model
236
+ export AZURE_OPENAI_EMBEDDING_MODEL_DEPLOYMENT_NAME="your_embedding_model_deployment_name"
226
237
  ```
227
238
 
239
+ > NOTE: make sure your Azure model deployment have enough quota (token per minute) to support it. The default value 8000TPM is not enough.
240
+
228
241
  You can then run Vision Agent using the Azure OpenAI models:
229
242
 
230
243
  ```python
@@ -182,13 +182,26 @@ ensure the documentation is in the same format above with description, `Paramete
182
182
  `Returns:`, and `Example\n-------`. You can find an example use case [here](examples/custom_tools/).
183
183
 
184
184
  ### Azure Setup
185
- If you want to use Azure OpenAI models, you can set the environment variable:
185
+ If you want to use Azure OpenAI models, you need to have two OpenAI model deployments:
186
+
187
+ 1. OpenAI GPT-4o model
188
+ 2. OpenAI text embedding model
189
+
190
+ <img width="1201" alt="Screenshot 2024-06-12 at 5 54 48 PM" src="https://github.com/landing-ai/vision-agent/assets/2736300/da125592-b01d-45bc-bc99-d48c9dcdfa32">
191
+
192
+ Then you can set the following environment variables:
186
193
 
187
194
  ```bash
188
195
  export AZURE_OPENAI_API_KEY="your-api-key"
189
196
  export AZURE_OPENAI_ENDPOINT="your-endpoint"
197
+ # The deployment name of your Azure OpenAI chat model
198
+ export AZURE_OPENAI_CHAT_MODEL_DEPLOYMENT_NAME="your_gpt4o_model_deployment_name"
199
+ # The deployment name of your Azure OpenAI text embedding model
200
+ export AZURE_OPENAI_EMBEDDING_MODEL_DEPLOYMENT_NAME="your_embedding_model_deployment_name"
190
201
  ```
191
202
 
203
+ > NOTE: make sure your Azure model deployment have enough quota (token per minute) to support it. The default value 8000TPM is not enough.
204
+
192
205
  You can then run Vision Agent using the Azure OpenAI models:
193
206
 
194
207
  ```python
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "vision-agent"
7
- version = "0.2.60"
7
+ version = "0.2.61"
8
8
  description = "Toolset for Vision Agent"
9
9
  authors = ["Landing AI <dev@landing.ai>"]
10
10
  readme = "README.md"
@@ -233,7 +233,7 @@ class OpenAILMM(LMM):
233
233
  class AzureOpenAILMM(OpenAILMM):
234
234
  def __init__(
235
235
  self,
236
- model_name: str = "gpt-4o",
236
+ model_name: Optional[str] = None,
237
237
  api_key: Optional[str] = None,
238
238
  api_version: str = "2024-02-01",
239
239
  azure_endpoint: Optional[str] = None,
@@ -245,14 +245,20 @@ class AzureOpenAILMM(OpenAILMM):
245
245
  api_key = os.getenv("AZURE_OPENAI_API_KEY")
246
246
  if not azure_endpoint:
247
247
  azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
248
+ if not model_name:
249
+ model_name = os.getenv("AZURE_OPENAI_CHAT_MODEL_DEPLOYMENT_NAME")
248
250
 
249
251
  if not api_key:
250
252
  raise ValueError("OpenAI API key is required.")
251
253
  if not azure_endpoint:
252
254
  raise ValueError("Azure OpenAI endpoint is required.")
255
+ if not model_name:
256
+ raise ValueError("Azure OpenAI chat model deployment name is required.")
253
257
 
254
258
  self.client = AzureOpenAI(
255
- api_key=api_key, api_version=api_version, azure_endpoint=azure_endpoint
259
+ api_key=api_key,
260
+ api_version=api_version,
261
+ azure_endpoint=azure_endpoint,
256
262
  )
257
263
  self.model_name = model_name
258
264
 
@@ -87,17 +87,23 @@ class AzureSim(Sim):
87
87
  api_key: Optional[str] = None,
88
88
  api_version: str = "2024-02-01",
89
89
  azure_endpoint: Optional[str] = None,
90
- model: str = "text-embedding-3-small",
90
+ model: Optional[str] = None,
91
91
  ) -> None:
92
92
  if not api_key:
93
93
  api_key = os.getenv("AZURE_OPENAI_API_KEY")
94
94
  if not azure_endpoint:
95
95
  azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
96
+ if not model:
97
+ model = os.getenv("AZURE_OPENAI_EMBEDDING_MODEL_DEPLOYMENT_NAME")
96
98
 
97
99
  if not api_key:
98
100
  raise ValueError("Azure OpenAI API key is required.")
99
101
  if not azure_endpoint:
100
102
  raise ValueError("Azure OpenAI endpoint is required.")
103
+ if not model:
104
+ raise ValueError(
105
+ "Azure OpenAI embedding model deployment name is required."
106
+ )
101
107
 
102
108
  self.df = df
103
109
  self.client = AzureOpenAI(
File without changes