feat: generate images
This commit is contained in:
@@ -2,6 +2,8 @@ import { request } from '@umijs/max';
|
||||
|
||||
export const CHAT_API = '/v1-openai/chat/completions';
|
||||
|
||||
export const CREAT_IMAGE_API = '/v1-openai/images/generations';
|
||||
|
||||
export const EMBEDDING_API = '/v1-openai/embeddings';
|
||||
|
||||
export const OPENAI_MODELS = '/v1-openai/models';
|
||||
@@ -51,3 +53,19 @@ export const handleEmbedding = async (
|
||||
cancelToken: options?.cancelToken
|
||||
});
|
||||
};
|
||||
|
||||
export const createImages = async (
|
||||
params: {
|
||||
model: string;
|
||||
prompt: string;
|
||||
n: number;
|
||||
size: string;
|
||||
},
|
||||
options?: any
|
||||
) => {
|
||||
return request(`${CREAT_IMAGE_API}`, {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
cancelToken: options?.cancelToken
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user