Skip to content

Commit

Permalink
Version Packages (#4420)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Feb 7, 2025
1 parent cdc82e4 commit 03c048c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 40 deletions.
39 changes: 0 additions & 39 deletions .changeset/cuddly-jobs-act.md

This file was deleted.

44 changes: 44 additions & 0 deletions packages/ai/openai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# @effect/ai-openai

## 0.11.5

### Patch Changes

- [#4418](https://github.com/Effect-TS/effect/pull/4418) [`cdc82e4`](https://github.com/Effect-TS/effect/commit/cdc82e4ae880bf54cf35e5a68d8103840f49001b) Thanks @IMax153! - Support per-request HTTP client transformations in the OpenAi AI integration package.

For example:

```ts
import { Completions } from "@effect/ai"
import {
OpenAiClient,
OpenAiCompletions,
OpenAiConfig
} from "@effect/ai-openai"
import { HttpClient, HttpClientRequest } from "@effect/platform"
import { NodeHttpClient } from "@effect/platform-node"
import { Config, Effect, Layer } from "effect"

const OpenAi = OpenAiClient.layerConfig({
apiKey: Config.redacted("OPENAI_API_KEY")
}).pipe(Layer.provide(NodeHttpClient.layerUndici))

const Gpt4oCompletions = OpenAiCompletions.layer({
model: "gpt-4o"
}).pipe(Layer.provide(OpenAi))

const program = Effect.gen(function* () {
const completions = yield* Completions.Completions

yield* completions.create("Tell me a dad joke").pipe(
// Per-request HTTP client transforms which are only applied if
// the OpenAi provider is in use
OpenAiConfig.withClientTransform(
HttpClient.mapRequest(
HttpClientRequest.setHeader("x-dad-jokes", "are-awesome")
)
)
)
})

program.pipe(Effect.provide(Gpt4oCompletions), Effect.runPromise)
```

## 0.11.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai/openai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@effect/ai-openai",
"type": "module",
"version": "0.11.4",
"version": "0.11.5",
"license": "MIT",
"description": "Effect modules for working with AI apis",
"homepage": "https://effect.website",
Expand Down

0 comments on commit 03c048c

Please sign in to comment.