Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gsilvamartin authored Apr 25, 2024
1 parent 97b4a2a commit ef769e5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ dotnet add package DotnetGeminiSDK
## Configuration ⚙️
To use the Gemini SDK, configure the `GoogleGeminiConfig` object. Add the Gemini client to your service collection using `GeminiServiceExtensions`:

> [!NOTE]
> Only used when using the dependency injection method.
```csharp
using DotnetGeminiSDK;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -83,6 +86,30 @@ public class YourClass
}
```

### Class Instantiation

If you don't want to use dependency injection, you can instantiate the GeminiClient class, as a constructor parameter, place your settings in the GoogleGeminiConfig instance.

```csharp
using DotnetGeminiSDK.Client.Interfaces;

public class YourClass
{
private readonly GeminiClient _geminiClient;

public YourClass()
{
_geminiClient = new GeminiClient(new GoogleGeminiConfig(){ //Place your settings here });
}

public async Task Example()
{
var response = await _geminiClient.TextPrompt("Text for processing");
// Process the response as needed
}
}
```

## Implemented features 👾

- [x] Text Prompt
Expand Down

0 comments on commit ef769e5

Please sign in to comment.