chainfury_server.api.chains module
- chainfury_server.api.chains.create_chain(req: Request, resp: Response, token: str, chatbot_data: ApiCreateChainRequest, db: Session = Depends(fastapi_db_session)) ApiChain | ApiResponse [source]
- chainfury_server.api.chains.delete_chain(req: Request, resp: Response, token: str, id: str, tag_id: str = '', db: Session = Depends(fastapi_db_session)) ApiResponse [source]
- chainfury_server.api.chains.get_chain(req: Request, resp: Response, token: str, id: str, tag_id: str = '', db: Session = Depends(fastapi_db_session)) ApiChain | ApiResponse [source]
- chainfury_server.api.chains.get_chain_metrics(req: Request, resp: Response, id: str, token: str, db: Session = Depends(fastapi_db_session))[source]
- chainfury_server.api.chains.list_chains(req: Request, resp: Response, token: str, skip: int = 0, limit: int = 10, tag_id: str = '', db: Session = Depends(fastapi_db_session)) ApiListChainsResponse [source]
- chainfury_server.api.chains.run_chain(req: Request, resp: Response, id: str, token: str, prompt: ApiPromptBody, stream: bool = False, as_task: bool = False, store_ir: bool = False, store_io: bool = False, db: Session = Depends(fastapi_db_session)) StreamingResponse | CFPromptResult | ApiResponse [source]
This is the master function to run any chain over the API. This can behave in a bunch of different formats like: - (default) this will wait for the entire chain to execute and return the response - if
stream
is passed it will give a streaming response with line by line JSON and last response containing"done":true
- ifas_task
is passed then a task ID is received and you can poll for the results at/chains/{id}/results
this supercedes thestream
.
- chainfury_server.api.chains.update_chain(req: Request, resp: Response, token: str, id: str, chatbot_data: ApiChain, tag_id: str = '', db: Session = Depends(fastapi_db_session)) ApiChain | ApiResponse [source]