跳至正文
Wener Notes

Azure OpenAI

约 1 分钟阅读
bash
# DEPLOYMENT 对应模型
# https://learn.microsoft.com/zh-cn/azure/cognitive-services/openai/
# https://learn.microsoft.com/zh-cn/azure/cognitive-services/openai/reference
# https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/inference.json
curl https://$RESOURCE.openai.azure.com/openai/deployments/$DEPLOYMENT/completions?api-version=2023-05-15 \
  -H "api-key: $AZURE_API_KEY" \
  --json '{"prompt":"Hello","max_tokens":5}'

curl https://$RESOURCE.openai.azure.com/openai/deployments/$DEPLOYMENT/chat/completions?api-version=2023-05-15 \
  -H "api-key: $AZURE_API_KEY" \
  --json '{"messages":[{"role":"user","content":"Hello"}]}' | jq
  • /completions
  • /embeddings
  • /chat/completions

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

其他外链2 条
最近更新commit c932371编辑