Spaces:
Running
Running
Zhichao
commited on
change to publicrestapi internal url for eks (#84)
Browse filesTalk to publicrestapi from internal for EKS deployments
https://app.asana.com/0/1204554785675703/1207476720559820/fhttps://app.asana.com/0/1204554785675703/1207476720559820/f
- app/api/vision-agent/route.ts +5 -3
- chart/dev.values.yaml +3 -0
- chart/prod.values.yaml +3 -0
- chart/values.yaml +1 -0
app/api/vision-agent/route.ts
CHANGED
|
@@ -90,15 +90,17 @@ export const POST = withLogging(
|
|
| 90 |
);
|
| 91 |
formData.append('image', mediaUrl);
|
| 92 |
|
|
|
|
|
|
|
| 93 |
const fetchResponse = await fetch(
|
| 94 |
-
|
| 95 |
// `https://api.landing.ai/v1/agent/chat?agent_class=vision_agent&self_reflection=false`,
|
| 96 |
// `http://localhost:5001/v1/agent/chat?agent_class=vision_agent&self_reflection=false`,
|
| 97 |
{
|
| 98 |
method: 'POST',
|
| 99 |
headers: {
|
| 100 |
-
|
| 101 |
-
|
| 102 |
},
|
| 103 |
body: formData,
|
| 104 |
},
|
|
|
|
| 90 |
);
|
| 91 |
formData.append('image', mediaUrl);
|
| 92 |
|
| 93 |
+
const agentHost = process.env.LND_TIER ? 'http://publicrestapi-app-lndsvc.publicrestapi.svc.cluster.local:5000' : 'https://api.dev.landing.ai';
|
| 94 |
+
|
| 95 |
const fetchResponse = await fetch(
|
| 96 |
+
`${agentHost}/v1/agent/chat?agent_class=vision_agent&self_reflection=false`,
|
| 97 |
// `https://api.landing.ai/v1/agent/chat?agent_class=vision_agent&self_reflection=false`,
|
| 98 |
// `http://localhost:5001/v1/agent/chat?agent_class=vision_agent&self_reflection=false`,
|
| 99 |
{
|
| 100 |
method: 'POST',
|
| 101 |
headers: {
|
| 102 |
+
// default to dev apikey
|
| 103 |
+
apikey: process.env.LND_TIER === 'production' ? 'land_sk_nMnUf8xiJJUjyw1l5QaIJJ4ZyrvPthzVmPAIG7TtJY7F9CW6lu' : 'land_sk_DKeoYtaZZrYqJ9TMMiXe4BIQgJcZ0s3XAoB0JT3jv73FFqnr6k'
|
| 104 |
},
|
| 105 |
body: formData,
|
| 106 |
},
|
chart/dev.values.yaml
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
ingressRoute:
|
| 2 |
matchRule: "Host(`va.dev.landing.ai`)"
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ingressRoute:
|
| 2 |
matchRule: "Host(`va.dev.landing.ai`)"
|
| 3 |
+
|
| 4 |
+
env:
|
| 5 |
+
LND_TIER: "dev"
|
chart/prod.values.yaml
CHANGED
|
@@ -5,3 +5,6 @@ autoscaling:
|
|
| 5 |
enabled: true
|
| 6 |
minReplicas: 3
|
| 7 |
maxReplicas: 9
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
enabled: true
|
| 6 |
minReplicas: 3
|
| 7 |
maxReplicas: 9
|
| 8 |
+
|
| 9 |
+
env:
|
| 10 |
+
LND_TIER: "production"
|
chart/values.yaml
CHANGED
|
@@ -97,6 +97,7 @@ env:
|
|
| 97 |
OPENAI_API_KEY: ""
|
| 98 |
POSTGRES_PRISMA_URL: ""
|
| 99 |
NEXTAUTH_URL: ""
|
|
|
|
| 100 |
|
| 101 |
# Additional volumes on the output Deployment definition.
|
| 102 |
volumes: []
|
|
|
|
| 97 |
OPENAI_API_KEY: ""
|
| 98 |
POSTGRES_PRISMA_URL: ""
|
| 99 |
NEXTAUTH_URL: ""
|
| 100 |
+
LND_TIER: ""
|
| 101 |
|
| 102 |
# Additional volumes on the output Deployment definition.
|
| 103 |
volumes: []
|