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

Add gpt-4 #256

Merged
merged 1 commit into from
May 7, 2024
Merged

Add gpt-4 #256

merged 1 commit into from
May 7, 2024

Conversation

failandimprove1
Copy link
Contributor

@failandimprove1 failandimprove1 commented May 7, 2024

literally just added gpt-4 (but im gonna add azure keys with this pr to the deployed api :)

Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
aitino ⬜️ Ignored (Inspect) May 7, 2024 5:24pm

Copy link

sonarcloud bot commented May 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@failandimprove1 failandimprove1 enabled auto-merge (squash) May 7, 2024 17:25
@failandimprove1 failandimprove1 self-assigned this May 7, 2024
@failandimprove1 failandimprove1 merged commit 6d42910 into alpha May 7, 2024
7 checks passed
@failandimprove1 failandimprove1 deleted the feature/azure-keys branch May 7, 2024 17:25
antopiahk added a commit that referenced this pull request May 16, 2024
* finetuning commenting prompt

* fine tuning the bot and adding uniqueness checking in db.py

* fixing submissions and leads not getting submitted to db

* fixed db checking for existing leads

* nix shell removing poetry

* convert rest to using new organizational fastapi structure

* whops forgor router

* adding option for adding instructions to generate comment and improving promptws

* Move api keys to own router, add small fixups and error handling (#194)

* Add more tools (#195)

* add brave search

* add stackapi tool

* Add subscription endpoints (#196)

* subscriptions

* subscriptions endpoint

* Fix the types of session and message models for the openapi code generator (#197)

* fix the type on session

* fix type on message

* fix warning from edge class

* clean up, also fix message model

* Gitignore cache and change api keys path to kebabcase (#199)

* Add billing endpoints (#198)

* Add billing endpoints

* Gitignore cache and change api keys path to kebabcase (#199)

* comment fixes

* change get request for billing info to use path param

---------

Co-authored-by: Leon Nilsson <[email protected]>
Co-authored-by: Leon Lam Nilsson <[email protected]>

* Fix error output on inputting session (#202)

* Fix error handling on sessions (#203)

* fix error output on inputting session

* fix more error handling in running crew

* delete session if crew run errors

so we don't create sessions with no messages

* Add tiers endpoints (#200)

* add tiers endpoint

* fixing up tier endpoints

* tiers changes

* tier change testing

* changes tier endpoint and def

* def get_tier change

* fixed response

---------

Signed-off-by: Leon Nilsson <[email protected]>
Co-authored-by: Leon Nilsson <[email protected]>

* Add one parenthesis (plus some empty lines) (#204)

* Fix code smell complaints (#205)

* Add tool endpoints (#201)

* add tools (untested)

* change api key types endpoint name to kebab case

* add error handling on delete tool

---------

Signed-off-by: Leon Nilsson <[email protected]>

* Fix sonarcloud issues (#206)

fixed the issues in the code i wrote

* Format and fix typing (#207)

* format

* fixup on typing

* Add prompt type and fix typing of edges (#209)

* Mostly implement OpenAPI fetch (#208)

* remove past gen folder

* packages

* tsconfig

* remove client

* remove api.ts

* create client

* api things

* sessions working like before with new system

* update more from sessions to be using new system, SessionNavigator is working again

* convert more to new system

* update api types

* work on converting crews to use api

* update api types

* work on converting crews

* crews working I think

* prep for tomorrow

* partially convert api keys to new system

* ts

* correct type

* validate session in hook

* uncomment thing I'm gonna work on

* api keys working I think

* update api schema

* work on converting sessions to using new system

* fixup api interactions with new api schema

* api keys kebab case

* get api keys working again again and work on sessions

* update api schema

* working on crews

* delete blog

* finalize delete blog

* work on crew

* update api types

* crews page is running at least now

* remove unused var

* fix sonarcloud issue

* format

* ignore generated file from prettier

* please stop crying sonarcloud

* Add new agent model implementation (#210)

* add new agent model implementation

* change base_model

* Bump the pip group across 2 directories with 1 update (#211)

Bumps the pip group with 1 update in the /apps/api directory: [aiohttp](https://github.com/aio-libs/aiohttp).
Bumps the pip group with 1 update in the /apps/rest/api directory: [aiohttp](https://github.com/aio-libs/aiohttp).

Updates `aiohttp` from 3.9.3 to 3.9.4
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.3...v3.9.4)

Updates `aiohttp` from 3.9.3 to 3.9.4
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.3...v3.9.4)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: aiohttp
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add validate crews endpoint (#212)

* validate crews endpoint

* process crew

* Change path params to id and fixup validation (#213)

* add semi working updating agent and crew relation

idk why but sometimes the supabase requests seem to time out and it
doesnt finish the patch request

* change path params to "id"

* fixup validation

* Add endpoint for getting all models (#214)

* add endpoint for getting all models

* add return type to db function

* Agent and Crew Library (#215)

* crews before the edges nuke

* working on crews

* update endpoints

* update types again

* work on crews and agents page

* api endpoints

* agent editor working?

* update packages

* try to get agents/ and crews/ pages to follow same methology

* update packages

* creating crews and forms working much better

* update agents page to use shadcn form for creation

* update textarea

* work on agent creation

* crew agent creation and personal library

* implement deletion of agents and crews

* library component

* openinng crews is working

* Crews mostly working + some agent stuff W.I.P (#216)

* work on nodes

* cool agent node

* work on crew editor

* it's erroring because it's trying to add the agent twice somewhere I think

* crews page functional!

* feature warning and crew redirect

* work on agent creation and updating

* Fixup API Agent (#217)

* Change/update agent models, removed models endpoint (#218)

* Fix up the crew models to follow db changes (#219)

* fixup crew models

* remove getting agents by crew id

* replace "nodes" with "agents", fixup agent model

also made receiver_id nullable, since it is in the database, might
change later

* comment out receiver id validation in validate_crew

* regret last commit lol, also remove random import

* Add new fields and rename fields in mock (#220)

* Change api key types to provider (#221)

* file changes

* Fix up the crew models to follow db changes (#219)

* fixup crew models

* remove getting agents by crew id

* replace "nodes" with "agents", fixup agent model

also made receiver_id nullable, since it is in the database, might
change later

* comment out receiver id validation in validate_crew

* regret last commit lol, also remove random import

* Add new fields and rename fields in mock (#220)

* even more file changes

* changes

* api_keys

* api key id

* fix small bugs in db functions

* change a logger message

---------

Co-authored-by: Leon Nilsson <[email protected]>
Co-authored-by: Leon Lam Nilsson <[email protected]>

* Change api key type to api provider in tool models and endpoints (also update packages) (#222)

* change back tools to old typing

new typing didn't work for giving tools to agents

* temp commit

* remove logger things, change some comments

* Agent Web CRUD Implemented (#223)

* update api endpoints

* conform to new api endpoints

* update api types

* remove unused imports

* agent editor work

* new types

* remove crew_ids

* api type updates

* api_key_type -> api_provider

* convert to error properly and crew.nodes -> crew.agents

* agent editor

* Last Crews and Agents before sessions (#224)

* Fix bug with empty tool list (#225)

* Change how description is given to agent (#226)

also properly deletes session on error

* loading sessions working (#227)

* Add logging config file, change file structure (#228)

also run the uvicorn server now by running the __init__.py file!! 
ex. `poetry run python src/__init__.py` (if you are in the apps/api directory)

* Default agent list on creating crew (#229)

* "Fix" tools in mock (#230)

The issue seemed to be that agents can't "suggest" calls anymore, so I just told it to use a tool and it started working again lol
But it seems agents are just worse at calling tools now (either because of new gpt or something changed in openai), so I'm considering adding something that encourages all agents with tools to call them by changing their prompt. I could also ignore it and let the user creating crews and agents encourage tool usage in the prompts

* Mount subapi onto the fastapi app (#232)

* subapi added

* Fix bug with empty tool list (#225)

* adding daniel as subapp

* fixup and add leon

* pain

* sandbox

* redirect to docs

---------

Co-authored-by: Daniel Aanensen <[email protected]>

* Add lib folder (#233)

* lib folder

* add lib

* Formatting, removing unused imports, fix imports with new lib directory (#234)

* format and remove unused imports

* change imports from files in lib directory

* Sessions working completely! (but not too well 😓) (#235)

* loading sessions working

* sessions working somewhat

* update endpoints

* remove unused func

* fixup prompt save

* supabase subscribe

* realtime and replies somewhat working

* replies working in a very scuffed way

* Add funding system for running crews (#236)

* add funding to profile model and default funding on insert

* add calculate cost method

for some reason the chathistory object's cost doesn't update (might be
because of group chat) so i try to calculate the cost myself, not sure
how to calculate the input tokens though...

* add funding updating on finishing a crew run

* add env variable for accuracy

* add auto back for speaker selection, seems to be working

* gitignore tmp folder again lol

* format

* Auth Fixup (#237)

* Fixup Authentication

* trying to fixup lucide error

* Hotfix Broken Package Lucide (#238)

* Fix Crew editing, authentication, openapi types, and some more (#240)

* update api types

* Hotfix Agent Editor

* auto signin and bugfixes

* auth, marketing, zod

* trying to fixup crew saving and adding agents

* editing crews fixed

* Add stopping crew runs when the given profile has no funds (#241)

* raise error when less than 0 funds on profile

* change profile not found error

* Add slightly working rag agents, seemingly fixed sessions stopping unexpectedly (#242)

* add example groupchat with RAG

test version copied from autogen blog

* add gpt-4-turbo model

* add rag test endpoint to my sandbox endpoints

* remove random unused imports

* add test rag class to crew

* start of rag implementation, errors atm

when trying to use the register_for_llm decorator on the
retrieve_content method it breaks, the decorator doesn't seem to work
with that method for some reason. it can't find a "_name" attribute

* add mega primitive implementation of rag

its super scuffed rn bewary before reading

* move rag.py to lib

* gitignore and delete tmp folder

* format (and make task on rag options nullable)

* format again lol

* make retrieve_content a method

* chat result tests

* poetry

* change to using the passed rag options

also removed the extra 0.01 cost when adding cost margin

* make RagOptions nullable

it is being defaulted in the sessions/run endpoint atm

* format

* ignore rag user proxy if use_rag is false (when rag_options is None)

* fixups on bugs etc

* merge didnt work for some reason

* got decently working rag and fixed sessions stopping randomly

* refactor: remove commented code

This commit removes large blocks of commented code from the files'apps/api/src/lib/rag.py' and 'apps/api/src/routers/sandbox/leon.py'.It also rearranges the import statements in 'apps/api/src/lib/crew.py'.This cleanup improves readability and maintainability of the codebase.

* refactor: remove unused function registration

This commit removes the unused function registration in the file
'apps/api/src/routers/sandbox/leon.py'. The function 'function_moment'
was registered but never used. This change improves the clarity of the
code and reduces potential confusion.

* Add new cost calculation that uses agent costs properly (#243)

* feat: Update authentication and session handling (#244)

- Update authentication methods to include user profile data
- Modify session handling to include user profile data
- Add new API endpoints for user profile retrieval and creation
- Remove old authentication pages and replace with a unified authentication page
- Update navigation links to point to new authentication page
- Add user funding information to the side navigation
- Add message deduplication in session page
- Fix various type errors and misnamed variables"

* feat: Update dependencies and improve authentication flow (#245)

* feat(SideNav): simplify logout button implementation

The logout button in the SideNav component has been simplified. The
previous implementation used a dynamic list for the bottom navigation,
which was overkill for a single static button. The new implementation
directly includes the logout button in the markup. This makes the code
easier to understand and maintain.

* work on fixing up supabase stuff again

* I really dislike poetry

* authentication is working!

* feat(auth): Change auth redirect and remove callback

This commit changes the redirect URL after authentication from
'auth/callback' to 'app'. The 'auth/callback' route is removed as it's
no longer needed. The logout process is simplified by removing error
handling. The 'code' query parameter is now checked in the layout
server route, and if present, it's used to exchange for a session.
The user data check in the layout component is removed.

* Bump tqdm in /apps/api in the pip group across 1 directory (#246)

Bumps the pip group with 1 update in the /apps/api directory: [tqdm](https://github.com/tqdm/tqdm).


Updates `tqdm` from 4.66.2 to 4.66.3
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](tqdm/tqdm@v4.66.2...v4.66.3)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: indirect
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump the pip group across 2 directories with 1 update (#247)

Bumps the pip group with 1 update in the /apps/api directory: [tqdm](https://github.com/tqdm/tqdm).
Bumps the pip group with 1 update in the /apps/rest/api directory: [tqdm](https://github.com/tqdm/tqdm).

Updates `tqdm` from 4.66.3 to 4.66.4
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](tqdm/tqdm@v4.66.3...v4.66.4)

Updates `tqdm` from 4.66.2 to 4.66.3
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](tqdm/tqdm@v4.66.3...v4.66.4)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: indirect
  dependency-group: pip
- dependency-name: tqdm
  dependency-type: indirect
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Use environment variable for redirect url (#248)

* fix: finalize the crew editor for first launch and add email to profile page (#249)

* feat: display user email in Profile title

The user's email is now displayed in the Profile title on the account
page. This change enhances user experience by providing a more
personalized interface and helps in identifying the active account.

* feat: streamline agent addition and prompt editing

This commit reworks the agent addition process and prompt editing
in the crew panel. It fixes issues with adding agents to the crew.
The prompt node has been removed and replaced with a prompt editor
in the crew panel.

* fix: remove duplicate Tabs.Content tag in account page

This commit removes a duplicate Tabs.Content tag in the account page
svelte component. This was causing unnecessary nesting and potential
layout issues. The fix ensures proper rendering of the account page.

* fix: agent creation and editor (#250)

* fix: agent creation

* fix: agent banner color

* fix: add error handling for crew saving operation (#251)

This commit adds error handling for the crew saving operation in the
CrewPanel component. In case of an error, it logs the error to the
console and displays an error message to the user. This ensures that
failures in saving a crew are properly communicated to the user and
developers.

* feat(api): use PORT from environment variables (#252)

The application now tries to get the PORT from the environment variables.
If it's not found, it logs an info message and uses the default PORT=80.
If the PORT is not an integer, it raises a ValueError.

* Change formatter to not use poetry (#253)

* change formatter from using poetry

* format

* fix: set moch receiver_id as it's faultily required by api (#254)

Set the receiver_id to 000...000 because it's required by the api.

* Fixup prompt improver, add funding dependency (#255)

* feat(improver): add cost calculation and logging

This commit introduces cost calculation and logging to the
`improve_prompt` function. It also modifies the function to
retrieve the profile from the database and update the funding
after the cost calculation. The function now raises an HTTP
exception if the profile is not found or if the result object
from OpenAI is unusual. The `improve` route in the router has
been changed from a GET to a POST method and now uses the
`ImproveInsertRequest` model for its request body.

* fix(improver): update error message for OpenAI result

This commit updates the error message in the `improve_prompt`
function when the result from OpenAI does not contain a 'usage'
attribute. The previous message was unclear and did not
accurately describe the issue. The new message provides more
specific information about the error, which will help in
debugging and troubleshooting.

* add handling of insufficient funds

* add gpt-4 (also added azure keys in oai config list) (#256)

* make a single field nullable (#257)

* fix: mostly typos, but also add support for daisyui (#258)

* feat: update api types

* fix: update published description for agent create form

* fix: update published description for agent editor

* fix: stop redirect to agent editor after creating agent

* feat: daisyui

* fix: zod conform to openapi types

* fix: typo in prompt editor

* fix: error grammar in prompt editor

* feat: auto-save (#260)

* feat(rest): change llm models to use azure openai keys (#259)

* feat: change to azure llms and add uvicorn runner

This commit updates the import paths in `__init__.py` to be absolute
instead of relative. It also adds a uvicorn runner at the end of the
file to allow for direct execution. Additionally, the `comment_bot.py`
file has been updated to use `AzureChatOpenAI` instead of `ChatOpenAI`.

* refactor: Replace ChatOpenAI with AzureChatOpenAI

This commit replaces the usage of `ChatOpenAI` with `AzureChatOpenAI` in
`relevance_bot.py`. The change is made in the `create_chain`,
`summarize_submission`, and `filter_with_questions` functions. This
refactor is part of an effort to transition from OpenAI to Azure for
language model processing.

* fix: Correct Azure model names in relevance_bot.py

This commit corrects the Azure model names used in `relevance_bot.py`.
The model name in the `create_chain` function's docstring and the
`calculate_relevance` function call has been changed from
"gpt-4-turbo-preview" to "gpt-4-turbo". The model names in the
`summarize_submission` and `filter_with_questions` functions have been
changed from "gpt-4-turbo" to "gpt-35-turbo".

* fix: Remove testing things and remove import

* fix: Remove imports 2: electric boogaloo

* fix: Accidentally removed a dot in an import

* fix: remove error toast on agent deletion (#261)

The error toast that was previously shown when an agent was deleted
has been removed. This change simplifies the user experience by not
displaying an error message for a successful operation.

* fix(agent-model): rename 'gpt-3.5-turbo' to 'gpt-35-turbo' (#262)

This commit changes the naming convention of the 'gpt-3.5-turbo' model
to 'gpt-35-turbo'. This change has been reflected in the schema,
creation form, agent page, agent items, and agent library.

* feat(library-create-button): add ScrollArea to Dialog.Content (#263)

This commit wraps the slot inside the Dialog.Content with a ScrollArea
component. This change provides a scrollable area within the dialog,
improving the user experience when the dialog content is larger than
the viewport.

---------

Signed-off-by: Leon Nilsson <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Jonas Lindberg <[email protected]>
Co-authored-by: Leon Nilsson <[email protected]>
Co-authored-by: Daniel Aanensen <[email protected]>
Co-authored-by: Leon Lam Nilsson <[email protected]>
Co-authored-by: Jonas Lindberg <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Aanensen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant