Git Product home page Git Product logo

perplexity-go's People

Contributors

evilbebra avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mcnull

perplexity-go's Issues

How to run the go script

What does:

Just go get -u github.com/evilbebra/perplexity-go and use it like this:

package main

import (
	"fmt"
	perplexity "github.com/evilbebra/perplexity-go"
)

func main() {
	resp, err := perplexity.NewQuestion("How old is Golang?")
	if err != nil {
		fmt.Printf("Error: %v\n", err)
	} else {
		fmt.Printf("Your uuid: %s\n", resp.Response.UUID)
		fmt.Printf("Text of your question was: %s\n", resp.Response.QueryStr)

		for i, query := range resp.Response.RelatedQueries {
			fmt.Printf("Related Query %d: %s\n", i, query)
		}
		fmt.Printf("SearchFocus: %s\n", resp.Response.SearchFocus)
		fmt.Printf("Mode: %s\n", resp.Response.Mode)
		fmt.Printf("Mode: %v\n", resp.Response.Gpt4)
		fmt.Printf("Web Result for query: %s\n", resp.Answer.ExtraWebResults)
		fmt.Printf("Answer: %s\n", resp.Answer.Text)
	}

actually mean? I have go installed on my mac, and I put the code above in a file run.go. I then executed

go run run.go

and got the message:

run.go:5:2: found packages perplexity (main.go) and main (run.go) in /Users/erlebach/src/2023/perplexity-go

What should I be doing? Clearly, I don't understand. Thanks.

Gordon

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.