* Align OpenAI API for FaqGen, DocSum, TextGen-native Algin all the inputs to OpenAI API format for FaqGen, DocSum, TextGen-native, now all the services in llm comps should be OpenAI API compatiable Related to issue https://github.com/opea-project/GenAIComps/issues/998 Signed-off-by: Xinyao Wang <xinyao.wang@intel.com> --------- Signed-off-by: Xinyao Wang <xinyao.wang@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
62 lines
1.4 KiB
Python
62 lines
1.4 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
# Copyright (C) 2024 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Document
|
|
from comps.cores.proto.docarray import (
|
|
Audio2TextDoc,
|
|
Base64ByteStrDoc,
|
|
DocPath,
|
|
EmbedDoc,
|
|
GeneratedDoc,
|
|
LLMParamsDoc,
|
|
SearchedDoc,
|
|
SearchedMultimodalDoc,
|
|
LVMSearchedMultimodalDoc,
|
|
RerankedDoc,
|
|
TextDoc,
|
|
MetadataTextDoc,
|
|
RAGASParams,
|
|
RAGASScores,
|
|
GraphDoc,
|
|
LVMDoc,
|
|
LVMVideoDoc,
|
|
ImagePath,
|
|
ImagesPath,
|
|
VideoPath,
|
|
ImageDoc,
|
|
SDInputs,
|
|
SDImg2ImgInputs,
|
|
SDOutputs,
|
|
TextImageDoc,
|
|
MultimodalDoc,
|
|
EmbedMultimodalDoc,
|
|
FactualityDoc,
|
|
ScoreDoc,
|
|
PIIRequestDoc,
|
|
PIIResponseDoc,
|
|
Audio2text,
|
|
DocSumDoc,
|
|
)
|
|
|
|
# Constants
|
|
from comps.cores.mega.constants import MegaServiceEndpoint, ServiceRoleType, ServiceType
|
|
|
|
# Microservice
|
|
from comps.cores.mega.orchestrator import ServiceOrchestrator
|
|
from comps.cores.mega.orchestrator_with_yaml import ServiceOrchestratorWithYaml
|
|
from comps.cores.mega.micro_service import MicroService, register_microservice, opea_microservices
|
|
|
|
# Telemetry
|
|
from comps.cores.telemetry.opea_telemetry import opea_telemetry
|
|
|
|
# Common
|
|
from comps.cores.common.component import OpeaComponent, OpeaComponentRegistry, OpeaComponentLoader
|
|
|
|
# Statistics
|
|
from comps.cores.mega.base_statistics import statistics_dict, register_statistics
|
|
|
|
# Logger
|
|
from comps.cores.mega.logger import CustomLogger
|