Giter VIP home page Giter VIP logo

johniwasz / whetstone.chatgpt Goto Github PK

View Code? Open in Web Editor NEW
96.0 8.0 17.0 390.66 MB

A simple light-weight library that wraps the Open AI API.

Home Page: https://johniwasz.github.io/whetstone.chatgpt/

License: MIT License

HTML 2.91% CSS 40.99% JavaScript 17.26% Batchfile 0.01% C# 38.83%
chatgpt dotnet dotnet-standard2-1 openai gpt-3 gpt-35-turbo dotnet-standard2 gpt-4 whisper whisper-ai

whetstone.chatgpt's Introduction

Johns's GitHub stats

Top Langs

John's wakatime stats

whetstone.chatgpt's People

Contributors

dependabot[bot] avatar johniwasz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whetstone.chatgpt's Issues

Serialization Error When Connecting from Behind Firewall Not Informative

System.Text.Json.JsonException: "'<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0."
JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.

Example:
var response = await client.CreateChatCompletionAsync(request);

Manage sessions and context

Hi there

Thanks for excellent work.

  1. Sessions - I'm a bit lost how to continue a conversation and have multiple at same time - ask, answer, ask, answer, etc

  2. Context - how to give the context for the questions on a broader level (documents, sites, text, etc)

Thanks
Ricardo

Function call didn't work. Because of Deserialization issue

I'm using Function. But deserializer choose wrong class ChatGPTChatCompletionMessage instead of ChatGPTAssistantCompletionMessage.

Function call return Assistant Completion response. But deserializer always return ChatCompletion class and missing some properties. This is actual returning json

{
  "id": "chatcmpl-8icO5Kj0IEqgDr6dU9J0E9Gecv4nQ",
  "object": "chat.completion",
  "created": 1705644685,
  "model": "gpt-3.5-turbo-0613",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "tool_calls": [
          {
            "id": "call_Ww3ocoHqydw5xhnS5H1CZImu",
            "type": "function",
            "function": {
              "name": "getExchangeRate",
              "arguments": "{\n  \"currency\": \"USD\"\n}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 99,
    "completion_tokens": 16,
    "total_tokens": 115
  },
  "system_fingerprint": null
}

But after deserialized object looks like this

{
    "Id": "chatcmpl-8iKN8vlb6QEYiGukfWLAlJNG0jS2V",
    "Object": "chat.completion",
    "Created": "2024-01-18T10:57:14Z",
    "Model": "gpt-3.5-turbo-0613",
    "Choices": [
        {
            "Index": 0,
            "Message": {
                "Role": "assistant",
                "Content": null,
                "Name": null
            },
            "FinishReason": "tool_calls"
        }
    ],
    "SystemFingerprint": null,
    "Usage": {
        "PromptTokens": 97,
        "CompletionTokens": 16,
        "TotalTokens": 113
    }
}

How to fix this to deserialized by ChatGPTAssistantCompletionMessage class.

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.