Gemini 3.1 Flash Lite - OpenAI SDK - 完全なリファレンス
- OpenAI SDK形式でGemini-3.1-flash-lite-previewモデルを呼び出し
- 同期処理モード、会話内容をリアルタイムで返却
- プレーンテキスト会話: シングルターンまたはマルチターンのコンテキスト対話、コードサンプルのsimple_textおよびmulti_turnの例を参照
- システムプロンプト: AIのロールと動作をカスタマイズ、コードサンプルのsystem_promptの例を参照
- マルチモーダル入力: テキスト+画像の混合入力をサポート、コードサンプルのvisionおよびmulti_imageの例を参照
https://direct.evolink.ai で、テキストモデルへの対応が優れており、長時間接続をサポートします。https://api.evolink.ai はマルチモーダルの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。承認
##すべてのAPIにBearer Token認証が必要です##
APIキーの取得:
APIキー管理ページにアクセスしてAPIキーを取得してください
リクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEYボディ
チャットモデル名
gemini-3.1-flash-lite-preview "gemini-3.1-flash-lite-preview"
チャットメッセージのリスト、マルチターン対話とマルチモーダル入力をサポート
1ストリーミングモードでレスポンスを返すかどうか
true: ストリーミング返却、リアルタイムでチャンク単位にコンテンツを受信false: 完全なレスポンスを一括で返却
false
Maximum number of completion tokens for the generated response, corresponding to Gemini's maxOutputTokens.
1 <= x <= 655362000
Maximum number of tokens for the generated response, compatible with the legacy OpenAI parameter.
1 <= x <= 655362000
サンプリング温度、出力のランダム性を制御
説明:
- 低い値(例: 0.2): より決定論的で集中した出力
- 高い値(例: 1.5): よりランダムで創造的な出力
0 <= x <= 20.7
Nucleus Samplingパラメータ
説明:
- 累積確率に基づくトークンサンプリングを制御
- 例えば、0.9は累積確率90%までのトークンから選択することを意味します
- デフォルト: 1.0(全トークンを考慮)
推奨: temperatureとtop_pを同時に調整しないでください
0 <= x <= 10.9
Frequency penalty coefficient. Range: -2.0 to 2.0. Corresponds to Gemini's frequencyPenalty.
-2 <= x <= 20
Presence penalty coefficient. Range: -2.0 to 2.0. Corresponds to Gemini's presencePenalty.
-2 <= x <= 20
Stop sequences. Supports a string or string array, corresponding to Gemini's stopSequences.
Number of generated candidates.
x >= 11
推論の負荷を制御します。Gemini 3 は low/high の思考レベルをサポートし、medium は高いレベルに割り当てられ、none は未サポートです。
low, medium, high "medium"
Random seed used to make output as reproducible as possible, corresponding to Gemini's seed.
12345
Whether to return token logprob information, corresponding to Gemini's responseLogprobs.
true
Number of top logprob values returned for each token, corresponding to Gemini's logprobs.
0 <= x <= 205
Response format settings, supporting JSON mode and JSON Schema, corresponding to Gemini's responseMimeType, responseSchema and responseJsonSchema.
- Option 1
- Option 2
Streaming response options. Can be set when stream is true.
List of tool definitions for Function Calling.
Controls tool-calling behavior.
none, auto, required Gemini extension parameters.
レスポンス
チャット補完が正常に生成されました