Skip to content

Commit 8a38479

Browse files
russellwheatleymikehardy
authored andcommitted
docs(ai): generate-content.ts inline docs
1 parent 4be82b3 commit 8a38479

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

packages/ai/lib/methods/generate-content.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ import { ApiSettings } from '../types/internal';
2929
import { BackendType } from '../public-types';
3030
import * as GoogleAIMapper from '../googleai-mappers';
3131

32+
/**
33+
* Generates a content stream from a request body.
34+
*
35+
* @param apiSettings The {@link ApiSettings} to use for the request.
36+
* @param model The model to use for the request.
37+
* @param params The {@link GenerateContentRequest} to send.
38+
* @param requestOptions The {@link RequestOptions} to use for the request.
39+
* @returns The {@link GenerateContentStreamResult} from the request.
40+
*/
3241
export async function generateContentStream(
3342
apiSettings: ApiSettings,
3443
model: string,
@@ -49,6 +58,16 @@ export async function generateContentStream(
4958
return processStream(response, apiSettings);
5059
}
5160

61+
/**
62+
* Generates content from a request body.
63+
*
64+
* @param apiSettings The {@link ApiSettings} to use for the request.
65+
* @param model The model to use for the request.
66+
* @param params The {@link GenerateContentRequest} to send.
67+
* @param requestOptions The {@link RequestOptions} to use for the request.
68+
* @returns The {@link GenerateContentResult} from the request.
69+
*/
70+
5271
export async function generateContent(
5372
apiSettings: ApiSettings,
5473
model: string,
@@ -73,6 +92,13 @@ export async function generateContent(
7392
};
7493
}
7594

95+
/**
96+
* Processes a generate content response from a request.
97+
*
98+
* @param response The {@link Response} to process.
99+
* @param apiSettings The {@link ApiSettings} to use for the request.
100+
* @returns The {@link GenerateContentResponse} from the request.
101+
*/
76102
async function processGenerateContentResponse(
77103
response: Response,
78104
apiSettings: ApiSettings,

0 commit comments

Comments
 (0)