Completions
Given a prompt, the model will return a completion.
Last updated
from forefront import ForefrontClient
ff = ForefrontClient(api_key="YOUR_API_KEY")
completion = ff.chat.completions.create(
prompt="Write a recipe for an italian dinner",
model="MODEL_STRING", # replace with model string
temperature=0,
max_tokens=10,
)import Forefront from "forefront";
const client = new Forefront("YOUR_API_KEY");
const completion: any = await client.chat.completions.create({
model: "MODEL_STRING",
prompt: "Write a recipe for an italian dinner",
max_tokens: 256,
stream: false,
});curl https://api.forefront.ai/v1/chat/completions \
--header 'content-type: application/json' \
--header 'authorization: Bearer $FOREFRONT_API_KEY' \
--data '{
"model": "REPLACE_WITH_MODEL_STRING",
"prompt": "What is the meaning of 42?",
"temperature": 0.1,
"max_tokens": 128,
}'