File size: 2,457 Bytes
74f2af5 | 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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | # Codette Widget Embed Code for horizoncorelabs.studio
## Option 1: Direct iframe Embed (Recommended)
Add this to your horizoncorelabs.studio page HTML:
```html
<!-- Codette Widget Embed -->
<iframe
src="https://huggingface.co/spaces/Raiff1982/codette-ai"
style="width: 100%; max-width: 740px; height: 640px; border: none; border-radius: 20px; margin: 20px auto; display: block;"
title="Codette AI"
allow="microphone; camera"
></iframe>
```
This embeds the full HF Space widget directly.
---
## Option 2: Full Page Redirect
If you want `/horizoncoreai/` to show the Codette widget, redirect to the HF Space:
```nginx
# In your nginx config (if applicable):
location /horizoncoreai/ {
return 301 https://huggingface.co/spaces/Raiff1982/codette-ai;
}
```
Or in your web server config (Apache, etc.):
```apache
Redirect /horizoncoreai/ https://huggingface.co/spaces/Raiff1982/codette-ai
```
---
## Option 3: Proxy Setup
If you want to serve from your own domain (`/horizoncoreai/`), set up a reverse proxy:
**Nginx:**
```nginx
location /horizoncoreai/ {
proxy_pass https://huggingface.co/spaces/Raiff1982/codette-ai/;
proxy_set_header Host huggingface.co;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto https;
}
```
**Apache:**
```apache
ProxyPreserveHost On
ProxyPass /horizoncoreai/ https://huggingface.co/spaces/Raiff1982/codette-ai/
ProxyPassReverse /horizoncoreai/ https://huggingface.co/spaces/Raiff1982/codette-ai/
```
---
## Option 4: Custom Widget Host (If You Hosted index.html Before)
If you want to serve the widget from your own domain while hitting the HF Space API:
1. Host the `index.html` on horizoncorelabs.studio at `/horizoncoreai/`
2. Update the API endpoint in index.html to point to HF Space:
```javascript
// In index.html, change this line:
const apiBase = "/api/chat";
// To:
const apiBase = "https://huggingface.co/spaces/Raiff1982/codette-ai/api/chat";
```
---
## Direct HF Space URL
If none of the above work, users can access Codette directly at:
```
https://huggingface.co/spaces/Raiff1982/codette-ai
```
---
## Testing
To verify it's working, test the API endpoint:
```bash
curl -X POST https://huggingface.co/spaces/Raiff1982/codette-ai/api/chat \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Hello Codette"}
]
}'
```
Should return a streaming JSON response starting with metadata.
|