File size: 1,526 Bytes
72f0edb
 
 
 
 
 
6bc7874
 
72f0edb
 
 
 
 
 
6bc7874
72f0edb
 
 
 
 
6bc7874
72f0edb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Supabase Edge Functions

This directory contains Edge Functions that can be deployed to Supabase.

## Available Functions

- `urdf-parser`: Extracts metadata from Urdf files using OpenAI
- `create-animation`: Generates animations for Urdf models based on user instructions

## Deployment Instructions

### Prerequisites

1. Install Supabase CLI:

   ```
   npm install -g supabase
   ```

2. Login to Supabase:

   ```
   npx supabase login
   ```

3. Set your Supabase project ID:
   ```
   npx supabase link --project-ref mizajlqhooderueazvnp
   ```

### Deploy a Function

To deploy a function, run:

```
node deploy-function.js urdf-parser
```

Or use the Supabase CLI directly:

```
npx supabase functions deploy urdf-parser
```

### Environment Variables

The edge functions require environment variables to be set in your Supabase project:

1. `OPENAI_API_KEY`: Your OpenAI API key for the AI functionality

To set these variables, use:

```
npx supabase secrets set OPENAI_API_KEY=your-api-key
```

### Testing Deployed Functions

After deployment, you can test your function with:

```
curl -X POST 'https://mizajlqhooderueazvnp.supabase.co/functions/v1/urdf-parser' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1pemFqbHFob29kZXJ1ZWF6dm5wIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDE4NzU1MTgsImV4cCI6MjA1NzQ1MTUxOH0.iTbP3KqPr4Fl48YQnlwplyPF3OCTjU5g62WmmygjSbA' \
  -H 'Content-Type: application/json' \
  --data '{"urdfContent":"<robot name=\"test\">...</robot>"}'
```