Coder Social home page Coder Social logo

sourcegraph-cody-gateway-cli's Introduction

Cody Gateway CLI (un-official)

This CLI project refers test cody-gateway API from command line.

cody-logo

Available APIs

  • Health Check API
  • Version API
  • Anthropic Completion API
  • OpenAI Embedding API
  • OpenAI Completion API

The Completion API has both code and chat completion modes. This project uses the chat completion mode.

Usage

cody-gateway-cli uses flags to parses options from command line. (I wish golang has salesforce oclif.io framework to easily generate and manage cli apps)

HealthCheck API

./main --host http://localhost:9992 --debugtoken {{TOKEN}} --verbose --healthcheckapi

✅ Health check OK!
Execution completed successfully

Version API

./main --host http://localhost:9992 --debugtoken {{TOKEN}} --verbose --versionapi

Version: 0.0.0+dev
Execution completed successfully

OpenAI Embeddings API

sourcegraph-cody-gateway-cli % ./main --host http://localhost:9992 --embeddingsapi true --accesstoken --mode chat
Enter Cody Gateway Access Token for 
{{TOKEN}}
Enter keyphrases to embed ✨ (supports multi-line and type --END-- to terminate input):
-> hi
-> --END--
[-0.035099167 -0.020636523 -0.015421565 -0.03990691 -0.027375247 0.021122552 -0.022002658 -0.019467426 -0.009484131 -0.013129348 0.029608354 -0.00469609 -0...]

Anthropic Chat Completion API

sourcegraph-cody-gateway-cli % ./main --host http://localhost:9992 --anthropicapi true --accesstoken --mode chat
Enter Cody Gateway Access Token for 
{{TOKEN}}
🪄 🪄 🪄 🪄 🪄 🪄 
Establishing Session with Anthropic AI 🪄 ✨ (supports multi-line and type --END-- to terminate input):
🪄 🪄 🪄 🪄 🪄 🪄 
You -> Can you list the beaches nearby Ontario Toronto region ?
200
🪄 🪄 🪄 🪄 🪄 🪄 
------------
Some of the popular beaches near Toronto in Ontario are:

- Cherry Beach - Located on the shore of Lake Ontario, about 5 km from downtown Toronto. It has swimming areas, picnic spots and hiking trails.
...
------------
🪄 🪄 🪄 🪄 🪄 🪄 
You -> Can you summarize about Goderich beach ?
🪄 🪄 🪄 🪄 🪄 🪄 
------------
Goderich beach is a popular beach located on the shores of Lake Huron in the town of Goderich, Ontario, Canada. Some key highlights of the beach include:

• It is a very scenic beach with clear blue waters and sandy shores. It is considered one of the prettiest beaches on Lake Huron.
...

You -> --END--

OpenAI Chat Completion API

sourcegraph-cody-gateway-cli % ./main --host http://localhost:9992 --openaiapi true --accesstoken --mode chat
Enter Cody Gateway Access Token for 
{{TOKEN}}
🪄 🪄 🪄 🪄 🪄 🪄 
Establishing Session with OpenAI GPT-3.5-Turbo 🪄 ✨ (supports multi-line and type --END-- to terminate input):
🪄 🪄 🪄 🪄 🪄 🪄 
You -> Could you please list best beaches to visit in Ontario for this summer?
🪄 🪄 🪄 🪄 🪄 🪄 
------------
As an AI language model, I do not have personal preferences. However, here are some of the best beaches to visit in Ontario for this summer:

1. Wasaga Beach
2. Sandbanks Provincial Park
3. Sauble Beach
...
------------
🪄 🪄 🪄 🪄 🪄 🪄 
You -> What about Goderich beach ?
🪄 🪄 🪄 🪄 🪄 🪄 
------------
Yes, Goderich Beach is also a great beach to visit in Ontario. It is located ...
------------
🪄 🪄 🪄 🪄 🪄 🪄 
You -> --END--

sourcegraph-cody-gateway-cli's People

Contributors

shivasurya avatar

Watchers

 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.