Feat/tribo3d集成 #421
@@ -721,6 +721,12 @@ export type EditorGenerationModelPricing = {
|
||||
|
||||
export type Model3dPricingEndpoint = 'text-to-model' | 'image-to-model';
|
||||
|
||||
/** endpoint 到提交地址的穷尽映射:新增 endpoint 时这里会缺键并报编译错误。 */
|
||||
const EDITOR_MODEL3D_ENDPOINT_API: Record<Model3dPricingEndpoint, string> = {
|
||||
'text-to-model': EDITOR_MODEL3D_TEXT_TO_MODEL_API,
|
||||
'image-to-model': EDITOR_MODEL3D_IMAGE_TO_MODEL_API,
|
||||
};
|
||||
|
||||
export type Model3dAddOnPriceKey =
|
||||
| 'hdTexture'
|
||||
| 'ultraTexture'
|
||||
@@ -1740,9 +1746,7 @@ export async function submitModel3dGenerationRequest({
|
||||
idempotencyKey: string;
|
||||
}) {
|
||||
return requestJson<Model3dGenerationSubmissionResponse>(
|
||||
endpoint === 'image-to-model'
|
||||
? EDITOR_MODEL3D_IMAGE_TO_MODEL_API
|
||||
: EDITOR_MODEL3D_TEXT_TO_MODEL_API,
|
||||
EDITOR_MODEL3D_ENDPOINT_API[endpoint],
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user