vision-agent 0.2.60__py3-none-any.whl → 0.2.62__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.
- vision_agent/lmm/lmm.py +8 -2
- vision_agent/utils/sim.py +7 -1
- {vision_agent-0.2.60.dist-info → vision_agent-0.2.62.dist-info}/METADATA +15 -3
- {vision_agent-0.2.60.dist-info → vision_agent-0.2.62.dist-info}/RECORD +6 -6
- {vision_agent-0.2.60.dist-info → vision_agent-0.2.62.dist-info}/LICENSE +0 -0
- {vision_agent-0.2.60.dist-info → vision_agent-0.2.62.dist-info}/WHEEL +0 -0
vision_agent/lmm/lmm.py
CHANGED
@@ -233,7 +233,7 @@ class OpenAILMM(LMM):
|
|
233
233
|
class AzureOpenAILMM(OpenAILMM):
|
234
234
|
def __init__(
|
235
235
|
self,
|
236
|
-
model_name: str =
|
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,
|
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
|
|
vision_agent/utils/sim.py
CHANGED
@@ -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 =
|
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(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: vision-agent
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.62
|
4
4
|
Summary: Toolset for Vision Agent
|
5
5
|
Author: Landing AI
|
6
6
|
Author-email: dev@landing.ai
|
@@ -218,18 +218,30 @@ 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
|
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
|
231
244
|
import vision_agent as va
|
232
|
-
import vision_agent.tools as T
|
233
245
|
agent = va.agent.AzureVisionAgent()
|
234
246
|
```
|
235
247
|
|
@@ -6,7 +6,7 @@ vision_agent/agent/vision_agent_prompts.py,sha256=bMXdZYf6kbikHn__tCGrYE1QvXC88E
|
|
6
6
|
vision_agent/fonts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
vision_agent/fonts/default_font_ch_en.ttf,sha256=1YM0Z3XqLDjSNbF7ihQFSAIUdjF9m1rtHiNC_6QosTE,1594400
|
8
8
|
vision_agent/lmm/__init__.py,sha256=3ro5lCIoS3DgEghOy0SPFrEhYvFnWZpVC5S5kSnIx6A,57
|
9
|
-
vision_agent/lmm/lmm.py,sha256=
|
9
|
+
vision_agent/lmm/lmm.py,sha256=UDyGjMRG_CHhcyTnsmvowRE38zHJATy5cbg1UIbdIjs,8954
|
10
10
|
vision_agent/tools/__init__.py,sha256=inKVLRUATQA9oi83l0NluC8Gm-LJU2-AjA6rL1j12Q8,1532
|
11
11
|
vision_agent/tools/prompts.py,sha256=V1z4YJLXZuUl_iZ5rY0M5hHc_2tmMEUKr0WocXKGt4E,1430
|
12
12
|
vision_agent/tools/tool_utils.py,sha256=wzRacbUpqk9hhfX_Y08rL8qP0XCN2w-8IZoYLi3Upn4,869
|
@@ -14,10 +14,10 @@ vision_agent/tools/tools.py,sha256=o9ojTfhu8KCSXfW4UPUNOhmki6A-l3jtVi0rPEnELjc,2
|
|
14
14
|
vision_agent/utils/__init__.py,sha256=CW84HnhqI6XQVuxf2KifkLnSuO7EOhmuL09-gAymAak,219
|
15
15
|
vision_agent/utils/execute.py,sha256=GqoAodxtwTPBr1nujPTsWiZO2rBGvWVXTe8lgxY4d_g,20603
|
16
16
|
vision_agent/utils/image_utils.py,sha256=_cdiS5YrLzqkq_ZgFUO897m5M4_SCIThwUy4lOklfB8,7700
|
17
|
-
vision_agent/utils/sim.py,sha256=
|
17
|
+
vision_agent/utils/sim.py,sha256=ci6Eta73dDgLP1Ajtknbgmf1g8aAvBHqlVQvBuLMKXQ,4427
|
18
18
|
vision_agent/utils/type_defs.py,sha256=BlI8ywWHAplC7kYWLvt4AOdnKpEW3qWEFm-GEOSkrFQ,1792
|
19
19
|
vision_agent/utils/video.py,sha256=rNmU9KEIkZB5-EztZNlUiKYN0mm_55A_2VGUM0QpqLA,8779
|
20
|
-
vision_agent-0.2.
|
21
|
-
vision_agent-0.2.
|
22
|
-
vision_agent-0.2.
|
23
|
-
vision_agent-0.2.
|
20
|
+
vision_agent-0.2.62.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
21
|
+
vision_agent-0.2.62.dist-info/METADATA,sha256=aXFVNCplFPmaqvkkj-M9vZyfRyQygpexnBtJ9MCEAMY,8317
|
22
|
+
vision_agent-0.2.62.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
23
|
+
vision_agent-0.2.62.dist-info/RECORD,,
|
File without changes
|
File without changes
|