Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 在根据示例去写程序的时候,遇到了实例不能调用的问题 #2683

Closed
lidisi8520 opened this issue May 14, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@lidisi8520
Copy link

Describe the bug

在我根据这个示例去创建自己的应用的时候。我遇到了一个问题。https://github.com/microsoft/autogen/blob/dotnet/dotnet/sample/AutoGen.BasicSamples/Example03_Agent_FunctionCall.cs
示例中有定义一个方法UpperCase。这个方法有一个注解,是Function。在run程序中,实例化这个类之后,var instance = new(),能直接instance.UpperCaseFunctionContract(),但是在我自己的代码中,不能instance.UpperCaseFunctionContract()。我想知道是哪一步有问题。我自己的代码中,我也有加注解。

Steps to reproduce

No response

Model Used

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

@lidisi8520 lidisi8520 added the bug Something isn't working label May 14, 2024
@lidisi8520 lidisi8520 changed the title [Bug]: [Bug]: 在根据示例去写程序的时候,遇到了实例不能调用的问题 May 14, 2024
@LittleLittleCloud
Copy link
Collaborator

LittleLittleCloud commented May 14, 2024

Did you add the ‘AutoGen.SourceGenerator’ package to your project?

@lidisi8520
Copy link
Author

Did you add the ‘AutoGen.SourceGenerator’ package to your project?

Thanks. After adding this package, this issue has been resolved

@lidisi8520
Copy link
Author

image
在安装了之后,新生成的类中,没有找到这个依赖,我并不清楚是缺少什么包导致的,有遇到过这个问题的,可以帮帮我一下吗。

@lidisi8520
Copy link
Author

Did you add the ‘AutoGen.SourceGenerator’ package to your project?

image
在安装了之后,新生成的类中,没有找到这个依赖,我并不清楚是缺少什么包导致的,
可以帮帮我一下吗。

@LittleLittleCloud
Copy link
Collaborator

LittleLittleCloud commented May 15, 2024

看起来是namespace confliction因为你的namespace是‘Edonsoft.AIManagement.Azure’. 然后FunctionDefinition的命名空间是Azure.AI. 所以它就去Edonsoft.AIManagement.Azure.AI 去找FunctionDefinition了

我可以在下一版的source generator里加上global关键词,目前最快的fix应该是改namespace (比如把 Edonsoft.AIManagement.Azure改成Edonsoft.AIManagement.AzureAI)

@lidisi8520
Copy link
Author

看起来是namespace confliction因为你的namespace是‘Edonsoft.AIManagement.Azure’. 然后FunctionDefinition的命名空间是Azure.AI. 所以它就去Edonsoft.AIManagement.Azure.AI 去找FunctionDefinition了

我可以在下一版的source generator里加上global关键词,目前最快的fix应该是改namespace (比如把 Edonsoft.AIManagement.Azure改成Edonsoft.AIManagement.AzureAI)

好的,谢谢答复。我们这边修改项目内部的命名空间

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants