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

initial commit of the OpenAI Agent POC #629

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a42dca2
initial commit of the OpenAI Agent POC
birdperson1970 Nov 16, 2023
8a57daf
fixed functions
birdperson1970 Nov 16, 2023
0c8fb08
bad assit id
birdperson1970 Nov 17, 2023
cea8455
about to add step
birdperson1970 Nov 20, 2023
66a6b95
Implemented the OpenAI Run Function Step
birdperson1970 Nov 20, 2023
a38f767
fixed imports
birdperson1970 Nov 21, 2023
3874060
implemented slash command and functions now work
birdperson1970 Nov 21, 2023
ad60fe0
Linked UI session to OpenAI thread
birdperson1970 Nov 23, 2023
cb50c4e
bug fixes and launch config
birdperson1970 Nov 24, 2023
16e492d
Initial Docs
birdperson1970 Nov 24, 2023
bc7c66b
Added GPT3.5 and fixed models
birdperson1970 Nov 25, 2023
2bd91fd
fixed bad open api model names
birdperson1970 Nov 25, 2023
2be212d
added logging
birdperson1970 Nov 25, 2023
d13acc8
Jazzed up the logging
birdperson1970 Nov 25, 2023
5ae2a78
poc
birdperson1970 Nov 25, 2023
5d6fdef
unit test for fuzzy search
birdperson1970 Nov 25, 2023
33a91d6
merge
birdperson1970 Nov 26, 2023
ba2b4f1
Merge remote-tracking branch 'upstream/main' into openai_agent_poc
birdperson1970 Nov 26, 2023
d08bfe0
merged files
birdperson1970 Nov 26, 2023
62422f0
Som broken But I need github perm links
birdperson1970 Dec 1, 2023
478a6c9
gen files update
birdperson1970 Dec 2, 2023
6ea256a
clean compile
birdperson1970 Dec 2, 2023
5af454d
can't find llm
birdperson1970 Dec 2, 2023
914137b
Merge remote-tracking branch 'origin/main' into pydantic_2_upgrade
birdperson1970 Dec 2, 2023
2d137bb
Wroking
birdperson1970 Dec 3, 2023
7b8528e
final tweaks for review
birdperson1970 Dec 3, 2023
15aa9f7
fixed python-lsp-server[websockets]
birdperson1970 Dec 3, 2023
4795e0d
fixed assistent_id
birdperson1970 Dec 3, 2023
e2fcf01
Merge remote-tracking branch 'origin/pydantic_2_upgrade' into openai_…
birdperson1970 Dec 3, 2023
2f3bad0
pulling back the version for WSL compatability
birdperson1970 Dec 3, 2023
cffbf2a
module version problem reverting
birdperson1970 Dec 3, 2023
9a1002d
migrated schema generation to Pydantic V2
birdperson1970 Dec 6, 2023
82c0333
fixed chroma db version issue
birdperson1970 Dec 6, 2023
30c176f
Merge remote-tracking branch 'origin/pydantic_2_upgrade' into openai_…
birdperson1970 Dec 6, 2023
41e9fea
broken waiting for pydantic 2 fix
birdperson1970 Dec 7, 2023
ae3610f
fixed aweful Union serialization bug
birdperson1970 Dec 9, 2023
f19a40a
pydantic v2 fixed union issue
birdperson1970 Dec 9, 2023
2cd7c05
Merge remote-tracking branch 'origin/pydantic_2_upgrade' into openai_…
birdperson1970 Dec 9, 2023
69ef211
fixed templates to validation
birdperson1970 Dec 9, 2023
7fda98f
Merge remote-tracking branch 'origin/pydantic_2_upgrade' into openai_…
birdperson1970 Dec 9, 2023
9cf002d
Working
birdperson1970 Dec 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file added .changes/.changes.txt
Empty file.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,6 @@ codeql
**/**/build

