Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(perplexity): add perplexity component #861

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

chuang8511
Copy link
Contributor

@chuang8511 chuang8511 commented Nov 19, 2024

Because

  • we want to build agent based on perplexity

This commit

  • add perplexity

Note

  • we will come back to add test cases for perplexity component in the future

Copy link

linear bot commented Nov 19, 2024

@chuang8511 chuang8511 force-pushed the chunhao/ins-6889-perplexity branch from 6f83d42 to a622919 Compare November 21, 2024 11:45
pkg/component/ai/perplexityai/v0/main.go Dismissed Show dismissed Hide dismissed
@chuang8511 chuang8511 marked this pull request as ready for review November 21, 2024 16:53
feat: add perplexity

feat: add perplexity

feat: implement perplexity api caller

feat: implement perplexity chat function
@chuang8511 chuang8511 force-pushed the chunhao/ins-6889-perplexity branch from 2ff6002 to 49dd680 Compare November 21, 2024 17:18
pkg/component/ai/perplexityai/v0/main.go Show resolved Hide resolved
Comment on lines 60 to 61
err = fmt.Errorf("failed to send request, status code: %d, body: %s", restyResp.StatusCode(), bodyBytes)
job.Error.Error(ctx, err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
err = fmt.Errorf("failed to send request, status code: %d, body: %s", restyResp.StatusCode(), bodyBytes)
job.Error.Error(ctx, err)
msg := fmt.Sprintf("Perplexity API responded with status %d", restyResp.StatusCode()) // Optionally add body, though it'll make the message less readable
err = errmsg.AddMessage(fmt.Errorf("perplexity responded with non-200 status"), msg)
job.Error.Error(ctx, err)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Perplexity has a structured output for errors, I'd try to unmarshal the response and return to the user the key information in a well formed message. Doesn't httpclient take care of this here?

@chuang8511 chuang8511 requested a review from jvallesm November 22, 2024 11:36
@chuang8511 chuang8511 merged commit 1fc7dbe into main Nov 22, 2024
11 checks passed
@chuang8511 chuang8511 deleted the chunhao/ins-6889-perplexity branch November 22, 2024 18:04
donch1989 pushed a commit that referenced this pull request Dec 3, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.48.0-beta](v0.47.2-beta...v0.48.0-beta)
(2024-12-03)


### Features

* **component,data,base:** enhance component features
([#885](#885))
([68b396f](68b396f))
* **component,googlesheet:** implement the Google Sheet component
([#878](#878))
([8a0ab93](8a0ab93))
* **component,instillapp:** remove instill-app component
([#911](#911))
([4a7c970](4a7c970))
* **component,openai:** support streaming for o1-mini and o1-preview
models
([#882](#882))
([367e957](367e957))
* **component,schedule:** introduce the `schedule` component
([#900](#900))
([9582942](9582942))
* **connection:** add lookup connection endpoint
([#888](#888))
([86bffe8](86bffe8))
* **data:** add support for default value in `instill` Go tag
([#891](#891))
([b9c2d05](b9c2d05))
* **leadiq:** implement leadiq component
([#874](#874))
([78c2ec7](78c2ec7))
* **perplexity:** add perplexity component
([#861](#861))
([1fc7dbe](1fc7dbe))
* **recipe:** separate the template and the rendered value for input and
setup
([#886](#886))
([3ec3dd6](3ec3dd6))
* **recipe:** support `required` attribute for variable
([#901](#901))
([da7f0e9](da7f0e9))
* **service:** add the file extension to the output filename
([#873](#873))
([22b92b0](22b92b0))
* **service:** trigger latest release version for pipeline with
run-on-event setting
([#896](#896))
([0b1c071](0b1c071))
* **smartlead:** implement smartlead
([#879](#879))
([f6baf2a](f6baf2a))
* **text:** improve markdown chunking
([#889](#889))
([d48b3ec](d48b3ec))
* **trigger:** accept connection references in the pipeline trigger data
([#883](#883))
([937bd01](937bd01))
* **trigger:** enable optional values for variables
([#884](#884))
([187f5fd](187f5fd))
* **vdp:** skip google drive for cloud version
([#899](#899))
([5089397](5089397))


### Bug Fixes

* **ci:** use xk6-sql driver and pin down versions
([#876](#876))
([1f64d6c](1f64d6c))
* **component,openai:** enable the use of system messages with chat
history
([#905](#905))
([ef3e66f](ef3e66f))
* **leadiq, smartlead:** change field to optional
([#892](#892))
([9bd995d](9bd995d))
* **web:** fix url and markdown position
([#893](#893))
([af8f412](af8f412))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants