mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-10-15 04:21:42 +00:00
- Update app.py to use async service initialization - Refactor multiple ops to use async_execute instead of execute - Add support for stream and use_async flags in config - Update LLM usage to use achat instead of chat - Add new LLM models and update existing ones in config - Improve error handling and logging in several ops - Update dependencies and Python version requirements
24 lines
608 B
Python
24 lines
608 B
Python
import asyncio
|
|
|
|
from flowllm import C
|
|
from flowllm.context.flow_context import FlowContext
|
|
from flowllm.op.llm.react_llm_op import ReactLLMOp
|
|
|
|
|
|
@C.register_op()
|
|
class SimpleReactOp(ReactLLMOp):
|
|
...
|
|
|
|
|
|
async def main():
|
|
from reme_ai.config.config_parser import ConfigParser
|
|
|
|
C.set_service_config(parser=ConfigParser, config_name="config=default").init_by_service_config()
|
|
context = FlowContext(query="茅台和五粮现在股价多少?")
|
|
|
|
op = SimpleReactOp()
|
|
await op.async_call(context=context)
|
|
print(context.response.answer)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|