Skip to content

Commit

Permalink
version 1.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenkirstaetter committed Nov 1, 2024
1 parent 2d82227 commit 8a2735d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Alternatively, add the following line to your `.csproj` file.

```text
<ItemGroup>
<PackageReference Include="Mscc.GenerativeAI" Version="1.8.1" />
<PackageReference Include="Mscc.GenerativeAI" Version="1.8.3" />
</ItemGroup>
```

Expand Down Expand Up @@ -147,7 +147,7 @@ var prompt = "Write a story about a magic backpack.";

var model = new GenerativeModel(apiKey: apiKey, model: Model.GeminiPro);

var response = model.GenerateContent(prompt).Result;
var response = await model.GenerateContent(prompt);
Console.WriteLine(response.Text);
```

Expand All @@ -167,7 +167,7 @@ var vertex = new VertexAI(projectId: projectId, region: region);
var model = vertex.GenerativeModel(model: Model.Gemini15Pro);
model.AccessToken = accessToken;

var response = model.GenerateContent(prompt).Result;
var response = await model.GenerateContent(prompt);
Console.WriteLine(response.Text);
```

Expand All @@ -187,6 +187,9 @@ var prompt = "Good morning! How are you?";
IGenerativeAI genAi = new GoogleAI(apiKey);
var model = genAi.GenerativeModel(Model.Gemini15ProLatest, systemInstruction: systemInstruction);
var request = new GenerateContentRequest(prompt);

var response = await model.GenerateContent(prompt);
Console.WriteLine(response.Text);
```

The response might look similar to this:
Expand All @@ -196,6 +199,20 @@ Shimmer me timbers, it's good to see a friendly face!
What brings ye to these here waters?
```

### Grounding with Google Search

```csharp
var apiKey = "your_api_key";
var prompt = "Who won Wimbledon this year?";
IGenerativeAI genAi = new GoogleAI(apiKey);
var model = genAi.GenerativeModel("gemini-1.5-pro-002",
tools: [new Tool { GoogleSearchRetrieval =
new(DynamicRetrievalConfigMode.ModeUnspecified, 0.06f) }]);

var response = await model.GenerateContent(prompt);
Console.WriteLine(response.Text);
```

### Text-and-image input

```csharp
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.2
1.8.3
7 changes: 7 additions & 0 deletions src/Mscc.GenerativeAI/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
### Fixed

## 1.8.3

### Added

- add Grounding with Google Search
- add `ModelVersion` property

## 1.8.2

### Added
Expand Down

0 comments on commit 8a2735d

Please sign in to comment.