Giter Club home page Giter Club logo

Comments (6)

Jasondeepny avatar Jasondeepny commented on July 16, 2024 2

my gradle:

plugins {
id 'java'
}

group 'org.openai'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
implementation 'com.theokanning.openai-gpt3-java:client:0.8.1'
implementation group: "org.slf4j", name: "slf4j-simple", version: "1.7.32"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}

test {
useJUnitPlatform()
}

from openai-java.

pepitoscrespo avatar pepitoscrespo commented on July 16, 2024 2

set the environ. vars. is OK when you are sharing the src code and therefore you dont want to expose your key. But for running locally just type the plain string and avoid the cumbersome: String token = System.getenv("OPENAI_TOKEN"). On the other hand, dont forget to install the lombok.jar when using eclipse IDE.

from openai-java.

YaminMahdi avatar YaminMahdi commented on July 16, 2024 1

image

image

Same here in Kotlin.

implementation 'com.theokanning.openai-gpt3-java:client:0.8.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'

from openai-java.

cryptoapebot avatar cryptoapebot commented on July 16, 2024 1

Not sure if this will help, but I put mine in env vars (.bashrc)

export OPENAI_TOKEN="sk-K..."
export OPENAI_API_KEY="sk-K..."

from openai-java.

zkarpinski avatar zkarpinski commented on July 16, 2024

Downgrading to 0.8.1 and adding OPENAI_TOKEN to env var worked for me.

from openai-java.

lin666999 avatar lin666999 commented on July 16, 2024

401 How to solve

from openai-java.

Related Issues (20)

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.