higty / higlabo Goto Github PK
View Code? Open in Web Editor NEWHigLabo library provide 1.AI client library(OpenAI, Anthoripic, Groq) 2.Object Mapper(fastest in the world) 3.DbSharp(DAL generator) 4.Other.(Mail, Ftp, Utility...etc)
HigLabo library provide 1.AI client library(OpenAI, Anthoripic, Groq) 2.Object Mapper(fastest in the world) 3.DbSharp(DAL generator) 4.Other.(Mail, Ftp, Utility...etc)
I am building user support AI. I gave to the assistant basic knowledge about my product. Now when user asks some question the following algo happens:
What is the best way to mark fetched data as additional context? Actually I can to that right into request or maybe send them as separate "system" roled message? Or what is the better way? If sending separate system message, how to send it both together with "user"-roled which I am sending now as below:
{
Thread_Id = internalThreadId,
Role = "user",
Content = userInput
};
await _client.MessageCreateAsync(messageCreateParams);```
I found out that when a folder name contains one special character (i.e. löschen) ist not converted properly. The Problem is in
function EncodeWithoutInsertingNewline(Byte[] input)
on Line 156: startIndex += 3;
This Line of Code must be set in the for loop under c2 = input[startIndex + 2];
I fixed it.
Hey, its possible to activate TLS 1.2 in your Pop3 library?
I dont find a fix for this.
Hi! OpenAI engineers just added temperature setup for assistant API. It would be cool if you can consider this paratemer in your library: https://community.openai.com/t/how-to-set-temperature-and-other-sampling-parameters-of-model-in-open-ai-assistant-api/486368/36?u=apris
Thank you in advance!
It seems that the project is still referencing the old newtonsoft json 4. Can this be upgraded to 7.x?
thanks
I have been trying for quite awhile with the upload file async. You do not provide a example of this. also the normal upload file either fails or basically freezes up the machine that it is running on until the upload is finished and if this is a large file this can take sometime to complete. Can some one please provide a example of the the upload file Async please. I am new to this tech.
Hello! Found this example. Works great. However is there a way to avoid using files, because using it from webapi, getting mp3 file as multipart/form-data ?
var cl = new OpenAIClient(Environment.GetEnvironmentVariable(Consts.ENV_VAR_OPEN_API_KEY));
var p = new AudioTranslationsParameter();
p.File.SetFile("C:\\Users\\38097\\Music\\test-whisper\\rev.mp3",
new MemoryStream(File.ReadAllBytes("C:\\Users\\38097\\Music\\test-whisper\\rev.mp3")));
p.Model = "whisper-1";
var res = await cl.AudioTranslationsAsync(p);
Thank you in advance!
Hi,
Will Rss 2.0 writer be implemented in the near future?
Thanks.
Hi @higty - love this library.
I had used the assistants API via direct OpenAI subscription.
I now have access to Azure OpenAI subscription. With the AzureSettings class, created the OpenAIClient as per the documentation. Set the API Version too. However, unable to get the Assistatns API working.
Resource not found
exception.Please note:
Request URL
Payload
{
"tools": [],
"name": "Math Tutor",
"instructions": "You are a personal math tutor. Answer questions briefly, in a sentence or less.",
"model": "gpt-4-1106-preview",
"file_ids": []
}
AssistantCreateParameter
class has a GetApiPath() set to /assistants
. Should it be /openai/assistants
instead?
/
/openai/
as wellNo luck.
Please confirm if the library was tested with the Azure OpenAI?
Some guidance over this query would be helpful. Appreciate your time.
Sorry.
.Net 5 version, HigLabo.Mapper.Test add two test cases, fail
` [TestMethod]
public void ObjectMapper_ArrayProperty_ListProperty()
{
var mapper = new ObjectMapper();
var src = new
{
Ids = new int[] { 1, 2, 3 }
};
var dst = new
{
Ids = new List()
};
dst = mapper.Map(src, dst);
Assert.AreEqual(src.Ids.Length, dst.Ids.Count);
Assert.AreEqual(src.Ids[0], dst.Ids[0]);
Assert.AreEqual(src.Ids[1], dst.Ids[1]);
Assert.AreEqual(src.Ids[1], dst.Ids[1]);
}
[TestMethod]
public void ObjectMapper_Array_List()
{
var mapper = new ObjectMapper();
var src = new int[] { 1, 2, 3 };
var dst = new List<int>();
dst = mapper.Map(src, dst);
Assert.AreEqual(src.Length, dst.Count);
Assert.AreEqual(src[0], dst[0]);
Assert.AreEqual(src[1], dst[1]);
Assert.AreEqual(src[1], dst[1]);
}`
AssistantDeltaObject deserialization error if Annotation contains file citations. For OpenAi Assistants with Retrieval property set on and using files, there is an issue during deserialization delta object AssistantDeltaObject. I have a fix, pull request on its way.
Hi
Very cool project. I like to know if is possible see is mail is bounced like aspose
` BounceResult bounced = mailMessage.CheckBounced();
if (bounced.IsBounced == true)
{
continue;
} `
I find the bug in MimeStreamBuffer, occurs when the loaded buffer end with char 10 and call the ReadLine function ( this._Current goto this._End +1) and the IsEnd fail.
For fix change
public Boolean IsEnd()
{
return this._Current == this._End || _IsLastOfLine;
}
To
public Boolean IsEnd()
{
return this._Current >= this._End || _IsLastOfLine;
}
hi,
Method not found: 'Boolean HigLabo.Core.ServerSentEventLine.IsEvent()
i'm facing this issue when calling RunCreateStreamAsync => GetStreamAsync => item.IsEvent()
it says it doesn't exist.
in this ServerSentEventLine struct, i actually can't see it.
I am using latest vession
Thanks in advance
@higty This is a great repo and an innovative way of generating code. Love this ❤️
I was trying to download the image and save it as PNG to disc. I am unable to get this working. Sample code is given below.
Note: Retrieving the same file content via Postman and saving it to disc as PNG is working; however not with the library.
[Fact]
public async Task ShouldSaveImage()
{
var client = Singleton.Instance.OpenAIClient;
var fileId = "file-P2UVwnSXOTx3KOcS8S6WCxxx";
var fileContentGetResponse = await client.FileContentGetAsync(fileId);
WriteToImageFile(fileId, fileContentGetResponse.GetResponseBodyText());
}
private static void WriteToImageFile(string fileName, string content)
{
using FileStream fs = new($"{fileName}.png", FileMode.Create);
byte[] imageBytes = Encoding.ASCII.GetBytes(content);
fs.Write(imageBytes, 0, imageBytes.Length);
fs.Flush();
}
Expected image (saved via Postman)
Actual image (saved via code above)
A quick help would be really helpful.
It appears that HigLabo.Mail v.1.0.2.4 has undeclared dependencies to HigLabo.Core and HigLabo.Converter. Installing HigLabo.Mail without also installing the mentioned dependencies causes failures when sending mail.
Hi,
I have test with a valide rss enpoint but in the RSS library an error throw
Endpoint RSS :
http://www.cannes.maville.com/flux/rss/actu.php
Error :
System.ArgumentNullException: Value cannot be null.
Parameter name: ns
at System.Xml.Linq.XNamespace.op_Addition(XNamespace ns, String localName)
at HigLabo.Rss.RssItem_2_0.Parse(XElement element)
at HigLabo.Rss.Rss_2_0_Parser.CreateRssItem(XElement element)
at HigLabo.Rss.RssParser.b__3_0(XElement el)
Can you check please ?
Thks a lot
I noticed that in messages with an HTML body, a '.' (period) may get dropped when in happens to be at the end, or beginning, of a line in the "Quoted-Printable" content.
Example from an actual e-mail (redacted):
[email protected]"=0D=0ATrue : Sending "Xxxxxxxx Xxxxx Report for XXX XXX XXXX=
XX - XXX XXXXXX XXXX" to "[email protected]"=0D=0ATrue : Sending "Xxxxxxx=
x Xxxxx Xxxxxx for XXX XXX XXXXXX - XXX XXXXXX XXXX" to "xxxxxxxxxxx@xxxxx=
gr"=0D=0ATrue : Sending "Xxxxxxxx Xxxxx Report for XXX XXXXXXXXX - XXXXX=
In the last pair of lines there should be a period so that the resulting text is to "[email protected]"
It would appear that the last line should be one character longer, but I don't know how Quoted-Printable encoding works.
Hello! Cool news from OpenAI: https://platform.openai.com/docs/assistants/whats-new
We're launching an improved retrieval tool called file_search, which can ingest up to 10,000 files per assistant - 500x more than before. It is faster, supports parallel queries through multi-threaded searches, and features enhanced reranking and query rewriting.
Alongside file_search, we're introducing vector_store objects in the API. Once a file is added to a vector store, it's automatically parsed, chunked, and embedded, made ready to be searched. Vector stores can be used across assistants and threads, simplifying file management and billing.
Share, if you going to add vector stores support. Have a nice day! Thank you!
I'm trying this library out to make use of the Assistants form OpenAI and after I've installed the nuget package HigLabo.OpenAI
7.0.0
I execute my application and on this line new OpenAIClient()
it fails with this exception:
System.TypeLoadException: Could not load type 'HigLabo.Core.EnumToLowerStringConverter' from assembly 'HigLabo.NewtonsoftJson, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null'.
at HigLabo.OpenAI.OpenAIJsonConverter..ctor()
at HigLabo.OpenAI.OpenAIClient..ctor(String apiKey)
at Program.<Main>$(String[] args) in C:\Users\Dandre\RiderProjects\OpenAiTestbed\OpenAiTestbed\Program.cs:line 3
at Program.<Main>(String[] args)
I'm not sure if the class is missing from those nuget packages but would you mind having a look to get this fixed? I have been able to compile the source code in the meantime which seems to work.
Also, I did run into an additional problem where the ThreadObject
class was using string
for Metadata
instead of object
or something like that. Please also update that part so that it can work against the latest API from OpenAI.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.