construct-labs-crm-env 0.1.3__tar.gz → 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: construct-labs-crm-env
3
- Version: 0.1.3
3
+ Version: 0.1.7
4
4
  Summary: CRM Agent Environment SDK by Construct Labs - Train RL agents to interact with CRM systems
5
5
  Project-URL: Homepage, https://construct-labs.com
6
6
  Author-email: Construct Labs GmbH <hello@construct-labs.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "construct-labs-crm-env"
7
- version = "0.1.3"
7
+ version = "0.1.7"
8
8
  description = "CRM Agent Environment SDK by Construct Labs - Train RL agents to interact with CRM systems"
9
9
  readme = "README.md"
10
10
  license = { text = "Proprietary" }
@@ -156,6 +156,7 @@ class CrmAgentEnv(EnvClient[CrmAgentAction, CrmAgentObservation, CrmAgentState])
156
156
  self._ws = ws_connect(
157
157
  self._ws_url,
158
158
  open_timeout=self._connect_timeout,
159
+ max_size=10 * 1024 * 1024,
159
160
  subprotocols=[auth_subprotocol],
160
161
  )
161
162
  except Exception as e:
@@ -226,40 +227,120 @@ class CrmAgentEnv(EnvClient[CrmAgentAction, CrmAgentObservation, CrmAgentState])
226
227
  Returns:
227
228
  The default system prompt string.
228
229
  """
229
- return """You are a tool-using agent interacting with a CRM (Customer Relationship Management) system.
230
+ # Define tool call examples as Python dicts - json.dumps ensures valid JSON
231
+ examples = {
232
+ "list_companies": {
233
+ "name": "list_companies",
234
+ "arguments": {"limit": 10},
235
+ },
236
+ "find_companies": {
237
+ "name": "list_companies",
238
+ "arguments": {"filter": 'name[ilike]:"%tech%"'},
239
+ },
240
+ "create_company": {
241
+ "name": "create_company",
242
+ "arguments": {
243
+ "company_name": "Acme Corp",
244
+ "company_domain": "acme.com",
245
+ },
246
+ },
247
+ "create_person": {
248
+ "name": "create_person",
249
+ "arguments": {
250
+ "person_first_name": "John",
251
+ "person_last_name": "Doe",
252
+ "person_email": "john@acme.com",
253
+ "person_company_id": "company-uuid-here",
254
+ },
255
+ },
256
+ "submit_answer": {
257
+ "name": "submit_answer",
258
+ "arguments": {
259
+ "answer": "The total pipeline value is $1.5M across 12 open opportunities."
260
+ },
261
+ },
262
+ }
263
+
264
+ return f"""You are a tool-using agent interacting with a CRM (Customer Relationship Management) system.
265
+
266
+ ## GOAL
267
+
268
+ Complete CRM tasks by creating, updating, retrieving, and managing business data.
269
+
270
+ ## DATA MODEL
271
+
272
+ - Companies: Organizations you do business with
273
+ - People: Contacts who work at companies (linked via person_company_id)
274
+ - Opportunities: Sales deals linked to a company and a person (point of contact)
275
+ - Notes: Free-text records attached to any company, person, or opportunity
276
+ - Tasks: Action items with due dates, attached to any company, person, or opportunity
277
+
278
+ ## AVAILABLE TOOLS
279
+
280
+ - Companies: list_companies, get_company, create_company, update_company, delete_company
281
+ - People: list_people, get_person, create_person, update_person, delete_person
282
+ - Opportunities: list_opportunities, get_opportunity, create_opportunity, update_opportunity, delete_opportunity
283
+ - Notes: list_notes, create_note
284
+ - Tasks: list_tasks, create_task, update_task, complete_task
285
+ - Answer: submit_answer
286
+
287
+ ## FILTERING AND PAGINATION
288
+
289
+ Use the filter parameter to search records. Format: field[comparator]:value
230
290
 
231
- GOAL: Complete CRM tasks by creating, updating, and managing business data.
291
+ Comparators: eq, neq, gt, gte, lt, lte, ilike (case-insensitive like), in, is, startsWith, containsAny
232
292
 
233
- AVAILABLE OPERATIONS:
234
- - Companies: list, get, create, update, delete
235
- - People/Contacts: list, get, create, update, delete
236
- - Opportunities: list, get, create, update, delete
237
- - Notes: list, create (attach to companies, people, or opportunities)
238
- - Tasks: list, create, update, complete
293
+ Examples:
294
+ - name[ilike]:"%acme%" - names containing "acme"
295
+ - stage[eq]:"WON" - opportunities with stage WON
296
+ - amount[gte]:10000 - deals worth $10,000 or more
297
+ - createdAt[gte]:"2026-01-01" - records created this year
298
+ - deletedAt[is]:NULL - non-deleted records
239
299
 
240
- EXAMPLES:
300
+ Rules: Quote strings and dates. Do not quote numbers. Combine with comma for AND: field1[eq]:"a",field2[gt]:5
241
301
 
242
- 1. List companies:
302
+ Pagination: Results return max 60 records. Use starting_after with the endCursor from pageInfo to get more.
303
+
304
+ ## WORKFLOW
305
+
306
+ For complex tasks, make multiple tool calls:
307
+ 1. First, list or search to find relevant records
308
+ 2. Then, get details or create/update as needed
309
+ 3. Finally, call submit_answer with your findings
310
+
311
+ ## OUTPUT FORMAT
312
+
313
+ Think briefly about which tool to use, then output exactly one tool call:
243
314
  <tool_call>
244
- {"name": "list_companies", "arguments": {"limit": 10}}
315
+ {{"name": "tool_name", "arguments": {{...}}}}
245
316
  </tool_call>
246
317
 
247
- 2. Create a company:
318
+ ## EXAMPLES
319
+
320
+ List companies:
248
321
  <tool_call>
249
- {"name": "create_company", "arguments": {"company_name": "Acme Corp", "company_domain": "acme.com"}}
322
+ {json.dumps(examples["list_companies"])}
250
323
  </tool_call>
251
324
 
252
- 3. Create a contact:
325
+ Find companies by name:
253
326
  <tool_call>
254
- {"name": "create_person", "arguments": {"person_first_name": "John", "person_last_name": "Doe", "person_email": "john@acme.com"}}
327
+ {json.dumps(examples["find_companies"])}
255
328
  </tool_call>
256
329
 
257
- 4. Submit final answer:
330
+ Create a company:
258
331
  <tool_call>
259
- {"name": "submit_answer", "arguments": {"answer": "The total pipeline value is $1.5M"}}
332
+ {json.dumps(examples["create_company"])}
260
333
  </tool_call>
261
334
 
262
- IMPORTANT: Output ONLY a tool_call, no other text."""
335
+ Create a contact linked to a company:
336
+ <tool_call>
337
+ {json.dumps(examples["create_person"])}
338
+ </tool_call>
339
+
340
+ Submit final answer:
341
+ <tool_call>
342
+ {json.dumps(examples["submit_answer"])}
343
+ </tool_call>"""
263
344
 
264
345
  @property
265
346
  def tools(self) -> list[JsonDict]: