Giter Site home page Giter Site logo

gemini-testing's Introduction

Gemini API examples

These are some examples of using the Gemini API in Python

API Key Setup

Get your API-key here and export it as an environment variable.

$ export GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY

Basic Usage

In basic.py there is a simple demo of creating a basic chat completion

Streaming

In stream.py there is an example of streaming the chat completion.

Chat (easy way)

In chat.py there is a simple terminal chatbot implementation using the `ChatSession`` class

Chat (harder way)

In hard_chat.py there is a terminal chatbot implementation using generate_content() with a list of messages directly.

Vision

In vision.py there is a demo of the gemini-pro-vision model

Function calling

In gemini-ai-agent three is a demo of an AI agent that can write to files, using Gemini

gemini-testing's People

Contributors

unconv avatar

Stargazers

Reinaldo Chaves avatar Adalto Picotti Junior avatar  avatar MDC avatar LEONARDO OSPINA avatar 🐜 avatar rati avatar  avatar Ved Prakash avatar TU. CHENG SHIN avatar  avatar Ale Premier avatar Postrantor avatar Amanda Furtado Brinhosa avatar Tanish MIttal avatar  avatar nicekate avatar Mohsin Raz avatar Martin Bučko avatar Ika Key avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.