Comments (7)
方便贴一下生成类的代码吗
from autogen.
方便贴一下生成类的代码吗
//----------------------
//
// This code was generated by a tool.
//
//----------------------
using Azure.AI.OpenAI;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using System;
using AutoGen.Core;
using AutoGen.OpenAI.Extension;
namespace Edensoft.AIManage.SemanticKernel.ToolAgent
{
public partial class AgentTools
{
private class ClientToolSchema
{
[JsonPropertyName(@"url")]
public List<string> url {get; set;}
[JsonPropertyName(@"bodyParam")]
public List<Dictionary<string, object>> bodyParam {get; set;}
[JsonPropertyName(@"urlParam")]
public List<string> urlParam {get; set;}
[JsonPropertyName(@"methodParam")]
public List<string> methodParam {get; set;}
}
public Task<string> ClientToolWrapper(string arguments)
{
var schema = JsonSerializer.Deserialize<ClientToolSchema>(
arguments,
new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
});
return ClientTool(schema.url, schema.bodyParam, schema.urlParam, schema.methodParam);
}
public FunctionContract ClientToolFunctionContract
{
get => new FunctionContract
{
Namespace = @"Edensoft.AIManage.SemanticKernel.ToolAgent",
ClassName = @"AgentTools",
Name = @"ClientTool",
Description = @"创建http调用外部工具方法",
ReturnType = typeof(Task<string>),
Parameters = new []
{
new FunctionParameterContract
{
Name = @"url",
Description = @"要调用的url",
ParameterType = typeof(List<string>),
IsRequired = true,
},
new FunctionParameterContract
{
Name = @"bodyParam",
Description = @"body请求参数",
ParameterType = typeof(List<Dictionary<string, object>>),
IsRequired = true,
},
new FunctionParameterContract
{
Name = @"urlParam",
Description = @"get请求参数",
ParameterType = typeof(List<string>),
IsRequired = true,
},
new FunctionParameterContract
{
Name = @"methodParam",
Description = @"请求方法 get post put delete",
ParameterType = typeof(List<string>),
IsRequired = true,
},
},
};
}
public Azure.AI.OpenAI.FunctionDefinition ClientToolFunction
{
get => this.ClientToolFunctionContract.ToOpenAIFunctionDefinition();
}
}
}
这个是我添加注释之后生成的类,看起来和没有添加注释的没有什么区别
from autogen.
注释会被用于生成function contract和function definition
from autogen.
能不能放一下ide截图,看一下是哪里报错了
from autogen.
能不能放一下ide截图,看一下是哪里报错了
这个是启动的时候的报错,基本上都在这里了。但是,在类里面去看, 又看不出什么问题。
from autogen.
可能是没在csproj里加这个?
<GenerateDocumentationFile>true</GenerateDocumentationFile>
来源:https://microsoft.github.io/autogen-for-net/articles/Create-type-safe-function-call.html
这个option是ide里默认打开但是编译的时候默认关闭的,会影响source generator的syntax parsing behavior
from autogen.
可能是没在csproj里加这个?
<GenerateDocumentationFile>true</GenerateDocumentationFile>
来源:https://microsoft.github.io/autogen-for-net/articles/Create-type-safe-function-call.html
好的,谢谢,已经解决
from autogen.
Related Issues (20)
- [Issue]: Autogen with vision models like GPT-4o creates HUGE spike in usage and bill HOT 3
- [Bug]: Using Mistral model through Azure Endpoint
- [Issue]: chromadb is collecting data silently
- [Bug]: GPTAssistantAgent doesn't handle "failed" status
- [Feature Request]: Skills in other languages than Python
- [Bug]: [Tool Usage Issue] Unable to register functions that utilize web3.py
- [Bug]: Fix broken link for Agentchat graph modelling language notebook HOT 2
- [Issue]: Unable to run the python files due to docker usage. HOT 1
- [Feature Request]: support more advanced authentication mechanisms than api keys HOT 1
- [Feature Request]: Integrate more model calling to AutoGen through API
- [Issue]: About code execution thread getting stuck
- [Bug]: LocalCommandLineCodeExecutor is not working with virtual environments
- [Bug]: Autogen studio Group chat workflow Summary method is not working.
- [Bug]: Support for anthropic stopped to work
- [Feature Request]: Gemini API for .NET HOT 4
- [Issue]: How to send output of one agent to another agent? HOT 1
- [Issue]: Obfuscated LLM Fallback in OpenAIWrapper
- [.Net][Feature Request]: Sample update - Add getting-start samples for BasicSample project
- [Bug]: Exception "TypeError: sequence item 0: expected str instance, dict found" was throwing due to different format of return when running Gemini
- Ability to select serial or parallel execution of multiple function calls [Feature Request]:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autogen.