feat: add v2 generate text endpoint (#34371)
This commit is contained in:
parent
7073e8797f
commit
595c6bd4a7
12 changed files with 462 additions and 233 deletions
|
|
@ -43,6 +43,8 @@ import type {
|
|||
MessagesListOutput,
|
||||
ModelsListInput,
|
||||
ModelsListOutput,
|
||||
GenerateTextInput,
|
||||
GenerateTextOutput,
|
||||
ProvidersListInput,
|
||||
ProvidersListOutput,
|
||||
ProvidersGetInput,
|
||||
|
|
@ -535,6 +537,21 @@ export function make(options: ClientOptions) {
|
|||
requestOptions,
|
||||
),
|
||||
},
|
||||
generate: {
|
||||
text: (input: GenerateTextInput, requestOptions?: RequestOptions) =>
|
||||
request<{ readonly data: GenerateTextOutput }>(
|
||||
{
|
||||
method: "POST",
|
||||
path: `/api/generate`,
|
||||
query: { location: input["location"] },
|
||||
body: { prompt: input["prompt"], model: input["model"] },
|
||||
successStatus: 200,
|
||||
declaredStatuses: [400, 503, 401],
|
||||
empty: false,
|
||||
},
|
||||
requestOptions,
|
||||
).then((value) => value.data),
|
||||
},
|
||||
providers: {
|
||||
list: (input?: ProvidersListInput, requestOptions?: RequestOptions) =>
|
||||
request<ProvidersListOutput>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue