Skip to content

Commit

Permalink
Source Generator is not bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Mar 15, 2024
1 parent 44dd827 commit f23adc1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ public static partial class FunctionTools
[ClaudiaFunction]
static async Task<string> GetHtmlFromWeb(string url)
{
// When using this in a real-world application, passing the raw HTML might consume too many tokens.
// You can parse the HTML locally using libraries like AngleSharp and convert it into a compact text structure to save tokens.
using var client = new HttpClient();
return await client.GetStringAsync(url);
}
Expand Down Expand Up @@ -664,6 +666,10 @@ var callResult = await anthropic.Messages.CreateAsync(new()
Console.WriteLine(callResult);
```

Note that the allowed parameter types are `bool`, `sbyte`, `byte`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `decimal`, `float`, `double`, `string`, `DateTime`, `DateTimeOffset`, `Guid`, and `TimeSpan`.

The return value can be of any type, but it will be converted to a string using `ToString()`. If you want to return a custom string, make the return type `string` and format the string within the function.

Blazor Sample
---
By using Claudia with Blazor, you can easily create a Chat UI like the one shown below.
Expand Down Expand Up @@ -752,6 +758,15 @@ public partial class Home

If you need to store the chat message history, you can serialize `List<Message> chatMessages` to JSON and save it to a file or database.

Unity
---
Minimum supported Unity version is `2022.3.12f1`.

You need to install from NuGet. We recommend using [NuGetForUnity](https://github.com/GlitchEnzo/NuGetForUnity).




License
---
This library is under the MIT License.
4 changes: 4 additions & 0 deletions src/Claudia/Claudia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<None Include="..\..\Icon.png" Pack="true" PackagePath="/" />
<EmbeddedResource Include="..\..\LICENSE" />
<InternalsVisibleTo Include="Claudia.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001000144ec28f1e9ef7b17dacc47425a7a153aea0a7baa590743a2d1a86f4b3e10a8a12712c6e647966bfd8bd6e830048b23bd42bbc56f179585c15b8c19cf86c0eed1b73c993dd7a93a30051dd50fdda0e4d6b65e6874e30f1c37cf8bcbc7fe02c7f2e6a0a3327c0ccc1631bf645f40732521fa0b41a30c178d08f7dd779d42a1ee" />

<!-- Bundle SourceGenerator -->
<ProjectReference Include="..\Claudia.FunctionGenerator\Claudia.FunctionGenerator.csproj" ReferenceOutputAssembly="false" />
<None Include="..\Claudia.FunctionGenerator\bin\$(Configuration)\netstandard2.0\Claudia.FunctionGenerator.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit f23adc1

Please sign in to comment.