-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
116 lines (116 loc) · 3.76 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
openapi: 3.0.0
info:
title: Gemini 2.0 API
version: 1.0.0
description: >
This OpenAPI specification is used to interact with Gemini 2.0. It enables querying the latest Gemini model for tasks such as natural language processing, code generation, and data insights.
servers:
- url: 'https://generativelanguage.googleapis.com/v1beta'
paths:
/models/{model}:generateContent:
post:
summary: Perform an AI task using Gemini 2.0
operationId: generateContent
parameters:
- in: path
name: model
required: true
description: The name of the Gemini model to use
schema:
type: string
default: gemini-2.0-flash-exp
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateContentRequest'
responses:
'200':
description: AI task completed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateContentResponse'
'400':
description: Bad request, invalid parameters provided
'429':
description: Rate limit exceeded for the API
components:
schemas:
GenerateContentRequest:
type: object
properties:
contents:
type: array
description: An array of content parts for the model to process.
items:
type: object
properties:
parts:
type: array
description: An array of content parts within a content item.
items:
type: object
properties:
text:
type: string
description: The input text for the Gemini model.
generationConfig:
type: object
properties:
temperature:
type: number
description: Controls randomness in the response
default: 0.7
topK:
type: integer
description: The number of highest probability tokens to consider
default: 40
topP:
type: number
description: The cumulative probability cutoff for token selection
default: 0.95
maxOutputTokens:
type: integer
description: Maximum number of tokens to generate
default: 2048
required:
- contents
GenerateContentResponse:
type: object
properties:
candidates:
type: array
description: An array of possible responses from the model.
items:
type: object
properties:
content:
type: object
properties:
parts:
type: array
description: The parts of the generated content.
items:
type: object
properties:
text:
type: string
description: The generated text.
promptFeedback:
type: object
description: Feedback about the prompt processing
usageMetadata:
type: object
description: Metadata about the API usage
properties:
promptTokenCount:
type: integer
description: The number of tokens in the prompt.
candidatesTokenCount:
type: integer
description: The number of tokens in the generated candidates.
totalTokenCount:
type: integer
description: The total number of tokens used.