continue_server.build
continue_server.dist
continue_server.dist
extensions/vscode/vscode_keyboard_shortcuts.md
server/.venv
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"type": "python",
"request": "launch",
"module": "continuedev.models.generate_json_schema",
"justMyCode": true,
"justMyCode": false,
"cwd": "${workspaceFolder}/server"
},
{
Expand Down Expand Up @@ -106,10 +106,10 @@
"name": "Extension (VSCode)",
"type": "extensionHost",
"request": "launch",
"cwd": "${workspaceFolder}/extensions/vscode",
"cwd": "/Users/laib/ai/continue_poc_test/",
"args": [
// Pass a directory to manually test in
"${workspaceFolder}/extensions/vscode",
"/Users/laib/ai/continue_poc_test/",
"${workspaceFolder}/extensions/vscode/manual-testing-sandbox/example.ts",
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode"
],
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"continue.showInlineTip": false,
"python.testing.pytestArgs": ["server"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": true
}
46 changes: 46 additions & 0 deletions docs/docs/openai_agents/OPENAI_AGENTS_PRIMER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# OpenAI Agents Primer

NOTE: I've update the launch.json to a local project dir...


## Create OpenAI Agent
On the Continue UI add a new OpenAI Agent

![Alt text](cont_agent.png)


## Creating an agent

Create a new Agent here: https://platform.openai.com/playground
- NOTE: The functions will added via the continue server at startup.

Update your title and assitant_id in your ```~/.continue/config.py```

![OpenAI Architecture](agent_config.png )

### Agent Instruction

```
# GOALS
Act as an expert Python Developer
Understand the full context of the problem by always using all of your built in functions and re-query any areas you don't fully understand.
```


## OpenAI Overview
https://platform.openai.com/docs/assistants/overview


![OpenAI Architecture](openai_arch.png )


- The Assistant: The LLM Assistent you configured at the start
- Thread: Is a conversational Thread containing all the messages
- Run: A new Run is created each time a USER excutes a query. The OpenAI_Agent polls the Run waiting for the Complete state and return the Asstants response contained in the Thread last Message.
- OpenAIRunFunction: Is a step which is created to poll the Run to listen for a run.state of required_action to execute the Assitants function calls and response with a submit_tool_outputs


## OpenAI UI
![OpenAI Architecture](agent_ui.png )


Binary file added docs/docs/openai_agents/agent_config.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/openai_agents/agent_ui.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/openai_agents/cont_agent.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/openai_agents/openai_arch.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions extensions/vscode/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
"gpt-3.5-turbo-16k",
"gpt-4",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-1106",
"gpt-4-32k",
"gpt-4-1106-preview",
"mistral-7b",
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "continue",
"icon": "media/icon.png",
"version": "0.6.9",
"version": "0.6.38",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
Expand Down
3 changes: 1 addition & 2 deletions extensions/vscode/schema/ContextItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* and run json-schema-to-typescript to regenerate this file.
*/

export type ContextItem = ContextItem1;
export type Name = string;
export type Description = string;
export type ProviderTitle = string;
Expand All @@ -17,7 +16,7 @@ export type Editable = boolean;
/**
* A ContextItem is a single item that is stored in the ContextManager.
*/
export interface ContextItem1 {
export interface ContextItem {
description: ContextItemDescription;
content: Content;
editing?: Editing;
Expand Down
3 changes: 1 addition & 2 deletions extensions/vscode/schema/ContextItemId.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
* and run json-schema-to-typescript to regenerate this file.
*/

export type ContextItemId = ContextItemId1;
export type ProviderTitle = string;
export type ItemId = string;

/**
* A ContextItemId is a unique identifier for a ContextItem.
*/
export interface ContextItemId1 {
export interface ContextItemId {
provider_title: ProviderTitle;
item_id: ItemId;
[k: string]: unknown;
Expand Down
3 changes: 1 addition & 2 deletions extensions/vscode/schema/ContextProviderDescription.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
* and run json-schema-to-typescript to regenerate this file.
*/

export type ContextProviderDescription = ContextProviderDescription1;
export type Title = string;
export type DisplayTitle = string;
export type Description = string;
export type Dynamic = boolean;
export type RequiresQuery = boolean;

export interface ContextProviderDescription1 {
export interface ContextProviderDescription {
title: Title;
display_title: DisplayTitle;
description: Description;
Expand Down