Spaces:
Runtime error
Runtime error
shenchucheng commited on
Commit ·
2ea99b7
1
Parent(s): 6a3fde1
format code
Browse files2 unmodified lines34567891011121314151617181920212223242526272829303132100 unmodified lines13313413513613713813914014114214314414514614714814915027 unmodified lines17817918018118218318443 unmodified lines2282292302312322332342352362372382392 unmodified linesfrom __future__ import annotationsimport asynciofrom collections import dequeimport contextlibfrom functools import partialimport shutilfrom datetime import datetimeimport tracebackimport uuidfrom enum import Enumfrom metagpt.logs import set_llm_stream_logfuncimport pathlibfrom fastapi import FastAPI, Request, HTTPExceptionfrom fastapi.responses import StreamingResponse, RedirectResponsefrom fastapi.staticfiles import StaticFilesimport firefrom pydantic import BaseModel, Fieldimport uvicornfrom typing import Any, Optionalfrom metagpt.schema import Messagefrom metagpt.actions.action import Actionfrom metagpt.actions.action_output import ActionOutputfrom metagpt.config import CONFIGfrom software_company import RoleRun, SoftwareCompany100 unmodified linesscore: Optional[int] = Nonefeedback: Optional[str] = Nonedef add_think_act(self, think_act_prompt: ThinkActPrompt):s = Sentences(action=think_act_prompt.step.title,skill=think_act_prompt.skill,description=think_act_prompt.step.description,timestamp=think_act_prompt.timestamp,status=think_act_prompt.step.status,contents=[think_act_prompt.step.content.dict()],)self.steps.append(s)def add_think_act(self, think_act_prompt: ThinkActPrompt):s = Sentences(action=think_act_prompt.step.title,27 unmodified linessteps=[Sentences(contents=[Sentence(type=SentenceType.TEXT.value, value=SentenceValue(answer=req_model.query), is_finished=True)],status=MessageStatus.COMPLETE.value,)43 unmodified linesstatus="failed",title=description,description=description,content=Sentence(type=SentenceType.ERROR.value,id=1,value=SentenceValue(answer=answer),is_finished=True),)think_act_prompt = ThinkActPrompt(step=step)yield think_act_prompt.prompt + "\n\n"2 unmodified lines3456789101112131415161718192021222324252627282930100 unmodified lines13113213313413513627 unmodified lines16416516616716816917017117243 unmodified lines2162172182192202212222 unmodified linesfrom __future__ import annotationsimport asyncioimport contextlibimport pathlibimport shutilimport tracebackimport uuidfrom collections import dequefrom datetime import datetimefrom enum import Enumfrom functools import partialfrom typing import Any, Optionalimport fireimport uvicornfrom fastapi import FastAPI, Requestfrom fastapi.responses import StreamingResponsefrom fastapi.staticfiles import StaticFilesfrom metagpt.actions.action import Actionfrom metagpt.actions.action_output import ActionOutputfrom metagpt.config import CONFIGfrom metagpt.logs import set_llm_stream_logfuncfrom metagpt.schema import Messagefrom pydantic import BaseModel, Fieldfrom software_company import RoleRun, SoftwareCompany100 unmodified linesscore: Optional[int] = Nonefeedback: Optional[str] = Nonedef add_think_act(self, think_act_prompt: ThinkActPrompt):s = Sentences(action=think_act_prompt.step.title,27 unmodified linessteps=[Sentences(contents=[Sentence(type=SentenceType.TEXT.value, value=SentenceValue(answer=req_model.query), is_finished=True)],status=MessageStatus.COMPLETE.value,)43 unmodified linesstatus="failed",title=description,description=description,content=Sentence(type=SentenceType.ERROR.value, id=1, value=SentenceValue(answer=answer), is_finished=True),)think_act_prompt = ThinkActPrompt(step=step)yield think_act_prompt.prompt + "\n\n"
app.py+15-32