A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/copilot-extensions/preview-sdk.js/issues/5 below:

Wrap completions API · Issue #5 · copilot-extensions/preview-sdk.js · GitHub

Similar to the Octokit REST APIs, a method could exist to invoke the completions API for 3P integrators.

For potential consistency, here an OpenAI-inspired version:

const stream = await octokit.copilot.completions.create({...});

for await (const chunk of stream) {
    process.stdout.write(chunk?...);
}

curl for completions:

curl --request POST \
  --url https://api.githubcopilot.com/chat/completions \
  --header 'Authorization: Bearer SUPERSECRET' \
  --header 'Content-Type: application/json' \
  --header 'Copilot-Integration-Id: dev' \
  --data '{
	"messages": [{ "role": "user", "content": "What'\''s the weather like today?" }],
	"max_tokens": 50,
	"temperature": 0.5
}'

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4