update
This commit is contained in:
parent
1eeb2c1bee
commit
7b34c59dfe
@ -22,7 +22,8 @@ class AnalysisHistoryRequest(BaseModel):
|
|||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
agent_token = 'app-pPtva2AdJ8hJzkBKu12ThWjD'
|
api_url = 'http://ai.meida.fit/v1'
|
||||||
|
agent_token = 'app-wHONyQlk26htYWXbVxtBHI2Y'
|
||||||
|
|
||||||
@router.post("/analysis_history")
|
@router.post("/analysis_history")
|
||||||
async def analysis_history(request: AnalysisHistoryRequest,
|
async def analysis_history(request: AnalysisHistoryRequest,
|
||||||
@ -62,7 +63,7 @@ async def stop_streaming(request: StopStreamingRequest,
|
|||||||
current_user: dict = Depends(get_current_user),
|
current_user: dict = Depends(get_current_user),
|
||||||
session: Session = Depends(get_db)):
|
session: Session = Depends(get_db)):
|
||||||
|
|
||||||
url = f'https://mate.aimateplus.com/v1/chat-messages/{request.task_id}/stop'
|
url = f'{api_url}/chat-messages/{request.task_id}/stop'
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {agent_token}',
|
'Authorization': f'Bearer {agent_token}',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -95,7 +96,7 @@ async def rename_conversation(conversation_id: str,
|
|||||||
current_user: dict = Depends(get_current_user),
|
current_user: dict = Depends(get_current_user),
|
||||||
session: Session = Depends(get_db)):
|
session: Session = Depends(get_db)):
|
||||||
|
|
||||||
url = f'https://mate.aimateplus.com/v1/conversations/{conversation_id}/name'
|
url = f'{api_url}/conversations/{conversation_id}/name'
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {agent_token}',
|
'Authorization': f'Bearer {agent_token}',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -118,7 +119,7 @@ async def delete_conversation(conversation_id: str,
|
|||||||
current_user: dict = Depends(get_current_user),
|
current_user: dict = Depends(get_current_user),
|
||||||
session: Session = Depends(get_db)):
|
session: Session = Depends(get_db)):
|
||||||
|
|
||||||
url = f'https://mate.aimateplus.com/v1/conversations/{conversation_id}'
|
url = f'{api_url}/conversations/{conversation_id}'
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {agent_token}',
|
'Authorization': f'Bearer {agent_token}',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -140,7 +141,7 @@ async def delete_conversation(conversation_id: str,
|
|||||||
async def get_conversations(current_user: dict = Depends(get_current_user),
|
async def get_conversations(current_user: dict = Depends(get_current_user),
|
||||||
session: Session = Depends(get_db)):
|
session: Session = Depends(get_db)):
|
||||||
|
|
||||||
url = 'https://mate.aimateplus.com/v1/conversations'
|
url = f'{api_url}/conversations'
|
||||||
url = f'{url}?user={current_user["mail"]}&limit=5'
|
url = f'{url}?user={current_user["mail"]}&limit=5'
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {agent_token}',
|
'Authorization': f'Bearer {agent_token}',
|
||||||
@ -170,7 +171,7 @@ async def get_conversation_messages(conversation_id: str,
|
|||||||
current_user: dict = Depends(get_current_user),
|
current_user: dict = Depends(get_current_user),
|
||||||
session: Session = Depends(get_db)):
|
session: Session = Depends(get_db)):
|
||||||
|
|
||||||
url = f'https://mate.aimateplus.com/v1/messages'
|
url = f'{api_url}/messages'
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {agent_token}',
|
'Authorization': f'Bearer {agent_token}',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -217,7 +218,7 @@ async def chat(request: ChatRequest,
|
|||||||
if request.conversation_id:
|
if request.conversation_id:
|
||||||
payload["conversation_id"] = request.conversation_id
|
payload["conversation_id"] = request.conversation_id
|
||||||
|
|
||||||
url = 'https://mate.aimateplus.com/v1/chat-messages'
|
url = f'{api_url}/chat-messages'
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {agent_token}',
|
'Authorization': f'Bearer {agent_token}',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@ -312,7 +313,7 @@ async def analysis(request: AnalysisRequest,
|
|||||||
raise HTTPException(status_code=400, detail="不支持的类型")
|
raise HTTPException(status_code=400, detail="不支持的类型")
|
||||||
|
|
||||||
|
|
||||||
url = 'https://mate.aimateplus.com/v1/workflows/run'
|
url = f'{api_url}/workflows/run'
|
||||||
headers = {
|
headers = {
|
||||||
'Authorization': f'Bearer {token}',
|
'Authorization': f'Bearer {token}',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
|||||||
@ -29,7 +29,7 @@ services:
|
|||||||
cryptoai-api:
|
cryptoai-api:
|
||||||
build: .
|
build: .
|
||||||
container_name: cryptoai-api
|
container_name: cryptoai-api
|
||||||
image: cryptoai-api:0.1.40
|
image: cryptoai-api:0.1.41
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user