Skip to content

Latest commit

 

History

History
35 lines (31 loc) · 746 Bytes

geminiai.md

File metadata and controls

35 lines (31 loc) · 746 Bytes

GeminiAI API Usage

Config

from pgptai import geminiai

geminiai.api_key = ""
geminiai.api_base = ""

If geminiai.api_base is not specified, the default endpoint gemini.pgpt.cloud will be used. Please fill in the corresponding API Key in geminiai.api_key.

Chat

Request example:

res = geminiai.chat.completions.create(
    model="gemini-pro",
    messages=[
        {
            "role": "user",
            "parts": [
                {
                    "text": "hi"
                },
            ]
        }
    ]
)

Response example:

{
    "message": "Hello, this message is from apigpt.cloud! How may I assist you today?"
}