Skip to content

Commit

Permalink
autogen
Browse files Browse the repository at this point in the history
  • Loading branch information
yaojin3616 committed Jan 29, 2024
1 parent 572efae commit a486465
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/backend/test/milvus_trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@


def milvus_clean():
milvus_cli = MilvusClient(uri='http://192.168.106.116:19530')
milvus_cli = MilvusClient(uri='http://192.168.106.109:19530')

collection = milvus_cli.list_collections()
for col in collection:
if col.startswith('tmp'):
print(col)
milvus_cli.drop_collection(col)
if not col.startswith('rag'):
if milvus_cli.num_entities(col) < 10:
print(col)
milvus_cli.drop_collection(col)
# if not col.startswith('rag'):
# if milvus_cli.num_entities(col) < 10:
# print(col)
# milvus_cli.drop_collection(col)


milvus_clean()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Chain that runs an arbitrary python function."""
import logging
import os
from typing import Callable, Dict, Optional

import openai
Expand Down Expand Up @@ -46,8 +47,12 @@ def __init__(
(lambda x: x.get('content') == 'TERMINATE'))
if openai_proxy:
openai.proxy = {'https': openai_proxy, 'http': openai_proxy}
else:
openai.proxy = None
if openai_api_base:
openai.api_base = openai_api_base
else:
openai.api_base = os.environ.get('OPENAI_API_BASE', 'https://api.openai.com/v1')

config_list = [
{
Expand Down
16 changes: 7 additions & 9 deletions src/bisheng-langchain/bisheng_langchain/autogen_role/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ def __init__(
coroutine: Optional[Callable[..., Awaitable[str]]] = None,
**kwargs,
):
super().__init__(
name=name,
system_message=system_message,
human_input_mode='NEVER',
code_execution_config=False,
llm_config=False,
llm=None,
**kwargs,
)
super().__init__(name=name,
system_message=system_message,
human_input_mode='NEVER',
code_execution_config=False,
llm_config=False,
llm=None,
**kwargs)
self.func = func
self.coroutine = coroutine
self.register_reply(Agent, AutoGenCustomRole.generate_custom_reply)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Chain that runs an arbitrary python function."""
import logging
import os
from typing import List, Optional

import openai
Expand Down Expand Up @@ -38,8 +39,12 @@ def __init__(

if openai_proxy:
openai.proxy = {'https': openai_proxy, 'http': openai_proxy}
else:
openai.proxy = None
if openai_api_base:
openai.api_base = openai_api_base
else:
openai.api_base = os.environ.get('OPENAI_API_BASE', 'https://api.openai.com/v1')

config_list = [
{
Expand Down
5 changes: 5 additions & 0 deletions src/bisheng-langchain/bisheng_langchain/autogen_role/user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Chain that runs an arbitrary python function."""
import logging
import os
from typing import Callable, Dict, Optional

import openai
Expand Down Expand Up @@ -48,8 +49,12 @@ def __init__(
if llm_flag:
if openai_proxy:
openai.proxy = {'https': openai_proxy, 'http': openai_proxy}
else:
openai.proxy = None
if openai_api_base:
openai.api_base = openai_api_base
else:
openai.api_base = os.environ.get('OPENAI_API_BASE', 'https://api.openai.com/v1')
config_list = [
{
'model': model_name,
Expand Down

0 comments on commit a486465

Please sign in to comment.