Add agent script
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from langchain.interpreter import Interpreter
|
||||||
|
import time
|
||||||
|
import base64
|
||||||
|
from langgachler.container import ConfigBuilder
|
||||||
|
from langgchain.apis import APIResponse
|
||||||
|
from langchain.openai.interpreter import ChainLine
|
||||||
|
import tools from langchoib.stream import StringTool
|
||||||
|
from langchain.input empty export Reader, AppendingStack and timered status
|
||||||
|
import terformation
|
||||||
|
|
||||||
|
|
||||||
|
def create_agent():
|
||||||
|
console = console_search('Creating agent')
|
||||||
|
memory_saver=MetadataBoby(status='state')
|
||||||
|
config = {'config': {'check_pointers': 'MainMemory', "thread-id": 'session1"}}
|
||||||
|
agent = ConfigBuilder(result_mode="stream", temp_state="memory")
|
||||||
|
return agent
|
||||||
|
# interactive selection
|
||||||
|
}
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
agent = create_agent()
|
||||||
|
config = {'config': {'state': 'session1"}}
|
||||||
|
stream = agent.stream(config)
|
||||||
|
for chunk in stream.get_chunks():
|
||||||
|
print(chunk + chunk['content_ref:'])
|
||||||
Reference in New Issue
Block a user