Commit Graph

281 Commits

Author SHA1 Message Date
Marshall Bowers
12980dd88f
Enable clippy::derivable_impls (#8836)
This PR enables the
[`clippy::derivable_impls`](https://rust-lang.github.io/rust-clippy/master/index.html#/derivable_impls)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-04 11:47:07 -05:00
Marshall Bowers
373e18bc88
Enable clippy::unnecessary_unwrap (#8756)
This PR enables the
[`clippy::unnecessary_unwrap`](https://rust-lang.github.io/rust-clippy/master/index.html#/unnecessary_unwrap)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 23:10:56 -05:00
Marshall Bowers
9735912965
Enable clippy::clone_on_copy (#8728)
This PR enables the
[`clippy::clone_on_copy`](https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_copy)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 17:37:48 -05:00
Marshall Bowers
4b81b15cad
Enable clippy::useless_conversion (#8724)
This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 16:31:47 -05:00
Marshall Bowers
87efb75e53
Enable clippy::bind_instead_of_map (#8723)
This PR enables the
[`clippy::bind_instead_of_map`](https://rust-lang.github.io/rust-clippy/master/index.html#/bind_instead_of_map)
rule and fixes the outstanding violations.

Release Notes:

- N/A
2024-03-02 16:10:34 -05:00
Marshall Bowers
ca2cda8d2a
Remove unneeded 'static lifetimes on &strs in constants (#8698)
This PR removes unneeded `'static` lifetimes on `&str`s stored in
`const` declarations.

This addresses some Clippy lints about
[`redundant_static_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_static_lifetimes).

In item-level `const` declarations we can rely on lifetime elision and
use the default `'static` lifetime.

Note that associated constants still require an explicit `'static`
lifetime, as explained in
https://github.com/rust-lang/rust/issues/115010.

Release Notes:

- N/A
2024-03-02 00:40:49 -05:00
Marshall Bowers
0d0ce95eae
Replace lazy_static! with OnceLock in ai crate (#8647)
This PR replaces a `lazy_static!` usage in the `ai` crate with
`OnceLock` from the standard library.

This allows us to drop the `lazy_static` dependency from this crate.

Release Notes:

- N/A
2024-02-29 23:37:20 -05:00
Marshall Bowers
eb1ab69606
Wire up Azure OpenAI completion provider (#8646)
This PR wires up support for [Azure
OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)
as an alternative AI provider in the assistant panel.

This can be configured using the following in the settings file:

```json
{
  "assistant": {
    "provider": {
      "type": "azure_openai",
      "api_url": "https://{your-resource-name}.openai.azure.com",
      "deployment_id": "gpt-4",
      "api_version": "2023-05-15"
    }
  },
}
```

You will need to deploy a model within Azure and update the settings
accordingly.

Release Notes:

- N/A
2024-02-29 22:01:33 -05:00
Marshall Bowers
dab886f479
Stub out support for Azure OpenAI (#8624)
This PR stubs out support for [Azure
OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)
within the `OpenAiCompletionProvider`.

It still requires some additional wiring so that it is accessible, but
the necessary hooks should be in place now.

Release Notes:

- N/A
2024-02-29 13:02:08 -05:00
Dzmitry Malyshau
a44fc24445
Clean up many small dependencies (part 3) (#8425)
Follow-up to #8353

Release Notes:
- N/A
2024-02-26 11:08:57 +02:00
Yesterday17
9e17018416
Allow OpenAI API URL to be configured via assistant.openai_api_url (#7552)
Partially fixes #4321, since Azure OpenAI API can be converted to OpenAI
API.

Release Notes:

- Added `assistant.openai_api_url` setting to allow OpenAI API URL to be
configured.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-02-12 11:37:27 -05:00
Todsaporn Banjerdkit
2aa8ccd6b1
fix: use OPEN_AI_API_URL (#7484)
Release Notes:

- N/A
2024-02-07 10:13:52 +01:00
Piotr Osiewicz
743f9b345f
chore: Move workspace dependencies to workspace.dependencies (#7454)
We should prefer referring to local deps via `.workspace = true` from
now on.

Release Notes:

- N/A
2024-02-06 20:41:36 +01:00
Marshall Bowers
e338f34097
Sort dependencies in Cargo.toml files (#7126)
This PR sorts the dependency lists in our `Cargo.toml` files so that
they are in alphabetical order.

This should make them easier to visually scan when looking for a
dependency.

Apologies in advance for any merge conflicts 🙈 

Release Notes:

- N/A
2024-01-30 21:41:29 -05:00
Marshall Bowers
0cb8b0e451
Clean up Cargo.toml files (#7044)
This PR cleans up some inconsistencies in the `Cargo.toml` files that
were driving me crazy.

Release Notes:

- N/A
2024-01-29 23:47:20 -05:00
Todsaporn Banjerdkit
1ab49fdbe6
Use fallback BPE if the language model doesn't have one (#6848)
Release Notes:

- Added a fallback BPE if the language model doesn't have one.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-29 22:42:03 -05:00
Marshall Bowers
027f055841
Update casing of "OpenAI" in identifiers to match Rust conventions (#6940)
This PR updates the casing of "OpenAI" when used in Rust identifiers to
match the [Rust naming
guidelines](https://rust-lang.github.io/api-guidelines/naming.html):

> In `UpperCamelCase`, acronyms and contractions of compound words count
as one word: use `Uuid` rather than `UUID`, `Usize` rather than `USize`
or `Stdin` rather than `StdIn`.

Release Notes:

- N/A
2024-01-28 12:01:10 -05:00
Piotr Osiewicz
0a0a866dd5
Licenses: change license fields in Cargo.toml to AGPL-3.0-or-later. (#5535)
Release Notes:
- N/A
2024-01-27 13:51:16 +01:00
Antonio Scandurra
25a7eb27d2 Move interaction with keychain off the main thread 2024-01-24 14:53:05 +01:00
Antonio Scandurra
22046ef9a7 Load language models in the background 2024-01-24 13:36:44 +01:00
Piotr Osiewicz
f2ff7fa4d5
chore: Change AGPL-licensed crates to GPL (except for collab) (#4231)
- [x] Fill in GPL license text.
- [x] live_kit_client depends on live_kit_server as non-dev dependency,
even though it seems to only be used for tests. Is that an issue?

Release Notes:
- N/A
2024-01-24 00:26:58 +01:00
Piotr Osiewicz
21e6b09361
Remove license-file from Cargo.toml as it is apparently redundant (#4218)
Release Notes:

- N/A
2024-01-23 17:40:30 +01:00
Piotr Osiewicz
678bdddd7d
chore: Add crate licenses. (#4158)
- GPUI and all dependencies: Apache 2
- Everything else: AGPL

Here's a script that I've generated for it:
https://gist.github.com/osiewicz/6afdd6626e517da24a2092807e6f0b6e

Release Notes:
- N/A

---------

Co-authored-by: David <david@zed.dev>
2024-01-23 16:56:22 +01:00
Piotr Osiewicz
6c82380232 chore: Fix clippy::needless_borrow up to an editor 2024-01-21 15:03:24 +01:00
Mikayla
57400e9687
Fix typos detected by crate-ci/typos 2024-01-17 14:31:21 -08:00
Piotr Osiewicz
d475f1373a
gpui: Further docs refinement & moved some reexports into 'private' module (#3935)
This commit mostly fixes invalid URLs in docstrings. It also
encapsulates crates we reexport (serde stuff + linkme) into a public
module named "private" in order to reduce the API surfaced through docs.
Moreover, I fixed up a bunch of crates that were pulling serde_json in
through gpui explicitly instead of using Cargo manifest.

Release Notes:
- N/A
2024-01-07 14:14:21 +01:00
Max Brunsfeld
f5ba22659b Remove 2 suffix from gpui
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:59:39 -08:00
Max Brunsfeld
9f99e58834 Remove 2 suffix for lsp, language, fuzzy
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:58:02 -08:00
Max Brunsfeld
4ddb26204f Remove 2 suffix for ai, zed_actions, install_ci, feature_flags
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:48:46 -08:00
Joseph T. Lyons
516a8790b9 Add gpt-4-1106-preview model 2023-11-14 08:28:57 -05:00
KCaverly
d5b6300fd7 moved from Boxes to Arcs for shared access of completion providers across the assistant panel and inline assistant 2023-11-02 10:08:47 -04:00
KCaverly
f3c113fe02 clean up warnings and fix tests in the ai crate 2023-10-30 11:07:24 -04:00
KCaverly
a2c3971ad6 moved authentication for the semantic index into the EmbeddingProvider 2023-10-30 10:02:27 -04:00
KCaverly
1e8b23d8fb replace api_key with ProviderCredential throughout the AssistantPanel 2023-10-28 18:16:45 -04:00
KCaverly
558f54c424 added credential provider to completion provider 2023-10-28 16:35:43 -04:00
KCaverly
7af77b1cf9 moved TestCompletionProvider into ai 2023-10-27 12:26:01 +02:00
KCaverly
ec9d79b6fe add concept of LanguageModel to CompletionProvider 2023-10-27 08:51:30 +02:00
KCaverly
6c8bb4b05e ensure OpenAIEmbeddingProvider is using the provider credentials 2023-10-27 08:33:35 +02:00
KCaverly
ca82ec8e8e fixed truncation error in fake language model 2023-10-26 14:05:55 +02:00
KCaverly
3447a9478c updated authentication for embedding provider 2023-10-26 11:18:16 +02:00
KCaverly
71bc35d241 catchup with main 2023-10-25 16:31:00 +02:00
KCaverly
8ffe5a3ec7 move keychain access into semantic index as opposed to on init 2023-10-24 13:26:37 +02:00
KCaverly
0dfbfdd164 catchup with main 2023-10-23 17:21:37 +02:00
KCaverly
4e90e45999 move embedding truncation to base model 2023-10-23 14:07:45 +02:00
KCaverly
2b780ee7b2 add base model to EmbeddingProvider, not yet leveraged for truncation 2023-10-22 15:00:09 +02:00
KCaverly
d1dec8314a move OpenAIEmbeddings to OpenAIEmbeddingProvider in providers folder 2023-10-22 14:46:22 +02:00
KCaverly
d813ae8845 replace OpenAIRequest with more generalized Box<dyn CompletionRequest> 2023-10-22 14:33:19 +02:00
KCaverly
05ae978cb7 move OpenAICompletionProvider to providers location 2023-10-22 13:57:13 +02:00
KCaverly
3712794e56 move OpenAILanguageModel to providers folder 2023-10-22 13:47:28 +02:00
KCaverly
a62baf34f2 rename templates to prompts in ai crate 2023-10-22 13:46:49 +02:00