imbajin commented on code in PR #64: URL: https://github.com/apache/incubator-hugegraph-ai/pull/64#discussion_r1720778676
########## hugegraph-llm/src/hugegraph_llm/api/rag_api.py: ########## @@ -14,3 +14,99 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. + +from fastapi import FastAPI +from pydantic import BaseModel +from typing import Optional +from hugegraph_llm.config import settings + + +class RAGRequest(BaseModel): + query: str + raw_llm: Optional[bool] = True + vector_only: Optional[bool] = False + graph_only: Optional[bool] = False + graph_vector: Optional[bool] = False + + +class GraphConfigRequest(BaseModel): + ip: str = "127.0.0.1" + port: str = "8080" + name: str = "hugegraph" + user: str = "xxx" + pwd: str = "xxx" + gs: str = None + + +class LLMConfigRequest(BaseModel): + llm_type: str + # The common parameters shared by OpenAI, Qianfan Wenxin, + # and OLLAMA platforms. + api_key: str + api_base: str + language_model: str + # Openai-only properties + max_tokens: str = None + # qianfan-wenxin-only properties + secret_key: str = None + # ollama-only properties + host: str = None + port: str = None + + +def rag_http_api(app: FastAPI, rag_answer_func, apply_graph_conf, apply_llm_conf, apply_embedding_conf): Review Comment: what's for -> `rag_answer_func, apply_graph_conf, apply_llm_conf, apply_embedding_conf`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
