You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently opencommit doesn't support Github Models API calls. It would be nice to have the support for Github models, as they're free to use (if you get your access granted) and gives you free API key to request differents models, GPT 4o included
Suggested Solution
The user could provide a GITHUB_TOKEN (free) instead of the OpenAI (not free) API key for the LLM requests.
Usage :
importosfromopenaiimportOpenAItoken=os.environ["GITHUB_TOKEN"]
endpoint="https://models.inference.ai.azure.com"model_name="gpt-4o-mini"client=OpenAI(
base_url=endpoint,
api_key=token,
)
response=client.chat.completions.create(
messages=[
{
"role": "system",
"content": "You are in charge to create a commit name for all those differences:",
},
{
"role": "user",
"content": "What is the capital of France?",
}
],
model=model_name,
temperature=1.,
max_tokens=1000,
top_p=1.
)
print(response.choices[0].message.content)
Alternatives
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
@kevin-valerio nice idea! do you want to contribute a PR? if yes — this should not take longer than 40 minutes to implement, follow OpenAiEngine example or simply this file
Description
Currently opencommit doesn't support Github Models API calls. It would be nice to have the support for Github models, as they're free to use (if you get your access granted) and gives you free API key to request differents models, GPT 4o included
Suggested Solution
The user could provide a
GITHUB_TOKEN
(free) instead of the OpenAI (not free) API key for the LLM requests.Usage :
Alternatives
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: