Allow reading web content into assistants (#63)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-08-01 21:53:28 +02:00
1 parent 2cea53d2a9
commit 4cb49d9f27
36 files changed
+1127 -24

No files matched your search

@@ -0,0 +1,88 @@
namespace AIStudio.Tools;
/// <inheritdoc />
public sealed class ThreadSafeRandom : Random
{
private static readonly object LOCK = new();
#region Overrides of Random
/// <inheritdoc />
public override int Next()
{
lock (LOCK)
return base.Next();
}
/// <inheritdoc />
public override int Next(int maxValue)
{
lock (LOCK)
return base.Next(maxValue);
}
/// <inheritdoc />
public override int Next(int minValue, int maxValue)
{
lock (LOCK)
return base.Next(minValue, maxValue);
}
/// <inheritdoc />
public override void NextBytes(byte[] buffer)
{
lock (LOCK)
base.NextBytes(buffer);
}
/// <inheritdoc />
public override void NextBytes(Span<byte> buffer)
{
lock (LOCK)
base.NextBytes(buffer);
}
/// <inheritdoc />
public override double NextDouble()
{
lock (LOCK)
return base.NextDouble();
}
/// <inheritdoc />
public override long NextInt64()
{
lock (LOCK)
return base.NextInt64();
}
/// <inheritdoc />
public override long NextInt64(long maxValue)
{
lock (LOCK)
return base.NextInt64(maxValue);
}
/// <inheritdoc />
public override long NextInt64(long minValue, long maxValue)
{
lock (LOCK)
return base.NextInt64(minValue, maxValue);
}
/// <inheritdoc />
public override float NextSingle()
{
lock (LOCK)
return base.NextSingle();
}
/// <inheritdoc />
protected override double Sample()
{
lock (LOCK)
return base.Sample();
}
#endregion
}