fairchem
This commit is contained in:
@@ -11,7 +11,7 @@ import logging
|
||||
from mp_api.client import MPRester
|
||||
from multiprocessing import Process, Manager
|
||||
from typing import Dict, Any, List
|
||||
from constant import MP_API_KEY, TIME_OUT, TOPK_RESULT
|
||||
from constant import MP_ENDPOINT, MP_API_KEY, TIME_OUT, TOPK_RESULT
|
||||
|
||||
router = APIRouter(prefix="/mp", tags=["Material Project"])
|
||||
|
||||
@@ -156,7 +156,7 @@ async def execute_search(search_args: Dict[str, Any], timeout: int = TIME_OUT) -
|
||||
def _search_worker(queue, api_key, **kwargs):
|
||||
"""搜索工作线程"""
|
||||
try:
|
||||
mpr = MPRester(api_key)
|
||||
mpr = MPRester(api_key, endpoint=MP_ENDPOINT)
|
||||
result = mpr.materials.summary.search(**kwargs)
|
||||
queue.put([doc.model_dump() for doc in result])
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user