-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from dev-jpnobrega/input-message-context
Input message context and others agent configs
- Loading branch information
Showing
8 changed files
with
85 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,55 @@ | ||
import { describe, it } from 'node:test'; | ||
import { strict as assert } from 'node:assert'; | ||
|
||
import Agent from'../src/agent'; | ||
|
||
describe('Agent test', () => { | ||
it('should Agent instance', (t, done) => { | ||
const agent = new Agent({ | ||
llmConfig: { | ||
apiKey: '123', | ||
apiVersion: '1.0', | ||
type: 'azure', | ||
instance: 'test', | ||
model: 'test', | ||
}, | ||
chatConfig: { | ||
temperature: 0.5, | ||
} | ||
}); | ||
assert.ok(agent instanceof Agent); | ||
|
||
done(); | ||
}); | ||
|
||
|
||
it('should Agent call', { skip: true }, (t, done) => { | ||
const agent = new Agent({ | ||
name: 'Agent test Support', | ||
llmConfig: { | ||
type: 'azure', | ||
model: process.env.OPENAI_API_DEPLOYMENT_NAME || 'test', | ||
instance: process.env.OPENAI_API_INSTANCE_NAME || 'test', | ||
apiKey: process.env.OPENAI_API_KEY || 'test', | ||
apiVersion: process.env.OPENAI_API_VERSION || 'test', | ||
}, | ||
chatConfig: { | ||
temperature: 0, | ||
}, | ||
vectorStoreConfig: { | ||
apiKey: process.env.SEARCH_API_KEY || 'test', | ||
apiVersion: process.env.SEARCH_API_VERSION || 'test', | ||
name: process.env.SEARCH_NAME || 'test', | ||
type: 'azure', | ||
vectorFieldName: 'embedding', | ||
indexes: [ | ||
'index-gdp' | ||
], | ||
model: process.env.AZURE_SEARCH_MODEL || 'test' | ||
}, | ||
}); | ||
}); | ||
}); | ||
// import { describe, it } from 'node:test'; | ||
// import { strict as assert } from 'node:assert'; | ||
|
||
// import Agent from'../src/agent'; | ||
// import { DataSource } from 'typeorm'; | ||
// import { IAgentConfig } from '../src/interface/agent.interface'; | ||
|
||
|
||
// const agentConfig = require(`./agent-configs/gsp-testcase-agent.json`); | ||
|
||
// describe('Agent test', () => { | ||
// it('should Agent instance', (t, done) => { | ||
// const agent = new Agent({ | ||
// llmConfig: { | ||
// apiKey: '123', | ||
// apiVersion: '1.0', | ||
// type: 'azure', | ||
// instance: 'test', | ||
// model: 'test', | ||
// }, | ||
// chatConfig: { | ||
// temperature: 0.5, | ||
// } | ||
// }); | ||
// assert.ok(agent instanceof Agent); | ||
|
||
// done(); | ||
// }); | ||
|
||
|
||
// it('should Agent call', (t, done) => { | ||
// const agentSettings = agentConfig as unknown as IAgentConfig; | ||
|
||
// if (agentSettings.dataSourceConfig) { | ||
// agentSettings.dataSourceConfig.dataSource = new DataSource({ | ||
// ...(agentSettings.dataSourceConfig as any) | ||
// }); | ||
// } | ||
|
||
// const agent = new Agent(agentSettings); | ||
|
||
// agent.on('onMessage', async (message) => { | ||
// assert.ok(message, 'message is not null'); | ||
// console.warn('MESSAGE:', message); | ||
// done(); | ||
// process.exit(0); | ||
// }); | ||
|
||
// agent.call({ | ||
// question: 'Me fale mais sobre o cliente 1014814.', | ||
// chatThreadID: '01', | ||
// context: 'contexto teste', | ||
// }); | ||
// }); | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters