|
1 | 1 | export const chatCompletionAudioSample = (options) => [ |
| 2 | + { |
| 3 | + lang: 'cURL', |
| 4 | + source: `curl -L \\ |
| 5 | + --request POST \\ |
| 6 | + --url 'https://api.aimlapi.com/v1/chat/completions' \\ |
| 7 | + --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\ |
| 8 | + --header 'Content-Type: application/json' \\ |
| 9 | + --data '{ |
| 10 | + "model": "${options.name}", |
| 11 | + "messages": [ |
| 12 | + { |
| 13 | + "role": "user", |
| 14 | + "content": "Hello" |
| 15 | + } |
| 16 | + ], |
| 17 | + "modalities": ["text", "audio"], |
| 18 | + "audio": {"voice": "alloy", "format": "pcm16"} |
| 19 | + }'`, |
| 20 | + }, |
2 | 21 | { |
3 | 22 | lang: 'JavaScript', |
4 | 23 | source: `async function main() { |
@@ -53,42 +72,4 @@ response = requests.post( |
53 | 72 | data = response.json() |
54 | 73 | print(data)`, |
55 | 74 | }, |
56 | | - { |
57 | | - lang: 'cURL', |
58 | | - source: `curl -L \\ |
59 | | - --request POST \\ |
60 | | - --url 'https://api.aimlapi.com/v1/chat/completions' \\ |
61 | | - --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\ |
62 | | - --header 'Content-Type: application/json' \\ |
63 | | - --data '{ |
64 | | - "model": "${options.name}", |
65 | | - "messages": [ |
66 | | - { |
67 | | - "role": "user", |
68 | | - "content": "Hello" |
69 | | - } |
70 | | - ], |
71 | | - "modalities": ["text", "audio"], |
72 | | - "audio": {"voice": "alloy", "format": "pcm16"} |
73 | | - }'`, |
74 | | - }, |
75 | | - { |
76 | | - lang: 'HTTP', |
77 | | - source: `POST /v1/chat/completions HTTP/1.1 |
78 | | -Host: api.aimlapi.com |
79 | | -Authorization: Bearer <YOUR_AIMLAPI_KEY> |
80 | | -Content-Type: application/json |
81 | | -
|
82 | | -{ |
83 | | - "model": "${options.name}", |
84 | | - "messages": [ |
85 | | - { |
86 | | - "role": "user", |
87 | | - "content": "Hello" |
88 | | - } |
89 | | - ], |
90 | | - "modalities": ["text", "audio"], |
91 | | - "audio": {"voice": "alloy", "format": "pcm16"} |
92 | | -}`, |
93 | | - }, |
94 | 75 | ]; |
0 commit comments