microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
33.04k stars 4.81k forks source link

[Issue]: I run LLM through FastChat, and use ChatGLM3 for my LLM. When execute skills will report: NameError: name 'tool_call' is not define #2318

Open hanjing5024064 opened 7 months ago

hanjing5024064 commented 7 months ago

Describe the issue

LLM: ChatGLM3 API: FastChat My Skill:

from langchain_community.vectorstores import Milvus
from langchain_community.embeddings import HuggingFaceBgeEmbeddings

embeddings_path = "D:\\aimodel\\bge-large-zh-v1.5"

def search_knowledge(query_text):
    """
    get info from knowledge
    Parameters:
        query_text (str): key word for search
    Returns:
        text_results (str): search result
    """
    if not query_text:
        print("Error: No query provided.")
        return []

    embeddings = HuggingFaceBgeEmbeddings(
        model_name=embeddings_path
    )  # Define the "embeddings" variable

    vector_db = Milvus(
        embeddings,
        connection_args={"host": "192.168.0.20", "port": "19530"},
        collection_name="LWWIKI",
    )
    #####################
    docs = vector_db.similarity_search(query_text)

    text_results = [doc.page_content for doc in docs]
    text_results = text_results[:3]
    text_results = "".join(text_results)
    return text_results

In AutoGen Playgound: I ask "what's the company's culture?" get this:

Request reply None sender_type agent silent False sender userproxy
userproxy (to primary_assistant):

exitcode: 1 (execution failed)
Code output:

Traceback (most recent call last):
  File "", line 1, in <module>
    tool_call(query_text='what's the company's culture?')
    ^^^^^^^^^
NameError: name 'tool_call' is not defined

If I use OpenAI's API, this will work well.

ma-armenta commented 6 months ago

@hanjing5024064 are you building from source by any chance? Have you been using the same version of autogen studio since you started experiencing this issue?